less instant disconnect, more broken multiplayer
This commit is contained in:
@@ -633,7 +633,10 @@ public class NetServer implements ApplicationListener{
|
|||||||
}
|
}
|
||||||
|
|
||||||
//reset player to previous synced position so it gets interpolated
|
//reset player to previous synced position so it gets interpolated
|
||||||
unit.set(prevx, prevy);
|
//the server does not interpolate
|
||||||
|
if(!headless){
|
||||||
|
unit.set(prevx, prevy);
|
||||||
|
}
|
||||||
|
|
||||||
//write sync data to the buffer
|
//write sync data to the buffer
|
||||||
fbuffer.limit(20);
|
fbuffer.limit(20);
|
||||||
|
|||||||
@@ -127,12 +127,12 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I
|
|||||||
public void afterSync(){
|
public void afterSync(){
|
||||||
//set up type info after reading
|
//set up type info after reading
|
||||||
setStats(this.type);
|
setStats(this.type);
|
||||||
|
controller.unit(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterRead(){
|
public void afterRead(){
|
||||||
//set up type info after reading
|
afterSync();
|
||||||
setStats(this.type);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ public class AIController implements UnitController{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void unit(Unitc unit){
|
public void unit(Unitc unit){
|
||||||
|
if(this.unit == unit) return;
|
||||||
|
|
||||||
this.unit = unit;
|
this.unit = unit;
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user