ToontownClient: Handle CLIENT_HEARTBEAT, CLIENT_DISCONNECT
This commit is contained in:
parent
4e43ff6f9e
commit
ce93dd70e5
|
|
@ -0,0 +1,8 @@
|
|||
CLIENT_DISCONNECT = 37
|
||||
|
||||
CLIENT_HEARTBEAT = 52
|
||||
|
||||
-- new toontown specific login message, adds last logged in, and if child account has parent acount
|
||||
CLIENT_LOGIN_TOONTOWN = 125
|
||||
|
||||
CLIENT_DISCONNECT_GENERIC = 1
|
||||
|
|
@ -1,6 +1,17 @@
|
|||
package.path = package.path .. ";lua/?.lua"
|
||||
|
||||
-- Load message types
|
||||
dofile("lua/MsgTypes.lua")
|
||||
|
||||
function receiveDatagram(client, dgi)
|
||||
-- Client received datagrams
|
||||
msgType = dgi:readUint16()
|
||||
print(msgType)
|
||||
|
||||
if msgType == CLIENT_HEARTBEAT then
|
||||
client:handleHeartbeat()
|
||||
elseif msgType == CLIENT_DISCONNECT then
|
||||
client:handleDisconnect()
|
||||
else
|
||||
client:sendDisconnect(CLIENT_DISCONNECT_GENERIC, string.format("Unknown message type: %d", msgType), true)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue