diff --git a/Scripts/LocationTracker.gd b/Scripts/LocationTracker.gd index e259f73b3..d2cbb610e 100644 --- a/Scripts/LocationTracker.gd +++ b/Scripts/LocationTracker.gd @@ -36,7 +36,7 @@ func send_position(userdata): if not result.empty(): la = result.position - var url = "/location/impression/%f/%f/%f/%f/%f/%f" % [p.x, p.z ,p.y, la.x, la.z, la.y] + var url = "/location/impression/%f/%f/%f/%f/%f/%f/%d" % [p.x, p.z ,p.y, la.x, la.z, la.y, global.session_id] #logger.debug("accessing: "+ url) ServerConnection.get_http(ServerConnection.default_server, url, ServerConnection.default_port) waiting = false diff --git a/Scripts/global.gd b/Scripts/global.gd index e71f4836f..a208a7013 100644 --- a/Scripts/global.gd +++ b/Scripts/global.gd @@ -3,4 +3,6 @@ extends Node # TODO: make this configurable from a file outside of the godot package var server = 'http://127.0.0.1' var port = 8000 + +var session_id #var DATASET = [] \ No newline at end of file diff --git a/Scripts/main.gd b/Scripts/main.gd index f4b0b9edb..fb6e54efc 100644 --- a/Scripts/main.gd +++ b/Scripts/main.gd @@ -61,7 +61,14 @@ func init_world(index): var UI = preload("res://Scenes/UI/UI.tscn").instance() get_node("ViewportContainer/DesktopViewport").add_child(UI) - get_node("ViewportContainer/DesktopViewport/Camera/LocationTracker").go() + + var session_id = ServerConnection.getJson(server,"/location/session/asdf", port) + if session_id.has("Error"): + logger.error("Could not get the session id") + else: + global.session_id = session_id.Data + logger.info("The session id is: %d" % global.session_id) + get_node("ViewportContainer/DesktopViewport/Camera/LocationTracker").go()