private void MyGameService_OnPingServerResponded(object sender, MyGameServerItem e) { MyGameService.OnPingServerResponded -= MyGameService_OnPingServerResponded; MyGameService.OnPingServerFailedToRespond -= MyGameService_OnPingServerFailedToRespond; SeamlessClient.TryShow("ServerPing Successful! Attempting to connect to lobby: " + e.GameID); LoadServer.LoadWorldData(e, WorldRequest.DeserializeWorldData()); MySandboxGame.Static.Invoke(delegate { StringBuilder Builder = new StringBuilder(); Builder.AppendLine("Please be patient! Some users can spend a minute switching servers... others may be able to swtich faster. Lots of factors to consider."); Builder.AppendLine(); Builder.AppendLine("Sitting in spectator is perfectly normal for a few seconds!"); MyAPIGateway.Utilities.ShowMissionScreen("Switching Servers!", null, null, Builder.ToString(), null, "Ok!"); //MySessionLoader.UnloadAndExitToMenu(); UnloadCurrentServer(); //MyJoinGameHelper.JoinGame(e, true); LoadServer.ResetMPClient(); ClearEntities(); //ReloadPatch.SeamlessSwitch = false; }, "SeamlessClient"); return; }
void ServerResponded(object sender, MyGameServerItem serverItem) { //CloseHandlers(); //m_progressScreen.CloseScreen(); MyLocalCache.SaveLastSessionInfo(null, true, false, serverItem.Name, serverItem.ConnectionString); MyJoinGameHelper.JoinGame(serverItem); }
private static void PingResponded(object sender, MyGameServerItem e) { //If server ping was successful we need to begin the switching proccess UnRegisterEvents(); SeamlessClient.TryShow($"{e.Name} was successfully pinged!"); SwitchServers Switcher = new SwitchServers(e, Request.DeserializeWorldData()); Switcher.BeginSwitch(); // LoadServer.LoadWorldData(e, Request.DeserializeWorldData()); }
internal MyMultiplayerClient(MyGameServerItem server, MySyncLayer syncLayer) : base(syncLayer) { this.m_members = new List <ulong>(); this.m_memberData = new Dictionary <ulong, MyMultiplayerBase.MyConnectedClientData>(); this.m_mods = new List <MyObjectBuilder_Checkpoint.ModItem>(); base.SyncLayer.RegisterClientEvents(this); base.SyncLayer.TransportLayer.IsBuffering = true; this.Server = server; base.ServerId = server.SteamID; base.ClientLeft += new Action <ulong, MyChatMemberStateChangeEnum>(this.MyMultiplayerClient_ClientLeft); syncLayer.TransportLayer.Register(MyMessageId.JOIN_RESULT, 0, new Action <MyPacket>(this.OnJoinResult)); syncLayer.TransportLayer.Register(MyMessageId.WORLD_DATA, 0, new Action <MyPacket>(this.OnWorldData)); syncLayer.TransportLayer.Register(MyMessageId.CLIENT_CONNNECTED, 0, new Action <MyPacket>(this.OnClientConnected)); base.ClientJoined += new Action <ulong>(this.MyMultiplayerClient_ClientJoined); base.HostLeft += new Action(this.MyMultiplayerClient_HostLeft); MyGameService.Peer2Peer.ConnectionFailed += new Action <ulong, string>(this.Peer2Peer_ConnectionFailed); MyGameService.Peer2Peer.SessionRequest += new Action <ulong>(this.Peer2Peer_SessionRequest); }
public static void LoadWorldData(MyGameServerItem TargetServer, MyObjectBuilder_World TargetWorld) { Server = TargetServer; World = TargetWorld; }
private static void ServerResponded(object sender, MyGameServerItem serverItem) { CloseHandlers(); m_progressScreen.CloseScreen(); MyJoinGameHelper.JoinGame(serverItem, true); }
public static void SuffixServerResponded(MyGameServerItem serverItem) { }
public SwitchServers(MyGameServerItem TargetServer, MyObjectBuilder_World TargetWorld) { this.TargetServer = TargetServer; this.TargetWorld = TargetWorld; }