fix: catch more edge cases
This commit is contained in:
parent
5eedbf2f1e
commit
b9a7a1c479
4 changed files with 28 additions and 25 deletions
|
|
@ -8,10 +8,17 @@ public class GBSUClient : MonoBehaviour
|
|||
{
|
||||
public static void JoinServer(string serverip, int serverport)
|
||||
{
|
||||
LobbyManager.Instance.LobbyStates.IP = serverip;
|
||||
LobbyManager.Instance.LobbyStates.Port = serverport;
|
||||
LobbyManager.Instance.LobbyStates.CurrentState = LobbyState.State.Ready | LobbyState.State.InGame;
|
||||
LobbyManager.Instance.LocalBeasts.SetupNetMemberContext(true);
|
||||
MonoSingleton<Global>.Instance.UNetManager.LaunchClient(serverip, serverport);
|
||||
if (!Helper.hosting)
|
||||
{
|
||||
LobbyManager.Instance.LobbyStates.IP = serverip;
|
||||
LobbyManager.Instance.LobbyStates.Port = serverport;
|
||||
LobbyManager.Instance.LobbyStates.CurrentState = LobbyState.State.Ready | LobbyState.State.InGame;
|
||||
LobbyManager.Instance.LocalBeasts.SetupNetMemberContext(true);
|
||||
MonoSingleton<Global>.Instance.UNetManager.LaunchClient(serverip, serverport);
|
||||
}
|
||||
else
|
||||
{
|
||||
GBSUGui.PushError("You are currently hosting a game! Please stop your server before attempting to join.");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue