Steam kick bugfixes
This commit is contained in:
@@ -230,8 +230,7 @@ public class Pathfinder implements Runnable{
|
|||||||
for(Flowfield path : mainList){
|
for(Flowfield path : mainList){
|
||||||
if(path != null){
|
if(path != null){
|
||||||
synchronized(path.targets){
|
synchronized(path.targets){
|
||||||
path.targets.clear();
|
path.updateTargetPositions();
|
||||||
path.getPositions(path.targets);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -312,8 +311,7 @@ public class Pathfinder implements Runnable{
|
|||||||
synchronized(path.targets){
|
synchronized(path.targets){
|
||||||
//make sure the position actually changed
|
//make sure the position actually changed
|
||||||
if(!(path.targets.size == 1 && tmpArray.size == 1 && path.targets.first() == tmpArray.first())){
|
if(!(path.targets.size == 1 && tmpArray.size == 1 && path.targets.first() == tmpArray.first())){
|
||||||
path.targets.clear();
|
path.updateTargetPositions();
|
||||||
path.getPositions(path.targets);
|
|
||||||
|
|
||||||
//queue an update
|
//queue an update
|
||||||
queue.post(() -> updateTargets(path));
|
queue.post(() -> updateTargets(path));
|
||||||
@@ -367,8 +365,7 @@ public class Pathfinder implements Runnable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void preloadPath(Flowfield path){
|
private void preloadPath(Flowfield path){
|
||||||
path.targets.clear();
|
path.updateTargetPositions();
|
||||||
path.getPositions(path.targets);
|
|
||||||
registerPath(path);
|
registerPath(path);
|
||||||
updateFrontier(path, -1);
|
updateFrontier(path, -1);
|
||||||
}
|
}
|
||||||
@@ -493,10 +490,10 @@ public class Pathfinder implements Runnable{
|
|||||||
protected Team team = Team.derelict;
|
protected Team team = Team.derelict;
|
||||||
/** Function for calculating path cost. Set before using. */
|
/** Function for calculating path cost. Set before using. */
|
||||||
protected PathCost cost = costTypes.get(costGround);
|
protected PathCost cost = costTypes.get(costGround);
|
||||||
/** If true, this flow field needs updating. This flag is only set to false once the flow field finishes and the weights are copied over. */
|
|
||||||
protected boolean dirty = false;
|
|
||||||
/** Whether there are valid weights in the complete array. */
|
/** Whether there are valid weights in the complete array. */
|
||||||
protected volatile boolean hasComplete;
|
protected volatile boolean hasComplete;
|
||||||
|
/** If true, this flow field needs updating. This flag is only set to false once the flow field finishes and the weights are copied over. */
|
||||||
|
protected boolean dirty = false;
|
||||||
|
|
||||||
/** costs of getting to a specific tile */
|
/** costs of getting to a specific tile */
|
||||||
public int[] weights;
|
public int[] weights;
|
||||||
@@ -524,6 +521,11 @@ public class Pathfinder implements Runnable{
|
|||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void updateTargetPositions(){
|
||||||
|
targets.clear();
|
||||||
|
getPositions(targets);
|
||||||
|
}
|
||||||
|
|
||||||
protected boolean passable(int pos){
|
protected boolean passable(int pos){
|
||||||
return cost.getCost(team.id, pathfinder.tiles[pos]) != impassable;
|
return cost.getCost(team.id, pathfinder.tiles[pos]) != impassable;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,19 @@ public class InverseKinematics{
|
|||||||
return solve(lengthA, lengthB, end, at1, result);
|
return solve(lengthA, lengthB, end, at1, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
inputs:
|
||||||
|
|
||||||
|
@param lengthA first line segment length
|
||||||
|
@param lengthB second line segment length
|
||||||
|
@param end length of the endpoint you want to reach
|
||||||
|
@param attractor direction you want the result to be closer to (since there are usually 2 solutions)
|
||||||
|
|
||||||
|
output:
|
||||||
|
|
||||||
|
@param result a point in-between (0, 0) and (end) such that (0, 0).dst(result) == lengthA and result.dst(end) == lengthB - or in basic terms, the position of a joint between (0, 0) and end where the two lengths of segments are lengthA and lengthB
|
||||||
|
@return whether IK succeeded (this can fail if end is too far, for example)
|
||||||
|
*/
|
||||||
public static boolean solve(float lengthA, float lengthB, Vec2 end, Vec2 attractor, Vec2 result){
|
public static boolean solve(float lengthA, float lengthB, Vec2 end, Vec2 attractor, Vec2 result){
|
||||||
Vec2 axis = mat2[0].set(end).nor();
|
Vec2 axis = mat2[0].set(end).nor();
|
||||||
mat2[1].set(attractor).sub(temp2.set(axis).scl(attractor.dot(axis))).nor();
|
mat2[1].set(attractor).sub(temp2.set(axis).scl(attractor.dot(axis))).nor();
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ public class BeControl{
|
|||||||
Log.info("&lcAutosaved.");
|
Log.info("&lcAutosaved.");
|
||||||
|
|
||||||
netServer.kickAll(KickReason.serverRestarting);
|
netServer.kickAll(KickReason.serverRestarting);
|
||||||
Threads.sleep(32);
|
Threads.sleep(500);
|
||||||
|
|
||||||
Log.info("&lcVersion downloaded, exiting. Note that if you are not using a auto-restart script, the server will not restart automatically.");
|
Log.info("&lcVersion downloaded, exiting. Note that if you are not using a auto-restart script, the server will not restart automatically.");
|
||||||
//replace old file with new
|
//replace old file with new
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package mindustry.net;
|
package mindustry.net;
|
||||||
|
|
||||||
|
import arc.*;
|
||||||
import arc.struct.*;
|
import arc.struct.*;
|
||||||
import arc.util.*;
|
import arc.util.*;
|
||||||
import mindustry.entities.units.*;
|
import mindustry.entities.units.*;
|
||||||
@@ -76,7 +77,12 @@ public abstract class NetConnection{
|
|||||||
Call.kick(this, reason);
|
Call.kick(this, reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
close();
|
if(uuid.startsWith("steam:")){
|
||||||
|
//run with a 2-frame delay so there is time to send the kick packet, steam handles this weirdly
|
||||||
|
Core.app.post(() -> Core.app.post(this::close));
|
||||||
|
}else{
|
||||||
|
close();
|
||||||
|
}
|
||||||
|
|
||||||
netServer.admins.save();
|
netServer.admins.save();
|
||||||
kicked = true;
|
kicked = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user