mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
somewhat better maybe?
This commit is contained in:
parent
44cd5011e3
commit
ba45a88fbe
2 changed files with 14 additions and 4 deletions
|
|
@ -1793,6 +1793,10 @@ class Marble extends GameObject {
|
||||||
} else {
|
} else {
|
||||||
this.level.pickUpPowerUp(cast this, this.level.powerUps[p.powerUpId]);
|
this.level.pickUpPowerUp(cast this, this.level.powerUps[p.powerUpId]);
|
||||||
}
|
}
|
||||||
|
if (p.moveQueueSize == 0 && this.connection != null) {
|
||||||
|
// Pad null move on client
|
||||||
|
this.connection.moveManager.duplicateLastMove();
|
||||||
|
}
|
||||||
|
|
||||||
// if (this.controllable && Net.isClient) {
|
// if (this.controllable && Net.isClient) {
|
||||||
// // We are client, need to do something about the queue
|
// // We are client, need to do something about the queue
|
||||||
|
|
|
||||||
|
|
@ -47,12 +47,12 @@ class MoveManager {
|
||||||
var maxMoves = 45;
|
var maxMoves = 45;
|
||||||
var maxSendMoveListSize = 30;
|
var maxSendMoveListSize = 30;
|
||||||
|
|
||||||
var serverTargetMoveListSize = 3;
|
var serverTargetMoveListSize = 4;
|
||||||
var serverMaxMoveListSize = 8;
|
var serverMaxMoveListSize = 16;
|
||||||
var serverAvgMoveListSize = 3.0;
|
var serverAvgMoveListSize = 4.0;
|
||||||
var serverSmoothMoveAvg = 0.15;
|
var serverSmoothMoveAvg = 0.15;
|
||||||
var serverMoveListSizeSlack = 1.5;
|
var serverMoveListSizeSlack = 1.5;
|
||||||
var serverDefaultMinTargetMoveListSize = 3;
|
var serverDefaultMinTargetMoveListSize = 4;
|
||||||
var serverAbnormalMoveCount = 0;
|
var serverAbnormalMoveCount = 0;
|
||||||
var serverLastRecvMove = 0;
|
var serverLastRecvMove = 0;
|
||||||
var serverLastAckMove = 0;
|
var serverLastAckMove = 0;
|
||||||
|
|
@ -144,6 +144,12 @@ class MoveManager {
|
||||||
queuedMoves[to].motionDir.load(queuedMoves[from].motionDir);
|
queuedMoves[to].motionDir.load(queuedMoves[from].motionDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public inline function duplicateLastMove() {
|
||||||
|
if (queuedMoves.length == 0)
|
||||||
|
return;
|
||||||
|
queuedMoves.insert(0, queuedMoves[0]);
|
||||||
|
}
|
||||||
|
|
||||||
public static inline function packMove(m:NetMove, b:OutputBitStream) {
|
public static inline function packMove(m:NetMove, b:OutputBitStream) {
|
||||||
b.writeUInt16(m.id);
|
b.writeUInt16(m.id);
|
||||||
b.writeByte(Std.int((m.move.d.x * 16) + 16));
|
b.writeByte(Std.int((m.move.d.x * 16) + 16));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue