예제 #1
0
        protected override void Handle(Client client, CListEndPacket packet)
        {
            Dictionary <short, Character> cachedCharacters = _cache.Get <Dictionary <short, Character> >(CListPacketHandler.CListPacketCacheKey);

            _eventManager.Emit(new CharactersListReceivedEvent(client)
            {
                Characters = cachedCharacters
            });
        }
예제 #2
0
        protected override void Handle(Client client, CListPacket packet)
        {
            var character = new Character(_logger, 0, packet.Name, client)
            {
                Class  = packet.Class,
                Gender = packet.Gender,
                Level  = packet.Level
            };

            Dictionary <short, Character> cachedCharacters = _cache.Get <Dictionary <short, Character> >(CListPacketCacheKey);

            if (cachedCharacters == null)
            {
                cachedCharacters = new Dictionary <short, Character>();
            }

            cachedCharacters.Add(packet.Slot, character);

            _cache.Set(CListPacketCacheKey, cachedCharacters);
        }