fix Sync Spawn Timer
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 1m19s
Some checks failed
Dynamic Branch Deploy / build-and-deploy (push) Failing after 1m19s
This commit is contained in:
@@ -65,7 +65,7 @@ func handleValidate(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
// ---> HIER RUFEN WIR JETZT DIE SIMULATION AUF <---
|
||||
isDead, score, obstacles, powerUpState, serverTick := simulateChunk(req.SessionID, req.Inputs, req.TotalTicks, vals)
|
||||
isDead, score, obstacles, powerUpState, serverTick, nextSpawnTick := simulateChunk(req.SessionID, req.Inputs, req.TotalTicks, vals)
|
||||
|
||||
status := "alive"
|
||||
if isDead {
|
||||
@@ -80,6 +80,7 @@ func handleValidate(w http.ResponseWriter, r *http.Request) {
|
||||
ServerObs: obstacles,
|
||||
PowerUps: powerUpState,
|
||||
ServerTick: serverTick,
|
||||
NextSpawnTick: nextSpawnTick,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -43,8 +43,9 @@ async function sendChunk() {
|
||||
}
|
||||
|
||||
// Sync Spawning Timer
|
||||
if (data.nextSpawnTick) {
|
||||
if (data.NextSpawnTick) {
|
||||
if (Math.abs(nextSpawnTick - data.nextSpawnTick) > 5) {
|
||||
console.log("Sync Spawn Timer:", nextSpawnTick, "->", data.NextSpawnTick);
|
||||
nextSpawnTick = data.nextSpawnTick;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user