コード例 #1
0
        public void Admin_Test()
        {
            var serverGuid = Guid.NewGuid();

            var ev = new FakeEventAggregator();

            var logic = new BELogic(ev);

            BECommand command = null;

            logic.ServerUpdateHandler += (s, e) =>
            {
                command = e.Command;
            };


            ev.GetEvent <BEMessageEvent <BEAdminLogMessage> >()
            .Publish(new BEAdminLogMessage(new LogMessage(), serverGuid));


            Assert.IsNotNull(command);
            Assert.AreEqual(CommandType.Admins, command.CommandType);

            GC.KeepAlive(logic);
        }
コード例 #2
0
 private void ProcessCommand(BECommand command)
 {
     if (command.CommandType == CommandType.RemoveBan || command.CommandType == CommandType.AddBan || command.CommandType == CommandType.Ban)
     {
         Task.Delay(2000).ContinueWith(t => _bansUpdater.Update(command.ServerId));
     }
 }
コード例 #3
0
            private void Command(BECommand command)
            {
                var server = BEServer;

                if (Info.Id == command.ServerId && server != null && server.Connected)
                {
                    server.SendCommand(command.CommandType, command.Parameters);
                }
            }
コード例 #4
0
ファイル: BELogic.cs プロジェクト: shox92/arma3beclient
 private void ProcessCommand(BECommand command)
 {
     if (command.CommandType == CommandType.RemoveBan || command.CommandType == CommandType.AddBan ||
         command.CommandType == CommandType.Ban)
     {
         Task.Delay(2000).ContinueWith(t =>
         {
             OnServerUpdateHandler(new BECommand(command.ServerId, CommandType.Bans));
         });
     }
 }
コード例 #5
0
ファイル: BELogic.cs プロジェクト: shox92/arma3beclient
 private void OnServerImmediateUpdateHandler(BECommand command)
 {
     ServerImmediateUpdateHandler?.Invoke(this, new ServerCommandEventArgs(command));
 }
コード例 #6
0
 public ServerCommandEventArgs(BECommand command)
 {
     Command = command;
 }