mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-11-30 09:51:38 +00:00
Live replies to a friends query listed the friends' properties whatever their access type (64 entries with accessType 0) and the properties of the account's other characters (28 entries, isAlt set); the client draws the lock on the ones that are closed. The query only returned friends' properties that were open to friends. The list was also what kept a closed property from being entered, so PropertyEntranceComponent::OnEnterProperty now checks the selected entry itself: public for everybody, friends-only for friends, as before. Entries after the first are never marked as owned, as live. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
27 lines
1.3 KiB
C++
27 lines
1.3 KiB
C++
#include "GameDependencies.h"
|
|
|
|
#include "PropertyEntranceComponent.h"
|
|
#include "ePropertySortType.h"
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
// The property browser's reply says whether the list it answers was the friends list. Live sent wasFriends 1 on every
|
|
// reply to a sort 5 query and 0 on the replies to sort 1 (reputation) and sort 3 (recent).
|
|
TEST(PropertyEntranceComponentTests, WasFriendsFollowsTheSortMethod) {
|
|
EXPECT_TRUE(PropertyEntranceComponent::IsFriendsSort(SORT_TYPE_FEATURED));
|
|
EXPECT_TRUE(PropertyEntranceComponent::IsFriendsSort(SORT_TYPE_FRIENDS));
|
|
EXPECT_FALSE(PropertyEntranceComponent::IsFriendsSort(SORT_TYPE_REPUTATION));
|
|
EXPECT_FALSE(PropertyEntranceComponent::IsFriendsSort(SORT_TYPE_RECENT));
|
|
}
|
|
|
|
// The friends list shows closed properties too (the client draws a lock on them); selecting one must still go nowhere.
|
|
// Access types: 0 private, 1 friends, 2 public.
|
|
TEST(PropertyEntranceComponentTests, ClosedPropertiesInTheListCannotBeVisited) {
|
|
EXPECT_FALSE(PropertyEntranceComponent::CanVisit(0, false));
|
|
EXPECT_FALSE(PropertyEntranceComponent::CanVisit(0, true));
|
|
EXPECT_FALSE(PropertyEntranceComponent::CanVisit(1, false));
|
|
EXPECT_TRUE(PropertyEntranceComponent::CanVisit(1, true));
|
|
EXPECT_TRUE(PropertyEntranceComponent::CanVisit(2, false));
|
|
EXPECT_TRUE(PropertyEntranceComponent::CanVisit(2, true));
|
|
}
|