Jump to content
  • 0

Sometimes character stops updating after skin change


f3cuk

Question

Since updating to 1051 several people have been complaining that sometimes their character seemed to go back in time after they had logged in. Untill today I couldn't pinpoint what was happening but now i think i found it. Sometimes when a player changes skin, his or her character stops updating from that point on. Resulting in progress loss when they logout and log back in, even simply going in and out the lobby will "reset" their character to the state they were in just before they changed clothes.

 

One user even reported that he died » ragequit » after logging back in a few hours later, was alive and had most of his gear back. He asked me if i did a rollback on the database, which we did not. It did not make sense to me but now i'm figuring he had probably just changed skins before and got reset to that.
 

Could anyone confirm this issue? Or did i mess it up all by myself :P

Link to comment
Share on other sites

Recommended Posts

  • 1

Sorry mate, kinda got sidetracked tonight by a friend tonight. Really tired right now so I'll do a quick writeup which should fix the issues. (@ebaydayz: Like you i feel this is a workaround, but it is a decent working one and debugging the backpack drove me crazy).
 
--
 
1.) In your server pbo open server_playersync.sqf
 
Find

if (_characterID == "0") exitWith {
    diag_log ("ERROR: Cannot Sync Character " + (_name) + " as no characterID");
};

Add below

if (_inTransit) exitWith {
    diag_log ("NOTICE: Cannot update " + (_name) + ", player is in transit");
};

Find

_humanity             = 0;

Add below

_inTransit             = _character getVariable ["inTransit",false];

2.) Get player_wearClothes.sqf, player_switchModel.sqf and player_humanityMorph.sqf to your custom compiles and link them inside (if they are not already there)

 

3.) In player_wearClothes.sqf

Find

[dayz_playerUID,dayz_characterID,_model] spawn player_humanityMorph;

Replace with

[dayz_playerUID,dayz_characterID,_model] call player_humanityMorph;

4.) In player_switchModel.sqf

Find

private ["_weapons","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_tagSetting","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_playerObjName","_wpnType","_ismelee"];

Replace with

private ["_charID","_weapons","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_class","_position","_dir","_currentAnim","_tagSetting","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_oldUnit","_group","_newUnit","_playerObjName","_wpnType","_ismelee"];

Find

_oldUnit = player;

Add below

_charID = player getVariable["CharacterID",0];

Find

_newUnit = _group createUnit [_class,dayz_spawnPos,[],0,"NONE"];

Add below

_newUnit setVariable["CharacterID",_charID,true];

5.) Open player_humanityMorph.sqf

 

Find

_old = player;

Add above

player setVariable["inTransit",true,true];

Find

player setVariable["tagList",_tagList,true];

Add below

player setVariable["inTransit",false,true];

6.) Done, although additionally you may want to take out the _charID stuff inside player_humanityMorph.sqf which has kinda been rendered useless now.

---

Our solution is a bit different then the one above but that mainly because I'm neurotic when it comes to cleaning up code. For anyone interested. vv

private ["_meleeNum","_magType","_oldUnit","_idc","_charidchanged","_charID","_weapons","_backpackWpn","_backpackMag","_currentWpn","_isWeapon","_backpackWpnTypes","_backpackWpnQtys","_countr","_model","_position","_dir","_currentAnim","_tagSetting","_playerUID","_countMags","_magazines","_primweapon","_secweapon","_newBackpackType","_muzzles","_group","_newUnit","_melee"];

if (gear_done) then { disableUserInput true; };

_model 			= _this select 0;

if(count _this > 1) then {
	_charID			= _this select 1;
	_charidchanged 	= true;
} else {
	_charidchanged 	= false;
};

_position 		= getPosATL player;
_dir 			= getDir player;
_currentAnim 	= animationState player;
_tagSetting 	= player getVariable["DZE_display_name",false];
_playerUID 		= getPlayerUID player;
_weapons 		= weapons player;
_countMags 		= call player_countMagazines; 
_magazines 		= _countMags select 0;
_backpackMag	= [];

if ((_playerUID == dayz_playerUID) && (count _magazines == 0) && (count (magazines player) > 0 )) exitWith {cutText [(localize "str_epoch_player_17"), "PLAIN DOWN"]};

_primweapon	= primaryWeapon player;
_secweapon	= secondaryWeapon player;

if(!(_primweapon in _weapons) && _primweapon != "") then {
	_weapons set [(count _weapons), _primweapon];
};

