public static void PlayerEnterWorld(Session session, ObjectGuid guid) { DatabaseManager.Shard.GetCharacter(guid.Full, ((AceCharacter c) => { session.SetPlayer(new Player(session, c)); session.Player.Load(c); // 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)); } Landblock block = GetLandblock(c.Location.LandblockId, true); // Must enqueue add world object -- this is called from a message handler context block.AddWorldObject(session.Player); string welcomeMsg = "Welcome to Asheron's Call" + "\n"; welcomeMsg += " powered by ACEmulator " + "\n"; welcomeMsg += "" + "\n"; welcomeMsg += "For more information on commands supported by this server, type @acehelp" + "\n"; session.Network.EnqueueSend(new GameMessageSystemChat(welcomeMsg, ChatMessageType.Broadcast)); })); }
public static async void PlayerEnterWorld(Session session) { var task = DatabaseManager.Character.LoadCharacter(session.Player.Guid.Low); task.Wait(); Character c = task.Result; await session.Player.Load(c); Landblock block = GetLandblock(c.Position.LandblockId, true); block.AddWorldObject(session.Player); }
public static void PlayerEnterWorld(Session session, ObjectGuid guid) { var start = DateTime.UtcNow; DatabaseManager.Shard.GetPlayerBiotas(guid.Full, biotas => { log.Info("GetPlayerBiotas took " + (DateTime.UtcNow - start).TotalMilliseconds + " ms"); // This can be removed after EF performance is at the desired level. Player player; if (biotas.Player.WeenieType == (int)WeenieType.Admin) { player = new Admin(biotas.Player, biotas.Inventory, biotas.WieldedItems, session); } else if (biotas.Player.WeenieType == (int)WeenieType.Sentinel) { player = new Sentinel(biotas.Player, biotas.Inventory, biotas.WieldedItems, session); } else { player = new Player(biotas.Player, biotas.Inventory, biotas.WieldedItems, session); } player.Name = session.Character.Name; session.SetPlayer(player); session.Player.PlayerEnterWorld(); // 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)); } var location = player.GetPosition(PositionType.Location); Landblock block = GetLandblock(location.LandblockId, true); // Must enqueue add world object -- this is called from a message handler context block.AddWorldObject(session.Player); string welcomeMsg = "Welcome to Asheron's Call" + "\n"; welcomeMsg += " powered by ACEmulator " + "\n"; welcomeMsg += "" + "\n"; welcomeMsg += "For more information on commands supported by this server, type @acehelp" + "\n"; session.Network.EnqueueSend(new GameMessageSystemChat(welcomeMsg, ChatMessageType.Broadcast)); }); }
public static async void PlayerEnterWorld(Session session) { var task = DatabaseManager.Character.LoadCharacter(session.Player.Guid.Low); task.Wait(); Character c = task.Result; await session.Player.Load(c); Landblock block = GetLandblock(c.Location.LandblockId, true); block.AddWorldObject(session.Player); session.Network.EnqueueSend(new GameMessageSystemChat("Welcome to Asheron's Call", ChatMessageType.Broadcast)); session.Network.EnqueueSend(new GameMessageSystemChat(" powered by ACEmulator ", ChatMessageType.Broadcast)); session.Network.EnqueueSend(new GameMessageSystemChat("", ChatMessageType.Broadcast)); session.Network.EnqueueSend(new GameMessageSystemChat("For more information on commands supported by this server, type @acehelp", ChatMessageType.Broadcast)); }
public static void AddObject(WorldObject worldObject) { Landblock block = GetLandblock(worldObject.Position.LandblockId, true); block.AddWorldObject(worldObject); }