Beispiel #1
0
 public ServerClientConnection(
     ILogger logger,
     UdpConnection connection,
     IServerRegistry registry,
     INetworkPacketController packetHandler)
     : base(logger, connection, packetHandler)
 {
     this.registry            = registry;
     connection.Disconnected += Connection_Disconnected;
 }
Beispiel #2
0
        public WebAPIQuery(IServerRegistry serverRegistry)
        {
            Field <ListGraphType <ServerType> >()
            .Name("servers")
            .ResolveAsync(async ctx =>
            {
                var request  = new DescribeServerByMetadataRequest();
                var response = await serverRegistry.DescribeByMetadata(request);

                return(response.Servers);
            });
        }
Beispiel #3
0
        public LoginStage(
            LoginStageConfig config,
            ILogger <IStage <LoginStage, LoginStageUser> > logger,
            IServerRegistry serverRegistry,
            ISessionRegistry sessionRegistry,
            IMigrationRegistry migrationRegistry,
            IGuildService guildService,
            IPartyService partyService,
            IAccountRepository accountRepository,
            IAccountWorldRepository accountWorldRepository,
            ICharacterRepository characterRepository,
            ITickerManager timerManager,
            IPacketProcessor <LoginStage, LoginStageUser> processor,
            ITemplateRepository <WorldTemplate> worldTemplates,
            ITemplateRepository <ItemTemplate> itemTemplates
            ) : base(
                ServerStageType.Login,
                config,
                logger,
                serverRegistry,
                sessionRegistry,
                migrationRegistry,
                accountRepository,
                accountWorldRepository,
                characterRepository,
                timerManager,
                processor
                )
        {
            Logger = logger;

            GuildService = guildService;
            PartyService = partyService;

            WorldTemplates = worldTemplates;
            ItemTemplates  = itemTemplates;

            processor.Register(new CheckPasswordHandler(this));
            processor.Register(new WorldInfoRequestHandler());
            processor.Register(new SelectWorldHandler());
            processor.Register(new CheckUserLimitHandler());
            processor.Register(new SetGenderHandler());
            processor.Register(new CheckPinCodeHandler());
            processor.Register(new WorldRequestHandler());
            processor.Register(new LogoutWorldHandler());
            processor.Register(new CheckDuplicatedIDHandler());
            processor.Register(new CreateNewCharacterHandler());
            processor.Register(new DeleteCharacterHandler());
            processor.Register(new ExceptionLogHandler(this));
            processor.Register(new EnableSPWRequestHandler(false));
            processor.Register(new CheckSPWRequestHandler(false));
        }
 public ServerConnectionProvider(ILogger logger, IServerRegistry serverRegistry, INetworkPacketController packetHandlers)
 {
     this.logger         = logger;
     this.serverRegistry = serverRegistry;
     this.packetHandlers = packetHandlers;
 }
