feat(network): align ping/pong and observer packets with Windows reference (pass30)
This commit is contained in:
@@ -1352,4 +1352,35 @@ bool PythonNetworkStream::RecvOfflineShopPacket() {
|
||||
}
|
||||
call("RefreshOfflineShop",Py_BuildValue("()"));return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::RecvPingPacket() {
|
||||
TPacketGCPing packet;
|
||||
if (!Read(sizeof(packet), &packet)) return false;
|
||||
TPacketCGPong pong;
|
||||
pong.bHeader = HEADER_CG_PONG;
|
||||
Send(&pong, sizeof(pong));
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::RecvObserverAddPacket() {
|
||||
TPacketGCObserverAdd packet;
|
||||
if (!Read(sizeof(packet), &packet)) return false;
|
||||
CPythonMiniMap::Instance().AddObserver(packet.vid, packet.x * 100.0f, packet.y * 100.0f);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::RecvObserverRemovePacket() {
|
||||
TPacketGCObserverAdd packet;
|
||||
if (!Read(sizeof(packet), &packet)) return false;
|
||||
CPythonMiniMap::Instance().RemoveObserver(packet.vid);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PythonNetworkStream::RecvObserverMovePacket() {
|
||||
TPacketGCObserverMove packet;
|
||||
if (!Read(sizeof(packet), &packet)) return false;
|
||||
CPythonMiniMap::Instance().MoveObserver(packet.vid, packet.x * 100.0f, packet.y * 100.0f);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user