if(!(_secweapon in _weapons) && _secweapon != "") then {
	_weapons set [(count _weapons), _secweapon];
};

//BackUp Backpack
dayz_myBackpack = unitBackpack player;
_newBackpackType = (typeOf dayz_myBackpack);
if(_newBackpackType != "") then {
	_backpackWpn = getWeaponCargo unitBackpack player;
	_backpackMag = _countMags select 1;
};

//Get Muzzle
_currentWpn = currentWeapon player;
_muzzles = getArray(configFile >> "cfgWeapons" >> _currentWpn >> "muzzles");

//Secure Player for Transformation
player setPosATL dayz_spawnPos;

_oldUnit = player;

/**********************************/
//DONT USE player AFTER THIS POINT//
/**********************************/

//Create New Character
_group 		= createGroup WEST;
_newUnit 	= _group createUnit [_model,dayz_spawnPos,[],0,"NONE"];

_newUnit 	setPosATL _position;
_newUnit 	setDir _dir;

//Clear New Character
{_newUnit removeMagazine _x;} count  magazines _newUnit;
removeAllWeapons _newUnit;	

//Equip New Charactar
{
	if (typeName _x == "ARRAY") then {if ((count _x) > 0) then {_newUnit addMagazine [(_x select 0), (_x select 1)]; }; } else { _newUnit addMagazine _x; };
} count _magazines;

{
	_newUnit addWeapon _x;
} count _weapons;

//Check && Compare it
if(str(_weapons) != str(weapons _newUnit)) then {
	//Get Differecnce
	{
		_weapons = _weapons - [_x];
	} count (weapons _newUnit);
	
	//Add the Missing
	{
		_newUnit addWeapon _x;
	} count _weapons;
};

if(_primweapon != (primaryWeapon _newUnit)) then {
	_newUnit addWeapon _primweapon;		
};

call {
	if(_primweapon == "MeleeCrowbar") 		exitWith { _newUnit addMagazine 'crowbar_swing'; };
	if(_primweapon == "MeleeSledge") 		exitWith { _newUnit addMagazine 'sledge_swing'; };
	if(_primweapon == "MeleeHatchet_DZE") 	exitWith { _newUnit addMagazine 'Hatchet_Swing'; };
	if(_primweapon == "MeleeMachete") 		exitWith { _newUnit addMagazine 'Machete_swing'; };
	if(_primweapon == "MeleeFishingPole") 	exitWith { _newUnit addMagazine 'Fishing_Swing'; };
};

if(_secweapon != (secondaryWeapon _newUnit) && _secweapon != "") then {
	_newUnit addWeapon _secweapon;		
};

//Add && Fill BackPack
if ((!isNil "_newBackpackType") && (_newBackpackType != "")) then {

	_newUnit 		addBackpack _newBackpackType;

	//Weapons
	_backpackWpnTypes 	= [];
	_backpackWpnQtys 	= [];

	if (count _backpackWpn > 0) then {
		_backpackWpnTypes = _backpackWpn select 0;
		_backpackWpnQtys = _backpackWpn select 1;
	};
		
	addSwitchableUnit		_newUnit;
	setPlayable 			_newUnit;
	selectPlayer 			_newUnit;
	
	if(_charidchanged) then {
		player setVariable["CharacterID",_charID,true];
		player setVariable["inTransit",true,true];
	};

	if (gear_done) then {sleep 0.001;};
	["1"] call gearDialog_create;
	if (gear_done) then {sleep 0.001;};
		
	//magazines
	_countr = 0;
	{
		if ((typeName _x) != "STRING") then {
			_isWeapon = (isClass(configFile >> "CfgWeapons" >> (_x select 0)));
		} else {
			_isWeapon = (isClass(configFile >> "CfgWeapons" >> _x));
		};
		
		if (!_isWeapon) then {
			_countr = _countr + 1;
			if ((typeName _x) != "STRING") then {
				(unitBackpack player) addMagazineCargoGlobal [(_x select 0), 1];
				_idc = (4999 + _countr);
				_idc setIDCAmmoCount (_x select 1);
			} else {
				(unitBackpack player) addMagazineCargoGlobal [_x, 1];
			};
		};
	} count _backpackMag;
		
	(findDisplay 106) closeDisplay 0;
	
	if (gear_done) then {
		sleep 0.001;
		disableUserInput false;
	};
		
	_countr = 0;
	{
		(unitBackpack player) addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];
		_countr = _countr + 1;
	} count _backpackWpnTypes;
		
} else { 

	addSwitchableUnit		_newUnit;
	setPlayable 			_newUnit;
	selectPlayer 			_newUnit;
	
	if(_charidchanged) then {
		player setVariable["CharacterID",_charID,true];
		player setVariable["inTransit",true,true];
	};
	
	if (gear_done) then {
		sleep 0.001;
		disableUserInput false;
	};

};

