Extravault in your MU WebSite

Results 1 to 19 of 19
  1. #1
    Valued Member Punker is offline
    MemberRank
    Nov 2004 Join Date
    Lima, PerúLocation
    133Posts

    Extravault in your MU WebSite

    Hello everybody, since we had problems with vault change command, I started to develop a better vault change system, well I developped this command by web, just pressing one button, let's see:

    First:

    - warehouse table: you must add column named: number(int)(4) default value (0)
    - CharBaul table: you must create this table and columns like this: AccountID(VarChar)(19)(PrimaryKey) | Baul(Int)(4)(NULL) default value (0) | Items(VarBinary)(1920)(NULL) | Money(Int)(4)(NULL)
    - ExtWarehouse table: obviusly you must have this table created.

    About files:

    baulextra.php file:

    Code:
    <form id="form1" name="form1" method="post" action="cambiobaul.php">
    <table width="100%" border="1" bordercolor="#000000">
    <td colspan="2">
    <div></div>
    </td>
    <tr>
    <td width="10%">
    <div>ID</div>
    </td>
    <td width="90%">
    <div><input name="id" type="text" maxlength="10" /></div>
    </td>
    </tr>
    <tr>
    <td>
    <div>Password</div>
    </td><td>
    <div><input name="clave" type="password" class="Estilo86" maxlength="10" />
    </div>
    </td>
    </tr>
    <tr>
    <td colspan="2">
    <div>Anti-Duppers System</div>
    </td>
    </tr>
    <tr>
    <td>
    <div><input name="Submit" type="submit" value="Change Vault" />
    </div>
    </td>
    </tr>
    </table>
    </form>
    cambiobaul.php file:

    Code:
    <?
    $conection = mssql_connect("ServerName","UserName","Password") or die("SQL connection fail, verify your connection config.");
    mssql_select_db("MuOnline",$conection);
    function anti_injection( $mensaje )
    {
    $banlist = array
    ("insert","select","drop","update","delete","distinct","having","truncate","replace",
    "handler","like","procedure","limit","order by","group by","<",">","/","'"," ","=","*",",","-");
    if ( eregi ( "[a-zA-Z0-9]+", $mensaje ) )
    {
    $mensaje = trim ( str_replace ( $banlist, '', strtolower ( $mensaje ) ) );
    }
    else
    {
    $mensaje = NULL;
    }
    return $mensaje;
    }
    if(trim($HTTP_POST_VARS["id"]) != "" && trim($HTTP_POST_VARS["clave"]) != "")
    {
    $sql = "SELECT memb___id FROM MEMB_INFO WHERE memb___id='".anti_injection($HTTP_POST_VARS["id"])."' and memb__pwd='".anti_injection($HTTP_POST_VARS["clave"])."'";
    $result = mssql_query($sql);
    if($row = mssql_fetch_array($result))
    {
      $sqlexiste = "SELECT AccountID FROM EXTWAREHOUSE WHERE AccountID='".anti_injection($HTTP_POST_VARS["id"])."'";
      $resultexiste = mssql_query($sqlexiste);
      if($rowexiste = mssql_fetch_array($resultexiste))
      {
       $sqlchar = mssql_query("SELECT ConnectStat FROM MEMB_STAT WHERE memb___id='".anti_injection($HTTP_POST_VARS["id"])."'");
       $rschar = mssql_fetch_array($sqlchar);
       if(($rschar['ConnectStat'])==0)
       {
        $sqlbaul = mssql_query("SELECT number FROM WAREHOUSE WHERE AccountID='".anti_injection($HTTP_POST_VARS["id"])."'");
        $rsbaul = mssql_fetch_array($sqlbaul);
        if(($rsbaul['number'])==1)
        {
         /* If I want my original vault */
         /* Save 2nd vault in extwarehouse table */
         $sql ="update extwarehouse set items=(select items from warehouse where accountid='".anti_injection($HTTP_POST_VARS["id"])."') where accountid='".anti_injection($HTTP_POST_VARS["id"])."'";
         mssql_query($sql);
         $sql ="update extwarehouse set money=(select money from warehouse where accountid='".anti_injection($HTTP_POST_VARS["id"])."') where accountid='".anti_injection($HTTP_POST_VARS["id"])."'";
         mssql_query($sql);
         /* Update main vault to original content */
         $sql ="update warehouse set items=(select items from charbaul where accountid='".anti_injection($HTTP_POST_VARS["id"])."') where accountid='".anti_injection($HTTP_POST_VARS["id"])."'";
         mssql_query($sql);
         $sql ="update warehouse set money=(select money from charbaul where accountid='".anti_injection($HTTP_POST_VARS["id"])."') where accountid='".anti_injection($HTTP_POST_VARS["id"])."'";
         mssql_query($sql);
         /* Set vault number */
         $sql ="update warehouse set number=0 where accountid='".anti_injection($HTTP_POST_VARS["id"])."'";
         mssql_query($sql);
         /* Clean main vault last data  */
         $sql ="delete charbaul where accountid='".anti_injection($HTTP_POST_VARS["id"])."'";
         mssql_query($sql);
        }
        if(($rsbaul['number'])==0)
        {
         /* If I want 2nd vault */
         /* Save main vault data into charbaul table */
         $sql ="insert into charbaul(accountid, items, money)(select accountid, items, money from warehouse where accountid='".anti_injection($HTTP_POST_VARS["id"])."')";
         mssql_query($sql);
         /* Update main vault to 2nd vault data */
         $sql ="update warehouse set items=(select items from extwarehouse where accountid='".anti_injection($HTTP_POST_VARS["id"])."') where accountid='".anti_injection($HTTP_POST_VARS["id"])."'";
         mssql_query($sql);
         $sql ="update warehouse set money=(select money from extwarehouse where accountid='".anti_injection($HTTP_POST_VARS["id"])."') where accountid='".anti_injection($HTTP_POST_VARS["id"])."'";
         mssql_query($sql);
         /* Set vault number */
         $sql ="update warehouse set number=1 where accountid='".anti_injection($HTTP_POST_VARS["id"])."'";
         mssql_query($sql);
        }
        echo "-".anti_injection($HTTP_POST_VARS["id"])." vault changed successfully !!!";
       }
       else
       {
        echo "You must be off line, vault change not proceed !!!";
       }
      }
      else
      {
       echo "You don't have extravault, contact your administrator !!!";
      }
    }
    else
    {
      echo "Login fail !!!";
    }
    mssql_free_result($result);
    }
    else
    {
    echo "You must to complete all field to login ok !!!";
    }
    mssql_close();
    ?>
    About scripts:

    1. Well this script add a trigger into memb_info table, then will be activated every time an account is INSERTED into this table. This trigger will add a new record into extwarehouse table using the new account ID created:

    Code:
    CREATE TRIGGER [extware] ON [dbo].[MEMB_INFO] 
    FOR INSERT
    AS
    declare @cuenta varchar(10)
    SELECT @cuenta=memb___id FROM INSERTED
    insert into extwarehouse values(@cuenta,0,0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,0,0,0,'')
    2. The complicated script:

    Code:
    ALTER TABLE warehouse ADD exist INTEGER NULL CONSTRAINT [DF_warehouses] DEFAULT ((0))
    UPDATE warehouse SET exist=0
    UPDATE warehouse SET exist=1 WHERE EXISTS ( SELECT extwarehouse.AccountID FROM extwarehouse WHERE extwarehouse.AccountID = warehouse.AccountID)
    INSERT INTO extwarehouse(AccountID,Number,Items,Money,EndUseDate,DbVersion,pw)(select accountid,0,0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,0,0,0,'' from warehouse where exist=0)
    UPDATE warehouse SET exist=1 WHERE EXISTS ( SELECT extwarehouse.AccountID FROM extwarehouse WHERE extwarehouse.AccountID = warehouse.AccountID)
    Details:

    Code:
    ALTER TABLE warehouse ADD exist INTEGER NULL CONSTRAINT [DF_warehouses] DEFAULT ((0))
    UPDATE warehouse SET exist=0
    This two lines will add "exist" column into warehouse table and set default value to cero.

    Code:
    UPDATE warehouse SET exist=1 WHERE EXISTS ( SELECT extwarehouse.AccountID FROM extwarehouse WHERE extwarehouse.AccountID = warehouse.AccountID)
    This line searching created vaults into extwarehouse table and update exist value from warehouse to 1 (the 2nd vault is alredy create).

    Code:
    INSERT INTO extwarehouse(AccountID,Number,Items,Money,EndUseDate,DbVersion,pw)(select accountid,0,0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF,0,0,0,'' from warehouse where exist=0)
    This line will add a record into extwarehouse table (make the 2nd vault) from all accounts with exist value = 0 (accounts don't have 2nd vault).

    Code:
    UPDATE warehouse SET exist=1 WHERE EXISTS ( SELECT extwarehouse.AccountID FROM extwarehouse WHERE extwarehouse.AccountID = warehouse.AccountID)
    This line do the same as 2nd linea, but update is necessary coz' you are created extra vaults.

    Finally, sorry about my english I hope you understand me what I mean hahaha. See ya!

    PD: =master=, this will be very usefull.


  2. #2
    Proficient Member kapeika is offline
    MemberRank
    Jan 2006 Join Date
    LatviaLocation
    150Posts

    Re: [Release] Extravault in your MU WebSite

    maby you can make install for this i test but it dident work ... :( but sjupa 9/10

  3. #3
    Valued Member Punker is offline
    MemberRank
    Nov 2004 Join Date
    Lima, PerúLocation
    133Posts

    Re: [Release] Extravault in your MU WebSite

    Quote Originally Posted by kapeika View Post
    maby you can make install for this i test but it dident work ... :( but sjupa 9/10
    Well show me the error, I can tell you what you must to do... 14 minutes and you have it?

  4. #4
    [Czt] Coder Team Member noobies is offline
    MemberRank
    Aug 2005 Join Date
    Behind you !!Location
    747Posts

    Re: [Release] Extravault in your MU WebSite

    Cool , good job!

  5. #5
    Account Upgraded | Title Enabled! Pinoyrealm is offline
    MemberRank
    Jan 2007 Join Date
    Walter MartLocation
    969Posts

    Re: [Release] Extravault in your MU WebSite

    hey punk have you tested them 100%? no problem at all in anything?

  6. #6
    Member TZM is offline
    MemberRank
    Nov 2007 Join Date
    LatviaLocation
    72Posts

    Re: [Release] Extravault in your MU WebSite

    i think its very unsafe, but anyway , good release 6/10

  7. #7
    Valued Member Punker is offline
    MemberRank
    Nov 2004 Join Date
    Lima, PerúLocation
    133Posts

    Re: [Release] Extravault in your MU WebSite

    Quote Originally Posted by Vergel View Post
    hey punk have you tested them 100%? no problem at all in anything?
    Tested more than 100 times and work 100%, don't have any problem in game.

    The one detail is when you make the 2nd vault and you change it, and then you try edit with MuEdit, the vault look like this:



    If you want edit you must reset warehouse first, that's the only details and the only time you have to do this (if you want use an editor), but in game the update is successfully.

    Quote Originally Posted by TZM View Post
    i think its very unsafe, but anyway , good release 6/10
    You can make it better maybe?, just put this option into users panel that's all:

    http://img155.imageshack.us/img155/9...hot1pv5ip9.png
    Last edited by Punker; 23-04-08 at 01:56 AM.

  8. #8
    Account Upgraded | Title Enabled! Colbert is offline
    MemberRank
    Sep 2007 Join Date
    ArgentinaLocation
    232Posts

    Re: [Release] Extravault in your MU WebSite

    nice job punker

  9. #9
    Proficient Member serrinha is offline
    MemberRank
    Nov 2006 Join Date
    Santa Rita, ParLocation
    195Posts

    Re: [Release] Extravault in your MU WebSite

    nice...
    very useful.

  10. #10
    Valued Member dante147 is offline
    MemberRank
    Aug 2007 Join Date
    Germany 1933Location
    108Posts

    Re: [Release] Extravault in your MU WebSite

    Good, Very usefull and easy, Perfect Work Punker 19/10:v:

  11. #11
    Valued Member Punker is offline
    MemberRank
    Nov 2004 Join Date
    Lima, PerúLocation
    133Posts

    Re: [Release] Extravault in your MU WebSite

    Important Note:

    The 2nd script must be used only one time, this only works if you have accounts created, if you start by 0, don't use it.

    See ya! n' good luck!

  12. #12
    Beep! sandbird is offline
    MemberRank
    Dec 2004 Join Date
    Greece, SalonicaLocation
    284Posts

    Re: [Release] Extravault in your MU WebSite

    hehe nice one :)
    I started making this project also some months back....cant remember why i stopped it though.
    I'll look into it again, maybe we can work on this together.

  13. #13

    Re: [Release] Extravault in your MU WebSite

    I made one to 3 months ago ... its in the user control pannel..
    When entering it shows the number of the vault you are in .. has no limit to the number of vaults or you can set the MAX one ..
    Has protection (offline,anti dupe,sql inject and php inject)
    Script is very light uses min resources and you dont have to edit or add any tables in sql
    and ofcourse very user frendly interface ,,, if you need it i can share it .. or i can help ,,
    Olso i started to make a project on the virtual accaunt (like a bank account .. itb stores credit units (as money) ,, you can byu them by real money or you can register it by giving uot hearts (this is optional .. script recognise any item from any version )..)
    This part is finished .. but i stoped this project .. a was planing to do an web shop based on the credit unit system .. the big ++ in this is that you have 2 options :
    1.Byu with real money
    2.Register items (something very rare)
    If anyone have interest in this project e-mail me and we can work together to finish this addon .. this addon is suposed to work on any website ..
    Lincolin@mail.ru

  14. #14
    Novice encis is offline
    MemberRank
    Mar 2008 Join Date
    LatviaLocation
    3Posts

    Re: [Release] Extravault in your MU WebSite

    I know this is old teared, but maybe some one explain me have to set up this on mu web 0.8? My knowledge about php is shallow. :(

    P.S. sorry forhe bad English.

  15. #15
    Valued Member Ale[!] is offline
    MemberRank
    Feb 2008 Join Date
    ArgentinaLocation
    136Posts

    Re: [Release] Extravault in your MU WebSite

    punker mira me tira este error cuando kiero cambiar de bault

    Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: NexT-Mu in C:\AppServ\www\servidor\cambiobaul.php on line 2
    SQL connection fail, verify your connection config.

    bueno eso me tira,,,

    SORRY FOR POSTING IN SPANISH

  16. #16
    Beep! sandbird is offline
    MemberRank
    Dec 2004 Join Date
    Greece, SalonicaLocation
    284Posts

    Re: [Release] Extravault in your MU WebSite

    Ale: your username and password is wrong or the MSSQL isnt running

  17. #17
    Account Upgraded | Title Enabled! NezuL is offline
    MemberRank
    Jan 2008 Join Date
    BulgariaLocation
    467Posts

    Re: [Release] Extravault in your MU WebSite

    Very nice one , Punker keep up the good work :]

  18. #18
    Valued Member Ale[!] is offline
    MemberRank
    Feb 2008 Join Date
    ArgentinaLocation
    136Posts

    Re: [Release] Extravault in your MU WebSite

    sanbird: Spanish:
    amigo me decis en que parte tengo que poner el password y usuario de SQL

    English English according to Google

    Friends tell me that part I put the password and user SQL

    sorry my bad english

  19. #19
    King of the bongo Denied is offline
    MemberRank
    Oct 2009 Join Date
    RomaniaLocation
    986Posts

    Re: Extravault in your MU WebSite

    This one's made for MuCore?



Advertisement