/// <summary> /// Joins to an existing game. /// </summary> /// <param name="mazeName">Maze name.</param> public void JoinGame(string mazeName) { GameRoom room = model.JoinGame(mazeName, Context.ConnectionId); //Parse maze to json. Maze maze = room.RoomMaze; JObject jsonMaze = ToJsonParser.ToJson(maze); //Send the maze to both players. Clients.Client(room.PlayerOne.ConnectionId).gotMaze(jsonMaze); Clients.Client(room.PlayerTwo.ConnectionId).gotMaze(jsonMaze); }