Ejemplo n.º 1
0
 public ChatHub(IChatHubService chatService,
                IChatEntityRepositoryProxy <Message, ChatDbContext> messageRepo,
                IChatEntityRepositoryProxy <Channel, ChatDbContext> channelRepo,
                IChatEntityRepositoryProxy <Server, ChatDbContext> serverRepo)
 {
     _chatService = chatService;
     _messageRepo = messageRepo;
     _channelRepo = channelRepo;
     _serverRepo  = serverRepo;
 }
Ejemplo n.º 2
0
 public ChatHub(IMessageService service, ILogger <ChatHub> logger, IAuthenticationService <int> authService, IChatHubService chatHubService, IUserProfilesService profileService, IVideoChatService videoChatService, INotificationService notificationContext, IHubContext <NotificationHub> notificationHubContext)
 {
     _service                = service;
     _authService            = authService;
     _chatHubService         = chatHubService;
     _profileService         = profileService;
     _videoChatService       = videoChatService;
     _notificationService    = notificationContext;
     _notificationHubContext = notificationHubContext;
 }
Ejemplo n.º 3
0
        public UserProvider(IChatHubService chatHubService)
        {
            _chatHubService = chatHubService;

            Users = new UserList();
            Users.OnAdd += Users_OnAdd;
            Users.OnRemove += Users_OnRemove;

            var disconnectedUserTask = new Task(CheckAlive);
            disconnectedUserTask.Start();
        }
Ejemplo n.º 4
0
 public MessageQueue(IConnectionFactory connectionFactory,
                     IConfiguration configuration,
                     IChatHubService chatHubService,
                     IRepository <ChatUser> userRepository)
 {
     _connectionFactory = connectionFactory;
     _configuration     = configuration;
     _configuration.GetSection("RabbitMqConfigurations")
     .Bind(_rabbitConfigurations);
     _chatHubService = chatHubService;
     _userRepository = userRepository;
 }
Ejemplo n.º 5
0
        public ChatHub(IChatHubService service, int temp = 0)
        {
            _service = service;
            _temp    = temp;

            //預設滿房
            var userList = new List <GameRoom>()
            {
                new GameRoom()
                {
                    RoomId = 1, Account = "*****@*****.**", IsAlive = true
                },
                new GameRoom()
                {
                    RoomId = 1, Account = "*****@*****.**", IsAlive = true
                },
                new GameRoom()
                {
                    RoomId = 1, Account = "*****@*****.**", IsAlive = true
                },
                new GameRoom()
                {
                    RoomId = 1, Account = "*****@*****.**", IsAlive = true
                },
                new GameRoom()
                {
                    RoomId = 1, Account = "*****@*****.**", IsAlive = true
                },
                new GameRoom()
                {
                    RoomId = 1, Account = "*****@*****.**", IsAlive = true
                },
                new GameRoom()
                {
                    RoomId = 1, Account = "*****@*****.**", IsAlive = true
                },
                new GameRoom()
                {
                    RoomId = 1, Account = "*****@*****.**", IsAlive = true
                },
                new GameRoom()
                {
                    RoomId = 1, Account = "*****@*****.**", IsAlive = true
                },
                new GameRoom()
                {
                    RoomId = 1, Account = "*****@*****.**", IsAlive = true
                },
            };

            _GameRoom.TryAdd(1, userList);
        }
Ejemplo n.º 6
0
        private int EntityId = -1; // passed as a querystring parameter for authorization and used for validation

        public ChatHubController(IWebHostEnvironment webHostEnvironment, IHubContext <Hubs.ChatHub> chatHub, UserManager <IdentityUser> identityUserManager, IChatHubRepository chatHubRepository, IChatHubService chatHubService, IHttpContextAccessor httpContextAccessor, ILogManager logger)
        {
            this.webHostEnvironment  = webHostEnvironment;
            this.chatHub             = chatHub;
            this.identityUserManager = identityUserManager;
            this.chatHubRepository   = chatHubRepository;
            this.chatHubService      = chatHubService;
            this.logger = logger;
            if (httpContextAccessor.HttpContext.Request.Query.ContainsKey("entityid"))
            {
                EntityId = int.Parse(httpContextAccessor.HttpContext.Request.Query["entityid"]);
            }
        }
Ejemplo n.º 7
0
 public ChatHub(
     IUserRepository userRepository,
     IChatHubRepository chatHubRepository,
     IChatHubService chatHubService,
     UserManager <IdentityUser> identityUserManager,
     IRoleRepository roles,
     IUserRoleRepository userRoles
     )
 {
     this.userRepository    = userRepository;
     this.chatHubRepository = chatHubRepository;
     this.chatHubService    = chatHubService;
     this.userManager       = identityUserManager;
     this.roles             = roles;
     this.userRoles         = userRoles;
 }
Ejemplo n.º 8
0
 public ChatHub(
     IHttpContextAccessor httpContextAccessor,
     IChatHubRepository chatHubRepository,
     IChatHubService chatHubService,
     UserManager <IdentityUser> identityUserManager,
     IRoleRepository roles,
     IUserRoleRepository userRoles
     )
 {
     this.httpContextAccessor = httpContextAccessor;
     this.chatHubRepository   = chatHubRepository;
     this.chatHubService      = chatHubService;
     this.userManager         = identityUserManager;
     this.roles     = roles;
     this.userRoles = userRoles;
 }
Ejemplo n.º 9
0
 public CommandManager(
     string connectionId,
     int roomId,
     ChatHubUser user,
     ChatHub chatHub,
     IChatHubService service,
     IChatHubRepository repository,
     UserManager <IdentityUser> userManager)
 {
     _connectionId = connectionId;
     _roomId       = roomId;
     _caller       = user;
     _chatHub      = chatHub;
     _chatService  = service;
     _repository   = repository;
     _userManager  = userManager;
 }
Ejemplo n.º 10
0
 public AccountController(IUnitOfWork unitOfWork, IChatHubService chatHubService) : base(unitOfWork)
 {
     _chatHubService = chatHubService;
 }
Ejemplo n.º 11
0
 public SchedulerMessageService(IChatHubService chatHubService)
 {
     _chatHubService = chatHubService;
 }
Ejemplo n.º 12
0
 public ChatHub(IMessageService messageService, IChatHubService chatHubService) : base()
 {
     this.messageService = messageService;
     hubService          = chatHubService;
 }
Ejemplo n.º 13
0
 public ChatHub(IChatHubService chatHubService) => _chatHubService = chatHubService;
 public MessageService(IUnitOfWork unitOfWork, IChatHubService chatHubService)
 {
     _unitOfWork     = unitOfWork;
     _chatHubService = chatHubService;
 }
Ejemplo n.º 15
0
 public GroupService(IUnitOfWork unitOfWork, IChatHubService chatHubService)
 {
     _unitOfWork     = unitOfWork;
     _chatHubService = chatHubService;
 }
Ejemplo n.º 16
0
 public ChatHubApp(IChatHubService chatHubService)
 {
     _chatHubService = chatHubService;
 }