Beispiel #5
0
        public GameStage(
            GameStageConfig config,
            ILogger <IStage <GameStage, GameStageUser> > logger,
            IServerRegistry serverRegistry,
            ISessionRegistry sessionRegistry,
            IMigrationRegistry migrationRegistry,
            IDispatchService dispatchService,
            IInviteService inviteService,
            IGuildService guildService,
            IPartyService partyService,
            IAccountRepository accountRepository,
            IAccountWorldRepository accountWorldRepository,
            ICharacterRepository characterRepository,
            ITickerManager tickerManager,
            IPacketProcessor <GameStage, GameStageUser> packetProcessor,
            IScriptEngine scriptEngine,
            ICommandProcessor commandProcessor,
            ITemplateRepository <ItemTemplate> itemTemplates,
            ITemplateRepository <ItemStringTemplate> itemStringTemplates,
            ITemplateRepository <ItemOptionTemplate> itemOptionTemplates,
            ITemplateRepository <ItemSetTemplate> itemSetTemplates,
            ITemplateRepository <SkillTemplate> skillTemplates,
            ITemplateRepository <FieldTemplate> fieldTemplates,
            ITemplateRepository <FieldStringTemplate> fieldStringTemplates,
            ITemplateRepository <ContiMoveTemplate> contiMoveTemplates,
            ITemplateRepository <NPCTemplate> npcTemplates,
            ITemplateRepository <NPCShopTemplate> npcShopTemplates,
            ITemplateRepository <MobTemplate> mobTemplates
            ) : base(
                ServerStageType.Game,
                config,
                logger,
                serverRegistry,
                sessionRegistry,
                migrationRegistry,
                accountRepository,
                accountWorldRepository,
                characterRepository,
                tickerManager,
                packetProcessor
                )
        {
            DispatchService = dispatchService;

            dispatchService
            .Subscribe(new DispatchSubscription {
                Server = ID
            })
            .ForEachAwaitAsync(OnDispatch);

            InviteService = inviteService;
            GuildService  = guildService;
            PartyService  = partyService;

            guildService
            .Subscribe()
            .ForEachAwaitAsync(OnGuildUpdate);
            partyService
            .Subscribe()
            .ForEachAwaitAsync(OnPartyUpdate);

            ScriptEngine         = scriptEngine;
            CommandProcessor     = commandProcessor;
            ItemTemplates        = itemTemplates;
            ItemStringTemplates  = itemStringTemplates;
            ItemOptionTemplates  = itemOptionTemplates;
            ItemSetTemplates     = itemSetTemplates;
            SkillTemplates       = skillTemplates;
            FieldTemplates       = fieldTemplates;
            FieldStringTemplates = fieldStringTemplates;
            ContiMoveTemplates   = contiMoveTemplates;
            NPCTemplates         = npcTemplates;
            NPCShopTemplates     = npcShopTemplates;
            MobTemplates         = mobTemplates;

            FieldRepository     = new FieldRepository(this, FieldTemplates, tickerManager);
            FieldSetRepository  = null; // TODO;
            ContiMoveRepository = new ContiMoveRepository(this, ContiMoveTemplates, FieldRepository, tickerManager);

            packetProcessor.Register(new UserTransferChannelRequestHandler());
            packetProcessor.Register(new UserMoveHandler());
            packetProcessor.Register(new UserMeleeAttackHandler());
            packetProcessor.Register(new UserShootAttackHandler());
            packetProcessor.Register(new UserMagicAttackHandler());
            packetProcessor.Register(new UserBodyAttackHandler());
            packetProcessor.Register(new UserEmotionHandler());
            packetProcessor.Register(new UserChatHandler());
            packetProcessor.Register(new UserSelectNPCHandler());
            packetProcessor.Register(new UserScriptMessageAnswerHandler());
            packetProcessor.Register(new UserGatherItemRequestHandler());
            packetProcessor.Register(new UserSortItemRequestHandler());
            packetProcessor.Register(new UserChangeSlotPositionRequestHandler());
            packetProcessor.Register(new UserCharacterInfoRequestHandler());
            packetProcessor.Register(new UserSkillUpRequestHandler());

            packetProcessor.Register(new GroupMessageHandler());
            packetProcessor.Register(new WhisperHandler());

            packetProcessor.Register(new PartyRequestHandler());
            packetProcessor.Register(new PartyResultHandler());

            packetProcessor.Register(new FuncKeyMappedModifiedHandler());
            packetProcessor.Register(new QuickSlotKeyMappedModifiedHandler());

            packetProcessor.Register(new MobMoveHandler());

            packetProcessor.Register(new NPCMoveHandler());

            packetProcessor.Register(new ContiStateHandler());

            commandProcessor.Register(new HelpCommand(commandProcessor));
            commandProcessor.Register(new AliasCommand(commandProcessor));
            commandProcessor.Register(new DebugCommand());

            commandProcessor.Register(new SetupCommand());

            commandProcessor.Register(new StatCommand());
            commandProcessor.Register(new SecondaryStatCommand());
            commandProcessor.Register(new ForcedStatCommand());
            commandProcessor.Register(new MobStatCommand());
            commandProcessor.Register(new SkillRecordCommand());
            commandProcessor.Register(new ItemCommand(ItemStringTemplates, ItemTemplates));
            commandProcessor.Register(new FieldCommand(FieldRepository, FieldStringTemplates, FieldTemplates));
            commandProcessor.Register(new ContiMoveCommand(ContiMoveRepository));
            commandProcessor.Register(new NPCShopCommand(npcShopTemplates));
        }