Add helper for finding ClientConns by player name

master
HimbeerserverDE 2021-09-09 19:45:57 +02:00
parent 64abe74d77
commit b4f4f013a0
No known key found for this signature in database
GPG Key ID: 1A651504791E6A8B
1 changed files with 10 additions and 0 deletions

View File

@ -28,3 +28,13 @@ func Clts() map[*ClientConn]struct{} {
return clts
}
func Find(name string) *ClientConn {
for clt := range Clts() {
if clt.Name() == name {
return clt
}
}
return nil
}