public StandardPlayLoop(Session session, ChatRoomService rooms, int queue)
        {
            this.session = session;
            this.QueueId = queue;

            Lobby = new StandardLobby(session, this, rooms);
        }
 public ChattingService(ChatRoomService chatRoomService, ChatroomsRepository chatRooms, ILogger <ChattingService> logger)
 {
     _chatRoomService = chatRoomService;
     _chatRooms       = chatRooms;
     _logger          = logger;
     chatHandler     += OnRoomJoined;
     chatHandler     += OnMessageReceived;
 }
Beispiel #3
0
        public StandardLobby(Session session, StandardPlayLoop loop, ChatRoomService rooms) : base(session, rooms)
        {
            this.session = session;
            this.loop    = loop;

            Messages.Consume <LobbyStatus>(OnLobbyStatus);
            Messages.Consume <InvitePrivileges>(OnInvitePrivelages);
            Messages.Consume <SearchingForMatchNotification>(OnSearchingForMatch);
            Messages.Consume <GameNotification>(OnGameNotification);
        }
Beispiel #4
0
        public CustomService(PlayLoopService loop, ChatRoomService rooms, Session session) : base("/playloop/custom")
        {
            this.session = session;
            this.rooms   = rooms;
            this.loop    = loop;

            var messages = new MessageConsumer(session);

            messages.Consume <GameDTO>(OnGameDTO);
            messages.Consume <LobbyStatus>(OnLobbyStatus);
            messages.Consume <InvitePrivileges>(OnInvitePrivelages);
        }
        public async Task GetChatRoomMessage()
        {
            var _repository = TestConfig._messageRepository;

            _repository.Setup(x => x.Get(null, null, null)).Returns(TestConfig.MESSAGE_IQUERYABLE);
            var service = new ChatRoomService(TestConfig._chatRoomRepository.Object,
                                              TestConfig._usersChatRoomRepository.Object,
                                              _repository.Object,
                                              TestConfig._userManageMock.Object);
            var valueResult = service.GetChatRoomMessage(It.IsAny <long>());

            Assert.IsType <List <MessageDto> >(valueResult.Result);
        }
        public async Task GetChatRooms()
        {
            var _repository = TestConfig._chatRoomRepository;

            _repository.Setup(x => x.GetAll()).Returns(TestConfig.CHAT_ROOM_QUERYABLE_LIST);
            var service = new ChatRoomService(_repository.Object,
                                              TestConfig._usersChatRoomRepository.Object,
                                              TestConfig._messageRepository.Object,
                                              TestConfig._userManageMock.Object);
            var valueResult = service.GetChatRooms();

            Assert.IsType <List <ChatRoom> >(valueResult.Result);
        }
Beispiel #7
0
        public PostGameService(ChatRoomService rooms, Session session) : base("/playloop/postgame")
        {
            this.rooms   = rooms;
            this.session = session;

            var messages = new MessageConsumer(session);

            messages.Consume <EndOfGameStats>(OnEndOfGameStats);
            messages.Consume <SimpleDialogMessage>(OnSimpleDialogMessage);
            messages.Consume <PlayerCredentialsDto>(OnPlayerCredentials);

            Reset();
        }
Beispiel #8
0
        public ActionResult JoinRequestRoom(string id)
        {
            var request = ChatRoomService.GetChatRequest(new Guid(id));

            var model = new AgentChatVm
            {
                RoomId          = request.RoomId.ToString(),
                ClientContextId = request.CreatorId.ToString(),
                ClientName      = request.UserName,
                RequestId       = request.Id.ToString()
            };

            return(View("AgentChatRequest", model));
        }
        public PlayLoopService(Session session, ChatRoomService rooms) : base("/playloop")
        {
            this.session    = session;
            session.Authed += Kappa_Authed;

            lobby       = new LobbyService(this, rooms, session);
            custom      = new CustomService(this, rooms, session);
            matchmaking = new MatchmakingService(this, session);
            champselect = new ChampSelectService(this, rooms, session);
            active      = new ActiveGameService(this, session);
            post        = new PostGameService(rooms, session);

            Reset();
        }
        public async Task Create()
        {
            var _repository = TestConfig._chatRoomRepository;

            _repository.Setup(x => x.Add(It.IsAny <ChatRoom>())).Returns(TestConfig.CHAT_ROOM);
            var service = new ChatRoomService(_repository.Object,
                                              TestConfig._usersChatRoomRepository.Object,
                                              TestConfig._messageRepository.Object,
                                              TestConfig._userManageMock.Object);

            var valueResult = service.Create(TestConfig.CHAT_ROOM);

            Assert.IsType <bool>(valueResult.Result);
        }
Beispiel #11
0
        public ChampSelectService(PlayLoopService loop, ChatRoomService rooms, Session session) : base("/playloop/champselect")
        {
            this.session = session;
            this.rooms   = rooms;
            this.loop    = loop;

            messages = new MessageConsumer(session);

            messages.Consume <GameDTO>(OnGameDTO);
            messages.Consume <TradeContractDTO>(OnTradeContract);

            messages.Consume <GameDataObject>(OnGameData);
            messages.Consume <RemovedFromService>(OnRemovedFromService);
        }
Beispiel #12
0
        public LobbyService(PlayLoopService loop, ChatRoomService rooms, Session session) : base("/playloop/lobby")
        {
            this.session = session;
            this.rooms   = rooms;
            this.loop    = loop;

            var messages = new MessageConsumer(session);

            messages.Consume <LobbyStatus>(OnLobbyStatus);
            messages.Consume <InvitePrivileges>(OnInvitePrivelages);
            messages.Consume <SearchingForMatchNotification>(OnSearchingForMatch);
            messages.Consume <GameNotification>(OnGameNotification);

            messages.Consume <GameDataObject>(OnGameData);
            messages.Consume <RemovedFromService>(OnRemovedFromService);
        }
