コード例 #1
0
        public void OnCharListRequest(Packets.Client.CM_CHAR_LIST_REQUEST p)
        {
            Logger.Log.Info(string.Format(this + ":Player is requesting char list for account ID:{0}", p.AccountID));

            SM_CHAR_LIST p1 = new SM_CHAR_LIST()
            {
                SessionID = p.SessionID
            };
            List <uint> ids = CharacterDB.Instance.GetCharIDs(p.AccountID);

            foreach (uint i in CharacterCache.Instance.GetCharIDsForAccount(p.AccountID))
            {
                if (!ids.Contains(i))
                {
                    ids.Add(i);
                }
            }
            List <ActorPC> res = new List <ActorPC>();

            foreach (uint i in ids)
            {
                ActorPC pc = CharacterCache.Instance[i];
                if (pc != null)
                {
                    res.Add(pc);
                }
            }
            p1.Characters = res;
            Logger.Log.Info(string.Format(this + ":Got {0} Characters", res.Count));

            Network.SendPacket(p1);
        }
コード例 #2
0
        public void OnCharList(SM_CHAR_LIST p)
        {
            long session = p.SessionID;

            if (packetSessions.TryRemove(session, out T client))
            {
                OnCharList(client, p.Characters);
            }
        }