So, Ill go over some options you have here after going over the communication between the worldserver and the user.
Every 200ms, a list of buffers stored of actions / responses is sent from the server to the client. This is found within CUser::Process(). There is a function called, CUser::Notify.
Code:
int CUser::Notify()
{
if (!IsValid())
return 0;
if (m_dwDestroyTime)
return 0;
static unsigned int uOffset = sizeof(DPID) + sizeof(unsigned long) + sizeof(unsigned long) + sizeof(short);
int nBufSize;
if (m_Snapshot.cb > 0)
{
unsigned char* lpBuf = m_Snapshot.ar.GetBuffer(&nBufSize);
*reinterpret_cast<__unaligned unsigned short*>(lpBuf + sizeof(DPID) + sizeof(unsigned long) + sizeof(unsigned long)) = m_Snapshot.cb;
g_DPSrvr.Send(lpBuf, nBufSize, m_Snapshot.dpidCache);
*reinterpret_cast<__unaligned unsigned long*>(lpBuf + sizeof(DPID)) = PACKETTYPE_SNAPSHOT;
m_Snapshot.cb = 0;
m_Snapshot.ar.ReelIn(uOffset);
return nBufSize;
}
return 0;
}
Those snapshots are made by a lot of CUser function calls which continually serializes more and more data to a buffer till eventually it is sent out.
The following sends the buffer to the cacheserver with the users cache id:
Code:
g_DPSrvr.Send(lpBuf, nBufSize, m_Snapshot.dpidCache);
The worldserver is connected to the Cacheserver and the cacheserver is connected to the clients. Because the packet header isn't a system header it would be getting routed to the UserMessageHandler.
PHP Code:
CDPCacheSrvr::UserMessageHandler
A free fix from v21.2 is stored here as well:
PHP Code:
CPlayer* pPlayer = CPlayerMng::Instance()->GetPlayer(idFrom);
if (!pPlayer)
return;
PACKET_HANDLER_FUNC pfn = GetHandler(dw);
but down below there is:
PHP Code:
default:
g_DPClientArray.SendToServer( idFrom, lpMsg, dwMsgSize );
break;
So, if the function isn't found in the std::map of function pointers and it isn't a set of packets (for the coreserver), they get routed to the client.
Then sent to the clients UserMessageHandler and then to the OnSnapShot function. Where it will loop over the network buffer and apply the list of "snapshotted" network buffers.
PHP Code:
unsigned char g_hdr, g_Prev;
void CDPClient::OnSnapshot(CAr& ar)
Meaning, if there is one error within a 200ms network buffer, and the buffer for that specific individual snapshot isn't extracted fully, data can be mismatched for the next loops until that specific round of execution.
Now, you can send a packet from the client to request the drop information for a monster when required, and then the worldserver can respond. You can even change it to make it work faster too for that individual packet if you wanted. Another alternative is, you can send the drop list whenever from the server to the client. Lastly, there's the alternative of just loading the drop table locally but that will expose all the drops visually but most are already exposed, no?
My personal preference would either be the first or the last. If you're having a dynamic drop table where you're reloading the drops on the server without rebooting the server, (Ie: editing the drop system a bit) then the first. Otherwise, the last. If you're not changing the drops, might as well trade off a little load time compared to the other alternatives.