public static void CharacterEnterWorld(ClientMessage message, Session session) { ObjectGuid guid = message.Payload.ReadGuid(); string account = message.Payload.ReadString16L(); if (account != session.Account) { session.SendCharacterError(CharacterError.EnterGameCharacterNotOwned); return; } var cachedCharacter = session.AccountCharacters.SingleOrDefault(c => c.Guid.Full == guid.Full); if (cachedCharacter == null) { session.SendCharacterError(CharacterError.EnterGameCharacterNotOwned); return; } session.CharacterRequested = cachedCharacter; session.InitSessionForWorldLogin(); session.State = SessionState.WorldConnected; LandblockManager.PlayerEnterWorld(session, cachedCharacter.Guid); }
public static void CharacterEnterWorld(ClientMessage message, Session session) { ObjectGuid guid = message.Payload.ReadGuid(); string account = message.Payload.ReadString16L(); if (account != session.Account) { session.SendCharacterError(CharacterError.EnterGameCharacterNotOwned); return; } var cachedCharacter = session.AccountCharacters.SingleOrDefault(c => c.Guid.Full == guid.Full); if (cachedCharacter == null) { session.SendCharacterError(CharacterError.EnterGameCharacterNotOwned); return; } session.CharacterRequested = cachedCharacter; session.InitSessionForWorldLogin(); session.State = SessionState.WorldConnected; // check the value of the welcome message. Only display it if it is not empty if (!String.IsNullOrEmpty(ConfigManager.Config.Server.Welcome)) { session.Network.EnqueueSend(new GameEventPopupString(session, ConfigManager.Config.Server.Welcome)); } LandblockManager.PlayerEnterWorld(session); }
public static void CharacterEnterWorld(ClientMessage message, Session session) { ObjectGuid guid = message.Payload.ReadGuid(); string clientString = message.Payload.ReadString16L(); if (clientString != session.Account) { session.SendCharacterError(CharacterError.EnterGameCharacterNotOwned); return; } var cachedCharacter = session.AccountCharacters.SingleOrDefault(c => c.BiotaId == guid.Full); if (cachedCharacter == null) { session.SendCharacterError(CharacterError.EnterGameCharacterNotOwned); return; } session.CharacterRequested = cachedCharacter; session.InitSessionForWorldLogin(); session.Character = cachedCharacter; session.State = SessionState.WorldConnected; LandblockManager.PlayerEnterWorld(session, new ObjectGuid(cachedCharacter.BiotaId)); // Save the the LoginTimestamp cachedCharacter.LastLoginTimestamp = Time.GetTimestamp(); DatabaseManager.Shard.SaveCharacter(cachedCharacter, null); }
public static void CharacterEnterWorld(ClientPacketFragment fragment, Session session) { ObjectGuid guid = fragment.Payload.ReadGuid(); string account = fragment.Payload.ReadString16L(); if (account != session.Account) { session.SendCharacterError(CharacterError.EnterGameCharacterNotOwned); return; } var cachedCharacter = session.AccountCharacters.SingleOrDefault(c => c.Guid.Full == guid.Full); if (cachedCharacter == null) { session.SendCharacterError(CharacterError.EnterGameCharacterNotOwned); return; } session.CharacterRequested = cachedCharacter; session.InitSessionForWorldLogin(); session.State = SessionState.WorldConnected; session.Network.EnqueueSend(new GameEventPopupString(session, ConfigManager.Config.Server.Welcome)); LandblockManager.PlayerEnterWorld(session); }