diff --git a/server/Dockerfile b/server/Dockerfile index 4273421..a2c9893 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -15,8 +15,7 @@ RUN go install github.com/go-delve/delve/cmd/dlv@latest FROM heroiclabs/nakama-dsym:3.26.0 +COPY --from=builder /go/bin/dlv /nakama/ COPY --from=builder /backend/backend.so /nakama/data/modules #COPY --from=builder /backend/local.yml /nakama/data/ -COPY --from=builder /backend/*.json /nakama/data/modules - -ENTRYPOINT [ "/bin/bash" ] \ No newline at end of file +COPY --from=builder /backend/*.json /nakama/data/modules \ No newline at end of file diff --git a/server/docker-compose.yaml b/server/docker-compose.yaml index ab5f5b1..2747d15 100644 --- a/server/docker-compose.yaml +++ b/server/docker-compose.yaml @@ -24,7 +24,7 @@ services: - "-ecx" - > /nakama/nakama migrate up --database.address root@cockroachdb:26257 && - exec /nakama/nakama --name nakama1 --database.address root@cockroachdb:26257 --logger.level ERROR --session.token_expiry_sec 7200 --metrics.prometheus_port 9100 + /nakama/dlv --log --log-output=debugger --listen=:4000 --headless=true --api-version=2 exec /nakama/nakama -- --name nakama1 --database.address root@cockroachdb:26257 --logger.level DEBUG --session.token_expiry_sec 7200 --metrics.prometheus_port 9100 restart: "no" links: - "cockroachdb:db" @@ -38,15 +38,22 @@ services: - "7350" - "7351" - "9100" + - "2345" ports: - "7349:7349" - "7350:7350" - "7351:7351" + - "2345:2345" + - "4000:4000" healthcheck: test: ["CMD", "/nakama/nakama", "healthcheck"] interval: 10s timeout: 5s retries: 5 + security_opt: + - seccomp:unconfined + stdin_open: true + tty: true prometheus: image: prom/prometheus entrypoint: /bin/sh -c diff --git a/server/game-modes/battle-royale/player-stage.go b/server/game-modes/battle-royale/player-stage.go index eba1592..61570f1 100644 --- a/server/game-modes/battle-royale/player-stage.go +++ b/server/game-modes/battle-royale/player-stage.go @@ -75,6 +75,7 @@ func (s *PlayerStageState) Delete() { ffi.DestroyBullet(bullet) } s.bullets = nil + s.playerInputs = nil ffi.DestroyCircle(s.hitCol) ffi.DestroyCircle(s.grazeCol) @@ -110,7 +111,7 @@ func (s *PlayerStageState) NewStateFromInputs(inputs []*ClientUpdate, tickToSimu stageStateCopy := s.DeepClone() // Replay each tick between the last locked in tick and the tick to simulate to - for t := stageStateCopy.lastLockedInTick; t < tickToSimulateTo; t++ { + for t := stageStateCopy.lastLockedInTick; t <= tickToSimulateTo; t++ { // Handle inputs for the current tick on the client for _, input := range inputs { if input.Tick == t { @@ -133,6 +134,7 @@ func (s *PlayerStageState) NewStateFromInputs(inputs []*ClientUpdate, tickToSimu // TODO bullets are impacting the past // TODO Then replay, since bullets should be working again // TODO: Finally, handle death and revival using deathState + // TODO: Use sort of the inputs to reduce the number of iterations ffi.DestroyBullet(b) return true