|
@ -285,7 +285,12 @@ public class SteamGraph |
|
|
con.getTraversal().V() |
|
|
con.getTraversal().V() |
|
|
.hasLabel(SteamGraph.KEY_PLAYER) |
|
|
.hasLabel(SteamGraph.KEY_PLAYER) |
|
|
.has(Player.KEY_STEAM_ID, id) |
|
|
.has(Player.KEY_STEAM_ID, id) |
|
|
.both().valueMap().toStream().forEach(r -> |
|
|
|
|
|
|
|
|
.outE() |
|
|
|
|
|
.inV() |
|
|
|
|
|
.hasLabel(SteamGraph.KEY_PLAYER) |
|
|
|
|
|
.valueMap() |
|
|
|
|
|
.toStream() |
|
|
|
|
|
.forEach(r -> |
|
|
add(new Player(r))); |
|
|
add(new Player(r))); |
|
|
}}; |
|
|
}}; |
|
|
} |
|
|
} |
|
@ -336,15 +341,22 @@ public class SteamGraph |
|
|
this.con.commit(); |
|
|
this.con.commit(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private void indexPersonsGames(String id) |
|
|
|
|
|
|
|
|
private List<Game> indexPersonsGames(String id) |
|
|
{ |
|
|
{ |
|
|
System.out.println("indexing games for " + id); |
|
|
System.out.println("indexing games for " + id); |
|
|
List<Game> games = this.api.getGames(id); |
|
|
List<Game> games = this.api.getGames(id); |
|
|
games.forEach(g -> insertGameForPlayerToGraph(id, g)); |
|
|
games.forEach(g -> insertGameForPlayerToGraph(id, g)); |
|
|
this.updateCrawledStatusGames(id); |
|
|
this.updateCrawledStatusGames(id); |
|
|
this.con.commit(); |
|
|
this.con.commit(); |
|
|
|
|
|
return games; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public List<Game> getGameList(String id) |
|
|
|
|
|
{ |
|
|
|
|
|
return this.playerGamesAlreadyIndexed(id) ? |
|
|
|
|
|
this.getPlayerGamesFromGraph(id) : |
|
|
|
|
|
this.indexPersonsGames(id); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
@ -373,6 +385,8 @@ public class SteamGraph |
|
|
{ |
|
|
{ |
|
|
p = this.api.getSingle(id); |
|
|
p = this.api.getSingle(id); |
|
|
this.insertPlayerIntoGraph(p, false); |
|
|
this.insertPlayerIntoGraph(p, false); |
|
|
|
|
|
this.indexPersonFriends(id); |
|
|
|
|
|
p.setFriends(this.getFriendsFromGraph(id)); |
|
|
} |
|
|
} |
|
|
catch (SteamConnectionException e) |
|
|
catch (SteamConnectionException e) |
|
|
{ |
|
|
{ |
|
@ -403,10 +417,14 @@ public class SteamGraph |
|
|
public static void main(String[] args) |
|
|
public static void main(String[] args) |
|
|
{ |
|
|
{ |
|
|
SteamGraph graph = new SteamGraph(); |
|
|
SteamGraph graph = new SteamGraph(); |
|
|
//graph.getPlayer("76561198068098265").getFriends().stream().forEach(System.out::println); |
|
|
|
|
|
// graph.indexPersonFriends("76561198188400721"); |
|
|
|
|
|
//graph.indexPersonsGames("76561198068098265"); |
|
|
|
|
|
System.out.println(graph.getPlayerGamesFromGraph("76561198068098265")); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
graph.getPlayer("76561198188400721"); |
|
|
|
|
|
graph.getGameList("76561198188400721"); |
|
|
|
|
|
// //graph.getPlayer("76561198068098265").getFriends().stream().forEach(System.out::println); |
|
|
|
|
|
//// graph.indexPersonFriends("76561198188400721"); |
|
|
|
|
|
// graph.indexPersonsGames("76561198188400721"); |
|
|
|
|
|
// System.out.println(graph.getGameList("76561198188400721")); |
|
|
|
|
|
// System.out.println(graph.getPlayer("76561198188400721")); |
|
|
graph.close(); |
|
|
graph.close(); |
|
|
// |
|
|
// |
|
|
// Player base = graph.getPlayer(args[0]); |
|
|
// Player base = graph.getPlayer(args[0]); |
|
|