Partial 7.0 merge - API preview
This commit is contained in:
@@ -5,7 +5,6 @@ import arc.util.*;
|
||||
import mindustry.entities.units.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.net.Administration.*;
|
||||
import mindustry.net.Net.*;
|
||||
import mindustry.net.Packets.*;
|
||||
|
||||
import java.io.*;
|
||||
@@ -40,7 +39,7 @@ public abstract class NetConnection{
|
||||
public void kick(KickReason reason){
|
||||
if(kicked) return;
|
||||
|
||||
Log.info("Kicking connection @; Reason: @", address, reason.name());
|
||||
Log.info("Kicking connection @ / @; Reason: @", address, uuid, reason.name());
|
||||
|
||||
if((reason == KickReason.kick || reason == KickReason.banned || reason == KickReason.vote)){
|
||||
PlayerInfo info = netServer.admins.getInfo(uuid);
|
||||
@@ -65,7 +64,7 @@ public abstract class NetConnection{
|
||||
public void kick(String reason, long kickDuration){
|
||||
if(kicked) return;
|
||||
|
||||
Log.info("Kicking connection @; Reason: @", address, reason.replace("\n", " "));
|
||||
Log.info("Kicking connection @ / @; Reason: @", address, uuid, reason.replace("\n", " "));
|
||||
|
||||
netServer.admins.handleKicked(uuid, address, kickDuration);
|
||||
|
||||
@@ -86,8 +85,8 @@ public abstract class NetConnection{
|
||||
int cid;
|
||||
StreamBegin begin = new StreamBegin();
|
||||
begin.total = stream.stream.available();
|
||||
begin.type = Registrator.getID(stream.getClass());
|
||||
send(begin, SendMode.tcp);
|
||||
begin.type = Net.getPacketId(stream);
|
||||
send(begin, true);
|
||||
cid = begin.id;
|
||||
|
||||
while(stream.stream.available() > 0){
|
||||
@@ -97,14 +96,14 @@ public abstract class NetConnection{
|
||||
StreamChunk chunk = new StreamChunk();
|
||||
chunk.id = cid;
|
||||
chunk.data = bytes;
|
||||
send(chunk, SendMode.tcp);
|
||||
send(chunk, true);
|
||||
}
|
||||
}catch(IOException e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void send(Object object, SendMode mode);
|
||||
public abstract void send(Object object, boolean reliable);
|
||||
|
||||
public abstract void close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user