DataToKills() public static method

public static DataToKills ( string data ) : int
data string
return int
コード例 #1
0
    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);
    }
コード例 #2
0
    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);
    }
コード例 #3
0
ファイル: PlayerScore.cs プロジェクト: raynerlrh/DRAGONZ
    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);
    }
コード例 #4
0
    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);
    }
コード例 #5
0
    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);
    }
コード例 #6
0
    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
    }
コード例 #7
0
    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);
    }
コード例 #8
0
    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);
    }
コード例 #9
0
    void OnDataReceived(string data)
    {
        //if (killCount == null || deathCount == null)
        //    return;

        killCount.text  = DataTranslator.DataToKills(data).ToString() + " KILLS";
        deathCount.text = DataTranslator.DataToDeaths(data).ToString() + " DEATHS";
    }
コード例 #10
0
 void OnReceivedData(string data)
 {
     if (killCount == null || deathCount == null)
     {
         return;
     }
     killCount.text  = DataTranslator.DataToKills(data).ToString() + " KILLS";
     deathCount.text = DataTranslator.DataToDeaths(data).ToString() + " DEATHS";
 }
コード例 #11
0
    void OnReceivedData(string data)
    {
        if (killCount == null || deathCount == null)
        {
            return;
        }

        killCount.text  = "Kills: " + DataTranslator.DataToKills(data);
        deathCount.text = "Deaths: " + DataTranslator.DataToDeath(data);
    }
コード例 #12
0
    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
    }
コード例 #13
0
    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";
    }
コード例 #14
0
    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);
    }
コード例 #15
0
    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;
    }
コード例 #16
0
ファイル: PlayerScore.cs プロジェクト: pdj2428/MultiplayerFPS
    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);
    }
コード例 #17
0
    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);
    }
コード例 #18
0
    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);
    }
コード例 #19
0
ファイル: PlayerStat.cs プロジェクト: DocJesus/FPS_Multi
 public void OnReceivedData(string data)
 {
     KillCount.text  = DataTranslator.DataToKills(data).ToString();
     DeathCount.text = DataTranslator.DataToDeath(data).ToString();
 }
コード例 #20
0
 void onRecievedData(string data)
 {
     killCount.text = DataTranslator.DataToKills(data).ToString() + " KILLS";
 }
コード例 #21
0
 void OnDataRecieved(string data)
 {
     Debug.Log("GOT DATA");
     highScore.text = "HIGH SCORE: " + DataTranslator.DataToKills(data);
 }
コード例 #22
0
 void OnReceivedData(string data)
 {
     killCount.text  = DataTranslator.DataToKills(data).ToString() + " KILLS";
     deathCount.text = DataTranslator.DataToDeaths(data).ToString() + " DEATHS";
 }