sort list of users
This commit is contained in:
parent
0e67101943
commit
b3be0ba704
@ -3,6 +3,7 @@ package game
|
||||
import (
|
||||
"fmt"
|
||||
"sirlab.de/go/knyt/syncdata"
|
||||
"sort"
|
||||
)
|
||||
|
||||
func (gm *Game) populateSyncDataCb(syncData *syncdata.SyncData) {
|
||||
@ -34,6 +35,10 @@ func (gm *Game) getPlayers() []syncdata.PlayerInfo {
|
||||
}
|
||||
}
|
||||
|
||||
sort.Slice(players, func(a, b int) bool {
|
||||
return players[a].Name < players[b].Name
|
||||
})
|
||||
|
||||
return players
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user