Jump to content
Sign in to follow this  
Explodie

Player Saves dead player

Recommended Posts

Hi guys,

 

having an issue with player saving dead players - ones that are dead but watching when the player save fires off every 300 secs. What this does is saves a player damage = 1 into the database, and next time the save fires off they've respawned since and there's a new playerid in the database for the same account_uid. Not sure if the player just loses connection or if they've logged out and back in again, but on return they cannot login till the id with damage=1 is deleted (currently a manual process)

 

I did try an overwrite of ExileServer_object_player_database_update like this:
 

/**
 * ExileServer_object_player_database_update
 *
 * Exile Mod
 * www.exilemod.com
 * © 2015 Exile Mod Team
 *
 * This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License. 
 * To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
 */
 
private["_player", "_playerID", "_playerPos", "_data", "_extDB2Message"];
_player = _this;
_playerID = _player getVariable["ExileDatabaseID", -1];
_playerPos = getPosATL _player;
_data = 
[
	_player getVariable ["ExileName",""],
	damage _player,
	_player getVariable ["ExileHunger", 100],
	_player getVariable ["ExileThirst", 100],
	_player getVariable ["ExileAlcohol", 0],
	getOxygenRemaining _player,
	getBleedingRemaining _player,
	_player call ExileClient_util_player_getHitPointMap,
	getDir _player,
	_playerPos select 0,
	_playerPos select 1,
	_playerPos select 2,
	assignedItems _player,
	backpack _player,
	(getItemCargo backpackContainer _player) call ExileClient_util_cargo_getMap,
	(backpackContainer _player) call ExileClient_util_cargo_getMagazineMap,
	(getWeaponCargo backpackContainer _player) call ExileClient_util_cargo_getMap,
	currentWeapon _player,
	goggles _player,
	handgunItems _player,
	handgunWeapon _player,
	headgear _player,
	binocular _player,
	_player call ExileClient_util_inventory_getLoadedMagazinesMap,
	primaryWeapon _player,
	primaryWeaponItems _player,
	secondaryWeapon _player,
	secondaryWeaponItems _player,
	uniform _player,
	(getItemCargo uniformContainer _player) call ExileClient_util_cargo_getMap,
	(uniformContainer _player) call ExileClient_util_cargo_getMagazineMap,
	(getWeaponCargo uniformContainer _player) call ExileClient_util_cargo_getMap,
	vest _player,
	(getItemCargo vestContainer _player) call ExileClient_util_cargo_getMap,
	(vestContainer _player) call ExileClient_util_cargo_getMagazineMap,
	(getWeaponCargo vestContainer _player) call ExileClient_util_cargo_getMap,
	_player getVariable ["ExileTemperature", 0],
	_player getVariable ["ExileWetness", 0],
	_playerID
];

// original 
/*
_extDB2Message = ["updatePlayer", _data] call ExileServer_util_extDB2_createMessage;
_extDB2Message call ExileServer_system_database_query_fireAndForget;

true
*/


//explodie added
if ((damage _player)< 1) then 
	{
		_extDB2Message = ["updatePlayer", _data] call ExileServer_util_extDB2_createMessage;
		_extDB2Message call ExileServer_system_database_query_fireAndForget;
	} else
	{
		_extDB2Message = ["deletePlayer", _playerID] call ExileServer_util_extDB2_createMessage;
		_extDB2Message call ExileServer_system_database_query_fireAndForget;
	};
true

There was some crazy shit going on with database saves afterwards - vehicles not saving where they should be, stuff missing from containers, etc so I rolled back the change in case that was causing it.

I removed this change as well as one to fix an issue i had with VG - I've since added back in the VG fix and no issue so guessing either something was just crazy with the DB at the time or this code above had introduced instability somehow.

 

Has anyone got a better fix for this issue?

 

Much appreciated!

Share this post


Link to post
Share on other sites
format["deletePlayer:%1", _victim getVariable ["ExileDatabaseId", -1]] call ExileServer_system_database_query_fireAndForget;

Search for this line in ExileServer_object_player_event_onMpKilled.sqf and move it to line 34.

 

 

  • Thanks 1

Share this post


Link to post
Share on other sites

I'll get that overwrite in and let you know how it goes. Much appreciated El' Rabito!

Share this post


Link to post
Share on other sites

Have not had a complaint about this issue all week, and given how busy the server was last night I'm sure to have at least had one occurrance if it was still happening so thanks El' Rabito I think we can call this bug squashed!

Share this post


Link to post
Share on other sites
6 hours ago, Explodie said:

Have not had a complaint about this issue all week, and given how busy the server was last night I'm sure to have at least had one occurrance if it was still happening so thanks El' Rabito I think we can call this bug squashed!

You have to thank @dave_beastttt, he posted that a while ago on the Exile discord 🙂

  • Like 1

Share this post


Link to post
Share on other sites
Sign in to follow this  

×