Skip to content
Snippets Groups Projects
Commit f55cb5e9 authored by Stuart John Watson's avatar Stuart John Watson
Browse files

Added 30 second heartbeat (rethinking the response data now)

parent 59fe4c7d
No related branches found
No related tags found
1 merge request!1Major Rebuild: AJAX and working game info
......@@ -138,6 +138,11 @@
SIGNUP_INFO = "Thank you for taking an interest in playing on the SUCS game server. Unfortunately the game server is currently only available to SUCS members, you can <a href=\"https://sucs.org/join\">sign up</a> to SUCS and get 24/7 access to the server plus all the other benefits that come with SUCS membership.";
function loginRefresh(){
console.log()
$.post("controll.php",{},onPostResponse);
}
function onPostResponse(response){
console.log(response)
var type = response["type"],
......@@ -185,6 +190,11 @@
$("#signup").show()
}
//Schedule a ping if its a good login
if (type == "sucs" | type == "uni"){
setTimeout(loginRefresh,30*1000);
}
$("#onlineList").empty();
for(var i=0;i<onlineUsers.length;i++){
$("<li>").text(onlineUsers[i]).appendTo("#onlineList");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment