Skip to content

Commit 0cffa92

Browse files
committed
Remove /whowas command
It turned out to be unreliable and can be implemented entirely in Lua
1 parent de149ef commit 0cffa92

File tree

15 files changed

+3
-189
lines changed

15 files changed

+3
-189
lines changed

Client/mods/deathmatch/logic/Config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ class CVaPassNext
9898
#error MAX_CHAT_LENGTH "macro can't exceed 255"
9999
#endif
100100

101-
// Defines how long the whowas list can be
102-
#define MAX_WHOWAS_LENGTH 1024
103-
104101
// Max valid weather id
105102
#define MAX_VALID_WEATHER 255
106103

Server/mods/deathmatch/Config.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ class CVaPassNext
107107
#error MAX_CHAT_LENGTH "macro can't exceed 255"
108108
#endif
109109

110-
// Defines how long the whowas list can be
111-
#define MAX_WHOWAS_LENGTH 1024
112-
113110
// Max valid weather id
114111
#define MAX_VALID_WEATHER 255
115112

Server/mods/deathmatch/StdInc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,6 @@ struct SAclRequest;
280280
#include "CWater.h"
281281
#include "CWaterManager.h"
282282
#include "CWeaponNames.h"
283-
#include "CWhoWas.h"
284283
#include "CXMLConfig.h"
285284
#include "CZoneNames.h"
286285
#include "TaskNames.h"

Server/mods/deathmatch/logic/CAccountManager.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,10 +568,6 @@ bool CAccountManager::LogIn(CClient* pClient, CClient* pEchoClient, const char*
568568
pEchoClient->SendEcho("login: You successfully logged in");
569569
}
570570

571-
// Update who was info
572-
if (pClient->GetClientType() == CClient::CLIENT_PLAYER)
573-
g_pGame->GetConsole()->GetWhoWas()->OnPlayerLogin(static_cast<CPlayer*>(pClient));
574-
575571
// Delete the old account if it was a guest account
576572
if (!pCurrentAccount->IsRegistered())
577573
delete pCurrentAccount;

Server/mods/deathmatch/logic/CConsole.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "StdInc.h"
1313

