Hi - At the end of my online game - i'm receiving a long delay due to Scripts Error (A red shield appears on the Right Hand Side of the url field - at the top of the browser) in Google Chrome
this is the url of my game
https://rockabilly19.com/rocktheworld/index.html
As an apk android app - the scores upload fine to my webhost server.
Selecting view, developer, javascript console i have the following displayed in Google Chrome.
*******************************************************************************************************************************************
Failed to load resource: the server responded with a status of 401 ()
https://realtimesupport.clients6.google.com/v2/customers/me/availabilities?…R&client_version=1481446959321&key=AIzaSyB5V4SIBGmrqREm7kf2fBJgPcBMCdUrLzE
*******************************************************************************************************************************************
I hope someone can assist. Thanks
Im using these functions in my game to upload scores
function SendScore(iScoremove$, sUserName$)
//Open an HTTP Connection
con = CreateHTTPConnection()
httpsOn = 0 //set whether you want to use SSL connection or not - we're not using one for this example.
domain$ = "www.rockabilly19.com"
directoryUserName$ = "**********"
directoryUserPassword$ = "**********"
secureDirectory = 0
directoryName$ = "rockscores/"
scriptName$ = "scores.php"
//Set the host for the connection
if secureDirectory = 1
SetHTTPHost(con , domain$ , httpsOn , directoryUserName$ , directoryUserPassword$)
else
SetHTTPHost(con , domain$ , httpsOn)
endif
//Create the post data that will be sent to the script.
post$ = "name=" + sUserName$ + "&" + "score=" + iScoremove$
//Initiate the request - I prefer async so we can give the user a waiting screen while the connection is working.
SendHTTPRequestASync(con , directoryName$ + scriptName$ , post$)
time0 = GetMilliseconds()
repeat
timeNow = GetMilliseconds()
timeElapsed = (timeNow - time0)
// Print("Time elapsed " + str(timeElapsed)) //Here we'd have an actual waiting animation or message.
ready = GetHTTPResponseReady(con)
if ready <> 0 or timeElapsed > 60000 //set a timeout limit
done = 1
endif
Sync()
until done = 1
if ready = 1
// We got a response, let's see how to handle it.
responseCode = val(GetHTTPResponse(con))
if responseCode = 1
//Tell the player that the score is a high score!
elseif responseCode = -1
//Report that the score is not a high score.
else
//Report there was some sort of error. You may also want to try again at this point in case there was a temporary issue.
endif
elseif ready = -1
//Report there was a connection error - this could happen due to a lost internet connection or the server failed to respond.
else
//Report there was a timeout error.
endif
CloseHTTPConnection(con)
DeleteHTTPConnection(con)
endfunction
function GetHighScores()
con = CreateHTTPConnection()
httpsOn = 0 //set whether you want to use SSL connection or not - we're not using one for this example.
domain$ = "www.rockabilly19.com"
directoryUserName$ = "**********"
directoryPassword$ = "**********"
secureDirectory = 0
directoryName$ = "rockscores/"
scriptName$ = "getscores.php"
//Set the host for the connection
if secureDirectory = 1
SetHTTPHost(con , domain$ , httpsOn , directoryUserName$ , directoryPassword$)
else
SetHTTPHost(con , domain$ , httpsOn)
endif
//We do not need to send post data to this script, but you may wish to do so.
post$ = ""
//Initiate the request - I prefer async so we can give the user a waiting screen while the connection is working.
SendHTTPRequestASync(con , directoryName$ + scriptName$ , post$)
time0 = GetMilliseconds()
repeat
timeNow = GetMilliseconds()
timeElapsed = (timeNow - time0)
// Print("Time elapsed " + str(timeElapsed)) //Here we'd have an actual waiting animation or message.
ready = GetHTTPResponseReady(con)
if ready <> 0 or timeElapsed > 60000 //set a timeout limit
done = 1
endif
Sync()
until done = 1
if ready = 1
// We got a response! We're not using response codes this time for simplicity.
response$ = GetHTTPResponse(con)
//Message(response$)
CreateText(76,response$)
LoadImage (76,"custom.png")
SetTextFontImage(76,76)
SetTextSize(76,15)
SetTextPosition(76,180,65)
SetTextColor( 76,0, 0,0,500 )
SetTextDepth(76,1)
sync()
//for his = 1 to 3500000
//next his
elseif ready = -1
//Report there was a connection error - this could happen due to a lost internet connection or the server failed to respond.
Message("Server connection failed")
else
//Report there was a timeout error.
Message("Server connection failed - timeout")
endif
CloseHTTPConnection(con)
DeleteHTTPConnection(con)
endfunction