spawn {
	removeSwitchableUnit _oldUnit;
	removeAllWeapons _oldUnit;
	{
		_oldUnit removeMagazine _x;
	} count  magazines _oldUnit;
	deleteVehicle _oldUnit;
};

if (count _muzzles > 1) then {
	player selectWeapon (_muzzles select 0);
} else {
	player selectWeapon _currentWpn;
};

[objNull, player, rSwitchMove,_currentAnim] call RE;

player disableConversation true;

if (_tagSetting) then {
	DZE_ForceNameTags = true;
};

if(_primweapon != "") then {
	_melee = (gettext (configFile >> "CfgWeapons" >> _primweapon >> "melee"));
	
	if (_melee == "true") then {		
		_magType = ([] + getArray (configFile >> "CfgWeapons" >> _primweapon >> "magazines")) select 0;
		_meleeNum = ({_x == _magType} count magazines player);
		if (_meleeNum < 1) then {
			player addMagazine _magType;
		};
		
	};
};

{
	player reveal _x
} count (nearestObjects [getPosATL player, dayz_reveal, 50]);

Link to comment
Share on other sites

  • 0

Okay after doing some debugging, we found that changing a player skin does not update character_data in the database directly. Only after manually triggering another event that updates the player the character gets updated to the right skin. I do not know if this might create opportunity for this bug to happen or if it is unrelated, but it seems like it might.

Link to comment
Share on other sites

  • 0

Thanks again ebay iv also seen this happen with players some times teleporting , they log off and log back on in a different position, it doesn't happen much but , it never used to happen before the new update thanks again hope that info helps a bit. 

 

if you need any testers for any thing hit me up!

 

 
On 7/15/2014 at 11:09 PM, f3cuk said:

Hmm interesting, could you elaborate on that?

 

Not much to say about that every ones Server is different bandwidth settings should all all be modified to fix your servers needs and some servers that are not dedicated do not even have the options of messing with the settings (basic.cfg and Sql sever)

but ebays post on bandwidth configs , along with MGT's post have helped me alot!

Link to comment
Share on other sites

  • 0

Nice one, I'll update these a.s.a.p. and let you know if it helps.

On 7/17/2014 at 8:35 PM, TNT said:

Not much to say about that every ones Server is different bandwidth settings should all all be modified to fix your servers needs and some servers that are not dedicated do not even have the options of messing with the settings (basic.cfg and Sql sever)

but ebays post on bandwidth configs , along with MGT's post have helped me alot!

Okay thanks, I thought you actually fixed this problem by tuning some of your server settings :P What post of ebaydayz are you referring to? I have read so much about the basic.cfg, but somehow people keep contradicting each other on it, makes it hard to find the truth.

Link to comment
Share on other sites

  • 0
 

Nice one, I'll update these a.s.a.p. and let you know if it helps.


Okay thanks, I thought you actually fixed this problem by tuning some of your server settings  :P What post of ebaydayz are you referring to? I have read so much about the basic.cfg, but somehow people keep contradicting each other on it, makes it hard to find the truth.

 

i guess i lessened the problem a bit , with really bad bandwidth settings the problem is multiplied x100

Link to comment
Share on other sites

  • 0

changed up the file on my chernarus server testing it now   if any one wants to help me test it , every thing running fine so far tested switching skins a few times and logging a few different ways didn't get any loss but could use alot more testing 

 

66.150.188.168:2302

Link to comment
Share on other sites

  • 0

after having it on my server for a bit i got the first report of some one losing all gear from time changed 

not sure if it was a lie or not , i will have to just keep a watch and i will post more updates as need be 

 

this happen after a restart i guess , he logged in to find him self at the point he last changed , 

this was a new player to the server

Link to comment
Share on other sites

  • 0

Although it does not seem to happen as often as before. Today i did have it happen to myself again. I wasn't able to reproduce but come to think of it, i did teleport just before skin change, so that may have something to do with it.

Link to comment
Share on other sites

  • 0

