private void OnDataRecieved(string data) { if (player.kills <= lastKills && player.death <= lastDeaths) { return; } int killsSinceLast = player.kills - lastKills; int deathSinceLast = player.death - lastDeaths; //if (killsSinceLast <= 0 && deathSinceLast <= 0) //{ // return; //} int kills = DataTranslator.DataToKills(data); int deaths = DataTranslator.DataToDeath(data); int totalKills = killsSinceLast + kills; int totalDeaths = deathSinceLast + deaths; string newData = DataTranslator.ValuesToData(totalKills, totalDeaths); Debug.Log("Syncing: " + newData); lastKills = player.kills; lastDeaths = player.death; UserAccountManager.instance.SendData(newData); }
private void OnDataReceived(string data) { if (player.kills <= lastKills && player.deaths <= lastDeaths) { return; } int killsSinceLastSync = player.kills - lastKills; int deathsSinceLastSync = player.deaths - lastDeaths; int kills = DataTranslator.DataToKills(data); int deaths = DataTranslator.DataToDeaths(data); int newKills = killsSinceLastSync + kills; int newDeaths = deathsSinceLastSync + deaths; string newData = DataTranslator.ValuesToData(newKills, newDeaths); Debug.Log("Syncig: " + newData); lastKills = player.kills; lastDeaths = player.deaths; UserAccountManager.instance.SendData(newData); }
void OnReceivedData(string data) { if (player.GetKills() <= lastKills && player.GetDeaths() <= lastDeaths) { return; } int killsSince = player.GetKills() - lastKills; int deathsSince = player.GetDeaths() - lastDeaths; if (killsSince == 0 && deathsSince == 0) { return; } int kills = DataTranslator.DataToKills(data); int deaths = DataTranslator.DataToDeaths(data); int newKills = killsSince + kills; int newDeaths = deathsSince + deaths; string newData = DataTranslator.ValueToData(newKills, newDeaths); //Debug.Log("Syncing: " + newData); lastKills = player.GetKills(); lastDeaths = player.GetDeaths(); UserAccountManager.instance.SendData(newData); }
void OnDataRecieved(string data) { if (player.kills <= lastKills && player.deaths <= lastDeaths) { return; } int killsSinceLast = player.kills - lastKills; int deathsSinceLast = player.deaths - lastDeaths; // Replaced by code on line 49 //if (killsSinceLast == 0 && deathsSinceLast == 0) //{ // return; //} int kills = DataTranslator.DataToKills(data); int deaths = DataTranslator.DataToDeaths(data); int newKills = killsSinceLast + kills; int newDeaths = deathsSinceLast + deaths; string newData = DataTranslator.ValuesToData(newKills, newDeaths); Debug.Log("Syncing: " + newData); lastKills = player.kills; lastDeaths = player.deaths; UserAccountManager.instance.SendData(newData); }
void OnDataReceived(string data) { if (player.kills <= lastKills && player.deaths <= lastDeaths) { return; } int killsSinceLast = player.kills - lastKills; int deathsSinceLast = player.deaths - lastDeaths; int kills = DataTranslator.DataToKills(data); int deaths = DataTranslator.DataToDeaths(data); int newKills = killsSinceLast + kills; int newDeaths = deathsSinceLast + deaths; string newData = DataTranslator.ValuesToData(newKills, newDeaths); Debug.Log("Syncing: " + newData); lastKills = player.kills; lastDeaths = player.deaths; UserAcountManager.instance.LoggedIn_SaveDataButtonPressed(newData); }
void OnDataReceived(string data) { if (player.kills <= lastKills && player.deaths <= lastDeaths) { return; } int killsSinceLast = player.kills - lastKills; int deathsSinceLast = player.deaths - lastDeaths; int kills = DataTranslator.DataToKills(data); int deaths = DataTranslator.DataToDeaths(data); //for new kills and deaths int newKills = killsSinceLast + kills; int newDeaths = deathsSinceLast + deaths; string newData = DataTranslator.ValuesToData(newKills, newDeaths);//storages newkills, newdata in string called newData //to be sent to valuestodata Debug.Log("Syncing: " + newData); //To update kills and deaths variables lastKills = player.kills; lastDeaths = player.deaths; UserAccountManager.instance.SendData(newData);//sends updated info to valuestodata method inside datatranslator to transform it to //data format by using senddata method inside useraccountmanager }
void OnDataReceived(string _data) { if (player.kills <= lastKills && player.deaths <= lastDeaths) { return; } int killsSinceLast = player.kills - lastKills; int deathsSinceLast = player.deaths - lastDeaths; if (killsSinceLast == 0 && deathsSinceLast == 0) { return; } int _kills = DataTranslator.DataToKills(_data); int _deaths = DataTranslator.DataToDeaths(_data); int _newKills = killsSinceLast + _kills; int _newDeaths = deathsSinceLast + _deaths; string _newData = DataTranslator.ValuesToData(_newKills, _newDeaths); Debug.Log("Syncing: " + _newData); lastKills = player.kills; lastDeaths = player.deaths; UserAccountManager.instance.SendData(_newData); }
void OnDataRecieved(string data) { if (player.kills <= lastKills && player.death <= lastDeath) { return; } int killsSinceLastTime = player.kills - lastKills; int deathSinceLastTime = player.death - lastDeath; //récupère les morts et les kills du joueurs dans la base de donnée int kills = DataTranslator.DataToKills(data); int death = DataTranslator.DataToDeath(data); int newKills = killsSinceLastTime + kills; int newDeath = deathSinceLastTime + death; string newData = DataTranslator.ValueToData(newKills, newDeath); lastKills = player.kills; lastDeath = player.death; Debug.Log("Syncing : " + newData); UserAccountManager.instance.SendData(newData); }
void OnDataReceived(string data) { //if (killCount == null || deathCount == null) // return; killCount.text = DataTranslator.DataToKills(data).ToString() + " KILLS"; deathCount.text = DataTranslator.DataToDeaths(data).ToString() + " DEATHS"; }
void OnReceivedData(string data) { if (killCount == null || deathCount == null) { return; } killCount.text = DataTranslator.DataToKills(data).ToString() + " KILLS"; deathCount.text = DataTranslator.DataToDeaths(data).ToString() + " DEATHS"; }
void OnReceivedData(string data) { if (killCount == null || deathCount == null) { return; } killCount.text = "Kills: " + DataTranslator.DataToKills(data); deathCount.text = "Deaths: " + DataTranslator.DataToDeath(data); }
void OnReceivedData(string data) //This is added as a function because it takes time to receive info from the server { if (killCount == null || deathCount == null) { return; } killCount.text = DataTranslator.DataToKills(data).ToString() + " Kills"; //Calls datatokills function in datatranslator and sends data in form of string deathCount.text = DataTranslator.DataToDeaths(data).ToString() + " Deaths"; //Calls datatodeaths function in datatranslator and sends data in form of string }
void OnReceivedData(string data) { //Debug.Log(data); if (killCount == null || deathCount == null) { return; } killCount.text = DataTranslator.DataToKills(data).ToString() + " Kills"; deathCount.text = DataTranslator.DataToDeaths(data).ToString() + " Deaths"; }
void OnRecievedData(string data) { if (player.kills == 0) { return; } int kills = DataTranslator.DataToKills(data); int newKills = player.kills + kills; string newData = DataTranslator.ValuesToData(kills); Debug.Log("Syncing"); player.kills = 0; useraccmanager.instance.SendData(newData); }
void OnDataRecieved(string data) { if (player.kills == 0 && player.deaths == 0) { return; } int kills = DataTranslator.DataToKills(data); int deaths = DataTranslator.DataToDeaths(data); int newKills = player.kills + kills; int newDeaths = player.deaths + deaths; string newData = DataTranslator.ValuesToData(newKills, newDeaths); Debug.Log("Syncing:" + newData); UserAccountManager.instance.SendUserData(newData); player.kills = 0; player.deaths = 0; }
void OnDataReceived(string data) { if (player.kills > lastKills && player.kills > lastDeath) return; int killsSinceLast = player.kills - lastKills; int deathsSinceLast = player.deaths - lastDeath; int kills = DataTranslator.DataToKills(data); int deaths = DataTranslator.DataToDeaths(data); int newKills = killsSinceLast + kills; int newDeath = deathsSinceLast + deaths; string newData = DataTranslator.ValuesToData(newKills, newDeath); Debug.Log("Syncing " + newData); lastKills = player.kills; lastDeath = player.deaths; UserAccountManager.instance.SendData(newData); }
void OnDataRecieved(string data) { if (HitCount.kills <= lastKills) { return; } high = DataTranslator.DataToKills(data); if (HitCount.kills > high) { high = HitCount.kills; Debug.Log("NEW HIGH"); } string newData = DataTranslator.ValuesToData(high); Debug.Log("Syncing: " + newData); lastKills = HitCount.kills; UserAccountManager.instance.SendData(newData); }
void OnDataReceived(string data) { if (player.Kills <= lastKills && player.Deaths <= lastDeaths) { return; } int killsSinceLast = player.Kills - lastKills; int deathsSinceLast = player.Deaths - lastDeaths; int kills = DataTranslator.DataToKills(data); int deaths = DataTranslator.DataToDeaths(data); int newKills = killsSinceLast + kills; int newDeaths = deathsSinceLast + deaths; lastKills = player.Kills; lastDeaths = player.Deaths; string newData = DataTranslator.ValueToData(newKills, newDeaths); Debug.Log("Syncing " + newData); UserAccountManager.instance.SaveorSetData(newData); }
public void OnReceivedData(string data) { KillCount.text = DataTranslator.DataToKills(data).ToString(); DeathCount.text = DataTranslator.DataToDeath(data).ToString(); }
void onRecievedData(string data) { killCount.text = DataTranslator.DataToKills(data).ToString() + " KILLS"; }
void OnDataRecieved(string data) { Debug.Log("GOT DATA"); highScore.text = "HIGH SCORE: " + DataTranslator.DataToKills(data); }
void OnReceivedData(string data) { killCount.text = DataTranslator.DataToKills(data).ToString() + " KILLS"; deathCount.text = DataTranslator.DataToDeaths(data).ToString() + " DEATHS"; }