Keep information of a disconnected player for a tic or so

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: Keep information of a disconnected player for a tic or so

Re: Keep information of a disconnected player for a tic or s

by edward850 » Sat Jan 09, 2016 4:11 am

Well the job then is to find a released example of this. :|

Re: Keep information of a disconnected player for a tic or s

by jpalomo » Sat Jan 09, 2016 4:10 am

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

Re: Keep information of a disconnected player for a tic or s

by edward850 » Sat Jan 09, 2016 3:25 am

How, exactly?

Re: Keep information of a disconnected player for a tic or s

by jpalomo » Sat Jan 09, 2016 3:23 am

Wouldn't this affect functions like [wiki]ClearInventory[/wiki]?

Re: Keep information of a disconnected player for a tic or s

by edward850 » Sat Jan 09, 2016 12:23 am

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

by randi » Fri Jan 08, 2016 10:49 pm

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.

Re: Keep information of a disconnected player for a tic or s

by edward850 » Fri Jan 08, 2016 6:42 pm

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.

Re: Keep information of a disconnected player for a tic or s

by phantombeta » Fri Jan 08, 2016 5:58 pm

Currently it seems the information of a player will be removed completely the instant he disconnects from a server.
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?

Keep information of a disconnected player for a tic or so

by Fused » Fri Jan 08, 2016 4:58 pm

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

Top