pause if no clients are connected

This commit is contained in:
Lennart Buhl 2016-02-07 17:46:20 +01:00
parent 0b1e623357
commit 0314ceae4a

View File

@ -81,6 +81,7 @@ func serveClients() {
level = data.LoadLevel(LevelFile)
frameCounter = 0
for { // while true
if len(clients) > 0 { // pause if no clients are connected
for _, k := range clientKeys {
id, client := k, clients[k]
if id > 0 {
@ -105,6 +106,7 @@ func serveClients() {
frameCounter++
time.Sleep(time.Second / time.Duration(level.FPS))
}
}
}
func runServer(cmd *cobra.Command, args []string) {