force maintaince, update done. closes #4 closes #3

This commit is contained in:
2023-07-09 19:39:19 +05:30
parent 90348f0460
commit 1800d5008f
72 changed files with 4913 additions and 3151 deletions

View File

@@ -0,0 +1,44 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CheckUpdates : MonoBehaviour
{
public static int ClientVersion = 1;
public static int ServerVersion;
public float interval = 30;
float t;
void Awake(){
DontDestroyOnLoad(gameObject);
CheckUpdate();
}
void Update()
{
t+=Time.deltaTime;
if(t > interval){ t=0; CheckUpdate();}
}
public void CheckUpdate(){
StartCoroutine(checkUpdate());
}
IEnumerator checkUpdate(){
WWW req= new WWW(DataManager.API_ENDPOINT + "get_version.php");
yield return req;
Debug.Log("Server version: " + req.text);
ServerVersion = int.Parse(req.text);
if(ServerVersion <= 0){
LoadingScreen.LoadLevel("maintaince");
}else if(ServerVersion != ClientVersion){
LoadingScreen.LoadLevel("update");
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 775efbe35cbc92e2d8825c2ea27a4d0b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,10 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UI_Helpers : MonoBehaviour
{
public void OpenUrl(string url){
Application.OpenURL(url);
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4ed3a603205d37eac86efa443f93035f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: