public static void SendErrorOnCharacterCreation(NetState state, string message) { Console.WriteLine("Login: {0}: Character creation failed. {1}", state, message); if (Core.AOS) { state.Send(SupportedFeatures.Instantiate(state)); } state.Send(new CharacterList(state.Account, state.CityInfo)); state.Send(new AsciiMessage(Serial.MinusOne, -1, MessageType.Regular, 38, 0, "System", message)); }
public static void OldClient_OnCommand(CommandEventArgs e) { Mobile m = e.Mobile; if (m.Player && m.Account != null) { IAccount acct = m.Account; if (e.Arguments.Length == 0) { m.SendMessage("Old style client packets is currently {0}.", acct.SFO == FeatureFlags.None ? "OFF" : "ON"); } else { bool turnon = e.Arguments[0].ToLower() == "on"; acct.SFO = turnon ? (FeatureFlags)0x03 : (FeatureFlags)0x0; m.SendMessage("Old style client packets has been turned {0}.", turnon ? "ON" : "OFF"); m.Send(new MobileIncoming(m, m)); m.Send(SupportedFeatures.Instantiate(m.NetState)); m.Send(new MobileUpdate(m)); m.Send(new MobileAttributes(m)); } } }
protected override void OnTarget(Mobile from, object o) { try { Mobile m = o as Mobile; if (m is BaseCreature) { ((BaseCreature)m).DisableAI(); } NetState ns = from.NetState; from.CloseAllGumps(); ns.BlockAllPackets = true; from.NetState = null; m.NetState = ns; ns.Mobile = m; ns.BlockAllPackets = false; ns.Send(new LoginConfirm(m)); if (m.Map != null) { ns.Send(new MapChange(m)); } ns.Send(new MapPatches()); ns.Send(SeasonChange.Instantiate(m.GetSeason(), true)); ns.Send(SupportedFeatures.Instantiate(ns)); ns.Sequence = 0; ns.Send(new MobileUpdateOld(m)); ns.Send(new MobileUpdateOld(m)); m.CheckLightLevels(true); ns.Send(new MobileUpdateOld(m)); ns.Send(new MobileIncomingOld(m, m)); //ns.Send( new MobileAttributes( m ) ); ns.Send(new MobileStatus(m, m)); ns.Send(Server.Network.SetWarMode.Instantiate(m.Warmode)); m.SendEverything(); ns.Send(SupportedFeatures.Instantiate(ns)); ns.Send(new MobileUpdateOld(m)); //ns.Send( new MobileAttributes( m ) ); ns.Send(new MobileStatus(m, m)); ns.Send(Server.Network.SetWarMode.Instantiate(m.Warmode)); ns.Send(new MobileIncomingOld(m, m)); ns.Send(LoginComplete.Instance); ns.Send(new CurrentTime()); ns.Send(SeasonChange.Instantiate(m.GetSeason(), true)); ns.Send(new MapChange(m)); from.LogoutLocation = from.Location; from.Map = Map.Internal; //PacketHandlers.DoLogin(ns, origo); //origo.NetState = from.NetState; //from.NetState.Mobile = origo; //from.InvalidateProperties(); //from.NetState.Flush(); } catch (Exception ex) { Misc.ExceptionLogging.WriteLine(ex); } }