This is a fork of Zandronum Beta for TSPG.
Revision | 2e7806885db5bd8c5b2b6fa9e996b288da7947fd (tree) |
---|---|
Time | 2022-02-04 23:44:20 |
Author | Adam Kaminski <kaminskiadam9@gmai...> |
Commiter | Adam Kaminski |
SERVERBAN_BanPlayer now saves the player's uncolored name with FString instead of C-style char arrays.
@@ -424,13 +424,12 @@ | ||
424 | 424 | } |
425 | 425 | |
426 | 426 | // Removes the color codes from the player name, for the ban record. |
427 | - char szPlayerName[64]; | |
428 | - sprintf( szPlayerName, "%s", players[ulPlayer].userinfo.GetName() ); | |
429 | - V_RemoveColorCodes( szPlayerName ); | |
427 | + FString playerName = players[ulPlayer].userinfo.GetName(); | |
428 | + V_RemoveColorCodes( playerName ); | |
430 | 429 | |
431 | 430 | // Add the ban and kick the player. |
432 | 431 | std::string message; |
433 | - g_ServerBans.addEntry( SERVER_GetClient( ulPlayer )->Address.ToString(), szPlayerName, pszBanReason, message, tExpiration ); | |
432 | + g_ServerBans.addEntry( SERVER_GetClient( ulPlayer )->Address.ToString(), playerName, pszBanReason, message, tExpiration ); | |
434 | 433 | Printf( "addban: %s", message.c_str() ); |
435 | 434 | SERVER_KickPlayer( ulPlayer, pszBanReason ? pszBanReason : "" ); // [RC] serverban_KickBannedPlayers would cover this, but we want the messages to be distinct so there's no confusion. |
436 | 435 |