mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-16 17:05:03 +01:00
Add support for players logging out and closing client
Removed seemingly unnecessary castedBinary messages on character login
This commit is contained in:
@@ -3,6 +3,7 @@ package channelserver
|
||||
import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"net"
|
||||
"sync"
|
||||
|
||||
@@ -124,6 +125,13 @@ func (s *Session) sendLoop() {
|
||||
func (s *Session) recvLoop() {
|
||||
for {
|
||||
pkt, err := s.cryptConn.ReadPacket()
|
||||
|
||||
if err == io.EOF {
|
||||
s.logger.Info(fmt.Sprintf("Character(%d) disconnected", s.charID))
|
||||
logoutPlayer(s)
|
||||
return
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
s.logger.Warn("Error on ReadPacket, exiting recv loop", zap.Error(err))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user