Skip to content

Commit

Permalink
g_forcelogin 3 block rename - need testing
Browse files Browse the repository at this point in the history
  • Loading branch information
videoP committed Feb 29, 2024
1 parent e119927 commit 3d61209
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions codemp/game/g_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2486,11 +2486,16 @@ qboolean ClientUserinfoChanged( int clientNum ) { //I think anything treated as
}
else
{
trap->SendServerCommand( -1, va( "print \"%s"S_COLOR_WHITE" %s %s\n\"", oldname, G_GetStringEdString( "MP_SVGAME", "PLRENAME" ), client->pers.netname ) );
G_LogPrintf( "ClientRename: %i [%s] (%s) \"%s^7\" -> \"%s^7\"\n", clientNum, ent->client->sess.IP, ent->client->pers.guid, oldname, ent->client->pers.netname );
client->pers.netnameTime = level.time + 5000;
if (g_playerLog.integer && ent && ent->client && !(ent->r.svFlags & SVF_BOT))
G_AddPlayerLog(client->pers.netname, client->sess.IP, client->pers.guid);
if (g_forceLogin.integer > 2 && !(ent->r.svFlags & SVF_BOT) && !ent->client->pers.userName[0]) { //needs testing
trap->SendServerCommand(ent - g_entities, "print \"^1You must login to rename!\n\"");
}
else {
trap->SendServerCommand(-1, va("print \"%s"S_COLOR_WHITE" %s %s\n\"", oldname, G_GetStringEdString("MP_SVGAME", "PLRENAME"), client->pers.netname));
G_LogPrintf("ClientRename: %i [%s] (%s) \"%s^7\" -> \"%s^7\"\n", clientNum, ent->client->sess.IP, ent->client->pers.guid, oldname, ent->client->pers.netname);
client->pers.netnameTime = level.time + 5000;
if (g_playerLog.integer && ent && ent->client && !(ent->r.svFlags & SVF_BOT))
G_AddPlayerLog(client->pers.netname, client->sess.IP, client->pers.guid);
}
}
}
}
Expand Down

0 comments on commit 3d61209

Please sign in to comment.