Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

New Excelent Registration Script

Skilled Illusionist
Joined
Oct 22, 2010
Messages
323
Reaction score
117
такое впечатление, что сдернули с pwi...
 
0, 1, 1, 2, 3, 5, 8, 13,
Joined
Sep 8, 2011
Messages
601
Reaction score
168
An impressive script indeed, hope i havent broken any rules by using this on my webbie, good luck and look forward to see what you create. والواقع أن هذه الكتابة هي المثيرة
 
Last edited:
Genesis?Is it a new drug?
Joined
Apr 8, 2010
Messages
512
Reaction score
96
такое впечатление, что сдернули с pwi...

ahm... what? xD
------------------
Hey hrace, I don't think that's necessary, it's just something more for the player remember... in my opinion, secret question, secret answer, e-mail and birthdate should be enough, especially if the change password must be confirmed in e-mail (wich only the owner will have access).
 
Skilled Illusionist
Joined
Oct 22, 2010
Messages
323
Reaction score
117
Just was aware. I thought always that you are pwfrance stuff member, so decided you just shared pwi registration scripts cos pwfrance leaked em somehow with all site content.
So sorry, if i was mistaken)
 
Skilled Illusionist
Joined
Oct 22, 2010
Messages
323
Reaction score
117
I think they leaked all the stuff))) And website too)))
 
Joined
Apr 2, 2009
Messages
1,056
Reaction score
210
ahm... what? xD
------------------
Hey hrace, I don't think that's necessary, it's just something more for the player remember... in my opinion, secret question, secret answer, e-mail and birthdate should be enough, especially if the change password must be confirmed in e-mail (wich only the owner will have access).

if it have PIN request i think it will more secure, but it was up to you, i just recomended it :tongue:
 
Genesis?Is it a new drug?
Joined
Apr 8, 2010
Messages
512
Reaction score
96
If there's someone who knows how to exactly manipulate the usecashnow table and usecash procedure, please tell me, and I'll update the registration.

I created the add cubi function based in how BatGM insert cubi-golds in the table, but it seems to not be working for some people.

Thanks.
 
