예제 #1
0
 public void JoinCallback(string secret)
 {
     Log.Info("[Discord] Joining Server");
     if (SceneManager.GetActiveScene().name == "StartScreen")
     {
         string[] splitSecret = secret.Split(':');
         string   ip          = splitSecret[0];
         string   port        = splitSecret[1];
         MainMenuMultiplayerPanel.OpenJoinServerMenu(ip, port);
     }
     else
     {
         Log.InGame("Please enter the multiplayer-main-menu if you want to join a session.");
         Log.Warn("[Discord] Warn: Can't join a server outside of the main-menu.");
     }
 }
예제 #2
0
    private void ActivityJoin(string secret)
    {
        Log.Info("[Discord] Joining Server");
        if (SceneManager.GetActiveScene().name != "StartScreen" || !MainMenuMultiplayerPanel.Main)
        {
            Log.InGame("Please press on the \"Multiplayer\" in the MainMenu if you want to join a session.");
            Log.Warn("[Discord] Can't join a server outside of the main-menu.");
            return;
        }

        string[] splitSecret = secret.Split(':');
        string   ip          = string.Join(":", splitSecret.Take(splitSecret.Length - 1));
        string   port        = splitSecret.Last();

        MainMenuMultiplayerPanel.OpenJoinServerMenu(ip, port);
    }