Okay this problem has taken a turn for the worse. Just now after restart about every player reported he got set back in time, looking at the RPT there are LOADS of "ERROR: Cannot sync character XX has no character id"

 

SERVER RPT: http://pastebin.com/Yh4WWtVt

First one started at 18:51:37, just after some WAI mission started. Anyone got an idea what might be happening?

Link to comment
Share on other sites

  • 0

Not much, count is a bit faster so it's often preferred. 1.5 replaced a lot of foreach loops with count loops, they did however overlook a problem which is that count does not let you have another count inside it. Most of these have been fixed for 1052.

To clarify

Fails

{

 DO STUFF // WORKS
 
 {

   DO STUFF // DOESNT WORK

 } count _arrayname2;


} count _arrayname1;
Works, optimal performance

{

 DO STUFF // WORKS
 
 {

   DO STUFF //WORKS

 } count _arrayname2;


} foreach _arrayname1;
Works, less performance

{

 DO STUFF // WORKS
 
 {

   DO STUFF // WORKS

 } foreach _arrayname2;


} foreach _arrayname1;
Link to comment
Share on other sites

  • 0

Thanks for those fixes on Github ebay. Done all of them on our live server, will keep this thread updated on found results.

 

Hmm still happening. Got these errors in my log for a full hour, then the player died and got send to the debug zone, in which he came back to life and could walk around untill radiation got him. After relog he went back in time to the point where the errors first started. Which was when he was changing his clothes inside a safe zone. Since we got AGN safezone installed it might be related to that.

1:01:34 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:01:34 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:01:35 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:01:40 Client: Object 24:147 (type Type_70) not found.
 1:01:40 Client: Object 24:146 (type Type_70) not found.
 1:01:45 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:01:56 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:02:00 "CLEANUP: Deleted 3 Loot Piles out of 183"
 1:02:11 "EPOCH SERVERTRADE: Player: Warrior Of The Future (76561198148317974) sold a M240_DZ in/at trader city Stary for 5x ItemGoldBar"
 1:02:21 "EPOCH SERVERTRADE: Player: Warrior Of The Future (76561198148317974) sold a 100Rnd_762x51_M240 in/at trader city Stary for 1x ItemGoldBar"
 1:02:26 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:02:26 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:02:27 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:02:30 "SAFE UNLOCKED: ID:8982 UID:0 BY zX3R0(76561198061024922)"
 1:02:38 "SAFE LOCKED: ID:9100 UID:0 BY Ghettovich(76561198015992245)"
 1:02:41 "EPOCH SERVERTRADE: Player: Warrior Of The Future (76561198148317974) sold a UZI_EP1 in/at trader city Stary for 2x ItemGoldBar"
 1:02:50 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:02:50 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:02:52 "CLEANUP: Deleted 1 Animals out of 15"
 1:02:52 "DEBUG FPS : 49.6894 OBJECTS: 4240 : PLAYERS: 15"
 1:02:52 "TIME SYNC: Local Time set to [2013,8,3,19,2]"
 1:02:56 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:02:57 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:03:00 "CLEANUP: Deleted 16 Loot Piles out of 182"
 1:03:08 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:03:19 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:03:30 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:03:44 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:03:46 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:03:57 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:04:07 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:04:18 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:04:29 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:04:38 "EPOCH SERVERTRADE: Player: Warrior Of The Future (76561198148317974) sold a 17Rnd_9x19_glock17 in/at trader city Stary for 5x ItemSilverBar"
 1:04:39 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:04:50 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:05:00 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:05:01 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:05:12 "ERROR: Cannot Sync Character Warrior Of The Future as no characterID"
 1:05:15 "EPOCH SERVERTRADE: Player: Warrior Of The Future (76561198148317974) sold a MakarovSD in/at trader city Stary for 1x ItemGoldBar"
 1:05:33 "EPOCH SERVERTRADE: Player: Warrior Of The Future (76561198148317974) bought a UZI_SD_EP1 in/at trader city Stary for 1x ItemGoldBar10oz"
Link to comment
Share on other sites

  • 0

Okay this problem has taken a turn for the worse. Just now after restart about every player reported he got set back in time, looking at the RPT there are LOADS of "ERROR: Cannot sync character XX has no character id"

 

SERVER RPT: http://pastebin.com/Yh4WWtVt

First one started at 18:51:37, just after some WAI mission started. Anyone got an idea what might be happening?

Can you post your hive log files?

