//服务器初始化 public void CreateMap() { //初始化地图 GenerateItem.Generate(ReadConfig.instance.map1, ReadConfig.instance.itemCount1, ReadConfig.map1Width, ReadConfig.map1Hight, 1); GameMapManager.instance.CreateMap(ReadConfig.map1Width, ReadConfig.map1Hight, ReadConfig.instance.map1, ReadConfig.instance.itemMap1, ReadConfig.instance.groundMap1); ConsoleLog.instance.Info("初始化完毕"); }
public void GameInit(object state) { SetNoLocationPlayers(); if (Server.instance.whichGame == 2) { GenerateItem.Generate(ReadConfig.instance.map2, ReadConfig.instance.itemCount2, ReadConfig.map2Width, ReadConfig.map2Hight, 2); GameMapManager.instance.CreateMap(ReadConfig.map2Width, ReadConfig.map2Hight, ReadConfig.instance.map2, ReadConfig.instance.itemMap2, ReadConfig.instance.groundMap2); } else if (Server.instance.whichGame == 3) { GenerateItem.Generate(ReadConfig.instance.map3, ReadConfig.instance.itemCount3, ReadConfig.map3Width, ReadConfig.map3Hight, 3); GameMapManager.instance.CreateMap(ReadConfig.map3Width, ReadConfig.map3Hight, ReadConfig.instance.map3, ReadConfig.instance.itemMap3, ReadConfig.instance.groundMap3); } Server.instance.isGaming = true; ServerUpdate.isSendLocation = true; SendStartAgain(Server.instance.whichGame); if (Server.instance.whichGame == 3) { chickenGameTimer = new Timer(new TimerCallback(Generate), null, ReadConfig.instance.chickenGameTime * 1000, Timeout.Infinite); } else if (Server.instance.whichGame == 2) { portalTimer = new Timer(new TimerCallback(GeneratePortal), null, ReadConfig.instance.portalGameTime * 1000, Timeout.Infinite); } }
public void Generate(object state) { S2CChickenLoc s2CChickenLoc = new S2CChickenLoc() { chickenLocList = new List <ChickenLoc>() }; GameMap gameMap = GameMapManager.instance.GetGameMap(0); GenerateItem.GenerateChicken(gameMap, 36, 36, ref s2CChickenLoc); SendChickenLoc(s2CChickenLoc); }
public void GeneratePortal(object state) { GameMap gameMap = GameMapManager.instance.GetGameMap(0); GenerateItem.GeneratePortal(gameMap, 48, 48); }