This is a simple (and probably unwanted) tutorial that will give you all the online players for each core, including the auth
We might argue about whether being in the select character phase is really in-game, but we will include it anyway
Why?
The /u and /w commands only provide data from the channel where the player is
Since I needed absolute values - as soon as someone logs in - I went searching in the source and came across the GetUserCount() function
Bitte melden Sie sich an, um dieses Bild zu sehen.
I had 3 players in separated channels (auth, 1 and 99 respectively)
I used the commands above and lastly the new one we are going to create
Explanation?
The function returns (in type DWORD) the size of m_map_kLogonAccount
It is a map that stores the login values with class CLoginData
It is also responsible for storing the values of the players online every 1h in usage.txt
It is given an insert in the map every login a player makes through the boolean function InsertLogonAccount()
What we're going to do is requesting the data from GetUserCount() and show it.
Installing
DB
ClientManager.cpp:
Search for:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Add below:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Search for:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Add below:
- void CClientManager::RequestUserCount(DWORD dwHandle)
- {
- for (TPeerList::const_iterator it = m_peerList.begin(); it != m_peerList.end(); ++it)
- {
- CPeer* peer = *it;
- if (!peer->GetChannel())
- continue;
- TPacketDGUserCount Info;
- peer->EncodeHeader(HEADER_DG_RET_USER_COUNT, dwHandle, sizeof(TPacketDGUserCount));
- Info.user = GetUserCount();
- peer->Encode(&Info, sizeof(TPacketDGUserCount));
- }
- }
Bitte melden Sie sich an, um diesen Anhang zu sehen.
ClientManager.h:
Search for:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Add below:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Common
tables.h:
Search for:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Add below:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Search for:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Add below:
Bitte melden Sie sich an, um diesen Anhang zu sehen.
Game
cmd_gm.cpp:
Search for:
Add below:
input.cpp:
Search for:
Add below:
input.h:
Search for:
Add below:
input_db.cpp:
Search for:
Add below:
Search for:
Add below:
Usage
The usage is /reload y