We can see there if the 201 calls fail or succeed with all the data that is transferred.

Link to comment
Share on other sites

  • 0

Do i need to switch the login back to trace? I had that before, but when i compared the datastamps on the errors to the events in the hiveext log with the same datestamp nothing seemed wrong. Even recreated the queries and done them manually to check if they were proper.

--

I may have pinpointed the issue a bit further, this needs testing but it seems like it happens when a player changes skin inside a safe zone, having his backpack on and having stuff in that backpack. After the skinchange players with messed up CHARID's will not have anything in their backpack. Getting more and more sure this must have something to do with AGN and godmode not allowing the character to get killed or something. I'll look into it some more today after I've finished other work.

--

Edit: Did find an error in the hiveext.log. Seems unrelated, but troublesome. Looks like mysql thingie is having trouble parsing long queries.

2014-08-08 13:29:25 HiveExt: [Error] Error executing |CHILD:303:6885:[[["ItemMatchbox_DZE","ItemCompass","ItemToolbox","ItemCrowbar","ItemHatchet_DZE","glock17_EP1","AKS_74_kobra","LeeEnfield","M24","M4A1","SVD_des_EP1","Winchester1866","UZI_SD_EP1","Makarov"],[1,1,1,1,1,3,1,2,1,1,1,2,1,1]],[["ItemSandbagExLarge5x","ItemBriefcase100oz","ItemComboLock","ItemMorphine","ItemBloodbag","ItemCanvas","ItemEpinephrine","ItemTankTrap","forest_large_net_kit","cinder_garage_kit","ItemTentDomed","ItemTrashToiletpaper","ItemSandbag","FlareGreen_M203","ItemBriefcase20oz","ItemPlotDeed","Skin_Bandit1_DZ","Skin_INS_Soldier_CO_DZ","Skin_Soldier1_DZ","ItemBriefcaseS100oz","ItemBriefcaseS60oz","ItemBriefcaseEmpty","Skin_Survivor2_DZ","FoodMRE","ItemORP","ItemTNK","ItemLRK","Skin_Drake_Light_DZ","Skin_Graves_Light_DZ","Skin_FR_OHara_DZ","HandRoadFlare","Skin_BanditW1_DZ","ItemAntibiotic","PartPlywoodPack","PartFueltank","PartWheel","Skin_TK_INS_Warlord_EP1_DZ","Skin_INS_Worker2_DZ","ItemSodaPepsiEmpty","ItemSodaEmpty","ItemSilverBar","ItemBriefcaseS30oz","FoodCanBakedBeans","ItemBriefcaseS50oz","ItemFuelBarrelEmpty","ItemJerrycanEmpty","ItemTrashRazor","TrashJackDaniels","1Rnd_Smoke_M203","TrashTinCan","ItemTinBar","ItemBriefcase60oz","ItemSodaCokeEmpty","ItemWoodFloor","ItemWoodLadder","ItemSodaCoke","ItemBriefcaseS90oz","ItemWoodWallLg","ItemGoldBar10oz","ItemGoldBar2oz","ItemSilverBar2oz","ItemSilverBar3oz","ItemSilverBar4oz","ItemGoldBar5oz","ItemSilverBar6oz","ItemGoldBar7oz","ItemSilverBar7oz","ItemSilverBar8oz","ItemGoldBar9oz","ItemAluminumBar","10x_303","ItemVault","ItemSodaPepsi","100Rnd_127x99_M2","ItemGoldBar","ItemWaterbottle","Skin_TK_INS_Soldier_EP1_DZ","ItemPainkiller","30Rnd_9x19_UZI_SD","8Rnd_9x18_Makarov","100Rnd_762x54_PK","5Rnd_86x70_L115A1","5Rnd_762x51_M24","8Rnd_B_Beneli_Pellets","8Rnd_B_Beneli_74Slug","20Rnd_B_765x17_Ball","ItemDocument","15Rnd_9x19_M9SD","ItemBandage","PartGlass"],[5,4,1,16,7,2,4,4,3,2,2,3,2,1,3,1,1,1,4,1,2,1,6,2,1,1,1,2,3,3,1,1,2,1,2,1,1,1,1,6,1,1,2,1,1,4,1,1,1,2,1,1,1,5,1,3,1,2,1,1,1,1,1,2,2,1,1,1,1,2,3,1,3,2,1,1,1,2,2,2,1,1,1,1,1,1,1,1,4,1|
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...