예제 #1
0
    /*
     * デバッグ用当たり判定の表示
     */
    public void DrawHitArea()
    {
        int len = modelSetting.GetHitAreasNum();

        for (int i = 0; i < len; i++)
        {
            string drawID = modelSetting.GetHitAreaID(i);
            float  left   = 0;
            float  right  = 0;
            float  top    = 0;
            float  bottom = 0;

            if (!getSimpleRect(drawID, out left, out right, out top, out bottom))
            {
                continue;
            }

            HitAreaUtil.DrawRect(matrixHitArea, left, right, top, bottom);
        }
    }
예제 #2
0
        string GetCombatLog(ulong steamid, int count)
        {
            var storage = CombatLog.Get(steamid);

            TextTable textTable = new TextTable();

            textTable.AddColumn("time");
            textTable.AddColumn("attacker");
            textTable.AddColumn("id");
            textTable.AddColumn("target");
            textTable.AddColumn("id");
            textTable.AddColumn("weapon");
            textTable.AddColumn("ammo");
            textTable.AddColumn("area");
            textTable.AddColumn("distance");
            textTable.AddColumn("old_hp");
            textTable.AddColumn("new_hp");
            textTable.AddColumn("info");

            int num  = storage.Count - count;
            int num1 = ConVar.Server.combatlogdelay;
            int num2 = 0;

            foreach (CombatLog.Event evt in storage)
            {
                if (num <= 0)
                {
                    float single = Time.realtimeSinceStartup - evt.time;
                    if (single < (float)num1)
                    {
                        num2++;
                    }
                    else
                    {
                        string str  = single.ToString("0.0s");
                        string str1 = evt.attacker == "you" ? GetNameFromId(steamid.ToString()) : evt.attacker;

                        string str2 = storedData.Players.ContainsKey((uint)evt.attacker_id) ? GetNameFromId(storedData.Players[(uint)evt.attacker_id].ToString()) : evt.attacker_id.ToString();

                        string str3 = evt.target == "you" ? GetNameFromId(steamid.ToString()) : evt.target;

                        string str4 = storedData.Players.ContainsKey((uint)evt.target_id) ? GetNameFromId(storedData.Players[(uint)evt.target_id].ToString()) : evt.target_id.ToString();

                        string str5  = evt.weapon;
                        string str6  = evt.ammo;
                        string lower = HitAreaUtil.Format(evt.area).ToLower();
                        string str7  = evt.distance.ToString("0.0m");
                        string str8  = evt.health_old.ToString("0.0");
                        string str9  = evt.health_new.ToString("0.0");
                        string str10 = evt.info;
                        textTable.AddRow(new string[] { str, str1, str2, str3, str4, str5, str6, lower, str7, str8, str9, str10 });
                    }
                }
                else
                {
                    num--;
                }
            }

            string str11 = textTable.ToString();

            if (num2 > 0)
            {
                string   str12    = str11;
                object[] objArray = new object[] { str12, "+ ", num2, " ", null };
                objArray[4] = (num2 <= 1 ? "event" : "events");
                str11       = string.Concat(objArray);
                str12       = str11;
                object[] objArray1 = new object[] { str12, " in the last ", num1, " ", null };
                objArray1[4] = (num1 <= 1 ? "second" : "seconds");
                str11        = string.Concat(objArray1);
            }
            return(str11);
        }
예제 #3
0
    public string Get(int count)
    {
        if (storage == null)
        {
            return(string.Empty);
        }
        if (storage.Count == 0)
        {
            return("Combat log empty.");
        }
        TextTable textTable = new TextTable();

        textTable.AddColumn("time");
        textTable.AddColumn("attacker");
        textTable.AddColumn("id");
        textTable.AddColumn("target");
        textTable.AddColumn("id");
        textTable.AddColumn("weapon");
        textTable.AddColumn("ammo");
        textTable.AddColumn("area");
        textTable.AddColumn("distance");
        textTable.AddColumn("old_hp");
        textTable.AddColumn("new_hp");
        textTable.AddColumn("info");
        int num            = storage.Count - count;
        int combatlogdelay = Server.combatlogdelay;
        int num2           = 0;

        foreach (Event item in storage)
        {
            if (num > 0)
            {
                num--;
                continue;
            }
            float num3 = UnityEngine.Time.realtimeSinceStartup - item.time;
            if (num3 >= (float)combatlogdelay)
            {
                string text        = num3.ToString("0.0s");
                string attacker    = item.attacker;
                uint   attacker_id = item.attacker_id;
                string text2       = attacker_id.ToString();
                string target      = item.target;
                attacker_id = item.target_id;
                string text3    = attacker_id.ToString();
                string weapon   = item.weapon;
                string ammo     = item.ammo;
                string text4    = HitAreaUtil.Format(item.area).ToLower();
                float  distance = item.distance;
                string text5    = distance.ToString("0.0m");
                distance = item.health_old;
                string text6 = distance.ToString("0.0");
                distance = item.health_new;
                string text7 = distance.ToString("0.0");
                string info  = item.info;
                textTable.AddRow(text, attacker, text2, target, text3, weapon, ammo, text4, text5, text6, text7, info);
            }
            else
            {
                num2++;
            }
        }
        string text8 = textTable.ToString();

        if (num2 > 0)
        {
            text8 = text8 + "+ " + num2 + " " + ((num2 > 1) ? "events" : "event");
            text8 = text8 + " in the last " + combatlogdelay + " " + ((combatlogdelay > 1) ? "seconds" : "second");
        }
        return(text8);
    }
