Skip to content

Commit

Permalink
Removed Simva Code
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorma committed May 4, 2020
1 parent 144cd14 commit 4e5661d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 34 deletions.
34 changes: 1 addition & 33 deletions Assets/uAdventure/__Scripts/Runner/GameLogic/GUIManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -373,39 +373,7 @@ public void ClearData()

public void ExitApplication()
{
if (PlayerPrefs.HasKey("LimesurveyToken") && PlayerPrefs.GetString("LimesurveyToken") != "ADMIN" && PlayerPrefs.HasKey("LimesurveyPost"))
{
string path = Application.persistentDataPath;

if (!path.EndsWith("/"))
{
path += "/";
}

Dictionary<string, string> headers = new Dictionary<string, string>();

Net net = new Net(this);

WWWForm data = new WWWForm();

TrackerAssetSettings trackersettings = (TrackerAssetSettings)TrackerAsset.Instance.Settings;
string backupfile = Application.persistentDataPath + System.IO.Path.DirectorySeparatorChar + trackersettings.BackupFile;

data.AddField("token", PlayerPrefs.GetString("LimesurveyToken"));
data.AddBinaryData("traces", System.Text.Encoding.UTF8.GetBytes(System.IO.File.ReadAllText(backupfile)));

//d//ata.headers.Remove ("Content-Type");// = "multipart/form-data";

net.POST(PlayerPrefs.GetString("LimesurveyHost") + "classes/collector", data, new SavedTracesListener());

System.IO.File.AppendAllText(path + PlayerPrefs.GetString("LimesurveyToken") + ".csv", System.IO.File.ReadAllText(backupfile));
PlayerPrefs.SetString("CurrentSurvey", "post");
SceneManager.LoadScene("_Survey");
}
else
{
Application.Quit();
}
Game.Instance.Exit();
}

class SavedTracesListener : Net.IRequestListener
Expand Down
19 changes: 18 additions & 1 deletion Assets/uAdventure/__Scripts/Runner/GameLogic/Game.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ protected void Awake()
protected void Start()
{
started = true;
GameState.OnGameResume();
if (!Application.isEditor)
{
GameState.OnGameResume();
}
gameExtensions.ForEach(g => g.OnAfterGameLoad());
uAdventureRaycaster = FindObjectOfType<uAdventureRaycaster>();
if (!uAdventureRaycaster)
Expand Down Expand Up @@ -403,6 +406,20 @@ public void Restart()
uAdventureInputModule.LookingForTarget = null;
}

public void Exit()
{
var exit = true;
foreach(var gameExtension in gameExtensions)
{
exit &= gameExtension.OnGameFinished();
}

if (exit)
{
Application.Quit();
}
}

public bool ContinueEffectExecution()
{
if (executeStack.Count > 0)
Expand Down

0 comments on commit 4e5661d

Please sign in to comment.