SHARE
TWEET

Cfusersignup

a guest May 23rd, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. require_once 'cf-config.php';
  3. require_once 'classes/class.content.php';
  4. require_once 'classes/class.gamehandler.php';
  5.  
  6. $Handler = new Handler();
  7. $Handler->caching = false;
  8.  
  9. if (empty($_POST)) $Handler->plain('status=Error&strReason=Invalid Input');
  10. $_POST = $Handler->MySQL('EscapeArray', $_POST);
  11.  
  12.     if (!empty($_SERVER['HTTP_CLIENT_IP'])){
  13.         $Address = $_SERVER['HTTP_CLIENT_IP'];
  14.     }elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])){
  15.         $Address = $_SERVER['HTTP_X_FORWARDED_FOR'];
  16.     }elseif (!empty($_SERVER['HTTP_X_FORWARDED'])){
  17.         $Address = $_SERVER['HTTP_X_FORWARDED'];
  18.     }elseif (!empty($_SERVER['HTTP_FORWARDED_FOR'])){
  19.         $Address = $_SERVER['HTTP_FORWARDED_FOR'];
  20.     }elseif (!empty($_SERVER['HTTP_FORWARDED'])){
  21.         $Address = $_SERVER['HTTP_FORWARDED'];
  22.     }else if (!empty($_SERVER['REMOTE_ADDR'])){
  23.         $Address = $_SERVER['REMOTE_ADDR'];
  24.     }else{
  25.         $Address = false;
  26.     }
  27.     $Address = $Handler->MySQL('EscapeString', $Address);
  28.     $Country = $Handler->getCountryCode();
  29.  
  30. $Registration = $Handler->MySQL('FetchObject', "SELECT COUNT(*) AS 'Limit' FROM users WHERE DateCreated >= CURDATE()");
  31. if ($Registration->Limit > Configuration::getPublic('RegistrationLimit')) $Handler->plain('status=Error&strReason=We\'ve reached our limit of '.Configuration::getPublic('RegistrationLimit').' user registrations for today. Please come back again tomorrow!');
  32.  
  33. $Registration = $Handler->MySQL('FetchObject', "SELECT COUNT(*) AS 'Limit' FROM users WHERE Address = '{$Address}' AND DateCreated >= CURDATE()");
  34. if ($Registration->Limit > 10) $Handler->plain('status=Error&strReason=You have reached maximum number of registration attempts. Please try again later.');
  35.  
  36. $ResultSet = $Handler->MySQL('Query', "SELECT id FROM `users` WHERE Name = '{$_POST["strUsername"]}'");
  37. if ($ResultSet->num_rows > 0) $Handler->plain('status=Taken&strReason=The username is already in use by another character.');
  38.        
  39. $Hash = $Handler->encryptPassword($_POST["strUsername"], $_POST["strPassword"]);
  40. $CountryCode = $Handler->getCountryCode();
  41. $ActivationFlag = Configuration::getPublic('EmailActivation') ? 0 : 5;
  42. $FILTER_VALIDATE_EMAIL = filter_var($_POST["strEmail"], FILTER_VALIDATE_EMAIL);
  43. $Domain = explode('@', $_POST["strEmail"]);
  44. $Domain = array_pop($Domain);
  45. $MX_RECORD_CHECK = checkdnsrr($Domain, 'MX');
  46.  
  47. //if (!$FILTER_VALIDATE_EMAIL || !$MX_RECORD_CHECK) $Handler->plain('status=Error&strReason=Email address is not valid.');
  48.  
  49. $_POST["intColorHair"] = dechex($_POST["intColorHair"]);
  50. $_POST["intColorSkin"] = dechex($_POST["intColorSkin"]);
  51. $_POST["intColorEye"] = dechex($_POST["intColorEye"]);
  52.  
  53. $Handler->MySQL('Query', "INSERT INTO `users` (`Name`, `Hash`, `HairID`, `Access`, `ActivationFlag`, `PermamuteFlag`, `Country`, `Age`, `Gender`, `Email`, `Level`, `Gold`, `Coins`, `Exp`, `ColorHair`, `ColorSkin`, `ColorEye`, `ColorBase`, `ColorTrim`, `ColorAccessory`, `SlotsBag`, `SlotsBank`, `SlotsHouse`, `DateCreated`, `LastLogin`, `CpBoostExpire`, `RepBoostExpire`, `GoldBoostExpire`, `ExpBoostExpire`, `UpgradeExpire`, `UpgradeDays`, `Upgraded`, `Achievement`, `Settings`, `DailyQuests0`, `DailyQuests1`, `DailyQuests2`, `MonthlyQuests0`, `LastArea`, `CurrentServer`, `HouseInfo`, `KillCount`, `DeathCount`, `Address`, `Rebirth`, `webLogin`) VALUES ('{$_POST["strUsername"]}', '{$Hash}', {$_POST['HairID']}, 1, {$ActivationFlag}, 0, '{$Country}', {$_POST['intAge']}, '{$_POST["strGender"]}', '{$_POST["strEmail"]}', 1, 0, 5000, 0, '{$_POST["intColorHair"]}', '{$_POST["intColorSkin"]}', '{$_POST["intColorEye"]}', '000000', '000000', '000000', 40, 0, 20, NOW(), NOW(), '2000-01-01 00:00:00', '2000-01-01 00:00:00', '2000-01-01 00:00:00', '2000-01-01 00:00:00', '2020-01-01 00:00:00', 7, 1, 0, 0, 0, 0, 0, 0, 'battleon-1|Enter|Spawn', 'Offline', '', 0, 0, '{$Address}', 0, 0);");
  54. $Handler->UserData = $Handler->getUserObjectByName($_POST["strUsername"]);
  55. if ($Handler->UserData == NULL) $Handler->plain("status=Error&strReason=Could not create your character. Please contact staff members as soon as possible!");
  56.  
  57. switch ($_POST['ClassID']) {
  58.     case 2:
  59.         # Swordsman
  60.         $Handler->MySQL('Query', "INSERT INTO `users_items` (itemid, userid, equipped, quantity, EnhID, Bank) VALUES ('1', '{$Handler->UserData->id}', '2', 1, 1957, 0)");
  61.         break;
  62.     case 4:
  63.         # Archer
  64.         $Handler->MySQL('Query', "INSERT INTO `users_items` (itemid, userid, equipped, quantity, EnhID, Bank) VALUES ('981237346', '{$Handler->UserData->id}', '4', 1, 1957, 0)");
  65.         break;
  66.     case 3:
  67.         # Magician
  68.         $Handler->MySQL('Query', "INSERT INTO `users_items` (itemid, userid, equipped, quantity, EnhID, Bank) VALUES ('981237356', '{$Handler->UserData->id}', '3', 1, 1957, 0)");
  69.         break;
  70.     case 5:
  71.         # Thief
  72.         $Handler->MySQL('Query', "INSERT INTO `users_items` (itemid, userid, equipped, quantity, EnhID, Bank) VALUES ('981237245', '{$Handler->UserData->id}', '5', 1, 1957, 0)");
  73.         break;
  74. }
  75.  
  76. $Handler->MySQL('Query', "INSERT INTO `users_items` (itemid, userid, equipped, quantity, EnhID, Bank) VALUES ('2', '{$Handler->UserData->id}', '1', 0, 1957, 0)");
  77.  
  78.         echo "status=Success";
  79.  
  80.  
  81. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top