Exemple #1
0
        private void joinServer(string code, string ip = "na")
        {
            Monitor.Log("Joining server.. ", LogLevel.Info);

            if (!config.UseIP || ip == null || ip == "na")
            {
                object lobbyFromInviteCode = Program.sdk.Networking.GetLobbyFromInviteCode(code);
                if (lobbyFromInviteCode == null)
                {
                    Monitor.Log("Server isn't available", LogLevel.Error);
                    return;
                }
                Game1.activeClickableMenu = new FarmhandMenu(Program.sdk.Networking.CreateClient(lobbyFromInviteCode));
            }
            else
            {
                Multiplayer multiplayer = (Multiplayer)typeof(Game1).GetField("multiplayer", BindingFlags.NonPublic | BindingFlags.Static).GetValue(null);
                Game1.activeClickableMenu = new FarmhandMenu(multiplayer.InitClient(new LidgrenClient(code)));
            }
        }
 public override Client InitClient(Client client)
 {
     return(intercepted.InitClient(client));
 }