Example #1
0
        private void BeServerConnectHandler(ServerInfo info)
        {
            _bansUpdater.Update(info.Id);
            _playersUpdater.Update(info.Id);

            _aggregator.GetEvent <BEMessageEvent <BECommand> >()
            .Publish(new BECommand(info.Id, CommandType.Missions));

            _aggregator.GetEvent <BEMessageEvent <BECommand> >()
            .Publish(new BECommand(info.Id, CommandType.Admins));
        }
Example #2
0
        private void _beLogic_ServerUpdateHandler(object sender, ServerCommandEventArgs e)
        {
            switch (e.Command.CommandType)
            {
            case CommandType.Players:
                _playersUpdater.Update(e.Command.ServerId);
                break;

            case CommandType.Bans:
                _bansUpdater.Update(e.Command.ServerId);
                break;

            case CommandType.Admins:
                _adminsUpdater.Update(e.Command.ServerId);
                break;

            case CommandType.Missions:
                _missionsUpdater.Update(e.Command.ServerId);
                break;

            default:
                _aggregator.GetEvent <BEMessageEvent <BECommand> >()
                .Publish(e.Command);
                break;
            }
        }