Revision | d5c29dd87dd3ad2615b0d62ea15ed11a14c1a2cc (tree) |
---|---|
Time | 2021-05-01 23:04:43 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
Prevented players from sending private messages to themselves using RCON.
@@ -719,6 +719,12 @@ | ||
719 | 719 | g_ulRCONPlayer = ulPlayer; |
720 | 720 | } |
721 | 721 | |
722 | +// [AK] Gets the number of the player currently using RCON. | |
723 | +ULONG CONSOLE_GetRCONPlayer( void ) | |
724 | +{ | |
725 | + return g_ulRCONPlayer; | |
726 | +} | |
727 | + | |
722 | 728 | // [AK] Toggles whether or not a console message gets printed to the player using RCON. |
723 | 729 | void CONSOLE_ShouldPrintToRCONPlayer( bool enable ) |
724 | 730 | { |
@@ -75,6 +75,7 @@ | ||
75 | 75 | |
76 | 76 | // [BC] New function prototypes. |
77 | 77 | void CONSOLE_SetRCONPlayer( ULONG ulPlayer ); |
78 | +ULONG CONSOLE_GetRCONPlayer( void ); // [AK] | |
78 | 79 | void CONSOLE_ShouldPrintToRCONPlayer( bool enable ); // [AK] |
79 | 80 | |
80 | 81 | void C_InitTicker (const char *label, unsigned int max, bool showpercent=true); |
@@ -1428,6 +1428,13 @@ | ||
1428 | 1428 | Printf( "You can't send private messages to yourself.\n" ); |
1429 | 1429 | return; |
1430 | 1430 | } |
1431 | + | |
1432 | + // [AK] Don't let the player send privates messages to themselves via RCON. | |
1433 | + if ( CONSOLE_GetRCONPlayer( ) == ulReceiver ) | |
1434 | + { | |
1435 | + SERVER_PrintfPlayer( ulReceiver, "You can't send private messages to yourself.\n" ); | |
1436 | + return; | |
1437 | + } | |
1431 | 1438 | } |
1432 | 1439 | |
1433 | 1440 | g_ulChatPlayer = ulReceiver; |