Make server_playerSync exit log more accurate

This will now show INFO instead of ERROR when sync exits while a player
is changing clothes.
This commit is contained in:
ebayShopper
2017-02-26 15:28:17 -05:00
parent 0eaa995d27
commit f0ef0fce35
2 changed files with 11 additions and 15 deletions

View File

@@ -19,12 +19,12 @@ _playerObj = nil;
//If playerObj is not in playableUnits then lets exit the disconnect system.
if (isNil "_playerObj") exitWith {
diag_log format["%1: Exiting. Player is not in playableUnits. _this:%2", __FILE__, _this];
diag_log format["INFO: OnPlayerDisconnect exiting. Player is not in playableUnits. %1", _this];
};
//Player object is alive in debug zone. The player most likely just respawned.
if (_playerPos distance respawn_west_original < 1500) exitWith {
diag_log format["%1: Exiting. Player is near respawn_west. This is normal if the player just died. _this:%2", __FILE__, _this];
diag_log format["INFO: OnPlayerDisconnect exiting. Player is near respawn_west. This is normal after death. %1", _this];
if (!isNull _playerObj) then {
_playerObj call sched_co_deleteVehicle;
};

View File

@@ -1,5 +1,5 @@
private ["_distanceFoot","_playerPos","_lastPos","_playerGear","_medical","_currentModel","_currentAnim",
"_currentWpn","_muzzles","_array","_coins","_key","_globalCoins","_bankCoins","_playerBackp",
"_currentWpn","_muzzles","_array","_coins","_key","_globalCoins","_bankCoins","_playerBackp","_exitReason",
"_backpack","_kills","_killsB","_killsH","_headShots","_humanity","_lastTime","_timeGross","_timeSince",
"_timeLeft","_config","_onLadder","_isTerminal","_modelChk","_temp","_currentState","_character",
"_magazines","_characterID","_charPos","_isInVehicle","_name","_inDebug","_newPos","_count","_maxDist","_relocate","_playerUID"];
@@ -16,20 +16,16 @@ _humanity = 0;
_name = if (alive _character) then {name _character} else {"Dead Player"};
_inDebug = (respawn_west_original distance _charPos) < 1500;
if (_character isKindOf "Animal") exitWith {
diag_log ("ERROR: Cannot Sync Character " + _name + " is an Animal class");
_exitReason = switch true do {
case (isNil "_characterID"): {("ERROR: Cannot Sync Character " + _name + " has nil characterID")}; //Unit is null
case (_inDebug): {format["INFO: Cannot Sync Character %1 near respawn_west %2. This is normal when relogging or changing clothes.",_name,_charPos]};
case (_characterID == "0"): {("ERROR: Cannot Sync Character " + _name + " has no characterID")};
case (_character isKindOf "Animal"): {("ERROR: Cannot Sync Character " + _name + " is an Animal class")};
default {"none"};
};
if (isNil "_characterID") exitWith {
diag_log ("ERROR: Cannot Sync Character " + _name + " has nil characterID");
};
if (_characterID == "0" or _inDebug) exitWith {
if (_inDebug) then {
diag_log format["INFO: server_playerSync: Cannot Sync Player %1 [%2]. Position in debug! %3. This is normal when respawning, relogging and changing clothes.",_name,_characterID,_charPos];
} else {
diag_log ("ERROR: Cannot Sync Character " + _name + " as no characterID");
};
if (_exitReason != "none") exitWith {
diag_log _exitReason;
};
//Check for player initiated updates