1414
CConsole::CConsole(CBlipManager* pBlipManager, CMapManager* pMapManager, CPlayerManager* pPlayerManager, CRegisteredCommands* pRegisteredCommands,
15-
CVehicleManager* pVehicleManager, CLuaManager* pLuaManager, CWhoWas* pWhoWas, CBanManager* pBanManager,
15+
CVehicleManager* pVehicleManager, CLuaManager* pLuaManager, CBanManager* pBanManager,
1616
CAccessControlListManager* pACLManager)
1717
{
1818
// Init
@@ -22,7 +22,6 @@ CConsole::CConsole(CBlipManager* pBlipManager, CMapManager* pMapManager, CPlayer
2222
m_pRegisteredCommands = pRegisteredCommands;
2323
m_pVehicleManager = pVehicleManager;
2424
m_pLuaManager = pLuaManager;
25-
m_pWhoWas = pWhoWas;
2625
m_pBanManager = pBanManager;
2726
m_pACLManager = pACLManager;
2827
}

Server/mods/deathmatch/logic/CConsole.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@
1313

1414
#include "CConsoleCommand.h"
1515
#include <list>
16-
#include "CWhoWas.h"
1716

1817
class CConsole
1918
{
2019
public:
2120
CConsole(class CBlipManager* pBlipManager, class CMapManager* pMapManager, class CPlayerManager* pPlayerManager,
22-
class CRegisteredCommands* pRegisteredCommands, class CVehicleManager* pVehicleManager, class CLuaManager* pLuaManager, CWhoWas* pWhoWas,
21+
class CRegisteredCommands* pRegisteredCommands, class CVehicleManager* pVehicleManager, class CLuaManager* pLuaManager,
2322
class CBanManager* pBanManager, class CAccessControlListManager* pACLManager);
2423
~CConsole(void);
2524

@@ -39,7 +38,6 @@ class CConsole
3938
class CPlayerManager* GetPlayerManager(void) { return m_pPlayerManager; };
4039
class CVehicleManager* GetVehicleManager(void) { return m_pVehicleManager; };
4140
class CBanManager* GetBanManager(void) { return m_pBanManager; };
42-
class CWhoWas* GetWhoWas(void) { return m_pWhoWas; };
4341

4442
private:
4543
class CBlipManager* m_pBlipManager;
@@ -49,7 +47,6 @@ class CConsole
4947
class CVehicleManager* m_pVehicleManager;
5048
class CLuaManager* m_pLuaManager;
5149
class CBanManager* m_pBanManager;
52-
class CWhoWas* m_pWhoWas;
5350
class CAccessControlListManager* m_pACLManager;
5451

5552
list<CConsoleCommand*> m_Commands;

Server/mods/deathmatch/logic/CConsoleCommands.cpp

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1221,69 +1221,6 @@ bool CConsoleCommands::WhoIs(CConsole* pConsole, const char* szArguments, CClien
12211221
return false;
12221222
}
12231223

1224-
bool CConsoleCommands::WhoWas(CConsole* pConsole, const char* szArguments, CClient* pClient, CClient* pEchoClient)
1225-
{
1226-
// Got any arguments?
1227-
if (szArguments && strlen(szArguments) > 0)
1228-
{
1229-
// Is the nick requested anyone?
1230-
bool bAnyone = (SStringX(szArguments) == "*");
1231-
1232-
// Start iterating the whowas list
1233-
CWhoWas* pWhoWas = pConsole->GetWhoWas();
1234-
if (pWhoWas->Count() > 0)
1235-
{
1236-
// Start iterating the list
1237-
unsigned int uiCount = 0;
1238-
list<SWhoWasEntry>::const_iterator iter = pWhoWas->IterBegin();
1239-
for (; iter != pWhoWas->IterEnd(); iter++)
1240-
{
1241-
// Matches?
1242-
if (bAnyone || iter->strNick.ContainsI(szArguments))
1243-
{
1244-
// Haven't got too many entries printed?
1245-
if (++uiCount <= 20)
1246-
{
1247-
// Convert the IP to a string
1248-
SString strIP = LongToDottedIP(iter->ulIP);
1249-
1250-
// Populate a line about him
1251-
SString strName = iter->strNick;
1252-
if (iter->strAccountName != GUEST_ACCOUNT_NAME)
1253-
strName += SString(" (%s)", *iter->strAccountName);
1254-
pClient->SendEcho(
1255-
SString("%s - IP:%s serial:%s version:%s", *strName, *strIP, iter->strSerial.c_str(), iter->strPlayerVersion.c_str()));
1256-
}
1257-
else
1258-
{
1259-
pClient->SendEcho("...");
1260-
return true;
1261-
}
1262-
}
1263-
}
1264-
1265-
// No matching entries?
1266-
if (uiCount == 0)
1267-
{
1268-
pClient->SendEcho("whowas: No matching nicks");
1269-
return false;
1270-
}
1271-
1272-
return true;
1273-
}
1274-
else
1275-
{
1276-
pClient->SendEcho("whowas: The whowas list is empty");
1277-
}
1278-
}
1279-
else
1280-
{
1281-
pClient->SendEcho("whowas: Syntax is 'whowas <nick>'");
1282-
}
1283-
1284-
return false;
1285-
}
1286-
12871224
bool CConsoleCommands::DebugScript(CConsole* pConsole, const char* szArguments, CClient* pClient, CClient* pEchoClient)
12881225
{
12891226
// Valid parameter?

Server/mods/deathmatch/logic/CConsoleCommands.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ class CConsoleCommands
4646
static bool AExec(class CConsole* pConsole, const char* szArguments, CClient* pClient, CClient* pEchoClient);
4747

4848
static bool WhoIs(class CConsole* pConsole, const char* szArguments, CClient* pClient, CClient* pEchoClient);
49-
static bool WhoWas(class CConsole* pConsole, const char* szArguments, CClient* pClient, CClient* pEchoClient);
5049

5150
static bool DebugScript(class CConsole* pConsole, const char* szArguments, CClient* pClient, CClient* pEchoClient);
5251

Server/mods/deathmatch/logic/CGame.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ bool CGame::Start(int iArgumentCount, char* szArguments[])
514514
m_pRegisteredCommands = new CRegisteredCommands(m_pACLManager);
515515
m_pLuaManager = new CLuaManager(m_pObjectManager, m_pPlayerManager, m_pVehicleManager, m_pBlipManager, m_pRadarAreaManager, m_pRegisteredCommands,
516516
m_pMapManager, &m_Events);
517-
m_pConsole = new CConsole(m_pBlipManager, m_pMapManager, m_pPlayerManager, m_pRegisteredCommands, m_pVehicleManager, m_pLuaManager, &m_WhoWas,
517+
m_pConsole = new CConsole(m_pBlipManager, m_pMapManager, m_pPlayerManager, m_pRegisteredCommands, m_pVehicleManager, m_pLuaManager,
518518
m_pBanManager, m_pACLManager);
519519
m_pMainConfig = new CMainConfig(m_pConsole, m_pLuaManager);
520520
m_pRPCFunctions = new CRPCFunctions;
@@ -1787,9 +1787,6 @@ void CGame::Packet_PlayerJoinData(CPlayerJoinDataPacket& Packet)
17871787
}
17881788
#endif
17891789

1790-
// Add him to the whowas list
1791-
m_WhoWas.Add(szNick, Packet.GetSourceIP(), pPlayer->GetSerial(), pPlayer->GetPlayerVersion(), pPlayer->GetAccount()->GetName());
1792-
17931790
PlayerCompleteConnect(pPlayer);
17941791
}
17951792
else

Server/mods/deathmatch/logic/CGame.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class CGame;
2020
#include "CCommandLineParser.h"
2121
#include "CConnectHistory.h"
2222
#include "CElementDeleter.h"
23-
#include "CWhoWas.h"
2423

2524
#include "packets/CCommandPacket.h"
2625
#include "packets/CExplosionSyncPacket.h"
@@ -530,7 +529,6 @@ class CGame
530529
CClock* m_pClock;
531530
CBanManager* m_pBanManager;
532531
CTeamManager* m_pTeamManager;
533-
CWhoWas m_WhoWas;
534532
CCommandLineParser m_CommandLineParser;
535533
CRegisteredCommands* m_pRegisteredCommands;
536534
CDatabaseManager* m_pDatabaseManager;

0 commit comments

Comments
 (0)