Skip to content

Commit 75861a7

Browse files
committed
Missed some log function when committing
1 parent ef88513 commit 75861a7

2 files changed

Lines changed: 28 additions & 30 deletions

File tree

commands.cpp

Lines changed: 27 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -342,11 +342,11 @@ void GelocityButtons(IConVar* var, const char* pOldValue, float flOldValue)
342342
// Check if host is in a gelocity map.
343343
if (!InGelocityMap())
344344
{
345-
if (!((ConVar*)var)->GetBool())
346-
P2MMLog(0, false, "Unlocked buttons...");
345+
if (!dynamic_cast<ConVar*>(var)->GetBool())
346+
P2MMLog(INFO, false, "Unlocked buttons...");
347347
else
348-
P2MMLog(0, false, "Locked buttons...");
349-
P2MMLog(1, false, "Mode will take effect when Gelocity map is loaded.");
348+
P2MMLog(INFO, false, "Locked buttons...");
349+
P2MMLog(WARNING, false, "Mode will take effect when Gelocity map is loaded.");
350350
return;
351351
}
352352

@@ -359,7 +359,7 @@ void GelocityButtons(IConVar* var, const char* pOldValue, float flOldValue)
359359
"EntFire(\"music_button_1\", \"Unlock\");"
360360
"EntFire(\"music_button_2\", \"Unlock\");", false
361361
);
362-
P2MMLog(0, false, "Unlocked buttons...");
362+
P2MMLog(INFO, false, "Unlocked buttons...");
363363
}
364364
else
365365
{
@@ -369,7 +369,7 @@ void GelocityButtons(IConVar* var, const char* pOldValue, float flOldValue)
369369
"EntFire(\"music_button_1\", \"Lock\");"
370370
"EntFire(\"music_button_2\", \"Lock\");", false
371371
);
372-
P2MMLog(0, false, "Locked buttons...");
372+
P2MMLog(INFO, false, "Locked buttons...");
373373
}
374374
}
375375
ConVar p2mm_gelocity_lockbuttons("p2mm_gelocity_lockbuttons", "0", FCVAR_NONE, "Toggle the state of the music and lap buttons.", true, 0, true, 1, GelocityButtons);
@@ -379,7 +379,7 @@ CON_COMMAND(p2mm_gelocity_laps, "Set lap count for the Gelocity Race. Specify 0
379379
// Check if host is in a gelocity map.
380380
if (!InGelocityMap())
381381
{
382-
P2MMLog(1, false, "Not currently in a Gelocity map!");
382+
P2MMLog(WARNING, false, "Not currently in a Gelocity map!");
383383
return;
384384
}
385385

@@ -388,7 +388,7 @@ CON_COMMAND(p2mm_gelocity_laps, "Set lap count for the Gelocity Race. Specify 0
388388
g_pScriptVM->GetValue("bRaceStarted", &raceStartedScript);
389389
if (raceStartedScript.m_bool)
390390
{
391-
P2MMLog(1, false, "Race is currently in progress!");
391+
P2MMLog(WARNING, false, "Race is currently in progress!");
392392
return;
393393
}
394394

@@ -399,12 +399,12 @@ CON_COMMAND(p2mm_gelocity_laps, "Set lap count for the Gelocity Race. Specify 0
399399
{
400400
ScriptVariant_t raceLaps;
401401
g_pScriptVM->GetValue("iGameLaps", &raceLaps);
402-
P2MMLog(0, false, "Current race laps: %i", raceLaps.m_int);
402+
P2MMLog(INFO, false, "Current race laps: %i", raceLaps.m_int);
403403
return;
404404
}
405405
else if (V_atoi(args.Arg(1)) < 1 || V_atoi(args.Arg(1)) > 300)
406406
{
407-
P2MMLog(1, false, "Value out of bounds! Lap counter goes from 1-300!");
407+
P2MMLog(WARNING, false, "Value out of bounds! Lap counter goes from 1-300!");
408408
return;
409409
}
410410

@@ -435,7 +435,7 @@ CON_COMMAND(p2mm_gelocity_music, "Set the music track for the Gelocity Race. 0-5
435435
// Check if host is in a gelocity map.
436436
if (!InGelocityMap())
437437
{
438-
P2MMLog(1, false, "Not currently in a Gelocity map!");
438+
P2MMLog(WARNING, false, "Not currently in a Gelocity map!");
439439
return;
440440
}
441441

@@ -444,7 +444,7 @@ CON_COMMAND(p2mm_gelocity_music, "Set the music track for the Gelocity Race. 0-5
444444
g_pScriptVM->GetValue("bFinalLap", &finalLapScript);
445445
if (finalLapScript.m_bool)
446446
{
447-
P2MMLog(1, false, "ITS THE FINAL LAP! LET THE INTENSE FINAL LAP MUSIC PLAY!");
447+
P2MMLog(WARNING, false, "ITS THE FINAL LAP! LET THE INTENSE FINAL LAP MUSIC PLAY!");
448448
return;
449449
}
450450

@@ -453,12 +453,12 @@ CON_COMMAND(p2mm_gelocity_music, "Set the music track for the Gelocity Race. 0-5
453453
{
454454
ScriptVariant_t iMusicTrack;
455455
g_pScriptVM->GetValue("iMusicTrack", &iMusicTrack);
456-
P2MMLog(0, false, "Current music track: %i", iMusicTrack.m_int);
456+
P2MMLog(INFO, false, "Current music track: %i", iMusicTrack.m_int);
457457
return;
458458
}
459459
else if (V_atoi(args.Arg(1)) < 0 || V_atoi(args.Arg(1)) > 5)
460460
{
461-
P2MMLog(1, false, "Value out of bounds! Music tracks goes from 0-5!");
461+
P2MMLog(WARNING, false, "Value out of bounds! Music tracks goes from 0-5!");
462462
return;
463463
}
464464

@@ -484,12 +484,12 @@ CON_COMMAND(p2mm_gelocity_music, "Set the music track for the Gelocity Race. 0-5
484484
if (V_atoi(args.Arg(1)) == 0)
485485
{
486486
UTIL_HudMessage(NULL, musicMessage, std::string("No Music").c_str());
487-
P2MMLog(0, false, "Music turned off!", V_atoi(args.Arg(1)));
487+
P2MMLog(INFO, false, "Music turned off!", V_atoi(args.Arg(1)));
488488
}
489489
else
490490
{
491491
UTIL_HudMessage(NULL, musicMessage, std::string("Music Track: " + std::string(args.Arg(1))).c_str());
492-
P2MMLog(0, false, "Set music track to %i!", V_atoi(args.Arg(1)));
492+
P2MMLog(INFO, false, "Set music track to %i!", V_atoi(args.Arg(1)));
493493
}
494494
}
495495

@@ -498,7 +498,7 @@ CON_COMMAND(p2mm_gelocity_start, "Starts the Gelocity race.")
498498
// Check if host is in a gelocity map.
499499
if (!InGelocityMap())
500500
{
501-
P2MMLog(1, false, "Not currently in a Gelocity map!");
501+
P2MMLog(WARNING, false, "Not currently in a Gelocity map!");
502502
return;
503503
}
504504

@@ -507,7 +507,7 @@ CON_COMMAND(p2mm_gelocity_start, "Starts the Gelocity race.")
507507
g_pScriptVM->GetValue("b_RaceStarted", &raceStartedScript);
508508
if (raceStartedScript.m_bool)
509509
{
510-
P2MMLog(1, false, "Race is currently in progress!");
510+
P2MMLog(WARNING, false, "Race is currently in progress!");
511511
return;
512512
}
513513

@@ -532,13 +532,12 @@ void RemovePlayerOperation(bool bBanning, int userid)
532532
// The first argument determines if the player will be banned or kicked. True is ban.
533533
if (bBanning)
534534
{
535-
for (size_t i = 0; i < banList.size(); i++)
535+
for (auto& i : banList)
536536
{
537-
if (FStrEq(banList[i].username.c_str(), bannedPlayer.username.c_str()))
537+
if (FStrEq(i.username.c_str(), bannedPlayer.username.c_str()))
538538
{
539-
P2MMLog(1, false, "Ban called on player that is already banned!");
540-
std::string errorMsg = std::string("\x03(P2:MM): This player is already banned!");
541-
UTIL_ClientPrint(UTIL_PlayerByIndex(0), HUD_PRINTTALK, errorMsg.c_str());
539+
P2MMLog(WARNING, false, "Ban called on player that is already banned!");
540+
UTIL_ClientPrint(UTIL_PlayerByIndex(0), HUD_PRINTTALK, "\x03(P2:MM): This player is already banned!");
542541
return;
543542
}
544543
}
@@ -562,18 +561,17 @@ void RemovePlayerOperation(bool bBanning, int userid)
562561
}
563562
engineClient->ExecuteClientCmd("gameui_hide");
564563

565-
P2MMLog(0, true, "Banning?: %i", bBanning);
566-
P2MMLog(0, true, "userID: %i", bannedPlayer.userID);
567-
P2MMLog(0, true, "username: %s", bannedPlayer.username.c_str());
568-
P2MMLog(0, true, "guid: %s", bannedPlayer.guid.c_str());
564+
P2MMLog(INFO, true, "Banning?: %i", bBanning);
565+
P2MMLog(INFO, true, "userID: %i", bannedPlayer.userID);
566+
P2MMLog(INFO, true, "username: %s", bannedPlayer.username.c_str());
569567
}
570568

571569
// Display UI for either banning or kicking so host can ban or kick a player.
572570
void RemovePlayerUI(int playerIndex, bool bBanning)
573571
{
574572
if (!IsGameActive())
575573
{
576-
P2MMLog(1, false, "Game session is not currently running!");
574+
P2MMLog(WARNING, false, "Game session is not currently running!");
577575
return;
578576
}
579577

@@ -629,7 +627,7 @@ CON_COMMAND(unban, "Unban a player from the P2:MM play session.")
629627
{
630628
if (!IsGameActive())
631629
{
632-
P2MMLog(1, false, "Game session is not currently running!");
630+
P2MMLog(WARNING, false, "Game session is not currently running!");
633631
return;
634632
}
635633

discordrpc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ unsigned SendWebHook(void* webhookParams)
139139
params->footer + "\" }}], \"attachments\": [] }"
140140
);
141141

142-
DiscordLog(0, true, std::string("jsonPayload: " + jsonPayload).c_str());
142+
DiscordLog(INFO, true, std::string("jsonPayload: " + jsonPayload).c_str());
143143

144144
// Set the POST data
145145
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, jsonPayload);

0 commit comments

Comments
 (0)