Beispiel #13
0
        public async Task AddChatRoomMessage_Should_ReturnCreatedMessage_When_Called(string userName, string message)
        {
            var testMessage = new Message {
                UserName = userName, MessageText = message
            };

            var iRepository = new Mock <IRepository <Message> >();

            iRepository
            .Setup(x => x.Insert(It.IsAny <Message>()))
            .ReturnsAsync(testMessage);

            var iService         = new ChatRoomService(iRepository.Object);
            var exprectedMessage = await iService.AddChatRoomMessage(testMessage);

            Assert.Equal(testMessage, exprectedMessage);
        }
        public async Task JoinToChat()
        {
            var _repository = TestConfig._usersChatRoomRepository;

            _repository.Setup(x => x.Get(c => c.ChatroomId == It.IsAny <long>() &&
                                         c.ApplicationUserId == It.IsAny <long>(), null, null)).Returns(TestConfig.USER_CHAT_ROOM_IQUERYABLE);

            var _userManager = TestConfig._userManageMock;

            _userManager.Setup(x => x.FindByEmailAsync(It.IsAny <string>())).ReturnsAsync(TestConfig.APPLICATION_USER);
            _repository.Setup(x => x.Add(It.IsAny <UsersChatRoom>())).Returns(TestConfig.USER_CHAT_ROOM);
            var service = new ChatRoomService(TestConfig._chatRoomRepository.Object,
                                              _repository.Object,
                                              TestConfig._messageRepository.Object,
                                              _userManager.Object);
            var valueResult = service.JoinToChat(It.IsAny <long>(), It.IsAny <string>());

            Assert.IsType <BaseDto>(valueResult.Result);
            Assert.False(valueResult.Result.HasError);
        }
 public ChatRoomsController(ChatRoomService chatRoomService)
 {
     this.chatRoomService = chatRoomService;
 }
 public ChatRoomController(IDatabase database, ChatRoomService wsService)
 {
     this.database  = database;
     this.wsService = wsService;
 }
Beispiel #17
0
 public UserController(ChatRoomService chatRoomService)
 {
     this._chatRoomService = chatRoomService;
 }
Beispiel #18
0
 protected LobbyDelegate(Session session, ChatRoomService rooms)
 {
     Rooms    = rooms;
     Messages = new MessageConsumer(session);
 }
Beispiel #19
0
 public MessageController(ChatRoomService chatRoomService)
 {
     this._chatRoomService = chatRoomService;
 }
Beispiel #20
0
 public ChatHub(UserConnectionsService userConnectionsService, ChatRoomService chatRoomService)
 {
     this.userConnectionsService = userConnectionsService;
     this.chatRoomService        = chatRoomService;
 }
Beispiel #21
0
 public AssignmentUserChatRoomController(ChatRoomService chatRoomService)
 {
     this._chatRoomService = chatRoomService;
 }
Beispiel #22
0
 public ChatRoomsController(ChatRoomService chatRoomService)
 => _chatRoomService = chatRoomService;
Beispiel #23
0
        public Session()
        {
            AccountService        = new Riot.Services.AccountService(this);
            ChampionTradeService  = new Riot.Services.ChampionTradeService(this);
            ClientFacadeService   = new Riot.Services.ClientFacadeService(this);
            GameInvitationService = new Riot.Services.GameInvitationService(this);
            GameService           = new Riot.Services.GameService(this);
            InventoryService      = new Riot.Services.InventoryService(this);
            LcdsProxyService      = new Riot.Services.LcdsProxyService(this);
            LeaguesService        = new Riot.Services.LeaguesService(this);
            LoginService          = new Riot.Services.LoginService(this);
            MasteryBookService    = new Riot.Services.MasteryBookService(this);
            MatchmakingService    = new Riot.Services.MatchmakingService(this);
            PlayerStatsService    = new Riot.Services.PlayerStatsService(this);
            RerollService         = new Riot.Services.RerollService(this);
            SpellBookService      = new Riot.Services.SpellBookService(this);
            SummonerIconService   = new Riot.Services.SummonerIconService(this);
            SummonerRuneService   = new Riot.Services.SummonerRuneService(this);
            SummonerService       = new Riot.Services.SummonerService(this);
            SummonerTeamService   = new Riot.Services.SummonerTeamService(this);

            LootService             = new LootService(this, LcdsProxyService);
            ChampionMasteryService  = new ChampionMasteryService(this, LcdsProxyService);
            TeambuilderDraftService = new TeambuilderDraftService(this, LcdsProxyService);

            PlayerPreferencesService = new PlayerPreferencesService(this);
            MatchHistoryService      = new MatchHistoryService(this);

            var patcher = new PatcherService(this);

            this.chat = new ChatService(this);

            this.Maestro = new Maestro(chat, patcher);

            var settings = new SettingsService(this);

            var hextech   = new HextechService(this);
            var champions = new ChampionsService(this);
            var masteries = new MasteriesService(this);
            var runes     = new RunesService(this);

            var matches = new Server.Profile.MatchHistoryService(this);

            this.summoner = new SummonerService(this);
            this.Assets   = new AssetsService(patcher);

            var rooms = new ChatRoomService(this, chat);
            var login = new AuthService(this);

            var game   = new PlayLoopService(this, rooms);
            var invite = new InviteService(this, game);

            var meta  = new MetaService(this);
            var debug = new DebugService(this);

            var replay = new ReplayService(this);

            patcher.FinishWAD();

            var info = new InfoService(this, patcher);
        }
 protected MatchmakingDelegate(Session session, ChatRoomService rooms)
 {
     Rooms    = rooms;
     Messages = new MessageConsumer(session);
 }