Beispiel #1
0
 public MapInstance(Map.Map map, Guid guid, bool shopAllowed, MapInstanceType type,
                    IMapItemGenerationService mapItemGenerationService, ILogger logger)
 {
     LastPackets     = new ConcurrentQueue <IPacket>();
     XpRate          = 1;
     DropRate        = 1;
     ShopAllowed     = shopAllowed;
     MapInstanceType = type;
     Map             = map;
     MapInstanceId   = guid;
     Portals         = new List <Portal>();
     _monsters       = new ConcurrentDictionary <int, MapMonster>();
     _npcs           = new ConcurrentDictionary <int, MapNpc>();
     MapItems        = new ConcurrentDictionary <long, MapItem>();
     _isSleeping     = true;
     LastUnregister  = SystemTime.Now().AddMinutes(-1);
     ExecutionEnvironment.TryGetCurrentExecutor(out var executor);
     Sessions = new DefaultChannelGroup(executor);
     _mapItemGenerationService = mapItemGenerationService;
     _logger  = logger;
     Requests = new Dictionary <Type, Subject <RequestData <MapInstance> > >
     {
         [typeof(IMapInstanceEntranceEventHandler)] = new Subject <RequestData <MapInstance> >()
     };
 }
Beispiel #2
0
 public MapInstanceGeneratorService(List <MapDto> maps, List <NpcMonsterDto> npcMonsters, List <NpcTalkDto> npcTalks, List <ShopDto> shopDtos,
                                    IMapItemGenerationService mapItemGenerationService, IDao <MapNpcDto, int> mapNpcs,
                                    IDao <MapMonsterDto, int> mapMonsters, IDao <PortalDto, int> portalDao, IDao <ShopItemDto, int>?shopItems, ILogger logger, EventLoaderService <MapInstance, MapInstance, IMapInstanceEntranceEventHandler> entranceRunnerService, MapInstanceHolder holder, IMapInstanceAccessorService mapInstanceAccessorService)
 {
     _mapItemGenerationService = mapItemGenerationService;
     _npcTalks                   = npcTalks;
     _npcMonsters                = npcMonsters;
     _mapMonsters                = mapMonsters;
     _portalDao                  = portalDao;
     _maps                       = maps;
     _mapNpcs                    = mapNpcs;
     _logger                     = logger;
     _shopItems                  = shopItems;
     _shopDtos                   = shopDtos;
     _entranceRunnerService      = entranceRunnerService;
     _holder                     = holder;
     _mapInstanceAccessorService = mapInstanceAccessorService;
 }