Ejemplo n.º 1
0
        public void ReceiveGameMessage(string message, IFlowClient client)
        {
            if (message[1] == 'I')
            {
                string[] str = message.Split('^');

                GameCommand request = new GameCommand
                {
                    Type   = GameCommandType.INPUT,
                    Target = client,
                };

                if (str.Length == 1)
                {
                    request.Command = str[0].Remove(0, 2);
                    clientRequestList.Enqueue(request);
                }
                else if (str.Length > 1)
                {
                    request.Title   = str[0].Remove(0, 2);
                    request.Command = str[1];
                    clientRequestList.Enqueue(request);
                }
            }
        }
        public RiverFlowProcessor(
            IUsgsIvClient usgsIvClient,
            IFlowClient flowClient,
            ILogger <IRiverFlowProcessor> logger,
            IMetrics metrics)
        {
            this.usgsIvClient = usgsIvClient;
            this.flowClient   = flowClient;
            this.logger       = logger;
            this.metrics      = metrics;

            this.requestTimer = new TimerOptions
            {
                Name            = "River Flow Queries",
                MeasurementUnit = App.Metrics.Unit.Calls,
                DurationUnit    = TimeUnit.Seconds,
                RateUnit        = TimeUnit.Minutes
            };

            this.recordTimer = new TimerOptions
            {
                Name            = "River Flow Recordings",
                MeasurementUnit = App.Metrics.Unit.Calls,
                DurationUnit    = TimeUnit.Seconds,
                RateUnit        = TimeUnit.Minutes
            };
        }
Ejemplo n.º 3
0
        public void AddPlayer(IFlowClient client)
        {
            players.Add(client, new GamePlayer());
            GameCommand request = new GameCommand
            {
                Type   = GameCommandType.SYSTEM,
                Target = client,
                Title  = "Send_List"
            };

            clientRequestList.Enqueue(request);
        }
Ejemplo n.º 4
0
 public void Service_ReceiveMessage(string message, IFlowClient client)
 {
     if (message != null && message != "")
     {
         if (message[0] == 'G')
         {
             foreach (GameManager manager in game)
             {
                 manager.ReceiveGameMessage(message, client);
             }
         }
     }
 }
Ejemplo n.º 5
0
 public void Service_ClientConnected(IFlowClient client)
 {
     //지금은 Channel 0으로 무조건 밀어 넣는 형식
     //채널 1개당 1스레드로 1스레드가 적정 양까지 버틸경우 1채널로 가도 됨
     //그럴 경우 이 서비스 매니저도 필요 없을 듯
     if (game != null && game.Length != 0)
     {
         game[0].AddPlayer(client);
     }
     else
     {
         ConsoleController.Alert("There is no game service", "Service Manager");
     }
 }
Ejemplo n.º 6
0
        public AddGroupDialog(UserState userState, IFlowClient flowClient) : base(nameof(AddGroupDialog))
        {
            _flowClient       = flowClient;
            _userDataAccessor = userState.CreateProperty <UserData>(nameof(UserData));

            AddDialog(new ConfirmPrompt(nameof(ConfirmPrompt)));
            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new List <WaterfallStep>
            {
                AskNameStepAsync,
                AskDescriptionStepAsync,
                AskMailNicknameStepAsync,
                AskChannelName,
                AskChannelDescription,
                AskTabName,
                AskTabUrl,
                AskUsers,
                EndDialog
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }
Ejemplo n.º 7
0
 private void Client_MessageReceived(string result, IFlowClient client)
 {
     ConsoleController.Log(result, client.ToString());
 }