Example #1
0
        private int GetContinuesKillRecord(ulong characterId)
        {
            KillRecord record = null;

            if (DictKillRecord.TryGetValue(characterId, out record))
            {
                return(record.ContinuesKill);
            }
            return(0);
        }
Example #2
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;
        }
Example #3
0
        public void Closeout()
        {
            foreach (var team in Teams)
            {
                team.Players.Clear();
                team.Players    = null;
                team.PlayerZero = null;
            }

            ColUtility.Free(Teams);
            ColUtility.Free(Banned);
            ColUtility.Free(Warned);
            KillRecord.Clear();

            Teams      = null;
            Banned     = null;
            Warned     = null;
            KillRecord = null;
        }
Example #4
0
        public IEnumerator ApplyPlayerExdata(Coroutine coroutine, ObjPlayer player)
        {
            Int32Array array = new Int32Array();

            array.Items.Add((int)eExdataDefine.e770);
            var result = SceneServer.Instance.LogicAgent.SSFetchExdata(player.ObjId, array);

            yield return(result.SendAndWaitUntilDone(coroutine));

            if (result.State != MessageState.Reply || result.ErrorCode != (int)ErrorCodes.OK)
            {
                Logger.Warn("ApplyPlayerExdata");
                yield break;
            }
            var        nCount = result.Response.Items[0];
            KillRecord record;

            if (false == DictKillRecord.TryGetValue(player.ObjId, out record))
            {
                record         = new KillRecord();
                record.KillNum = player.GetExdata((int)eExdataDefine.e770);
                DictKillRecord.Add(player.ObjId, record);
            }
            record.KillNum = nCount;
            AssignMsg();
            PushActionToAllPlayer(proxyPlayer =>
            {
                if (!proxyPlayer.Active)
                {
                    return;
                }
                AssignSelfMsg(proxyPlayer.ObjId);
                // 向客户端刷新副本信息
                Msg.Int32OneList.Clear();
                Msg.FloatList.Clear();
                Msg.Int32OneList.Add(GetAlivePlayerNum());
                Msg.Int32OneList.Add(PlayerCount);
                Msg.FloatList.Add(TimeExpRatio);
                proxyPlayer.Proxy.NotifyRefreshDungeonInfo(Msg);
            });
            yield break;
        }