Keep information of a disconnected player for a tic or so
Moderator: GZDoom Developers
Keep information of a disconnected player for a tic or so
Currently it seems the information of a player will be removed completely the instant he disconnects from a server. The only thing you could basically catch is his ID using the DISCONNECT script type. This is annoying as you would have to create arrays to store information of every player because of this, in case you need to know certain info after he disconnected.
My suggestion is to allow player information to stay around for another tic or so so it can be found after he disconnected. This will save effort on having to create multiple arrays and also allow for more accurate info (since before disconnecting, things can be changed. Think about their nick and such).
My suggestion is to allow player information to stay around for another tic or so so it can be found after he disconnected. This will save effort on having to create multiple arrays and also allow for more accurate info (since before disconnecting, things can be changed. Think about their nick and such).
- phantombeta
- Posts: 2159
- Joined: Thu May 02, 2013 1:27 am
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: Brazil
Re: Keep information of a disconnected player for a tic or s
I'm assuming you're testing this in Zandronum, as there are no servers in ZDoom. Are you sure ZDoom removes the player's info, not just Zandronum?Currently it seems the information of a player will be removed completely the instant he disconnects from a server.
Re: Keep information of a disconnected player for a tic or s
Yes it does, or rather the info becomes useless because the player is marked as gone. Which also in lies the problem: The player is marked as gone (an absolutely necessary part of removing the player), so the playsim isn't allowed to address what might well be invalid data as the same indicator is equally used to check to make sure it doesn't address a dead slot.
This likely can't change, both because of that and any future functionality that could very well require that slot to be free instantly.
This likely can't change, both because of that and any future functionality that could very well require that slot to be free instantly.
Re: Keep information of a disconnected player for a tic or s
It seems safe enough to run the script immediately before destroying the player, so I changed it. I could be misremembering the order of features, but I'm pretty sure disconnect scripts were added before SetReturnValue, which is when it became possible to immediately run scripts without waiting for the ACS thinker to run them, or they would have been implemented like this in the first place.
I could be wrong and this actually breaks something. Somebody might want to test this out.
I could be wrong and this actually breaks something. Somebody might want to test this out.
Re: Keep information of a disconnected player for a tic or s
I think it might be safe from rarity alone. I can't find anything off hand that properly uses it.
Re: Keep information of a disconnected player for a tic or s
Wouldn't this affect functions like [wiki]ClearInventory[/wiki]?
Re: Keep information of a disconnected player for a tic or s
A script type of disconnect would normally count as no activator (the world, until this change at least). Instead of the function being run for all players, it now will only run for the disconnecting player. I'll check to see what other functions this could potentially affect.If the function is run with no activator (for example an OPEN script or removing an existing activator with SetActivator), it will run for and affect all active players in the game.
Edit:
[wiki]GiveInventory[/wiki], [wiki]TakeInventory[/wiki], [wiki]UseInventory[/wiki], [wiki]FadeTo[/wiki], and [wiki]FadeRange[/wiki] all seem to be in the same boat as ClearInventory.
Last edited by jpalomo on Sat Jan 09, 2016 4:21 am, edited 2 times in total.
Re: Keep information of a disconnected player for a tic or s
Well the job then is to find a released example of this. 
