Пример #1
0
        public JObject Join(string gameName)
        {
            MultiPlayerModel model         = MultiPlayerModel.GetInstance();
            string           clientID      = Context.ConnectionId;
            string           mazeAsString  = model.Join(gameName, clientID);
            Maze             maze          = Maze.FromJSON(mazeAsString);
            string           otherPlayerID = model.GetOtherPlayerID(clientID);

            JObject obj = JObject.Parse(maze.ToJSON());

            //TODO: Call to function to draw the mazes on other player client(by notify to otherPlayerID ).
            Clients.Client(clientID).drawMazes(obj);
            Clients.Client(otherPlayerID).drawMazes(obj);
            return(obj);
        }