Add helper for finding ClientConns by player name
This commit is contained in:
parent
64abe74d77
commit
b4f4f013a0
10
players.go
10
players.go
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user