Compare commits
1 Commits
45e6e08a5c
...
da82f31d46
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da82f31d46 |
@@ -1,7 +1,6 @@
|
||||
package c4game
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@@ -120,10 +119,7 @@ func HandleGameEvents(store *connect4.Store, nc *nats.Conn, sm *scs.SessionManag
|
||||
}
|
||||
|
||||
sendPing := func() error {
|
||||
data, _ := json.Marshal(struct {
|
||||
LastPing int64 `json:"lastPing"`
|
||||
}{time.Now().UnixMilli()})
|
||||
return sse.PatchSignals(data)
|
||||
return sse.PatchSignals([]byte(fmt.Sprintf(`{"lastPing":%d}`, time.Now().UnixMilli())))
|
||||
}
|
||||
|
||||
// Send initial render and ping
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package snakegame
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strconv"
|
||||
@@ -126,10 +125,7 @@ func HandleSnakeEvents(snakeStore *snake.SnakeStore, nc *nats.Conn, sm *scs.Sess
|
||||
}
|
||||
|
||||
sendPing := func() error {
|
||||
data, _ := json.Marshal(struct {
|
||||
LastPing int64 `json:"lastPing"`
|
||||
}{time.Now().UnixMilli()})
|
||||
return sse.PatchSignals(data)
|
||||
return sse.PatchSignals([]byte(fmt.Sprintf(`{"lastPing":%d}`, time.Now().UnixMilli())))
|
||||
}
|
||||
|
||||
// Send initial render and ping
|
||||
|
||||
Reference in New Issue
Block a user