MantisBT - Zandronum
View Issue Details
0000799Zandronum[All Projects] Bugpublic2012-04-22 01:382018-09-30 20:45
MediumTank 
Torr Samaho 
highmajoralways
closedfixed 
98d 
1.11.1 
0000799: 98e - Running more than one CLIENTSIDE script transfers to all other players upon activator disconnecting
Pretend player 1, 2 and 3 connect:

In the attached wad, if player 1 pukes script 01 (which is NET CLIENTSIDE), it will invoke ACS_ExecuteAlways for scripts 02, 03, and 04 (of which are all CLIENTSIDE, no 'NET' is on them).

Upon doing so, player 1 will see the text, player 2 and player 3 will *not* see any of the text, which shows that it is successfully clientsided for player 1. Note that the scripts will continue printing a string every few tics, I tried it with both Restart; and while(true) { ... } replacing 'restart;' to see if maybe the Restart ACS command did something, but both gave the same result.

Now when player 1 disconnects, script 02 is terminated and does not appear on any of the clients. This one is run first.
Script 03 and 04 however are passed on to all the other clients, and the ACS script runs on their client.



Therefore from what I've seen, when you run X amount of clientside scripts, the very first one successfully terminates upon quitting (or isn't passed onto everyone else), but the rest just execute for everyone.
This in turn limits only one clientside script being able to run for each player. Maybe this is how it's supposed to be and it's not a bug. I have to re-think a part of my wad now though because there's the possibility of a player quitting while a second one is running and that'd mess up everyone else's screen.


I have not investigated how functions work on clientside scripts or any other things. If you want more data just tell me what to do and I'll go see what happens. This was online btw.
1. Open .wad file attached

2. Join 2+ players to an online game

3. Have one of them type "puke 1" in console

4. Quit Game for the player who puked script 1, then switch over to the other player(s) to see 2 of the 3 scripts suddenly start running on the non-invoker's machine
#include "zcommon.acs"
#library "AHCRAP"

int serverNum = 2;

Script 1 (void) NET CLIENTSIDE
{
    ACS_ExecuteAlways(2, 0);
    ACS_ExecuteAlways(3, 0);
    ACS_ExecuteAlways(4, 0);
}

Script 2 (void) CLIENTSIDE
{
    int tid = ActivatorTID();
    int pn = PlayerNumber();
    serverNum = 8;
    while (true) {
        Print(d: serverNum, s: " _ Tid ", d: tid, s: ", PlayerNum ", d: pn, s: " = ", d: GetActorProperty(0, APROP_HEALTH));
        delay(35);
    }
    restart;
}

Script 3 (void) CLIENTSIDE
{
    serverNum = 1;
    Print(s: "Servernum = ", d: serverNum);
    delay(25);
    restart;
}