예제 #4
0
    public string Get(int count)
    {
        if (this.storage == null)
        {
            return(string.Empty);
        }
        if (this.storage.Count == 0)
        {
            return("Combat log empty.");
        }
        TextTable textTable = new TextTable();

        textTable.AddColumn("time");
        textTable.AddColumn("attacker");
        textTable.AddColumn("id");
        textTable.AddColumn("target");
        textTable.AddColumn("id");
        textTable.AddColumn("weapon");
        textTable.AddColumn("ammo");
        textTable.AddColumn("area");
        textTable.AddColumn("distance");
        textTable.AddColumn("old_hp");
        textTable.AddColumn("new_hp");
        textTable.AddColumn("info");
        int num  = this.storage.Count - count;
        int num1 = ConVar.Server.combatlogdelay;
        int num2 = 0;

        foreach (CombatLog.Event @event in this.storage)
        {
            if (num <= 0)
            {
                float single = UnityEngine.Time.realtimeSinceStartup - @event.time;
                if (single < (float)num1)
                {
                    num2++;
                }
                else
                {
                    string str   = single.ToString("0.0s");
                    string str1  = @event.attacker;
                    string str2  = @event.attacker_id.ToString();
                    string str3  = @event.target;
                    string str4  = @event.target_id.ToString();
                    string str5  = @event.weapon;
                    string str6  = @event.ammo;
                    string lower = HitAreaUtil.Format(@event.area).ToLower();
                    string str7  = @event.distance.ToString("0.0m");
                    string str8  = @event.health_old.ToString("0.0");
                    string str9  = @event.health_new.ToString("0.0");
                    string str10 = @event.info;
                    textTable.AddRow(new string[] { str, str1, str2, str3, str4, str5, str6, lower, str7, str8, str9, str10 });
                }
            }
            else
            {
                num--;
            }
        }
        string str11 = textTable.ToString();

        if (num2 > 0)
        {
            object[] objArray = new object[] { str11, "+ ", num2, " ", null };
            objArray[4] = (num2 > 1 ? "events" : "event");
            str11       = string.Concat(objArray);
            object[] objArray1 = new object[] { str11, " in the last ", num1, " ", null };
            objArray1[4] = (num1 > 1 ? "seconds" : "second");
            str11        = string.Concat(objArray1);
        }
        return(str11);
    }
예제 #5
0
    public string Get(int count)
    {
        if (this.storage == null)
        {
            return(string.Empty);
        }
        if (this.storage.Count == 0)
        {
            return("Combat log empty.");
        }
        TextTable textTable = new TextTable();

        textTable.AddColumn("time");
        textTable.AddColumn("attacker");
        textTable.AddColumn("id");
        textTable.AddColumn("target");
        textTable.AddColumn("id");
        textTable.AddColumn("weapon");
        textTable.AddColumn("ammo");
        textTable.AddColumn("area");
        textTable.AddColumn("distance");
        textTable.AddColumn("old_hp");
        textTable.AddColumn("new_hp");
        textTable.AddColumn("info");
        int num1           = this.storage.Count - count;
        int combatlogdelay = Server.combatlogdelay;
        int num2           = 0;

        foreach (CombatLog.Event @event in this.storage)
        {
            if (num1 > 0)
            {
                --num1;
            }
            else
            {
                float num3 = Time.get_realtimeSinceStartup() - @event.time;
                if ((double)num3 >= (double)combatlogdelay)
                {
                    string str1     = num3.ToString("0.0s");
                    string attacker = @event.attacker;
                    uint   num4     = @event.attacker_id;
                    string str2     = num4.ToString();
                    string target   = @event.target;
                    num4 = @event.target_id;
                    string str3   = num4.ToString();
                    string weapon = @event.weapon;
                    string ammo   = @event.ammo;
                    string lower  = HitAreaUtil.Format(@event.area).ToLower();
                    float  num5   = @event.distance;
                    string str4   = num5.ToString("0.0m");
                    num5 = @event.health_old;
                    string str5 = num5.ToString("0.0");
                    num5 = @event.health_new;
                    string str6 = num5.ToString("0.0");
                    string info = @event.info;
                    textTable.AddRow(new string[12]
                    {
                        str1,
                        attacker,
                        str2,
                        target,
                        str3,
                        weapon,
                        ammo,
                        lower,
                        str4,
                        str5,
                        str6,
                        info
                    });
                }
                else
                {
                    ++num2;
                }
            }
        }
        string str = ((object)textTable).ToString();

        if (num2 > 0)
        {
            str = str + "+ " + (object)num2 + " " + (num2 > 1 ? (object)"events" : (object)"event") + " in the last " + (object)combatlogdelay + " " + (combatlogdelay > 1 ? (object)"seconds" : (object)"second");
        }
        return(str);
    }