mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-06 16:27:25 +07:00
Merge remote-tracking branch 'origin/steam' into steam
This commit is contained in:
@ -334,7 +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");
|
Log.info("> connect confirmation. net status: client={0} server={1}", Net.client(), Net.server());
|
||||||
Core.app.post(() -> ui.loadfrag.hide());
|
Core.app.post(() -> ui.loadfrag.hide());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -91,6 +91,11 @@ public class Net{
|
|||||||
packetQueue.clear();
|
packetQueue.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setClientConnected(){
|
||||||
|
active = true;
|
||||||
|
server = false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connect to an address.
|
* Connect to an address.
|
||||||
*/
|
*/
|
||||||
|
@ -203,6 +203,7 @@ public class SteamNetImpl implements SteamNetworkingCallback, SteamMatchmakingCa
|
|||||||
Connect con = new Connect();
|
Connect con = new Connect();
|
||||||
con.addressTCP = "steam:" + currentServer.getAccountID();
|
con.addressTCP = "steam:" + currentServer.getAccountID();
|
||||||
|
|
||||||
|
Net.setClientConnected();
|
||||||
Net.handleClientReceived(con);
|
Net.handleClientReceived(con);
|
||||||
Log.info("enter lobby {0} {1}", steamIDLobby.getAccountID(), response);
|
Log.info("enter lobby {0} {1}", steamIDLobby.getAccountID(), response);
|
||||||
}
|
}
|
||||||
@ -281,7 +282,7 @@ public class SteamNetImpl implements SteamNetworkingCallback, SteamMatchmakingCa
|
|||||||
@Override
|
@Override
|
||||||
public void onP2PSessionRequest(SteamID steamIDRemote){
|
public void onP2PSessionRequest(SteamID steamIDRemote){
|
||||||
Log.info("Connection request: {0}", steamIDRemote.getAccountID());
|
Log.info("Connection request: {0}", steamIDRemote.getAccountID());
|
||||||
if(Net.client()){
|
if(currentServer != null && !Net.server()){
|
||||||
Log.info("Am client");
|
Log.info("Am client");
|
||||||
if(steamIDRemote == currentServer){
|
if(steamIDRemote == currentServer){
|
||||||
snet.acceptP2PSessionWithUser(steamIDRemote);
|
snet.acceptP2PSessionWithUser(steamIDRemote);
|
||||||
|
Reference in New Issue
Block a user