Ejemplo n.º 1
0
            private void PlayWordRequest(string line)
            {
                PlayWordDetails playWordDetails = JsonConvert.DeserializeObject <PlayWordDetails>(line);
                PlayWordDetails wordDetail      = new BoggleService().PlayWord(gameID, playWordDetails, out HttpStatusCode status);
                string          result          = CreateResult(wordDetail, status);

                ss.BeginSend(result, (x, y) => { ss.Shutdown(System.Net.Sockets.SocketShutdown.Both); }, null);
            }
Ejemplo n.º 2
0
            private void JoinGameRequest(string line)
            {
                SetGame sg      = JsonConvert.DeserializeObject <SetGame>(line);
                SetGame setGame = new BoggleService().JoinGame(sg, out HttpStatusCode status);
                string  result  = CreateResult(setGame, status);

                ss.BeginSend(result, (x, y) => { ss.Shutdown(System.Net.Sockets.SocketShutdown.Both); }, null);
            }
Ejemplo n.º 3
0
            private void CreateUserRequest(string line)
            {
                // Check
                Name   n      = JsonConvert.DeserializeObject <Name>(line);
                User   u      = new User(n);
                User   user   = new BoggleService().CreateUser(u, out HttpStatusCode status);
                string result = CreateResult(user, status);

                ss.BeginSend(result, (x, y) => { ss.Shutdown(System.Net.Sockets.SocketShutdown.Both); }, null);
            }
Ejemplo n.º 4
0
            private void GetGameStatusRequest(string line)
            {
                string brief = "no";

                if (firstLine.Contains("yes"))
                {
                    brief = "yes";
                }
                Game   game   = new BoggleService().GameStatus(gameID, brief, out HttpStatusCode status);
                string result = CreateResult(game, status);

                ss.BeginSend(result, (x, y) => { ss.Shutdown(System.Net.Sockets.SocketShutdown.Both); }, null);
            }