MantisBT - Zandronum
View Issue Details
0000810Zandronum[All Projects] Bugpublic2012-04-24 20:542018-09-30 19:52
MediumTank 
Torr Samaho 
highmajoralways
closedfixed 
98d 
1.0 
0000810: CLIENTSIDE ACS Script 1 floods the server and clients with data, extreme packet loss
98e-alpha 120405-0228

I have no idea why this is happening, but lets say you have



#include "zcommon.acs"
#library "TEST"

script 1 (void) NET CLIENTSIDE
{
    SetHudSize(640, 480, 1);
    for (int i = 0; i < 512; i++)
        HudMessage(s: "test"; HUDMSG_PLAIN, 500 + i, CR_WHITE, 50.0, 50.0, 0.1);
    delay(1);
    restart;
}

Script 2 ENTER
{
    ACS_ExecuteAlways(1, 0);
}

Script 3 (void) CLIENTSIDE
{
}



A few problems I noticed:

1) Script 1 is unpukable for some unknown reason, so I have to invoke it with ENTER

2) When it was pukable, the same result happened... why it won't even puke now is beyond me.

3) If you remove
Script 3 (void) CLIENTSIDE
{
}
It will function just normally
As soon as you add any CLIENTSIDE script, it breaks.

4) If you copy paste it to another script number (script 1 ---> script 4 for example), it will run normally, therefore it's something with script 1.


