Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
This commit is contained in:
@@ -568,6 +568,38 @@ public class NetServer implements ApplicationListener{
|
||||
player.con.hasDisconnected = true;
|
||||
}
|
||||
|
||||
//these functions are for debugging only, and will be removed!
|
||||
|
||||
@Remote(targets = Loc.client, variants = Variant.one)
|
||||
public static void requestDebugStatus(Player player){
|
||||
int flags =
|
||||
(player.con.hasDisconnected ? 1 : 0) |
|
||||
(player.con.hasConnected ? 2 : 0) |
|
||||
(player.isAdded() ? 4 : 0) |
|
||||
(player.con.hasBegunConnecting ? 8 : 0);
|
||||
|
||||
Call.debugStatusClient(player.con, flags, player.con.lastReceivedClientSnapshot, player.con.snapshotsSent);
|
||||
Call.debugStatusClientUnreliable(player.con, flags, player.con.lastReceivedClientSnapshot, player.con.snapshotsSent);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both, priority = PacketPriority.high)
|
||||
public static void debugStatusClient(int value, int lastClientSnapshot, int snapshotsSent){
|
||||
logClientStatus(true, value, lastClientSnapshot, snapshotsSent);
|
||||
}
|
||||
|
||||
@Remote(variants = Variant.both, priority = PacketPriority.high, unreliable = true)
|
||||
public static void debugStatusClientUnreliable(int value, int lastClientSnapshot, int snapshotsSent){
|
||||
logClientStatus(false, value, lastClientSnapshot, snapshotsSent);
|
||||
}
|
||||
|
||||
static void logClientStatus(boolean reliable, int value, int lastClientSnapshot, int snapshotsSent){
|
||||
Log.info("@ Debug status received. disconnected = @, connected = @, added = @, begunConnecting = @ lastClientSnapshot = @, snapshotsSent = @",
|
||||
reliable ? "[RELIABLE]" : "[UNRELIABLE]",
|
||||
(value & 1) != 0, (value & 2) != 0, (value & 4) != 0, (value & 8) != 0,
|
||||
lastClientSnapshot, snapshotsSent
|
||||
);
|
||||
}
|
||||
|
||||
@Remote(targets = Loc.client)
|
||||
public static void serverPacketReliable(Player player, String type, String contents){
|
||||
if(netServer.customPacketHandlers.containsKey(type)){
|
||||
@@ -931,6 +963,7 @@ public class NetServer implements ApplicationListener{
|
||||
Call.entitySnapshot(player.con, (short)sent, syncStream.toByteArray());
|
||||
}
|
||||
|
||||
player.con.snapshotsSent ++;
|
||||
}
|
||||
|
||||
String fixName(String name){
|
||||
|
||||
@@ -22,6 +22,8 @@ public abstract class NetConnection{
|
||||
public long connectTime = Time.millis();
|
||||
/** ID of last received client snapshot. */
|
||||
public int lastReceivedClientSnapshot = -1;
|
||||
/** Count of snapshots sent from server. */
|
||||
public int snapshotsSent;
|
||||
/** Timestamp of last received snapshot. */
|
||||
public long lastReceivedClientTime;
|
||||
/** Build requests that have been recently rejected. This is cleared every snapshot. */
|
||||
|
||||
@@ -41,7 +41,8 @@ public class LanguageDialog extends BaseDialog{
|
||||
"be", "Беларуская",
|
||||
"bg", "Български",
|
||||
"ru", "Русский",
|
||||
"uk_UA", "Українська (Україна)",
|
||||
"sr", "Српски",
|
||||
"uk_UA", "Українська",
|
||||
"th", "ไทย",
|
||||
"zh_CN", "简体中文",
|
||||
"zh_TW", "正體中文",
|
||||
|
||||
@@ -169,7 +169,7 @@ public class Drill extends Block{
|
||||
return new TextureRegion[]{region, rotatorRegion, topRegion};
|
||||
}
|
||||
|
||||
void countOre(Tile tile){
|
||||
protected void countOre(Tile tile){
|
||||
returnItem = null;
|
||||
returnCount = 0;
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ public enum StatUnit{
|
||||
degrees,
|
||||
seconds,
|
||||
minutes,
|
||||
perSecond,
|
||||
perMinute,
|
||||
perSecond(false),
|
||||
perMinute(false),
|
||||
perShot(false),
|
||||
timesSpeed(false),
|
||||
percent(false),
|
||||
|
||||
@@ -342,7 +342,7 @@ public class StatValues{
|
||||
}
|
||||
|
||||
if(type.status != StatusEffects.none){
|
||||
sep(bt, (type.minfo.mod == null ? type.status.emoji() : "") + "[stat]" + type.status.localizedName);
|
||||
sep(bt, (type.status.minfo.mod == null ? type.status.emoji() : "") + "[stat]" + type.status.localizedName);
|
||||
}
|
||||
|
||||
if(type.fragBullet != null){
|
||||
|
||||
Reference in New Issue
Block a user