Page MenuHomeFeedback Tracker

Respawn event never triggers on the server!
Assigned, WishlistPublic

Description

It is not possible to assign an event handler that would trigger upon player respawn on the server. "Respawn" EH naturally would not trigger on the server as player is never local to the server. However "MPRespawn" should by design be able to trigger on the server, but it never does, not when it is assigned on the server, not when it is assigned where player is local.

To compare "MPhit" and "MPkilled" both fire on the server as well as everywhere. But the main issue here is that there is no way of getting respawn event on the server without additional scripting on client side to notify the server of the client respawn. This is really awkward.

Details

Legacy ID
2366346794
Severity
None
Resolution
Open
Reproducibility
Always
Category
Multiplayer
Steps To Reproduce

In MP execute on the client:

player removeallmpeventhandlers "mprespawn";
player addmpeventhandler ["mprespawn", {diag_log ["mprespawnCLIENT", _this]}];

throw 2 grenades under yourself -> event registers in client .rpt not server

execute on the server:

(playableUnits select 0) removeallmpeventhandlers "mprespawn";
(playableUnits select 0) addmpeventhandler ["mprespawn", {diag_log ["mprespawnSERVER", _this]}];

again it registers on the client only.

Event Timeline

Killzone_Kid edited Additional Information. (Show Details)
Killzone_Kid set Category to Multiplayer.
Killzone_Kid set Reproducibility to Always.
Killzone_Kid set Severity to None.
Killzone_Kid set Resolution to Open.
Killzone_Kid set Legacy ID to 2366346794.May 7 2016, 4:44 PM
Killzone_Kid edited a custom field.

To add, something that should be very simple like deleting player's dead body upon respawn server side will require some additional MP scripting, but should really be a very simple task to accomplish.

Let me summarise this:

MPHit - triggers globally on every machine no matter where it was added
MPKilled - triggers globally on every machine no matter where it was added
MPRespawn - triggeres only locally, no matter where it was added.

MPRespawn needs to be fixed.

Security issues:

While removing global vehicle init commands was a wise move, MP event handlers present the same level of security issues since they allow the transfer of the EH code over network and execution on every machine from any machine.

Suggestion: make the effect of these EHs LOCAL, i.e so that they could only be executed where added.

X39 added a subscriber: X39.May 7 2016, 4:44 PM
X39 added a comment.Jan 13 2014, 1:28 AM

not related to this ticket but as short note:
removing dead corpses etc. can be done through iterating through http://community.bistudio.com/wiki/allDead

This MPRespawn is still an issue.

It was a very good suggestion by KK. Hopefully you didnt forget it =)
2013-09-15 10:37 - Ran into the same problem.
Date: 16.05.2015

Thanks KK for adding it to the Wiki =)

However. Please Please do it
a) Local execution were it has been added
b) If it is being added in initPlayerServer.sqf - Please keep it local on the server

Reason:
In conjunction with the end game content: I am able to add and remove respawns for the players when they are needed. I would like to keep as much as possible on the server.

As workaround: I will send a dummy publicVariable from client to server, which is just starting the serverside respawn calculations. The server adds the things. The client waits until the server updates a blocking variable to true on the client. The client will remain in a uiSleep, until the stopper is being set to true.
The stopper will be placed in the onPlayerRespawn.sqf

It should solve it.

PiepMGI added a subscriber: PiepMGI.May 7 2016, 4:44 PM

MEH MPRespawn or EH Respawn are both returning the same object for _this select 0 & _this select 1 (bis_fnc_objectVar +same number).
(just hint format ["%1 %2", _this select 0, _this select1]; in the respawn code.

Furthermore, trying to add/remove action menu for the unit=player, I always failed to remove action from corpse. And I merely obtain action on corpse instead of unit after respawn.
In other words, if you want to remove Action on corpse, it's rather impossible, and if you want to add Action on the "new" unit, use corpse instead of unit (_this select 1 seems to work for new unit even if this is totally weird, but you obtain 2 actions on corpse).

Conclusion: There is a huge lack of example in BIKI. I'd like to put the challenge on you to explain clearly how to manage an action menu (addAction) with EH (orMEH) (MP)Respawn!
I'll save weeks of poor tests.

Any explanation welcome.