THE PROBLEM:
Script 1 in the .pk3 I attached, when run will do clientside stuff for the one who invoked it, but sends massive amounts of data to the server (just because I'm running 512 HudMessages x 35 per second). When you put it on Script 4 for example, puking it via console works, and it runs perfectly clientsided as you want (no bandwidth usage).

Now the confusing part is, if you have one other CLIENTSIDE script anywhere else, script 1 breaks and floods you. If you do not have another CLIENTSIDE script, then script 1 works as normal.



If you literally change the number from 1 to 4, rejoin the server. You'll get a thing saying "I dont know what script 1 is" since it's gone, then if you type 'puke 4' in your console, it runs perfectly without any bandwidth loss if you check the Statistics tab.

Why only Script 1... no idea.
I wonder how many wads though may have this problem buried in it by using script 1? If you loop script 1 for whatever reason, there's going to be bandwidth leaking.
1. Create an online game (I did with Doomseeker, no other configs) with my attached PK3

2. all flags (DM1/2/3, Compat1/2) were all zero according to the console, though even when I messed around with flags it didn't change anything

3. Join it, notice intense packet flooding
No tags attached.
related to 0000799closed Torr Samaho 98e - Running more than one CLIENTSIDE script transfers to all other players upon activator disconnecting 
? Bandwidth.pk3 (921) 2012-04-24 20:54
/tracker/file_download.php?file_id=576&type=bug
? bandwidth_01.wad (3,750) 2012-04-25 08:19
/tracker/file_download.php?file_id=578&type=bug
? script_net_puke_01.wad (2,471) 2012-05-05 20:32
/tracker/file_download.php?file_id=604&type=bug
Issue History
2012-04-24 20:54MediumTankNew Issue
2012-04-24 20:54MediumTankFile Added: Bandwidth.pk3
2012-04-25 08:18unknownnaStatusnew => confirmed
2012-04-25 08:19unknownnaFile Added: bandwidth_01.wad
2012-04-25 08:21unknownnaProduct Version => 98d
2012-04-25 08:21unknownnaSummary98e - CLIENTSIDE ACS Script 1 floods the server and clients with data, extreme packet loss => CLIENTSIDE ACS Script 1 floods the server and clients with data, extreme packet loss
2012-04-25 08:25unknownnaNote Added: 0003425
2012-04-25 08:29unknownnaPrioritynormal => high
2012-04-25 10:49unknownnaNote Edited: 0003425bug_revision_view_page.php?bugnote_id=3425#r1836
2012-04-25 11:15DuskAssigned To => Dusk
2012-04-25 11:15DuskStatusconfirmed => assigned
2012-04-25 11:48DuskNote Added: 0003429
2012-04-25 11:48DuskNote Edited: 0003429bug_revision_view_page.php?bugnote_id=3429#r1838
2012-04-25 11:52DuskNote Added: 0003430
2012-04-25 11:52DuskStatusassigned => feedback
2012-04-25 11:53DuskNote Edited: 0003430bug_revision_view_page.php?rev_id=1840
2012-04-25 11:54DuskNote Deleted: 0003430
2012-04-25 11:56DuskNote Edited: 0003429bug_revision_view_page.php?bugnote_id=3429#r1841
2012-04-25 11:56DuskStatusfeedback => assigned
2012-04-25 11:57DuskNote Edited: 0003429bug_revision_view_page.php?bugnote_id=3429#r1842
2012-04-25 21:59DuskNote Added: 0003432
2012-04-25 21:59DuskStatusassigned => feedback
2012-04-26 00:20Torr SamahoRelationship addedrelated to 0000799
2012-04-26 12:16DuskNote Added: 0003441
2012-05-05 20:30unknownnaNote Added: 0003564
2012-05-05 20:31unknownnaNote Edited: 0003564bug_revision_view_page.php?bugnote_id=3564#r1931
2012-05-05 20:31unknownnaNote Edited: 0003564bug_revision_view_page.php?bugnote_id=3564#r1932
2012-05-05 20:32unknownnaFile Added: script_net_puke_01.wad
2012-05-05 20:33unknownnaNote Edited: 0003564bug_revision_view_page.php?bugnote_id=3564#r1933
2012-06-09 13:22Torr SamahoCategoryGeneral => Bug
2012-08-05 14:47Torr SamahoNote Added: 0004265
2012-08-05 14:47Torr SamahoAssigned ToDusk => Torr Samaho
2012-08-05 14:47Torr SamahoStatusfeedback => needs testing
2012-09-23 18:18unknownnaNote Added: 0004762
2012-09-23 18:26Torr SamahoStatusneeds testing => resolved
2012-09-23 18:26Torr SamahoFixed in Version => 1.0
2012-09-23 18:26Torr SamahoResolutionopen => fixed
2018-09-30 19:52Blzut3Statusresolved => closed

Notes
(0003425)
unknownna   
2012-04-25 08:25   
(edited on: 2012-04-25 10:49)
I'm able to puke the first script in my own example WAD.

If I comment out

for (int i = 0; i < 512; i++)

it doesn't kick me from the server for missing more than 1024 packets.

If I remove the dummy CLIENTSIDE script, i.e., script 3, the server doesn't leak out bandwidth.

If I change script 1's number to any number above 1, the server doesn't leak out bandwidth.

MAP01 in the example WAD has the NET CLIENTSIDE script numbered as 1. MAP02 in the example WAD has the NET CLIENTSIDE script numbered as 2.

Script 1 (Void) NET CLIENTSIDE
{
    SetHudSize (640, 480, 1);
    for (int i = 0; i < 512; i++)
        HudMessage(s: "test"; HUDMSG_PLAIN, 500 + i, CR_WHITE, 50.0, 50.0, 0.1);
    Delay (1);
    Restart;
}

Script 2 (Void) CLIENTSIDE {}

Script 2 (Void) NET CLIENTSIDE
{
    SetHudSize (640, 480, 1);
    for (int i = 0; i < 512; i++)
        HudMessage(s: "test"; HUDMSG_PLAIN, 500 + i, CR_WHITE, 50.0, 50.0, 0.1);
    Delay (1);
    Restart;
}

Script 1 (Void) CLIENTSIDE {}

BTW: For some reason the switch in MAP02 will not make any sounds or display the switch animation.

Edit:

Quote from unknownna
I'm able to puke the first script in my own example WAD.

I had sv_cheats set to 1. I can't puke the script in MAP01 if sv_cheats is set to 0. But I'm able to puke the script in MAP02.

(0003429)
Dusk   
2012-04-25 11:48   
(edited on: 2012-04-25 11:57)
Looks like ZDoom fixed this later on. The script flags for 1 are getting overridden by 0, adding a div by 4 to a variable seems to fix this - and this is present in current ZDoom code. I'm trying to pinpoint the revision this was fixed in now.

EDIT: Scratch that. ZDoom seems to still have this issue. It divides the max by 4 for the var counting*, but not for script flags.
I'll try reproduce in ZDoom, make an example wad and report there accordingly...

*'http://zdoom.org/Changelog/3352/files [^]'

(0003432)
Dusk   
2012-04-25 21:59   
Reported:'http://forum.zdoom.org/viewtopic.php?f=2&t=32670 [^]'
(0003441)
Dusk   
2012-04-26 12:16   
ZDoom fixed this:
'http://zdoom.org/Changelog/3593/files [^]'
(0003564)
unknownna   
2012-05-05 20:30   
(edited on: 2012-05-05 20:33)
Regarding the puke issue: I found a pattern. There are 10 NET scripts.

With all scripts included, script 10 is unpukable.
If I remove script 1, script 9 becomes unpukable.
If I remove script 1-2, script 8 becomes unpukable.
If I remove script 1-3, script 7 becomes unpukable.
If I remove script 1-4, script 6 becomes unpukable.
If I remove script 1-5, script 6-10 are still pukable.

#Include "zcommon.acs"

Script 1 (Void) NET CLIENTSIDE
{
    PrintBold (s:"Script 1 NET CLIENTSIDE puked.");
}

Script 2 (Void) NET CLIENTSIDE
{
    PrintBold (s:"Script 2 NET CLIENTSIDE puked.");
}

Script 3 (Void) NET CLIENTSIDE
{
    PrintBold (s:"Script 3 NET CLIENTSIDE puked.");
}

Script 4 (Void) NET CLIENTSIDE
{
    PrintBold (s:"Script 4 NET CLIENTSIDE puked.");
}

Script 5 (Void) NET CLIENTSIDE
{
    PrintBold (s:"Script 5 NET CLIENTSIDE puked.");
}

Script 6 (Void) NET CLIENTSIDE
{
    PrintBold (s:"Script 6 NET CLIENTSIDE puked.");
}

Script 7 (Void) NET CLIENTSIDE
{
    PrintBold (s:"Script 7 NET CLIENTSIDE puked.");
}

Script 8 (Void) NET CLIENTSIDE
{
    PrintBold (s:"Script 8 NET CLIENTSIDE puked.");
}

Script 9 (Void) NET CLIENTSIDE
{
    PrintBold (s:"Script 9 NET CLIENTSIDE puked.");
}

Script 10 (Void) NET CLIENTSIDE
{
    PrintBold (s:"Script 10 NET CLIENTSIDE puked.");
}


(0004265)
Torr Samaho   
2012-08-05 14:47   
I backported the fixes from ZDoom revision 3352 and 3593, this should take care of the problems. Please confirm with the upcoming beta build.
(0004762)
unknownna   
2012-09-23 18:18   
Quote from Torr Samaho
Please confirm with the upcoming beta build.

Things seem to be fine now.