private static void Main() { string location = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(location, "nlog.config")); Directory.SetCurrentDirectory(location); Console.Title = Title; log.Info("Initialising..."); try { ConfigManager.Initialise(Path.Combine(Directory.GetCurrentDirectory(), "Config.json")); PacketManager.Initialise(); DatabaseManager.Initialise(); DungeonTileManager.Initialise(); NetworkManager.Initialise(); WorldManager.Initialise(lastTick => { NetworkManager.Update(lastTick); FellowshipManager.Update(lastTick); ChannelManager.Update(lastTick); }); log.Info("Ready!"); } catch (Exception exception) { log.Error(exception); } }
public static void HandleDungeonTile(Session session, ClientDungeonTiles packet) { foreach (uint cellId in packet.CellIds) { DungeonInfo dungeonInfo = DungeonTileManager.GetDungeonInfo((short)cellId); if (dungeonInfo == null) { continue; } var dungeonTiles = new ServerDungeonTiles(); foreach (DungeonTileInfo dungeonTileInfo in dungeonInfo) { dungeonTiles.Tiles.Add(new ServerDungeonTiles.Tile { X = dungeonTileInfo.Origin.X, Y = dungeonTileInfo.Origin.Y, Z = dungeonTileInfo.Origin.Z, TileId = dungeonTileInfo.TileId, LandBlockId = dungeonTileInfo.LandBlockId, ushort_2 = 0, byte_0 = 1 }); } session.EnqueueMessage(dungeonTiles); } }
private static void Main() { string location = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location); LogManager.Configuration = new XmlLoggingConfiguration(Path.Combine(location, "nlog.config")); Directory.SetCurrentDirectory(location); Console.Title = Title; log.Info("Initialising..."); try { ConfigManager.Initialise($"{Directory.GetCurrentDirectory()}\\Config.json"); DatabaseManager.Initialise(ConfigManager.Config.MySql); PacketManager.Initialise(); WorldManager.Initialise(); DungeonTileManager.Initialise(); NetworkManager.Initialise(); } catch (Exception exception) { log.Error(exception); } }
public static void HandleBla(Session session, ClientPacket04 packet) { foreach (uint cellId in packet.CellIds) { var dungeonTiles = new ServerPacket03(); List <DungeonTileInfo> tiles = DungeonTileManager.GetDungeonTileInfo((ushort)cellId); if (tiles == null) { continue; } foreach (DungeonTileInfo dungeonTile in tiles) { dungeonTiles.Tiles.Add(new ServerPacket03.Tile { X = dungeonTile.Origin.X, Y = dungeonTile.Origin.Y, Z = dungeonTile.Origin.Z, TileId = dungeonTile.TileId, LandBlockId = dungeonTile.LandBlockId, ushort_2 = 0, byte_0 = 1 }); } session.EnqueuePacket(dungeonTiles); } }
public static void HandleDungeonList(Session session, ClientDungeonList packet) { var dungeonList = new ServerDungeonList { SearchParameter = packet.SearchParameter }; foreach (DungeonInfo dungeonInfo in DungeonTileManager.GetDungeonInfo(packet.SearchParameter)) { dungeonList.Dungeons.Add(new ServerDungeonList.Dungeon(dungeonInfo)); } session.EnqueueMessage(dungeonList); }