mirror of
https://github.com/PretendoNetwork/friends.git
synced 2026-03-21 18:04:11 -05:00
Add Disconnect event handler
This commit is contained in:
parent
9ed6d3add8
commit
b671d440bd
|
|
@ -38,7 +38,20 @@ func startNEXServer() {
|
|||
database.UpdateUserLastOnlineTime(pid, lastOnline)
|
||||
sendUserWentOfflineWiiUNotifications(packet.Sender())
|
||||
|
||||
fmt.Println("Leaving")
|
||||
fmt.Println("Leaving (Kick)")
|
||||
})
|
||||
|
||||
globals.NEXServer.On("Disconnect", func(packet *nex.PacketV0) {
|
||||
pid := packet.Sender().PID()
|
||||
delete(globals.ConnectedUsers, pid)
|
||||
|
||||
lastOnline := nex.NewDateTime(0)
|
||||
lastOnline.FromTimestamp(time.Now())
|
||||
|
||||
database.UpdateUserLastOnlineTime(pid, lastOnline)
|
||||
sendUserWentOfflineWiiUNotifications(packet.Sender())
|
||||
|
||||
fmt.Println("Leaving (Disconnect)")
|
||||
})
|
||||
|
||||
globals.NEXServer.On("Ping", func(packet *nex.PacketV0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user