IMPORTANT UPDATE:
This fix will NOT fully fix the attacks that were going on previously. This fix will only filter messages from invalid players sending packets.
The actual fix has been developed with a lot of outside help and in a group of 10 people.
The group in total has decided to not disclose any details as we invested a lot of time into it and simply don't want to share it with everyone out there.
Sharing a fix will also mean making servers that are not present on epvp vulnerable to the attack. We don't want that to happen.
The invalid user filter will stay on here, but nothing else will be disclosed.
Previous Updates:
User.h
below
Code:
map<DWORD, CUser*> m_users;
Code:
map<DWORD, CUser*> m_invalid_users;
Code:
CUser* GetUser(DPID dpidCache, DPID dpidUser);
Code:
CUser* GetInvalidUser(DPID dpidUser);
add
Code:
CUser* CUserMng::GetInvalidUser(DPID dpidUser)
{
auto it = m_invalid_users.find(dpidUser);
if (it != m_invalid_users.end())
return it->second;
else
return nullptr;
}
in
Code:
CUserMng::AddPlayer
Code:
m_users.insert({ pUser->m_dwSerial, pUser });
m_invalid_users.erase(pUser->m_dwSerial);
Code:
CUserMng::AddUser
Code:
m_users.insert(std::make_pair(dpidUser, pUser));
Code:
m_invalid_users.insert({dpidUser, pUser});
Code:
CUserMng::RemoveUser
Code:
auto findInvalid = m_invalid_users.find(dwSerial);
if (findInvalid != m_invalid_users.end())
{
m_invalid_users.erase(findInvalid);
return;
}
In OnJoin replace
Code:
CUser* pUser = g_UserMng.GetUser( dpidCache, dpidUser );
Code:
CUser* pUser = g_UserMng.GetInvalidUser( dpidUser );
In UserMessageHandler after GETTYPE( ar ) add
Code:
CUser* pUser = g_UserMng.GetInvalidUser(*(UNALIGNED LPDPID)lpMsg);
if (pUser)
{
Error("Received Packet from Invalid user");
return;
}
after
Code:
if( nSlot >= 3 ) return;
Code:
CUser* pInvalidUser = g_UserMng.GetInvalidUser(dpidUser);
if (pInvalidUser)
{
Error("Invalid Connection Attempt UserID [%u]", idPlayer);
return;
}
After adding that the error triggered twice when logging in local server. As said above, if you have concerns or suggestions on how to improve that code, post here or pm me.
Quick demonstration of the fix:
Contributions and suggestions made by:
Vladi#5038
Dylan#8888
kotori#0001






