pause if no clients are connected
This commit is contained in:
parent
0b1e623357
commit
0314ceae4a
|
@ -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 {
|
||||
|
@ -106,6 +107,7 @@ func serveClients() {
|
|||
time.Sleep(time.Second / time.Duration(level.FPS))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func runServer(cmd *cobra.Command, args []string) {
|
||||
log.Println("Running server on port", ServerPort)
|
||||
|
|
Loading…
Reference in New Issue
Block a user