MantisBT - Zandronum
View Issue Details
0000871Zandronum[All Projects] Bugpublic2012-06-10 18:482024-03-14 05:08
Dusk 
 
normalminoralways
closedunable to reproduce 
1.0-beta 
 
0000871: RCON users get SERVER_Printf'd messages twice
If a client with rcon access issues an rcon command that ends up calling SERVER_Printf to broadcast a message to clients, he'll get the message twice - once from the verbose output and another from the real broadcast.

Fix here:
'https://bitbucket.org/CrimsonDusk/neurosphere/changeset/9bbf7257d865 [^]'
'https://bitbucket.org/CrimsonDusk/neurosphere/changeset/6e34d2e66647 [^]'
No tags attached.
Issue History
2012-06-10 18:48DuskNew Issue
2012-06-10 18:48DuskStatusnew => assigned
2012-06-10 18:48DuskAssigned To => Dusk
2012-06-10 18:48DuskStatusassigned => needs review
2012-06-10 19:01DuskDescription Updatedbug_revision_view_page.php?rev_id=2049#r2049
2012-06-24 10:31Torr SamahoNote Added: 0003835
2012-06-24 10:31Torr SamahoStatusneeds review => feedback
2012-06-24 10:42Torr SamahoNote Edited: 0003835
2012-06-24 10:42Torr SamahoNote Edited: 0003835
2012-06-24 10:43Torr SamahoNote Edited: 0003835
2012-06-24 10:44Torr SamahoNote Edited: 0003835bug_revision_view_page.php?bugnote_id=3835#r2093
2012-06-24 10:44Torr SamahoNote Revision Dropped: 3835: 0002089
2012-06-24 10:44Torr SamahoNote Revision Dropped: 3835: 0002090
2012-06-24 10:45Torr SamahoNote Revision Dropped: 3835: 0002091
2012-06-24 10:45Torr SamahoNote Revision Dropped: 3835: 0002092
2012-06-24 11:00DuskNote Added: 0003837
2012-06-24 11:00DuskStatusfeedback => assigned
2012-06-24 11:00DuskStatusassigned => feedback
2012-06-24 11:47Torr SamahoNote Added: 0003838
2013-01-30 14:14DuskNote Added: 0005872
2013-01-30 14:14DuskStatusfeedback => assigned
2013-01-30 14:14DuskAssigned ToDusk =>
2013-01-30 14:14DuskStatusassigned => feedback
2024-03-14 05:08Ru5tK1ngNote Added: 0023391
2024-03-14 05:08Ru5tK1ngStatusfeedback => closed
2024-03-14 05:08Ru5tK1ngResolutionopen => unable to reproduce

Notes
(0003835)
Torr Samaho   
2012-06-24 10:31   
(edited on: 2012-06-24 10:44)
For the sake of consistency (CONSOLE_SetRCONPlayer already exists), instead of exporting g_ulRCONPlayer, the access function CONSOLE_GetRCONPlayer should be introduced.

Anyway, the whole constructing gets weird: We already have
SERVER_RCON_Printf( outlinecopy );
if ( g_ulRCONPlayer != MAXPLAYERS )
  SERVER_PrintfPlayer( printlevel, g_ulRCONPlayer, outlinecopy );
and now you add an additional construction in SERVER_Printf to counter this. The existing construction deliberately prints messages twice for the RCON player, once with SERVER_RCON_Printf and once with SERVER_PrintfPlayer. So to me this behavior seems to be intentional and not a bug. Possibly I'm overlooking something here.

(0003837)
Dusk   
2012-06-24 11:00   
.. WTF?

How can something like this be intentional? I'm confused now.
(0003838)
Torr Samaho   
2012-06-24 11:47   
I didn't write any of this code, so I can just speculate about its intentions. The fragment from c_console.cpp I posted above apparently prints the messages twice, once with SERVER_RCON_Printf and once with SERVER_PrintfPlayer. I'd guess it makes a difference which of these functions is used to print a message.

If we come to the conclusion that this is wrong, we should fix it in that fragment. Since SERVER_RCON_Printf is only called once, we could move the ( g_ulRCONPlayer != MAXPLAYERS ) part into SERVER_RCON_Printf along with the logic you added at two other places.
(0005872)
Dusk   
2013-01-30 14:14   
I think I might've been a bit vague with this: with RCON user I mean a client logged into RCON access with send_password and is issuing commands with the rcon command.

I also took a closer look into this now and I think SERVER_RCON_Printf has nothing to do with this. The code fragment in the first reply is in PrintString which is executed by all Printfs on the server, including SERVER_Printf. So if an RCON user sends a command to for instance change dmflags, SERVER_Printf broadcasts it to clients (including the RCON user) and logs it to the server console - which is then tee'd to the RCON user, thus he's getting it twice.
(0023391)
Ru5tK1ng   
2024-03-14 05:08   
I can't seem to reproduce this with puking or changing dmflags with 3.1. Closing ticket as a result of my findings. Feel free to reopen this if it's still an issue.