Skip to content

Commit

Permalink
adjusted location tracker to reflect changes in server method
Browse files Browse the repository at this point in the history
- location tracker now uses session_id as additional parameter when connecting to server
  • Loading branch information
MoritzRoth committed Dec 12, 2018
1 parent 5232109 commit a4959ec
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Scripts/LocationTracker.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Scripts/global.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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 = []
9 changes: 8 additions & 1 deletion Scripts/main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -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()



Expand Down

0 comments on commit a4959ec

Please sign in to comment.