Exemple #1
0
        public static void StartGame(string gameID, string userID)
        {
            var action = new Models.Game.GameAction()
            {
                UserID = userID,
                GameID = gameID,
                Type   = Models.Game.GAME_ACTIONS.START
            };

            var content = new SocketAction
            {
                Route   = "game.patch.action",
                Payload = action
            };

            WebSocket.Instance.Emit("action", content);
        }
Exemple #2
0
        public static void RequestHint(string gameID, string userID, string roundID)
        {
            var action = new Models.Game.GameAction()
            {
                UserID  = userID,
                GameID  = gameID,
                Type    = Models.Game.GAME_ACTIONS.REQUEST_HINT,
                RoundID = roundID
            };

            var content = new SocketAction
            {
                Route   = "",
                Payload = action
            };

            WebSocket.Instance.Emit("Action", content);
        }
Exemple #3
0
        public static void GuessWord(string userID, string gameID, string roundID, string word)
        {
            var action = new Models.Game.GameAction()
            {
                UserID  = userID,
                GameID  = gameID,
                Type    = Models.Game.GAME_ACTIONS.GUESS_WORD,
                RoundID = roundID,
                Payload = new Models.Game.ActionWordGuess()
                {
                    Word = word
                }
            };

            var content = new SocketAction
            {
                Route   = "game.patch.action",
                Payload = action
            };

            WebSocket.Instance.Emit("action", content);
        }