Ejemplo n.º 1
0
    public void Log(AttackEntity weapon, Projectile projectile, string description = null)
    {
        uint d;

        CombatLog.Event @event = new CombatLog.Event()
        {
            time = UnityEngine.Time.realtimeSinceStartup
        };
        if (!this.player || this.player.net == null)
        {
            d = 0;
        }
        else
        {
            d = this.player.net.ID;
        }
        @event.attacker_id = d;
        @event.target_id   = 0;
        @event.attacker    = "you";
        @event.target      = "N/A";
        @event.weapon      = (weapon ? weapon.name : "N/A");
        @event.ammo        = (projectile ? projectile.name : "N/A");
        @event.bone        = "N/A";
        @event.area        = (HitArea)0;
        @event.distance    = 0f;
        @event.health_old  = 0f;
        @event.health_new  = 0f;
        @event.info        = (description != null ? description : string.Empty);
        this.Log(@event);
    }
Ejemplo n.º 2
0
    public void Log(HitInfo info, float health_old, float health_new, string description = null)
    {
        uint   d;
        uint   num;
        string str;
        string str1;

        CombatLog.Event healthOld = new CombatLog.Event()
        {
            time = UnityEngine.Time.realtimeSinceStartup
        };
        if (!info.Initiator || info.Initiator.net == null)
        {
            d = 0;
        }
        else
        {
            d = info.Initiator.net.ID;
        }
        healthOld.attacker_id = d;
        if (!info.HitEntity || info.HitEntity.net == null)
        {
            num = 0;
        }
        else
        {
            num = info.HitEntity.net.ID;
        }
        healthOld.target_id = num;
        if (this.player == info.Initiator)
        {
            str = "you";
        }
        else
        {
            str = (info.Initiator ? info.Initiator.ShortPrefabName : "N/A");
        }
        healthOld.attacker = str;
        if (this.player == info.HitEntity)
        {
            str1 = "you";
        }
        else
        {
            str1 = (info.HitEntity ? info.HitEntity.ShortPrefabName : "N/A");
        }
        healthOld.target     = str1;
        healthOld.weapon     = (info.WeaponPrefab ? info.WeaponPrefab.name : "N/A");
        healthOld.ammo       = (info.ProjectilePrefab ? info.ProjectilePrefab.name : "N/A");
        healthOld.bone       = info.boneName;
        healthOld.area       = info.boneArea;
        healthOld.distance   = (info.IsProjectile() ? info.ProjectileDistance : Vector3.Distance(info.PointStart, info.HitPositionWorld));
        healthOld.health_old = health_old;
        healthOld.health_new = health_new;
        healthOld.info       = (description != null ? description : string.Empty);
        this.Log(healthOld);
    }
Ejemplo n.º 3
0
    public void Log(CombatLog.Event val)
    {
        if (this.storage == null)
        {
            return;
        }
        this.storage.Enqueue(val);
        int num = Mathf.Max(0, ConVar.Server.combatlogsize);

        while (this.storage.Count > num)
        {
            this.storage.Dequeue();
        }
    }