mirror of
https://github.com/openmoh/openmohaa.git
synced 2025-04-28 21:57:57 +03:00
Print network name change
This commit is contained in:
parent
0080f55ef8
commit
9538dcb6e7
1 changed files with 10 additions and 0 deletions
|
@ -757,6 +757,7 @@ void G_ClientUserinfoChanged(gentity_t *ent, const char *u)
|
||||||
char *s;
|
char *s;
|
||||||
gclient_t *client;
|
gclient_t *client;
|
||||||
int clientnum;
|
int clientnum;
|
||||||
|
char oldname[MAX_NAME_LENGTH];
|
||||||
|
|
||||||
if (!ent) {
|
if (!ent) {
|
||||||
return;
|
return;
|
||||||
|
@ -772,10 +773,19 @@ void G_ClientUserinfoChanged(gentity_t *ent, const char *u)
|
||||||
|
|
||||||
clientnum = ent - g_entities;
|
clientnum = ent - g_entities;
|
||||||
|
|
||||||
|
Q_strncpyz(oldname, client->pers.netname, sizeof(oldname));
|
||||||
if (gi.SanitizeName(s, client->pers.netname, sizeof(client->pers.netname))) {
|
if (gi.SanitizeName(s, client->pers.netname, sizeof(client->pers.netname))) {
|
||||||
gi.Printf("WARNING: had to sanitize the name for client %i\n", clientnum);
|
gi.Printf("WARNING: had to sanitize the name for client %i\n", clientnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strcmp(oldname, client->pers.netname)) {
|
||||||
|
//
|
||||||
|
// Added in OPM
|
||||||
|
// Print name changes
|
||||||
|
//
|
||||||
|
gi.Printf("Client %i changed name from '%s' to '%s'\n", clientnum, oldname, client->pers.netname);
|
||||||
|
}
|
||||||
|
|
||||||
s = Info_ValueForKey(u, "dm_playermodel");
|
s = Info_ValueForKey(u, "dm_playermodel");
|
||||||
|
|
||||||
if (!s) {
|
if (!s) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue