From 26b989226fe748d89c806ce9e0c5e2425fd01dcb Mon Sep 17 00:00:00 2001 From: david Date: Sat, 20 Oct 2018 18:17:52 -0400 Subject: [PATCH] login / logout msgs --- codemp/game/SpeederNPC.c | 2 +- codemp/game/g_account.c | 21 ++++++++++++--------- codemp/game/g_cmds.c | 32 ++++++++++++++++++++++++++------ codemp/game/g_weapon.c | 2 +- 4 files changed, 40 insertions(+), 17 deletions(-) diff --git a/codemp/game/SpeederNPC.c b/codemp/game/SpeederNPC.c index dcf6dced7c..8edccafafc 100644 --- a/codemp/game/SpeederNPC.c +++ b/codemp/game/SpeederNPC.c @@ -187,7 +187,7 @@ static void ProcessMoveCommands( Vehicle_t *pVeh ) } } //trap->Print("Prim fire boost\n"); - parentPS->gravity = 1;// = pVeh->m_pVehicleInfo->turboSpeed; // Instantly Jump To Turbo Speed + parentPS->gravity = 1;// = pVeh->m_pVehicleInfo->turboSpeed; // Instantly Jump To Turbo Speed gravboost parentPS->velocity[2] += 50; //RACESWOOP } } diff --git a/codemp/game/g_account.c b/codemp/game/g_account.c index 95961ca242..ffd0148944 100644 --- a/codemp/game/g_account.c +++ b/codemp/game/g_account.c @@ -2142,10 +2142,10 @@ void Cmd_ACLogin_f( gentity_t *ent ) { //loda fixme show lastip ? or use lastip Q_strncpyz(ent->client->pers.userName, username, sizeof(ent->client->pers.userName)); if (ent->client->sess.raceMode && ent->client->pers.stats.startTime) { ResetPlayerTimers(ent, qtrue); - trap->SendServerCommand(ent - g_entities, "print \"Login sucessful. Time reset.\n\""); + //trap->SendServerCommand(ent - g_entities, "print \"Login sucessful. Time reset.\n\""); } else - trap->SendServerCommand(ent - g_entities, "print \"Login sucessful.\n\""); + //trap->SendServerCommand(ent - g_entities, "print \"Login sucessful.\n\""); if (!ip) //meh ip = lastip; @@ -2167,15 +2167,16 @@ void Cmd_ACLogin_f( gentity_t *ent ) { //loda fixme show lastip ? or use lastip //Problem, only add to flags, not remove? if ((flags & JAPRO_ACCOUNTFLAG_FULLADMIN) && !(ent->client->sess.accountFlags & JAPRO_ACCOUNTFLAG_FULLADMIN)) { - if (Q_stricmp(g_fullAdminMsg.string, "")) - trap->SendServerCommand(-1, va("print \"%s ^7%s\n\"", ent->client->pers.netname, g_fullAdminMsg.string)); + trap->SendServerCommand(-1, va("print \"%s^7 (%s) has logged in %s\n\"", ent->client->pers.netname, ent->client->pers.userName, g_fullAdminMsg.string)); ent->client->sess.accountFlags |= JAPRO_ACCOUNTFLAG_FULLADMIN; } else if ((flags & JAPRO_ACCOUNTFLAG_JRADMIN) && !(ent->client->sess.accountFlags & JAPRO_ACCOUNTFLAG_JRADMIN)) { - if (Q_stricmp(g_juniorAdminMsg.string, "")) - trap->SendServerCommand(-1, va("print \"%s ^7%s\n\"", ent->client->pers.netname, g_juniorAdminMsg.string)); + trap->SendServerCommand(-1, va("print \"%s^7 (%s) has logged in %s\n\"", ent->client->pers.netname, ent->client->pers.userName, g_juniorAdminMsg.string)); ent->client->sess.accountFlags |= JAPRO_ACCOUNTFLAG_JRADMIN; } + else { + trap->SendServerCommand(-1, va("print \"%s^7 (%s) has logged in\n\"", ent->client->pers.netname, ent->client->pers.userName)); + } if (flags & JAPRO_ACCOUNTFLAG_IPLOCK) ent->client->sess.accountFlags |= JAPRO_ACCOUNTFLAG_IPLOCK; if (flags & JAPRO_ACCOUNTFLAG_TRUSTED) @@ -2693,6 +2694,7 @@ void Svcmd_ListAdmins_f(void) int s; unsigned int flags; char adminString[16]; + int row = 1; CALL_SQLITE(open(LOCAL_DB_PATH, &db)); @@ -2709,7 +2711,8 @@ void Svcmd_ListAdmins_f(void) Q_strncpyz(adminString, "Full", sizeof(adminString)); else if (flags & 16) Q_strncpyz(adminString, "Junior", sizeof(adminString)); - Com_Printf(va(" %-18s %s\n", (char*)sqlite3_column_text(stmt, 0), adminString)); + Com_Printf(va("^5%2i^3: ^3%-18s %s^7\n", row, (char*)sqlite3_column_text(stmt, 0), adminString)); + row++; } else if (s == SQLITE_DONE) { break; @@ -3311,10 +3314,10 @@ void Cmd_ACLogout_f( gentity_t *ent ) { //If logged in, print logout msg, remove ent->client->pers.stats.racetime = 0.0f; } - Q_strncpyz(ent->client->pers.userName, "", sizeof(ent->client->pers.userName)); //ent->client->pers.unlocks = 0; //ent->client->sess.accountFlags = 0; - trap->SendServerCommand(ent-g_entities, "print \"Logged out.\n\""); + trap->SendServerCommand(-1, va("print \"%s^7 (%s) has logged out\n\"", ent->client->pers.netname, ent->client->pers.userName)); + Q_strncpyz(ent->client->pers.userName, "", sizeof(ent->client->pers.userName)); } else trap->SendServerCommand(ent-g_entities, "print \"You are not logged in!\n\""); diff --git a/codemp/game/g_cmds.c b/codemp/game/g_cmds.c index b0a3da64f6..6ff2bbc2d4 100644 --- a/codemp/game/g_cmds.c +++ b/codemp/game/g_cmds.c @@ -4932,9 +4932,10 @@ void Cmd_Amlogin_f(gentity_t *ent) return; ent->client->sess.accountFlags &= ~JAPRO_ACCOUNTFLAG_JRADMIN; ent->client->sess.accountFlags |= JAPRO_ACCOUNTFLAG_FULLADMIN; - trap->SendServerCommand(ent - g_entities, "print \"^2You are now logged in with full admin privileges.\n\""); - if (Q_stricmp(g_fullAdminMsg.string, "")) - trap->SendServerCommand(-1, va("print \"%s ^7%s\n\"", ent->client->pers.netname, g_fullAdminMsg.string)); + if (Q_stricmp(g_fullAdminMsg.string, "")) //Ok, so just set this to " " if you want it to print the normal login msg, or set it to "" to skip. or "with junior admin" for more info.. etc + trap->SendServerCommand(-1, va("print \"%s^7 has logged in %s\n\"", ent->client->pers.netname, g_fullAdminMsg.string)); + else + trap->SendServerCommand(ent - g_entities, "print \"^2You are now logged in with full admin privileges.\n\""); return; } if (!Q_stricmp(pass, g_juniorAdminPass.string)) @@ -4943,9 +4944,10 @@ void Cmd_Amlogin_f(gentity_t *ent) return; ent->client->sess.accountFlags |= JAPRO_ACCOUNTFLAG_JRADMIN; ent->client->sess.accountFlags &= ~JAPRO_ACCOUNTFLAG_FULLADMIN; - trap->SendServerCommand(ent - g_entities, "print \"^2You are now logged in with junior admin privileges.\n\""); if (Q_stricmp(g_juniorAdminMsg.string, "")) - trap->SendServerCommand(-1, va("print \"%s ^7%s\n\"", ent->client->pers.netname, g_juniorAdminMsg.string)); + trap->SendServerCommand(-1, va("print \"%s^7 has logged in %s\n\"", ent->client->pers.netname, g_juniorAdminMsg.string)); + else + trap->SendServerCommand(ent - g_entities, "print \"^2You are now logged in with junior admin privileges.\n\""); return; } else @@ -7192,7 +7194,7 @@ void Cmd_RaceTele_f(gentity_t *ent) if (clientid == -1 || clientid == -2) return; - if (g_entities[clientid].client->pers.noFollow) { + if (g_entities[clientid].client->pers.noFollow || g_entities[clientid].client->sess.sessionTeam == TEAM_SPECTATOR) { if ((ent->client->sess.accountFlags & JAPRO_ACCOUNTFLAG_FULLADMIN) && !(g_fullAdminLevel.integer & (1 << A_SEEHIDDEN))) return; //Print msg? else if ((ent->client->sess.accountFlags & JAPRO_ACCOUNTFLAG_JRADMIN) && !(g_juniorAdminLevel.integer & (1 << A_SEEHIDDEN))) @@ -7366,6 +7368,15 @@ void Cmd_Amtele_f(gentity_t *ent) if (clientid1 == -1 || clientid1 == -2) return; + if (g_entities[clientid1].client->pers.noFollow || g_entities[clientid1].client->sess.sessionTeam == TEAM_SPECTATOR) { + if ((ent->client->sess.accountFlags & JAPRO_ACCOUNTFLAG_FULLADMIN) && !(g_fullAdminLevel.integer & (1 << A_SEEHIDDEN))) + return; //Print msg? + else if ((ent->client->sess.accountFlags & JAPRO_ACCOUNTFLAG_JRADMIN) && !(g_juniorAdminLevel.integer & (1 << A_SEEHIDDEN))) + return; + else + return; + } + origin[0] = g_entities[clientid1].client->ps.origin[0]; origin[1] = g_entities[clientid1].client->ps.origin[1]; origin[2] = g_entities[clientid1].client->ps.origin[2] + 96; @@ -7383,6 +7394,15 @@ void Cmd_Amtele_f(gentity_t *ent) if (clientid1 == -1 || clientid1 == -2 || clientid2 == -1 || clientid2 == -2) return; + if (g_entities[clientid2].client->pers.noFollow || g_entities[clientid2].client->sess.sessionTeam == TEAM_SPECTATOR) { + if ((ent->client->sess.accountFlags & JAPRO_ACCOUNTFLAG_FULLADMIN) && !(g_fullAdminLevel.integer & (1 << A_SEEHIDDEN))) + return; //Print msg? + else if ((ent->client->sess.accountFlags & JAPRO_ACCOUNTFLAG_JRADMIN) && !(g_juniorAdminLevel.integer & (1 << A_SEEHIDDEN))) + return; + else + return; + } + if (g_entities[clientid1].client && (g_entities[clientid1].client->sess.accountFlags & JAPRO_ACCOUNTFLAG_FULLADMIN) || ((ent->client->sess.accountFlags & JAPRO_ACCOUNTFLAG_JRADMIN) && (g_entities[clientid1].client->sess.accountFlags & JAPRO_ACCOUNTFLAG_JRADMIN)))//He has admin { if (g_entities[clientid1].client->ps.clientNum != ent->client->ps.clientNum)//Hes not me diff --git a/codemp/game/g_weapon.c b/codemp/game/g_weapon.c index 5e4181b249..f6cdc33269 100644 --- a/codemp/game/g_weapon.c +++ b/codemp/game/g_weapon.c @@ -3837,7 +3837,7 @@ static void WP_FireConcussionAlt( gentity_t *ent ) qboolean hitDodged = qfalse; vec3_t shot_mins, shot_maxs; int i; - const int shove = -400 * g_selfDamageScale.integer; + const int shove = -400 * g_selfDamageScale.value; //this seems like a dumb idea though? qboolean ghoul2 = qfalse; //[JAPRO - Serverside - Weapons - Tweak weapons Buff Conc alt - Start]