// Show that more than one clientside script gets messed up
Script 4 (void) CLIENTSIDE
{
    Print(s: "Omg script 4 is at it again");
    delay(53);
    restart;
}
No tags attached.
related to 0000810closed Torr Samaho CLIENTSIDE ACS Script 1 floods the server and clients with data, extreme packet loss 
? ClientsideProblems.wad (1,208) 2012-04-22 01:38
/tracker/file_download.php?file_id=566&type=bug
? script_clientside_disconnect_01.wad (1,915) 2012-05-05 15:50
/tracker/file_download.php?file_id=600&type=bug
? script_spectator_activator_01.wad (2,226) 2012-05-08 03:04
/tracker/file_download.php?file_id=615&type=bug
Issue History
2012-04-22 01:38MediumTankNew Issue
2012-04-22 01:38MediumTankFile Added: ClientsideProblems.wad
2012-04-22 01:41MediumTankNote Added: 0003379
2012-04-22 02:25Torr SamahoNote Added: 0003380
2012-04-22 02:26Torr SamahoAssigned To => Torr Samaho
2012-04-22 02:26Torr SamahoStatusnew => feedback
2012-04-22 15:14MediumTankNote Added: 0003383
2012-04-22 15:14MediumTankStatusfeedback => assigned
2012-04-26 00:20Torr SamahoRelationship addedrelated to 0000810
2012-04-26 00:34Torr SamahoNote Added: 0003433
2012-04-26 00:34Torr SamahoStatusassigned => feedback
2012-05-05 15:46unknownnaNote Added: 0003563
2012-05-05 15:50unknownnaFile Added: script_clientside_disconnect_01.wad
2012-05-08 02:04Torr SamahoNote Added: 0003593
2012-05-08 02:25unknownnaNote Added: 0003594
2012-05-08 03:04unknownnaFile Added: script_spectator_activator_01.wad
2012-05-08 03:11unknownnaNote Added: 0003595
2012-05-08 03:12unknownnaNote Edited: 0003595bug_revision_view_page.php?bugnote_id=3595#r1967
2012-06-09 13:22Torr SamahoCategoryGeneral => Bug
2012-08-05 16:23Torr SamahoNote Added: 0004268
2012-08-05 16:23Torr SamahoStatusfeedback => needs testing
2012-09-23 18:10unknownnaNote Added: 0004761
2012-09-23 18:36Torr SamahoNote Added: 0004767
2012-09-23 19:04unknownnaNote Added: 0004773
2013-01-12 21:25Torr SamahoNote Added: 0005742
2013-01-12 21:25Torr SamahoTarget Version => 1.1
2013-02-13 20:55StrikerMan780Note Added: 0006023
2013-02-13 20:56StrikerMan780Note Edited: 0006023bug_revision_view_page.php?bugnote_id=6023#r3321
2013-02-13 20:57StrikerMan780Note Edited: 0006023bug_revision_view_page.php?bugnote_id=6023#r3322
2013-02-13 22:23DuskStatusneeds testing => resolved
2013-02-13 22:23DuskFixed in Version => 1.1
2013-02-13 22:23DuskResolutionopen => fixed
2018-09-30 20:45Blzut3Statusresolved => closed

Notes
(0003379)
MediumTank   
2012-04-22 01:41   
This may help:
98e alpha: r120405-0228
(0003380)
Torr Samaho   
2012-04-22 02:25   
FYI, CLIENTSIDE does not mean that the script is only run on the activator's client. These scripts are run on all clients. If you replace Print by Printbold you should see this.

One potential bug I see here is that CLIENTSIDE scripts are likely not terminated when the activating player disconnects, even though they should be. I'll look into this.
(0003383)
MediumTank   
2012-04-22 15:14   
> If you replace Print by Printbold you should see this.

I tried substituting PrintBold in for Print and I didn't see anything come out on other clients, just the client itself.
I loaded up the wad again this morning and I have no idea why it's working as normal.


For the clientside scripts not being terminated, would 'developer true' show that?
(0003433)
Torr Samaho   
2012-04-26 00:34   
Some more clarifications: Puking NET CLIENTSIDE on a client, will only run the script on the client. If the server is instructed to start a CLIENTSIDE script (by puking, ACS_Execute, player entering the game, etc.), the server will not run the script, but tells all clients to do so.

0000810 of course affects this example wad, so if this ticket is meant to report a different problem, please supply an example wad that doesn't use 1 as script number.

This should fix that clients don't terminate CLIENTSIDE scripts whose activator is a player if that player disconnects. I couldn't test this fix though since I didn't have an appropriate example wad hand.
(0003563)
unknownna   
2012-05-05 15:46   
> This should fix that clients don't terminate CLIENTSIDE scripts whose activator is a player if that player disconnects.

It fixed the issue. It also works with the new compatflag. But switches that execute client-side scripts don't animate or play any sounds online.

What about scripts that are puked as a spectator? They aren't terminated when you turn into a player. And they aren't terminated when you turn into a spectator again or disconnect either.

Are non-CLIENTSIDE scripts executed within CLIENTSIDE scripts counted as CLIENTSIDE scripts?
(0003593)
Torr Samaho   
2012-05-08 02:04   
> But switches that execute client-side scripts don't animate or play any sounds online.

Sounds like a completely different issue. Is this what script_clientside_disconnect_01.wad is supposed to show (didn't have a chance to check the wad yet)?

> What about scripts that are puked as a spectator? They aren't terminated when you turn into a player. And they aren't terminated when you turn into a spectator again or disconnect either.

Spectator are supposed not to be part of the game. According to this logic a spectator puked script should have the world as activator (if we want to allow spectator puking at all). Whether it works exactly like this needs to be tested.

> Are non-CLIENTSIDE scripts executed within CLIENTSIDE scripts counted as CLIENTSIDE scripts?

They should be, I'm not sure if anybody ever tested this.
(0003594)
unknownna   
2012-05-08 02:25   
> Sounds like a completely different issue. Is this what script_clientside_disconnect_01.wad is supposed to show (didn't have a chance to check the wad yet)?

Yes, the switch in the map doesn't display the switch animation or play the corresponding sound online.

> Spectator are supposed not to be part of the game. According to this logic a spectator puked script should have the world as activator (if we want to allow spectator puking at all). Whether it works exactly like this needs to be tested.

What I remember from my testing a few days ago is that scripts puked as a spectator are terminated if the spectator disconnects, but not if the spectator joins the game and then turns into a spectator again and disconnects. I could make a new example WAD later and test this.

> They should be, I'm not sure if anybody ever tested this.

I remember testing this and IIRC it seemed to work that way. But you can really mess things up locally if you change the map geometry, spawn things or alter player properties, etc.
(0003595)
unknownna   
2012-05-08 03:11   
(edited on: 2012-05-08 03:12)
> What I remember from my testing a few days ago is that scripts puked as a spectator are terminated if the spectator disconnects, but not if the spectator joins the game and then turns into a spectator again and disconnects.

Indeed, it seems to work this way.

1. skulltag.exe -file script_spectator_activator_01.wad -host
2. Connect a client to the server.
3. "puke 2" in the console.
4. "disconnect" in the console.
5. "reconnect" in the console. The script is terminated.
6. "puke 2" in the console.
7. "join" in the console.
8. "spectate" in the console. This step isn't needed.
9. "disconnect" in the console.
10. "reconnect" in the console. The script is still running.

(0004268)
Torr Samaho   
2012-08-05 16:23   
Quote from unknownna
Yes, the switch in the map doesn't display the switch animation or play the corresponding sound online.

and
Quote from unknownna

scripts puked as a spectator are terminated if the spectator disconnects, but not if the spectator joins the game and then turns into a spectator again and disconnects

should be fixed now. For the latter scripts are terminated now when the spectator joins the game. Please confirm both in the upcoming beta build.
(0004761)
unknownna   
2012-09-23 18:10   
It seems that you fixed the issues.
(0004767)
Torr Samaho   
2012-09-23 18:36   
From a quick look at this ticket it looks like all reported issues are fixed by now. Or is anything still open?
(0004773)
unknownna   
2012-09-23 19:04   
If a spectator pukes script 1 in ClientsideProblems.wad and then joins the game, the other scripts aren't terminated.

And if the server pukes script 1, client B will see the other scripts once client A joins the game.
(0005742)
Torr Samaho   
2013-01-12 21:25   
Quote from unknownna
If a spectator pukes script 1 in ClientsideProblems.wad and then joins the game, the other scripts aren't terminated.

This should be fixed now. Probably this fix also fixes the other problem, i.e.:
Quote from unknownna
And if the server pukes script 1, client B will see the other scripts once client A joins the game.

Please test with this binary.
(0006023)
StrikerMan780   
2013-02-13 20:55   
(edited on: 2013-02-13 20:57)
So far this seems to be fixed. Between Dusk and I, we tested an issue in GoldenEye TC that was caused by this bug, which used to occur in 1.0. It doesn't happen in this build.