Commits

mcc  committed 758fc69

Track pid

  • Participants
  • Parent commits 82f203b

Comments (0)

Files changed (2)

File media/overlay/launch/onLoad.lua

 bridge:coreServices().drawScreensFirst = true
 -- TODO: um.force?
 
+player_info = bridge:loadTableFromFile("player.xml", true)
+if (not player_info) or "table" ~= type( player_info ) or not player_info.id then
+	math.random(0,2147483646) math.random(0,2147483646) math.random(0,2147483646) -- WAKE UP!! WAKE UP!!
+	player_info = {}
+	player_info.id = string.format("p%s", math.random(0,2147483646))
+	bridge:saveTableIntoFile("player.xml", "player", player_info);
+	if _DEBUG then print({"PLAYER ID: ", player_info.id}) end
+end
+
 -- Start
 
 makeDos()

File media/overlay/play/onLoad.lua

 	if session and session.real then
 		local keep_session = session
 		reset_session()
-		put = {version=1.0, pid=-1, deaths=keep_session.deaths, totalf=keep_session.totalf}
+		put = {version=1.0, pid=player_info.id, deaths=keep_session.deaths, totalf=keep_session.totalf}
 		if keep_session.deaths then
 			local rms = 0
 			for i,v in ipairs(keep_session.f) do