Ejemplo n.º 1
0
 private void onGalaxyLobbyEnter(GalaxyID lobbyID, LobbyEnterResult result)
 {
     connectingLobbyID = null;
     if (result != 0)
     {
         return;
     }
     Console.WriteLine("Lobby entered: {0}", lobbyID.ToUint64());
     lobby      = lobbyID;
     lobbyOwner = GalaxyInstance.Matchmaking().GetLobbyOwner(lobbyID);
     if (Game1.chatBox != null)
     {
         string invite_code_string = "";
         if (Program.sdk.Networking != null && Program.sdk.Networking.SupportsInviteCodes())
         {
             invite_code_string = Game1.content.LoadString("Strings\\UI:Chat_LobbyJoined_InviteCode", GetInviteCode());
         }
         if (isRecreatedLobby)
         {
             Game1.chatBox.addInfoMessage(Game1.content.LoadString("Strings\\UI:Chat_LobbyRecreated", invite_code_string).Trim());
         }
         else
         {
             Game1.chatBox.addInfoMessage(Game1.content.LoadString("Strings\\UI:Chat_LobbyJoined", invite_code_string).Trim());
         }
     }
     if (lobbyOwner == selfId)
     {
         foreach (KeyValuePair <string, string> pair in lobbyData)
         {
             GalaxyInstance.Matchmaking().SetLobbyData(lobby, pair.Key, pair.Value);
         }
         updateLobbyPrivacy();
     }
 }
Ejemplo n.º 2
0
 public static void Postfix(GalaxyID lobbyID, LobbyEnterResult result)
 {
     if (result == LobbyEnterResult.LOBBY_ENTER_RESULT_SUCCESS)
     {
         ModEntry.CurrentCreatedLobby = lobbyID;
         ServerMetaData.InnitServer(lobbyID);
     }
     else
     {
         Console.WriteLine("Failed to create galaxy lobby: " + result);
     }
 }
Ejemplo n.º 3
0
 private void onGalaxyLobbyEnter(GalaxyID lobbyID, LobbyEnterResult result)
 {
     if (result == LobbyEnterResult.LOBBY_ENTER_RESULT_SUCCESS)
     {
         Console.WriteLine("Lobby entered: {0}", lobbyID.ToUint64());
         lobby      = lobbyID;
         lobbyOwner = GalaxyInstance.Matchmaking().GetLobbyOwner(lobbyID);
         if (lobbyOwner == selfId)
         {
             foreach (KeyValuePair <string, string> pair in lobbyData)
             {
                 GalaxyInstance.Matchmaking().SetLobbyData(lobby, pair.Key, pair.Value);
             }
             updateLobbyPrivacy();
         }
     }
 }
Ejemplo n.º 4
0
        public override void OnLobbyEntered(GalaxyID lobbyID, LobbyEnterResult _result)
        {
            switch (_result)
            {
            case LobbyEnterResult.LOBBY_ENTER_RESULT_SUCCESS:
                LobbyEntered(lobbyID);
                break;

            case LobbyEnterResult.LOBBY_ENTER_RESULT_LOBBY_DOES_NOT_EXIST:
                LobbyEnteringError("Lobby does not exist");
                break;

            case LobbyEnterResult.LOBBY_ENTER_RESULT_LOBBY_IS_FULL:
                LobbyEnteringError("Lobby is full");
                break;

            case LobbyEnterResult.LOBBY_ENTER_RESULT_ERROR:
                LobbyEnteringError("Unspecified error");
                break;
            }
        }
Ejemplo n.º 5
0
 public override void OnLobbyEntered(GalaxyID lobbyID, LobbyEnterResult _result)
 {
     if (_result != LobbyEnterResult.LOBBY_ENTER_RESULT_SUCCESS)
     {
         Debug.Log("LobbyEnteredListenerBrowsing failed");
         GameObject.Find("MainMenu").GetComponent <MainMenuController>().SwitchMenu(MainMenuController.MenuEnum.OnlineBrowser);
         GameObject.Find("PopUps").GetComponent <PopUps>().PopUpWithClosePopUpsButton("Could not join lobby\nReason: " +
                                                                                      _result.ToString(), "Back");
         return;
     }
     Debug.Log("LobbyEnteredListenerBrowsing succeded");
     matchmaking.CurrentLobbyID = lobbyID;
     matchmaking.LobbyOwnerID   = matchmaking.GetLobbyOwner(lobbyID);
     matchmaking.SetLobbyMemberData("state", "notReady");
     GameObject.Find("MainMenu").GetComponent <MainMenuController>().SwitchMenu(MainMenuController.MenuEnum.OnlineWait);
     friends.SetRichPresence("status", "In online lobby");
     friends.SetRichPresence("connect", "--JoinLobby=" + lobbyID);
     matchmaking.LobbyManagmentMainMenuListenersInit();
     matchmaking.LobbyChatListenersInit();
     matchmaking.LobbyBrowsingListenersDispose();
 }
Ejemplo n.º 6
0
 public override void OnLobbyEntered(GalaxyID lobbyID, LobbyEnterResult result)
 {
     callback(lobbyID, result);
 }