MantisBT - Zandronum
View Issue Details
0001267Zandronum[All Projects] Bugpublic2013-01-29 11:522018-09-30 20:29
StrikerMan780 
Dusk 
normalminoralways
closedfixed 
1.0 
1.11.1 
0001267: All LIGHTNING scripts are treated CLIENTSIDE
Continuing from 0000283: it appears all LIGHTNING scripts are sent to the client to execute no matter if they're CLIENTSIDE or not.
- Host a server with example wad and connect a client to it.
- Hit the switch - this calls Light_ForceLightning to trigger lightning.
- Two log messages are printed out, "CLIENTSIDE LIGHTNING" - this is produced by a LIGHTNING CLIENTSIDE script, and "SERVERSIDE LIGHTNING", this is produced by a normal LIGHTNING script.

The serverside message should be printed into the server log, not onto the client. This shows that the client is executing all LIGHTNING scripts.
No tags attached.
child of 0000283closed Torr Samaho Lightning strikes cause massive traffic spikes 
zip LightningScriptTest.wad.zip (1,359) 2013-01-29 11:52
/tracker/file_download.php?file_id=928&type=bug
Issue History
2013-01-29 11:52DuskNew Issue
2013-01-29 11:52DuskFile Added: LightningScriptTest.wad.zip
2013-01-29 11:52DuskRelationship addedchild of 0000283
2013-01-29 11:52DuskReporterDusk => StrikerMan780
2013-01-29 12:07DuskAssigned To => Dusk
2013-01-29 12:07DuskStatusnew => assigned
2013-01-29 13:08DuskNote Added: 0005860
2013-01-29 13:08DuskStatusassigned => needs review
2013-01-29 13:08DuskNote Edited: 0005860bug_revision_view_page.php?bugnote_id=5860#r3202
2013-02-02 08:45Torr SamahoNote Added: 0005911
2013-02-02 08:45Torr SamahoStatusneeds review => feedback
2013-02-02 10:48DuskNote Added: 0005914
2013-02-10 11:04Torr SamahoNote Added: 0005979
2013-02-10 14:31DuskNote Added: 0005981
2013-02-10 14:31DuskStatusfeedback => needs review
2013-02-10 19:33Torr SamahoNote Added: 0005983
2013-02-16 23:03DuskNote Added: 0006031
2013-02-17 08:56Torr SamahoNote Added: 0006039
2013-02-17 08:58Torr SamahoStatusneeds review => needs testing
2013-02-17 08:58Torr SamahoProduct Version1.1 => 1.0
2013-02-17 08:58Torr SamahoTarget Version => 1.1
2013-02-21 02:57StrikerMan780Note Added: 0006057
2013-02-23 08:09Torr SamahoNote Added: 0006061
2013-02-24 08:59StrikerMan780Note Added: 0006069
2013-02-24 12:52DuskStatusneeds testing => resolved
2013-02-24 12:52DuskResolutionopen => fixed
2013-02-24 12:52DuskStatusresolved => feedback
2013-02-24 12:52DuskResolutionfixed => reopened
2013-02-24 12:52DuskStatusfeedback => resolved
2013-02-24 12:52DuskFixed in Version => 1.1
2013-02-24 12:52DuskResolutionreopened => fixed
2018-09-30 20:29Blzut3Statusresolved => closed

Notes
(0005860)
Dusk   
2013-01-29 13:08   
I decided to do some restructuring to the lightning networking: server manages lightning and tells clients to flash when needed. Removed some obsolete networking code and fixed LIGHTNING script management in the process.

'https://bitbucket.org/CrimsonDusk/neurosphere/commits/0c3f6101733beed16b5d8db93edc47b2 [^]'

Note that this is currently in the neurosphere head as I'm pretty sure I'm going to have to do some adjustments.

(0005911)
Torr Samaho   
2013-02-02 08:45   
Can you elaborate your changes in DLightningThinker::Tick? If the server is supposed to handle the synchronization, how can it avoid calling parts of the code like

    LightningFlashCount = (pr_lightning()&7)+8;
    flashLight = 200+(pr_lightning()&31);

Or are the flashes still supposed to be not fully synchronized (they weren't synchronized before either)?
(0005914)
Dusk   
2013-02-02 10:48   
That stuff is determines lightning duration and strength, it has nothing to do with the logic to decide when a lightning strikes.

The first call to ::Tick sets those variables you quoted and performs initial flash, sky mask, sounds, etc. After, it is called repeadetly as long as LightningFlashCount is > 0 and said counter is decreased each time - this is for the fade-out effect. The clients can decide how long and strong each lightning flash is so the server jumps past it.
(0005979)
Torr Samaho   
2013-02-10 11:04   
I see, intentionally not syncing the length and strength between client and server is fine with me.

I think you can simplify the code slightly by removing the StaticStartTypedScripts from the server block and moving the nextflash above the StaticStartTypedScripts calls.
(0005981)
Dusk   
2013-02-10 14:31   
'https://bitbucket.org/CrimsonDusk/neurosphere/commits/3853 [^]'
Better now? If this is good I'll push to a new head.
(0005983)
Torr Samaho   
2013-02-10 19:33   
Yes, looks good to me now. Thanks!

I didn't test this at all though, so I'll assume you tested it sufficiently.
(0006031)
Dusk   
2013-02-16 23:03   
Ah, dang, forgot all about this..

Here is this:'https://bitbucket.org/CrimsonDusk/neurosphere/commits/80ea1f130719fe23033a1be653de84090485c479 [^]'
(0006039)
Torr Samaho   
2013-02-17 08:56   
Thanks! Pulled.
(0006057)
StrikerMan780   
2013-02-21 02:57   
I can test this if another build is made.
(0006061)
Torr Samaho   
2013-02-23 08:09   
This should contain Dusk's fix.
(0006069)
StrikerMan780   
2013-02-24 08:59   
Confirmed to work. Thanks.