aboutsummaryrefslogtreecommitdiff
path: root/process.go
diff options
context:
space:
mode:
Diffstat (limited to 'process.go')
-rw-r--r--process.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/process.go b/process.go
index 34a794b..208638a 100644
--- a/process.go
+++ b/process.go
@@ -76,6 +76,9 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
return
}
+ cc.name = cmd.PlayerName
+ cc.logger.SetPrefix(fmt.Sprintf("[%s %s] ", cc.RemoteAddr(), cc.Name()))
+
if !playerNameChars.MatchString(cmd.PlayerName) {
cc.Log("<-", "invalid player name")
ack, _ := cc.SendCmd(&mt.ToCltKick{Reason: mt.BadNameChars})
@@ -89,9 +92,6 @@ func (cc *ClientConn) process(pkt mt.Pkt) {
return
}
- cc.name = cmd.PlayerName
- cc.logger.SetPrefix(fmt.Sprintf("[%s %s] ", cc.RemoteAddr(), cc.Name()))
-
ip := cc.RemoteAddr().(*net.UDPAddr).IP.String()
if DefaultAuth().Banned(ip, cc.Name()) {
cc.Log("<-", "banned")