private void OnCharacterListingRequest(INetworkConnection con, Packet msg) { // character was created successfully. send a listing of all new characters PacketCharacterListing pcl = (PacketCharacterListing)con.CreatePacket((int)PacketType.CharacterListing, 0, false, false); List <ICharacterInfo> allToons = CharacterUtil.Instance.GetCharacterListing(this.ServerUser.ID); if (allToons.Count == 0) { if (ServerUser.CurrentCharacter != null) { pcl.Characters.Add(ServerUser.CurrentCharacter.CharacterInfo); } else { pcl.Characters = new List <ICharacterInfo>(); } } else { foreach (ICharacterInfo inf in allToons) { pcl.Characters.Add(inf); } } msg.ReplyPacket = pcl; }
private void OnCharacterListingRequest(INetworkConnection con, Packet msg) { // character was created successfully. send a listing of all new characters PacketCharacterListing pcl = (PacketCharacterListing)con.CreatePacket((int)PacketType.CharacterListing, 0, false, false); List<ICharacterInfo> allToons = CharacterUtil.Instance.GetCharacterListing(this.ServerUser.ID); if (allToons.Count == 0) { if(ServerUser.CurrentCharacter != null) { pcl.Characters.Add(ServerUser.CurrentCharacter.CharacterInfo); } else { pcl.Characters = new List<ICharacterInfo>(); } } else { foreach (ICharacterInfo inf in allToons) { pcl.Characters.Add(inf); } } msg.ReplyPacket = pcl; }