Skip to content

Commit

Permalink
Small changes to get app ready for reuse
Browse files Browse the repository at this point in the history
  • Loading branch information
drakewill committed Apr 20, 2022
1 parent 22bd4ee commit 5dcf2da
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
9 changes: 6 additions & 3 deletions loadingScene.lua
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require("dataTracker")
local function startGame()
statusText.text = "Opening Game..."
composer.gotoScene("SceneSelect")
-- composer.gotoScene("geocacheScene")
-- composer.gotoScene("uploadTest")
end

function loadingGpsListener(event)
Expand Down Expand Up @@ -50,6 +50,7 @@ require("dataTracker")
--currentPlusCode = "376QRVF4+MP" --Antartic SPOI
--currentPlusCode = "85872779+F4" --Hoover Dam Lookout
--currentPlusCode = "85PFF56C+5P" --Old Faithful
-- currentPlusCode = "87G8Q2GH+7H" --Central park.
end

--These 2 are mostly duplicates of the ones in dataTracker, but I want to stop the loading process until I get the server bounds.
Expand Down Expand Up @@ -140,6 +141,7 @@ function scene:show( event )
CREATE INDEX IF NOT EXISTS terrainIndex on terrainData(pluscode);
CREATE INDEX IF NOT EXISTS generationIndex on tileGenerationData(pluscode);
CREATE INDEX IF NOT EXISTS hintIndex on geocacheHints(plusCode8);
CREATE INDEX IF NOT EXISTS creatureNameIndex on creaturesCaught(name);
INSERT OR IGNORE INTO systemData(id, dbVersionID, serverAddress) values (1, ]] .. currentDbVersion .. [[, 'https://oh.praxismapper.org:5001/');
INSERT OR IGNORE INTO playerData(id, factionID, totalPoints) values (1, 0, 0);
INSERT OR IGNORE INTO idleStats(id, lastAddTime, allPerSec, parkPerSec, naturePerSec, trailPerSec, graveyardPerSec, touristPerSec, allTotal, parkTotal, natureTotal, trailTotal, graveyardTotal, touristTotal, wins) values (1, ]] .. os.time() .. [[, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
Expand Down Expand Up @@ -170,9 +172,10 @@ function scene:show( event )

--Debug setup
--if (debug) then
--serverURL = "http://localhost/praxismapper/"
-- serverURL = "http://localhost/praxismapper/"
--serverURL = "http://localhost:5000/"
--serverURL = "http://192.168.50.247/praxismapper/"
serverURL = "https://oh.praxismapper.org:5001/"
--serverURL = "https://oh.praxismapper.org:5001/"
--serverURL = "https://us.praxismapper.org/praxismapper/"
--end

Expand Down
17 changes: 15 additions & 2 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ function backListener(event)
if (debug) then print("key listener got") end
if (event.keyName == "back" and event.phase == "up") then
local currentScene = composer.getSceneName("current")
if (currentScene == "SceneSelect") then
--TOOD: this detection does not work
if currentScene == "leaveHintOverlay" or currentScene == "creatureOverlay" or currentScene == "creatureList"
or currentScene == "getSecretOverlay" or currentScene == "leaveSecretOverlay" or currentScene == "overlayMPAreaClaim" then
composer.hideOverlay()
elseif (currentScene == "SceneSelect") then
return false
end
if (debug) then print("back to scene select") end
Expand Down Expand Up @@ -221,10 +225,19 @@ function DefaultNetCallHandler(event)
end
end

function DefaultQueuedNetCallHandler(event)
if (event.status ~= 200) then
netDown(event)
else
netUp()
end
networkQueueBusy = false
end

function netQueueCheck()
if #networkQueue> 0 and networkQueueBusy == false then
nextNetworkQueue()
end
end

timer.performWithDelay(25, netQueueCheck, -1)
timer.performWithDelay(5, netQueueCheck, -1)

0 comments on commit 5dcf2da

Please sign in to comment.