Fixed some GWT bugs and errors

This commit is contained in:
Anuken
2018-02-26 23:31:29 -05:00
parent bbe3115186
commit 828dd78611
6 changed files with 10 additions and 7 deletions

View File

@ -1,7 +1,7 @@
#Autogenerated file. Do not modify. #Autogenerated file. Do not modify.
#Mon Feb 26 22:08:54 EST 2018 #Mon Feb 26 23:26:06 EST 2018
version=release version=release
androidBuildCode=306 androidBuildCode=308
name=Mindustry name=Mindustry
code=3.4 code=3.4
build=29 build=29

View File

@ -15,4 +15,5 @@
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.net.Packet" /> <extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.net.Packet" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.net.Streamable" /> <extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.net.Streamable" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.world.BlockBar" /> <extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.world.BlockBar" />
<extend-configuration-property name="gdx.reflect.include" value="com.badlogic.gdx.utils.Predicate" />
</module> </module>

View File

@ -23,6 +23,8 @@ public class AdminsDialog extends FloatingDialog {
private void setup(){ private void setup(){
content().clear(); content().clear();
if(gwt) return;
float w = 400f, h = 80f; float w = 400f, h = 80f;
Table table = new Table(); Table table = new Table();

View File

@ -20,6 +20,8 @@ public class BansDialog extends FloatingDialog {
private void setup(){ private void setup(){
content().clear(); content().clear();
if(gwt) return;
float w = 400f, h = 80f; float w = 400f, h = 80f;
Table table = new Table(); Table table = new Table();

View File

@ -87,7 +87,7 @@ public class PlayerListFragment implements Fragment{
float h = 74f; float h = 74f;
for(Player player : playerGroup.all()){ for(Player player : playerGroup.all()){
NetConnection connection = Net.getConnection(player.clientid); NetConnection connection = gwt ? null : Net.getConnection(player.clientid);
if(connection == null && Net.server() && !player.isLocal) continue; if(connection == null && Net.server() && !player.isLocal) continue;
@ -162,7 +162,7 @@ public class PlayerListFragment implements Fragment{
}); });
} }
}).update(b ->{ }).update(b ->{
b.setChecked(connection != null && netServer.admins.isAdmin(connection.address)); b.setChecked(player.isAdmin);
b.setDisabled(Net.client()); b.setDisabled(Net.client());
}).get().setTouchable(() -> Net.client() ? Touchable.disabled : Touchable.enabled); }).get().setTouchable(() -> Net.client() ? Touchable.disabled : Touchable.enabled);

View File

@ -404,8 +404,6 @@ public class KryoServer implements ServerProvider {
} }
class SocketServer extends WebSocketServer { class SocketServer extends WebSocketServer {
public SocketServer(int port) { public SocketServer(int port) {
@ -415,7 +413,7 @@ public class KryoServer implements ServerProvider {
@Override @Override
public void onOpen(WebSocket conn, ClientHandshake handshake) { public void onOpen(WebSocket conn, ClientHandshake handshake) {
Connect connect = new Connect(); Connect connect = new Connect();
connect.addressTCP = conn.getRemoteSocketAddress().toString(); connect.addressTCP = conn.getRemoteSocketAddress().getAddress().getHostAddress();
KryoConnection kn = new KryoConnection(lastconnection ++, connect.addressTCP, conn); KryoConnection kn = new KryoConnection(lastconnection ++, connect.addressTCP, conn);
Log.info("&bRecieved web connection: {0} {1}", kn.id, connect.addressTCP); Log.info("&bRecieved web connection: {0} {1}", kn.id, connect.addressTCP);