chuck.js/app/Game/Client/Me.js
Jeena d39a55e20e Remove server reconciliation in favor of pure client prediction
The reconciliation system caused visible teleportation at high latency
(e.g. 250ms Germany→Korea): position corrections snapped the local
player and thrown items back to stale server states.

- Drop the inputAck/seq tracking, InputBuffer, and applyReconciliation.
  The client predicts locally and the server stays authoritative via
  the existing worldUpdate broadcast; own-doll updates remain ignored.
- Override Item.setUpdateData on the client so in-flight items run free
  on local Box2D physics (client and server share the same throw
  impulse) and only sync when stationary or far out of sync. This keeps
  grab-sensor contact accurate while eliminating mid-flight snapping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-28 23:35:22 +00:00

74 lines
No EOL
1.7 KiB
JavaScript

define([
"Game/Client/Player",
"Game/Config/Settings",
"Lib/Utilities/NotificationCenter",
"Lib/Utilities/Assert",
"Game/Client/Control/PlayerController",
],
function (Parent, Settings, nc, Assert, PlayerController) {
"use strict";
function Me(id, physicsEngine, user) {
Parent.call(this, id, physicsEngine, user);
// View uses this to calculate center position
this.lookAtXY = {
x: Settings.VIEWPORT_LOOK_AHEAD,
y: 0
};
this.arrowMesh = null;
this.createAndAddArrow();
this.playerController = new PlayerController(this);
}
Me.prototype = Object.create(Parent.prototype);
Me.prototype.lookAt = function(x, y) {
this.lookAtXY = {
x: x,
y: y
};
Parent.prototype.lookAt.call(this, x, y);
};
Me.prototype.getLookAt = function() {
return {
x: this.lookAtXY.x,
y: this.lookAtXY.y
};
};
Me.prototype.createAndAddArrow = function() {
var self = this;
var position = this.getPosition();
var options = {
x: position.x * Settings.RATIO,
y: position.y * Settings.RATIO,
};
var callback = function(arrowMesh) {
self.arrowMesh = arrowMesh;
};
nc.trigger(nc.ns.client.view.playerArrow.createAndAdd, callback, options);
};
Me.prototype.render = function() {
Parent.prototype.render.call(this);
var position = this.getPosition();
var options = {
x: position.x * Settings.RATIO,
y: position.y * Settings.RATIO,
};
nc.trigger(nc.ns.client.view.playerArrow.update, this.arrowMesh, options);
};
return Me;
});