Beispiel #1
0
        public void LeaveUserFromGame(string userId, Guid gameId)
        {
            if (string.IsNullOrWhiteSpace(userId))
            {
                throw new ArgumentException("User Id cannot be null or empty");
            }

            if (gameId == null || gameId == Guid.Empty)
            {
                throw new ArgumentException("Game Id cannot be null or empty");
            }

            var message = new LeaveGameMessage
            {
                UserId = userId,
                GameId = gameId
            };

            this.leaveGameQueue.AddMessage(message);
        }
        public void LeaveUserFromGame(string userId, Guid gameId)
        {
            if (string.IsNullOrWhiteSpace(userId))
            {
                throw new ArgumentException("User Id cannot be null or empty");
            }

            if (gameId == null || gameId == Guid.Empty)
            {
                throw new ArgumentException("Game Id cannot be null or empty");
            }

            var message = new LeaveGameMessage
            {
                UserId = userId,
                GameId = gameId
            };

            this.leaveGameQueue.AddMessage(message);
        }