This commit is contained in:
Anuken
2019-08-22 17:37:16 -04:00
parent d97fe47206
commit 04b4aabcf6
3 changed files with 9 additions and 3 deletions

View File

@ -63,7 +63,7 @@ public class SteamNetImpl implements SteamNetworkingCallback, SteamMatchmakingCa
}else{
Log.err("Unknown user with ID: {0}", fromID);
}
}else if(Net.client() && currentServer != null && fromID == currentServer.getAccountID()){
}else if(currentServer != null && fromID == currentServer.getAccountID()){
Core.app.post(() -> Net.handleClientReceived(output));
}
});
@ -205,6 +205,7 @@ public class SteamNetImpl implements SteamNetworkingCallback, SteamMatchmakingCa
Connect con = new Connect();
con.addressTCP = "steam:" + currentServer.getAccountID();
Net.setClientConnected();
Net.handleClientReceived(con);
Log.info("enter lobby {0} {1}", steamIDLobby.getAccountID(), response);
}
@ -283,7 +284,7 @@ public class SteamNetImpl implements SteamNetworkingCallback, SteamMatchmakingCa
@Override
public void onP2PSessionRequest(SteamID steamIDRemote){
Log.info("Connection request: {0}", steamIDRemote.getAccountID());
if(Net.client()){
if(currentServer != null && !Net.server()){
Log.info("Am client");
if(steamIDRemote == currentServer){
snet.acceptP2PSessionWithUser(steamIDRemote);