Private
Public Access
Integrate shared physics engine for player movement and collision handling, refine 20 TPS gameplay logic, and enhance client prediction with server-reconciliation updates.
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m51s
Dynamic Branch Deploy / build-and-deploy (push) Successful in 7m51s
This commit is contained in:
1 parent
23d42d42e7
commit
023996229a
13 files changed
+685
-251
No files matched your search
@@ -88,9 +88,17 @@ func (g *Game) wsReadPump() {
|
||||
// Out-of-Order-Erkennung: Ignoriere alte Updates
|
||||
if state.Sequence > 0 && state.Sequence <= g.lastRecvSeq {
|
||||
// Alte Nachricht - ignorieren
|
||||
g.outOfOrderCount++
|
||||
continue
|
||||
}
|
||||
g.lastRecvSeq = state.Sequence
|
||||
g.totalUpdates++
|
||||
g.lastUpdateTime = time.Now()
|
||||
|
||||
// Aktualisiere CurrentSpeed für Client-Prediction
|
||||
g.predictionMutex.Lock()
|
||||
g.currentSpeed = state.CurrentSpeed
|
||||
g.predictionMutex.Unlock()
|
||||
|
||||
// Server Reconciliation für lokalen Spieler (VOR dem Lock)
|
||||
for _, p := range state.Players {
|
||||
|
||||
Reference in new issue
Block a user