Advertisement
Guest User

player login

a guest
Jul 21st, 2013
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 2.73 KB | None | 0 0
  1. private["_int","_newModel","_doLoop","_wait","_hiveVer","_isHiveOk","_playerID","_playerObj","_randomSpot","_publishTo","_primary","_secondary","_key","_result","_charID","_playerObj","_playerName","_finished","_spawnPos","_spawnDir","_items","_counter","_magazines","_weapons","_group","_backpack","_worldspace","_direction","_newUnit","_score","_position","_isNew","_inventory","_backpack","_medical","_survival","_stats","_state"];
  2. //Set Variables
  3.  
  4. diag_log ("STARTING LOGIN: " + str(_this));
  5.  
  6. _playerID = _this select 0;
  7. _playerObj = _this select 1;
  8. _playerName = name _playerObj;
  9. _worldspace = [];
  10.  
  11. if (count _this > 2) then {
  12.     dayz_players = dayz_players - [_this select 2];
  13. };
  14.  
  15. //waitUntil{allowConnection};
  16.  
  17. //Variables
  18. _inventory =    [];
  19. _backpack =     [];
  20. _items =        [];
  21. _magazines =    [];
  22. _weapons =      [];
  23. _medicalStats = [];
  24. _survival =     [0,0,0];
  25. _tent =         [];
  26. _state =        [];
  27. _direction =    0;
  28. _model =        "";
  29. _newUnit =      objNull;
  30.  
  31. if (_playerID == "") then {
  32.     _playerID = getPlayerUID _playerObj;
  33. };
  34.  
  35. if ((_playerID == "") or (isNil "_playerID")) exitWith {
  36.     diag_log ("LOGIN FAILED: Player [" + _playerName + "] has no login ID");
  37. };
  38.  
  39. // Make Players Wait 60 if Alt F4 Bot detected
  40.  
  41. if (_playerID in botPlayers) then {
  42.     botPlayers = botPlayers - [_playerID];
  43. };
  44. endLoadingScreen;
  45. diag_log ("LOGIN ATTEMPT: " + str(_playerID) + " " + _playerName);
  46.  
  47. _key = format["CHILD:101:%1:%2:%3:",_playerID,dayZ_instance,_playerName];
  48. _primary = [_key,false,dayZ_hivePipeAuth] call server_hiveReadWrite;
  49.  
  50. if (isNull _playerObj or !isPlayer _playerObj) exitWith {
  51.     diag_log ("LOGIN RESULT: Exiting, player object null: " + str(_playerObj));
  52. };
  53.  
  54. if ((_primary select 0) == "ERROR") exitWith {
  55.     diag_log format ["LOGIN RESULT: Exiting, failed to load _primary: %1 for player: %2 ",_primary,_playerID];
  56. };
  57.  
  58. //Process request
  59. _newPlayer  = _primary select 1;
  60. _isNew      = count _primary < 6;
  61. _charID     = _primary select 2;
  62. _randomSpot = false;
  63. _hiveVer    = 0;
  64.  
  65. //Set character variables
  66. _inventory = _primary select 4;
  67. _backpack  = _primary select 5;
  68. _survival  = _primary select 6;
  69. _model     = _primary select 7;
  70. _hiveVer   = _primary select 8;
  71.    
  72. if (!(_model in ["SurvivorW2_DZ","Survivor2_DZ","Survivor3_DZ","Sniper1_DZ","Soldier1_DZ","Camo1_DZ","Bandit1_DZ","Rocket_DZ"])) then {
  73.     _model = "Survivor2_DZ";
  74. };
  75.  
  76. diag_log ("LOGIN LOADED: " + str(_playerObj) + " Type: " + (typeOf _playerObj));
  77.  
  78. _isHiveOk = false;
  79. if (_hiveVer >= dayz_hiveVersionNo) then {
  80.     _isHiveOk = true;
  81. };
  82.  
  83. _clientID = owner _playerObj;
  84. dayzPlayerLogin = [_charID,_inventory,_backpack,_survival,_isNew,dayz_versionNo,_model,_isHiveOk,_newPlayer];
  85. _clientID publicVariableClient "dayzPlayerLogin";
  86.  
  87. //_playerObj enableSimulation false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement