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

  • 0

You will need to modify scripts.txt if you have this filter: 5 "call player_humanityMorph"

I haven't done so yet but just noticed while testing.

Also getting errors following your instructions.

11:27:27 Error in expression <_name) + " as no characterID");

};

if (_inTransit) exitWith {

diag_log ("NOTICE>

11:27:27 Error position: <_inTransit) exitWith {

diag_log ("NOTICE>

11:27:27 Error Undefined variable in expression: _intransit

11:27:27 File z\addons\dayz_server\compile\server_playerSync.sqf, line 39

11:27:29 Error in expression <_name) + " as no characterID");

};

Hey justchil, so did you just change this line in your scripts.txt to a 1?

 

I have that set to a 5 currently as I guess every infiSTAR user would have....

Link to comment
Share on other sites

  • 0

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]);

Hi f3cuk,

 

I have tried this and followed it to the letter. It won't let half my players including me join and just freezes the game client. In the logs it's showing createvehicle restriction 0 which is a kick for seagull. This happens every time we try to log in....

 

Any ideas?

 

Thanks

Link to comment
Share on other sites

  • 0

Server rpt:

15:57:13 - Player #12 Jxxi (GUID HERE) has been kicked by BattlEye: CreateVehicle Restriction #0

 

Createvehicle.log:

15.09.2014 14:56:13: Jxxi (88.xxx.xxx:2334) GUID HERE- #0 "SeaGull" 61:2 [2779,3118,158]
 
createvehicle.txt BE filter:
5 "SeaGull"
 
the odd thing is that other players were in the server all OK..... :/
Link to comment
Share on other sites

  • 0

Hey man, when I reverted back to the backed up files we could all log in again....

 

The reason I wanted to load this is we are getting some seriously wild humanity going up and down and thought your changes to player sync may help that and that we also have the core problem of changing skin and your character not updating. Thought they may be related based on the posts earlier....

 

I have PM'd you my rpt as it has player id's etc in there.

 

Really appreciate your help. :)

Link to comment
Share on other sites

  • 0

Happens when there are no more group slots for a player to spawn into and they go into spectating mode as a bird in arma.

 

The kick is there to force them to relog.

Yes, but when I had the changes applied we relogged and relogged over and over and just couldn't get back in. Also, the kick, for some reason and unlike usual, would just make the client freeze at the loading screen.... :\

Link to comment
Share on other sites

  • 0

Not sure whether its related to this thread and to my problem applying this fix for skin change but, I seem to get quite a few players names change to error in the database and then change back later....seems to happen when population is high but, that's about all I can narrow it down to. Their names are displayed properly in game.

 

Does anyone else have this happening..?

Link to comment
Share on other sites

  • 0

After this patch, When I wear clothes I got kicked by Batteye script restriction. #127

 

Any solution??

Yes, read justchil's post requoted below that was 2 pages back....

 

You will need to modify scripts.txt if you have this filter: 5 "call player_humanityMorph"

I haven't done so yet but just noticed while testing.

Also getting errors following your instructions.

11:27:27 Error in expression <_name) + " as no characterID");

};

if (_inTransit) exitWith {

diag_log ("NOTICE>

11:27:27 Error position: <_inTransit) exitWith {

diag_log ("NOTICE>

11:27:27 Error Undefined variable in expression: _intransit

11:27:27 File z\addons\dayz_server\compile\server_playerSync.sqf, line 39

11:27:29 Error in expression <_name) + " as no characterID");

};

Link to comment
Share on other sites

  • 0

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

Sometimes? Fales, False and False.

If they give a "used magzin" in the backpack and then when the player changes the clothing, "always" stops the updating of the character from that point on. 100% reproducible ;-)

The Bug is the "used magazin".

Link to comment
Share on other sites

  • 0

Sometimes? Fales, False and False.

If they give a "used magzin" in the backpack and then when the player changes the clothing, "always" stops the updating of the character from that point on. 100% reproducible ;-)

The Bug is the "used magazin".

Hellraver is correct. This can be done 100% and can be used as a dupe. Place a used magzin in backpack, change clothes, place all your gear in a storage container, relog to lobby then back in-game and you have everything on character plus everything in storage container. This needs to be fixed.

 

A possible fix would be using a older version (1.0.4.2) player_werarclothes.sqf to force the player to remove his/her backpack before they can change skins.

 

This might fix it 

 

EDIT: The above link works, forcing them to remove there backpack prevents the used magzin bug/dupe. Lets see if there is another way to reproduce this bug. Only time will tell. Will post back after having this live on my server(s) for a few days.

Link to comment
Share on other sites

  • 0

Sometimes? Fales, False and False.

If they give a "used magzin" in the backpack and then when the player changes the clothing, "always" stops the updating of the character from that point on. 100% reproducible ;-)

The Bug is the "used magazin".

 

Well i just tried this duping glitch on our server and it didn't work. Guess the updates i did to switchmodel / wearclothes / humanitymorph files fixed that one. On another note, we haven't experienced this issue anymore since i last posted in this thread. Completely fixed, no need to drop your backpack when changing clothes.

Link to comment
Share on other sites

  • 0

hey iv done this, can get in game ok and everything but getting this error on login

23:39:12 Error in expression < =		_primary select 8;

if (!(_model in AllPlayers)) then {
_model = "Survivor2_>
23:39:12   Error position: <AllPlayers)) then {
_model = "Survivor2_>
23:39:12   Error Undefined variable in expression: allplayers
23:39:12 File z\addons\dayz_server\compile\server_playerLogin.sqf, line 75

any help?

 

 

Edit..............ignore this, i fucked up

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...