diff --git a/GameServer/managers/playermanager/FriendsManager.cs b/GameServer/managers/playermanager/FriendsManager.cs index 86d5aeb7f6..4dbd606975 100644 --- a/GameServer/managers/playermanager/FriendsManager.cs +++ b/GameServer/managers/playermanager/FriendsManager.cs @@ -102,7 +102,7 @@ public void AddPlayerFriendsListToCache(GamePlayer Player) var offlineFriends = new FriendStatus[0]; if (friends.Any()) { - offlineFriends = Database.SelectObjects("`Name` = @Name", friends.Select(name => new[] { new QueryParameter("@Name", name) })).SelectMany(chars => chars) + offlineFriends = Database.SelectObjects(DB.Column("Name").IsIn(friends)) .Select(chr => new FriendStatus(chr.Name, chr.Level, chr.Class, chr.LastPlayed)).ToArray(); } diff --git a/GameServer/packets/Server/PacketLib1104.cs b/GameServer/packets/Server/PacketLib1104.cs index 681666fdec..df0406a1f9 100644 --- a/GameServer/packets/Server/PacketLib1104.cs +++ b/GameServer/packets/Server/PacketLib1104.cs @@ -78,9 +78,10 @@ public override void SendCharacterOverview(eRealm realm) if (charsBySlot.Any()) { - var allItems = GameServer.Database.SelectObjects("`OwnerID` = @OwnerID AND `SlotPosition` >= @MinEquipable AND `SlotPosition` <= @MaxEquipable", - charsBySlot.Select(kv => new [] { new QueryParameter("@OwnerID", kv.Value.ObjectId), new QueryParameter("@MinEquipable", (int)eInventorySlot.MinEquipable), new QueryParameter("@MaxEquipable", (int)eInventorySlot.MaxEquipable) })) - .SelectMany(objs => objs); + var ownerIdWhere = DB.Column("OwnerID").IsIn(charsBySlot.Values.Select(c => c.ObjectId)); + var slotWhere = DB.Column("SlotPosition").IsGreaterOrEqualTo((int)eInventorySlot.MinEquipable) + .And(DB.Column("SlotPosition").IsLessOrEqualTo((int)eInventorySlot.MaxEquipable)); + var allItems = GameServer.Database.SelectObjects(ownerIdWhere.And(slotWhere)); foreach (InventoryItem item in allItems) {