예제 #1
0
 public ChannelServer(string ipAddress, int port)
     : base(ipAddress, port)
 {
     gameEngine = new GameEngine();
     mapEngine = new MapEngine(ConfigurationManager.ConnectionStrings["XiahDb"].ConnectionString, ConfigurationManager.ConnectionStrings["XiahDb"].ProviderName);
     accountManager = new AccountManager(ConfigurationManager.ConnectionStrings["XiahDb"].ConnectionString, ConfigurationManager.ConnectionStrings["XiahDb"].ProviderName);
     characterManager = new CharacterManager(ConfigurationManager.ConnectionStrings["XiahDb"].ConnectionString, ConfigurationManager.ConnectionStrings["XiahDb"].ProviderName);
     itemDataManager = new ItemDataManager(ConfigurationManager.ConnectionStrings["XiahDb"].ConnectionString, ConfigurationManager.ConnectionStrings["XiahDb"].ProviderName);
 }
예제 #2
0
 public ChannelServer(string ipAddress, int port)
     : base(ipAddress, port)
 {
     gameEngine       = new GameEngine();
     mapEngine        = new MapEngine(ConfigurationManager.ConnectionStrings["XiahDb"].ConnectionString, ConfigurationManager.ConnectionStrings["XiahDb"].ProviderName);
     accountManager   = new AccountManager(ConfigurationManager.ConnectionStrings["XiahDb"].ConnectionString, ConfigurationManager.ConnectionStrings["XiahDb"].ProviderName);
     characterManager = new CharacterManager(ConfigurationManager.ConnectionStrings["XiahDb"].ConnectionString, ConfigurationManager.ConnectionStrings["XiahDb"].ProviderName);
     itemDataManager  = new ItemDataManager(ConfigurationManager.ConnectionStrings["XiahDb"].ConnectionString, ConfigurationManager.ConnectionStrings["XiahDb"].ProviderName);
 }
예제 #3
0
        public List <Character> GetCharactersInRange(Position pos, int distance)
        {
            List <Character> nearbyChars = ActiveClientEntities.Where(entity => entity is Character && MapEngine.GetDistance(pos.X, pos.Y, entity.Position.X, entity.Position.Y) <= distance).Cast <Character>().ToList();

            return(nearbyChars);
        }
예제 #4
0
        private void InitiateMapEngines()
        {
            Map[] maps = mapManager.GetAllMaps();
            mapEngines = new List<MapEngine>();

            for (int i = 0; i < maps.Length; i++)
            {
                MapEngine mapEngine = new MapEngine(ConfigurationManager.ConnectionStrings["XiahDb"].ConnectionString, ConfigurationManager.ConnectionStrings["XiahDb"].ProviderName, maps[i]);
                mapEngine.MonsterMove += new EventHandler<MonsterMoveInfoEventArgs>(mapEngine_MonsterMove);
                mapEngine.MonsterAttack += new EventHandler<MonsterAttackInfoEventArgs>(mapEngine_MonsterAttack);
                mapEngines.Add(mapEngine);
            }
        }