.
This commit is contained in:
@@ -334,6 +334,7 @@ public class NetClient implements ApplicationListener{
|
|||||||
Net.setClientLoaded(true);
|
Net.setClientLoaded(true);
|
||||||
Core.app.post(Call::connectConfirm);
|
Core.app.post(Call::connectConfirm);
|
||||||
Time.runTask(40f, Platform.instance::updateRPC);
|
Time.runTask(40f, Platform.instance::updateRPC);
|
||||||
|
Log.info("> connect confirmation");
|
||||||
Core.app.post(() -> ui.loadfrag.hide());
|
Core.app.post(() -> ui.loadfrag.hide());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import io.anuke.arc.backends.sdl.jni.*;
|
|||||||
import io.anuke.arc.collection.*;
|
import io.anuke.arc.collection.*;
|
||||||
import io.anuke.arc.files.*;
|
import io.anuke.arc.files.*;
|
||||||
import io.anuke.arc.function.*;
|
import io.anuke.arc.function.*;
|
||||||
|
import io.anuke.arc.scene.event.*;
|
||||||
import io.anuke.arc.scene.ui.*;
|
import io.anuke.arc.scene.ui.*;
|
||||||
import io.anuke.arc.util.*;
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.arc.util.Log.*;
|
import io.anuke.arc.util.Log.*;
|
||||||
@@ -51,6 +52,7 @@ public class DesktopPlatform extends Platform{
|
|||||||
Events.on(GameLoadEvent.class, event -> {
|
Events.on(GameLoadEvent.class, event -> {
|
||||||
Label[] label = {null};
|
Label[] label = {null};
|
||||||
Core.scene.table(t -> {
|
Core.scene.table(t -> {
|
||||||
|
t.touchable(Touchable.disabled);
|
||||||
t.top().left();
|
t.top().left();
|
||||||
t.update(t::toFront);
|
t.update(t::toFront);
|
||||||
t.table("guideDim", f -> {
|
t.table("guideDim", f -> {
|
||||||
|
|||||||
@@ -51,7 +51,9 @@ public class SteamNetImpl implements SteamNetworkingCallback, SteamMatchmakingCa
|
|||||||
snet.readP2PPacket(from, readBuffer, 0);
|
snet.readP2PPacket(from, readBuffer, 0);
|
||||||
int fromID = from.getAccountID();
|
int fromID = from.getAccountID();
|
||||||
Object output = serializer.read(readBuffer);
|
Object output = serializer.read(readBuffer);
|
||||||
|
if(Net.server()){
|
||||||
Log.info("Read {0} of length {1} from {2}", output, length, fromID);
|
Log.info("Read {0} of length {1} from {2}", output, length, fromID);
|
||||||
|
}
|
||||||
|
|
||||||
Core.app.post(() -> {
|
Core.app.post(() -> {
|
||||||
if(Net.server()){
|
if(Net.server()){
|
||||||
@@ -61,7 +63,7 @@ public class SteamNetImpl implements SteamNetworkingCallback, SteamMatchmakingCa
|
|||||||
}else{
|
}else{
|
||||||
Log.err("Unknown user with ID: {0}", fromID);
|
Log.err("Unknown user with ID: {0}", fromID);
|
||||||
}
|
}
|
||||||
}else if(fromID == currentServer.getAccountID()){
|
}else if(Net.client() && currentServer != null && fromID == currentServer.getAccountID()){
|
||||||
Core.app.post(() -> Net.handleClientReceived(output));
|
Core.app.post(() -> Net.handleClientReceived(output));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -361,7 +363,7 @@ public class SteamNetImpl implements SteamNetworkingCallback, SteamMatchmakingCa
|
|||||||
writeBuffer.position(0);
|
writeBuffer.position(0);
|
||||||
serializer.write(writeBuffer, object);
|
serializer.write(writeBuffer, object);
|
||||||
writeBuffer.flip();
|
writeBuffer.flip();
|
||||||
Log.info("Send {0} to {1} mode {2}", object, sid.getAccountID(), mode);
|
//Log.info("Send {0} to {1} mode {2}", object, sid.getAccountID(), mode);
|
||||||
|
|
||||||
snet.sendP2PPacket(sid, writeBuffer, mode == SendMode.tcp ? P2PSend.Reliable : P2PSend.UnreliableNoDelay, 0);
|
snet.sendP2PPacket(sid, writeBuffer, mode == SendMode.tcp ? P2PSend.Reliable : P2PSend.UnreliableNoDelay, 0);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
|||||||
Reference in New Issue
Block a user