Fix frame counter
This commit is contained in:
parent
729cbf2c2f
commit
1fabcfb3f4
|
@ -60,7 +60,7 @@ func serveClients() {
|
||||||
id, client := k, clients[k]
|
id, client := k, clients[k]
|
||||||
if id > 0 {
|
if id > 0 {
|
||||||
oFrame := World.GetFrame(0, client.w, fCounter)
|
oFrame := World.GetFrame(0, client.w, fCounter)
|
||||||
fCounter++
|
|
||||||
enc := gob.NewEncoder(client.con)
|
enc := gob.NewEncoder(client.con)
|
||||||
err := enc.Encode(oFrame)
|
err := enc.Encode(oFrame)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -78,6 +78,7 @@ func serveClients() {
|
||||||
//log.Println("ID:", id, "Client:", client)
|
//log.Println("ID:", id, "Client:", client)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
fCounter++
|
||||||
time.Sleep(time.Second / time.Duration(World.FPS))
|
time.Sleep(time.Second / time.Duration(World.FPS))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user