• R/O
  • SSH

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

This is a fork of Zandronum used on servers hosted by The Sentinels Playground (TSPG).


Commit MetaInfo

Revision47d69cebabc15bdb02752f3691132b97cbb2bf9b (tree)
Time2022-02-04 23:52:21
AuthorAdam Kaminski <kaminskiadam9@gmai...>
CommiterAdam Kaminski

Log Message

SERVER_KickPlayer now uses FString instead of C-style char arrays.

Change Summary

Incremental Difference

diff -r 961f23b6edf1 -r 47d69cebabc1 src/sv_main.cpp
--- a/src/sv_main.cpp Fri Feb 04 09:54:03 2022 -0500
+++ b/src/sv_main.cpp Fri Feb 04 09:52:21 2022 -0500
@@ -3758,23 +3758,23 @@
37583758 //
37593759 void SERVER_KickPlayer( ULONG ulPlayer, const char *pszReason )
37603760 {
3761- ULONG ulIdx;
3762- char szKickString[512];
3763- char szName[64];
3761+ ULONG ulIdx;
3762+ FString kickString;
3763+ FString playerName;
37643764
37653765 // Make sure the target is valid and applicable.
37663766 if (( ulPlayer >= MAXPLAYERS ) || ( !playeringame[ulPlayer] ))
37673767 return;
37683768
3769- sprintf( szName, "%s", players[ulPlayer].userinfo.GetName() );
3770- V_RemoveColorCodes( szName );
3769+ playerName = players[ulPlayer].userinfo.GetName();
3770+ V_RemoveColorCodes( playerName );
37713771
37723772 // Build the full kick string.
3773- sprintf( szKickString, TEXTCOLOR_ORANGE "%s" TEXTCOLOR_ORANGE " was kicked from the server! Reason: %s\n", szName, pszReason );
3774- Printf( "%s", szKickString );
3773+ kickString.Format( TEXTCOLOR_ORANGE "%s was kicked from the server! Reason: %s\n", playerName.GetChars(), pszReason );
3774+ Printf( "%s", kickString.GetChars() );
37753775
37763776 // Rebuild the string that will be displayed to clients. This time, color codes are allowed.
3777- sprintf( szKickString, TEXTCOLOR_ORANGE "%s" TEXTCOLOR_ORANGE " was kicked from the server! Reason: %s\n", players[ulPlayer].userinfo.GetName(), pszReason );
3777+ kickString.Format( TEXTCOLOR_ORANGE "%s" TEXTCOLOR_ORANGE " was kicked from the server! Reason: %s\n", players[ulPlayer].userinfo.GetName(), pszReason );
37783778
37793779 // Send the message out to all clients.
37803780 for ( ulIdx = 0; ulIdx < MAXPLAYERS; ulIdx++ )
@@ -3782,7 +3782,7 @@
37823782 if ( SERVER_IsValidClient( ulIdx ) == false )
37833783 continue;
37843784
3785- SERVER_PrintfPlayer( PRINT_HIGH, ulIdx, "%s", szKickString );
3785+ SERVER_PrintfPlayer( PRINT_HIGH, ulIdx, "%s", kickString.GetChars() );
37863786 }
37873787
37883788 // If we're kicking a bot, just remove him.