예제 #1
0
        private void AddKillOrDeadRecord(ulong characterId, bool kill)
        {
            KillRecord record = null;

            if (!DictKillRecord.TryGetValue(characterId, out record))
            {
                record = new KillRecord();
                DictKillRecord.Add(characterId, record);
            }

            var oldval    = record.ContinuesKill;
            var character = FindCharacter(characterId);

            if (kill)
            {
                if (oldval >= 0)
                {
                    oldval++;
                }
                else
                {
                    oldval = 1;
                }
                record.ContinuesKill = oldval;
                record.TotalKill++;
                ObjPlayer me = character as ObjPlayer;
                if (me != null)
                {
                    var dict = new Dict_int_int_Data();
                    record.KillNum++;
                    dict.Data.Add((int)eExdataDefine.e770, 1);
                    me.SendExDataChange(dict);
                }
            }
            else
            {
                if (oldval >= 0)
                {
                    oldval = -1;
                }
                else
                {
                    oldval--;
                }
            }
            record.ContinuesKill = oldval;
        }