Joined
Apr 2, 2009
Messages
1,056
Reaction score
210
Code:
BEGIN
DECLARE sn_old INTEGER;
DECLARE aid_old INTEGER;
DECLARE point_old INTEGER;
DECLARE cash_old INTEGER;
DECLARE status_old INTEGER;
DECLARE createtime_old DATETIME;
DECLARE time_old INTEGER;
DECLARE need_restore INTEGER;
DECLARE exists1 INTEGER;
DECLARE rowcount INTEGER;
START TRANSACTION;
  SET error = 0;
  SET need_restore = 0;
  SELECT SQL_CALC_FOUND_ROWS sn, aid, point, cash, status, creatime INTO sn_old, aid_old, point_old, cash_old, status_old, createtime_old FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND sn >= 0;
  SET rowcount = FOUND_ROWS();
  IF rowcount = 1 THEN
    SET exists1 = 1;
  ELSE
    SET exists1 = 0;
  END IF;
  IF status1 = 0 THEN
    IF exists1 = 0 THEN
      SELECT aid, point INTO aid1, point1 FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn1;
      SET point1 = IFNULL(point1,0);
      UPDATE point SET time = time-point1 WHERE uid = userid1 AND aid = aid1 AND time >= point1;
      SET rowcount = ROW_COUNT();
      IF rowcount = 1 THEN
        UPDATE usecashnow SET sn = 0, status = 1 WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn1;
      ELSE
        SET error = -8;
      END IF;
    END IF;
  ELSE
    IF status1 = 1 THEN
      IF exists1 = 0 THEN
        UPDATE point SET time = time-point1 WHERE uid = userid1 AND aid = aid1 AND time >= point1;
        SET rowcount = ROW_COUNT();
        IF rowcount = 1 THEN
          INSERT INTO usecashnow (userid, zoneid, sn, aid, point, cash, status, creatime) VALUES (userid1, zoneid1, sn1, aid1, point1, cash1, status1, now());
        ELSE
          INSERT INTO usecashnow SELECT userid1, zoneid1, IFNULL(min(sn),0)-1, aid1, point1, cash1, 0, now() FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND 0 >= sn;
          SET error = -8;
        END IF;
      ELSE
        INSERT INTO usecashnow SELECT userid1, zoneid1, IFNULL(min(sn),0)-1, aid1, point1, cash1, 0, now() FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND 0 >= sn;
        SET error = -7;
      END IF;
    ELSE
      IF status1 = 2 THEN
        IF exists1 = 1 AND status_old = 1 AND sn_old = 0 THEN
          UPDATE usecashnow SET sn = sn1, status = status1 WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn_old;
        ELSE
          SET error = -9;
        END IF;
      ELSE
        IF status1 = 3 THEN
           IF exists1 = 1 AND status_old = 2 THEN
            UPDATE usecashnow SET status = status1 WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn_old;
           ELSE
            SET error = -10;
            END IF;
        ELSE
         IF status1 = 4 THEN
          IF exists1 = 1 THEN
            DELETE FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn_old;
            INSERT INTO usecashlog (userid, zoneid, sn, aid, point, cash, status, creatime, fintime) VALUES (userid1, zoneid1, sn_old, aid_old, point_old, cash_old, status1, createtime_old, now());
          END IF;
          IF NOT (exists1 = 1 AND status_old = 3) THEN
            SET error = -11;
          END IF;
        ELSE
          SET error = -12;
        END IF;
      END IF;
    END IF;
  END IF;
  END IF;
  IF need_restore = 1 THEN
    UPDATE point SET time = time+point_old WHERE uid = userid1 AND aid = aid_old;
    DELETE FROM usecashnow WHERE userid = userid1 AND zoneid = zoneid1 AND sn = sn_old;
    INSERT INTO usecashlog (userid, zoneid, sn, aid, point, cash, status, creatime, fintime) VALUES (userid1, zoneid1, sn_old, aid_old, point_old, cash_old, status1, createtime_old, now());
  END IF;
COMMIT;
END
 
Genesis?Is it a new drug?
Joined
Apr 8, 2010
Messages
512
Reaction score
96
Okay, I want to know what's exactly 'sn'... Do it need to have different values in every insertion? I guess it's like a queue to send cubis to the server.

And hrace, I have the procedure xD
 
Angelemu founder
Joined
Mar 2, 2011
Messages
525
Reaction score
247
something like a queue, yes...
just don't ever think of going around that procedure.. it has many failsafe functions.
you can call it from php via mysqli multi_query
Code:
$res = $mysqli->multi_query( "CALL usecash( $id , 1, 0, 1, 0, $amount, 1, @error);SELECT @error" );

you can then use the $res variable to switch-case over different error codes..

error:
0. success;
-1: Unknown error;
-2. The account does not exist;
-3: Connection account server failed;
-4: Failed to send data to the account server;
-5: Account server did not return;
-6: The game server does not exist or does not start;
-7: The user has gold ingot being allocated, has been placed in the queue;
-8. charging zone or the allocated amount less than the balance of error, has been placed in the queue;
-9: call sequence error, the current state is not 1;
-10: call sequence error, the current state is not 2;
-11: call sequence error, the current state is not 3;
-12: Call the order of the error, no such records;
-13: to obtain the serial number the game server sends the request failed;
-14: transfer to the game server sends the request failed;
-15: to get the serial number to game server timeout;
-16: game server failed to get the serial number;
-17: game server allocation failed;
-18: game server gold ingot insufficient funds;

something like a queue, yes...
just don't ever think of going around that procedure.. it has many failsafe functions.
you can call it from php via mysqli multi_query
Code:
$res = $mysqli->multi_query( "CALL usecash( $id , 1, 0, 1, 0, $amount, 1, @error);SELECT @error" );

you can then use the $res variable to switch-case over different error codes..

to make it short: 0,-7,-8 mean the user will get the cash sooner or later
 
Back
Top