public void LoadUserAssignedCases( DatabaseMgr.Callback callback ) { // first try to load local CaseInfo.xml....if available then just use that if ( LoadXML("XML/CaseInfo") != null ) { // we have a local file, we're ok if ( callback != null ) callback(true,null,null,null); return; } loadCasesCallback = callback; WWWForm form = new WWWForm(); form.AddField("command", "loadUserAssignedCasesWithData"); // command without data is loadUserAssignedCases form.AddField("username", LoginMgr.GetInstance().Username); // if we are offline then do trauma offline container if (TraumaOfflineAssetContainer.GetInstance () != null && TraumaOfflineAssetContainer.GetInstance ().bUseOfflineAssets ) { TraumaOfflineAssetContainer.GetInstance ().DBCallOffline (GameMgr.GetInstance().DatabaseURL, form, loadCases); } else { DBCall(GameMgr.GetInstance().DatabaseURL,form,loadCases); } }
public void LoadCaseConfiguration( string name, DatabaseMgr.Callback callback ) { if ( UsingLocalData == true ) { // load local case if available CaseInfo localCase = LoadCaseInfo(name); if ( localCase != null ) { // set local data Data = localCase.CaseOptionData; // prepare PrepareCaseForStart(); // do callback if ( callback != null ) callback(true,null,null,null); } } else { // check to see if we have local data, if so just copy the data loadCaseCallback = callback; WWWForm form = new WWWForm(); form.AddField("command", "loadCase"); form.AddField("name", name); loadTime = Time.time; // if we are offline then do trauma offline container if (TraumaOfflineAssetContainer.GetInstance () != null && TraumaOfflineAssetContainer.GetInstance ().bUseOfflineAssets ) { TraumaOfflineAssetContainer.GetInstance ().DBCallOffline (GameMgr.GetInstance().DatabaseURL, form, loadCase); } else { DBCall(GameMgr.GetInstance().DatabaseURL,form,loadCase); } } }
public void LoadCaseConfigurations( DatabaseMgr.Callback callback ) { if ( UsingLocalData == true ) { // first try to load local CaseInfo.xml....if available then just use that if ( LoadXML("XML/CaseInfo") != null ) { // we have a local file, we're ok callback(true,null,null,null); return; } } else { loadCasesCallback = callback; WWWForm form = new WWWForm(); form.AddField("command", "loadCases"); form.AddField("owner", LoginMgr.GetInstance().Username); // if we are offline then do trauma offline container if (TraumaOfflineAssetContainer.GetInstance () != null && TraumaOfflineAssetContainer.GetInstance ().bUseOfflineAssets ) { TraumaOfflineAssetContainer.GetInstance ().DBCallOffline (GameMgr.GetInstance().DatabaseURL, form, loadCases); } else { DBCall(GameMgr.GetInstance().DatabaseURL,form,loadCases); } } }
public void CheckLogin( string username, string password, DatabaseMgr.Callback callback ) { this.username = username; this.password = password; // check for built-in admin if ( username == AdminName && password == AdminPassword ) { admin = true; validLogin = true; if ( callback != null ) callback(true,"","",null); return; } if ( AllowGuest == true && username == "guest" ) { admin = false; validLogin = true; if ( callback != null ) callback(true,"","",null); return; } checkLoginCallback = callback; #if USE_LMS_LOGIN LMSIntegration.GetInstance().LMSLoginWithPing(username,password,LoginCallback); #else WWWForm form = new WWWForm(); form.AddField("command","login"); form.AddField("username", username); form.AddField("password", password); DatabaseMgr.GetInstance().DBCall(GameMgr.GetInstance().DatabaseURL,form,LoginCallback); #endif }
public void GetLogins( DatabaseMgr.Callback callback ) { WWWForm form = new WWWForm(); form.AddField("command","loadLogins"); DatabaseMgr.GetInstance().DBCall(GameMgr.GetInstance().DatabaseURL,form,getLoginsCallback); loginsCallback = callback; }
public void CheckLoginWithPing( string username, string password, DatabaseMgr.Callback callback ) { this.username = username; this.password = password; // check for built-in admin if ( username == AdminName && password == AdminPassword ) { admin = true; validLogin = true; if ( callback != null ) callback(true,"","",null); return; } checkLoginCallback = callback; LMSIntegration.GetInstance().LMSLoginWithPing(username,password,LoginCallback); }
public DBCallInfo( string url, WWWForm form, DatabaseMgr.Callback callback ) { URL = url; Form = form; Callback = callback; }