mirror of
https://github.com/EggLinks/DanhengServer-OpenSource.git
synced 2026-01-02 20:26:03 +08:00
feat: privacy settings
This commit is contained in:
@@ -56,6 +56,7 @@ public class PlayerData : BaseDatabaseDataHelper
|
||||
[SugarColumn(IsNullable = true)] public long LastActiveTime { get; set; }
|
||||
|
||||
[SugarColumn(IsJson = true)] public List<int> TakenLevelReward { get; set; } = [];
|
||||
[SugarColumn(IsJson = true)] public PrivacySettingsPb PrivacySettings { get; set; } = new();
|
||||
|
||||
public static PlayerData? GetPlayerByUid(long uid)
|
||||
{
|
||||
@@ -162,7 +163,7 @@ public class PlayerData : BaseDatabaseDataHelper
|
||||
WorldLevel = (uint)WorldLevel,
|
||||
EMOBIJBDKEI = true, // ShowDisplayAvatar
|
||||
RecordInfo = new PlayerRecordInfo(),
|
||||
PrivacySettings = new PrivacySettings(),
|
||||
PrivacySettings = PrivacySettings.ToProto(),
|
||||
HeadFrame = HeadFrame.ToProto()
|
||||
};
|
||||
|
||||
@@ -217,4 +218,37 @@ public class PlayerHeadFrameInfo
|
||||
HeadFrameId = HeadFrameId
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public class PrivacySettingsPb
|
||||
{
|
||||
public bool DisplayChallengeLineup { get; set; } = true;
|
||||
public bool DisplayActiveState { get; set; } = true;
|
||||
public bool DisplayRecentlyState { get; set; } = true;
|
||||
public bool DisplayBattleRecord { get; set; } = true;
|
||||
public bool DisplayCollection { get; set; } = true;
|
||||
|
||||
public PrivacySettings ToProto()
|
||||
{
|
||||
return new PrivacySettings
|
||||
{
|
||||
DisplayChallengeLineup = DisplayChallengeLineup,
|
||||
DisplayActiveState = DisplayActiveState,
|
||||
DisplayRecentlyState = DisplayRecentlyState,
|
||||
DisplayBattleRecord = DisplayBattleRecord,
|
||||
DisplayCollection = DisplayCollection
|
||||
};
|
||||
}
|
||||
|
||||
public PlayerSettingInfo ToSettingProto()
|
||||
{
|
||||
return new PlayerSettingInfo
|
||||
{
|
||||
DisplayChallengeLineup = DisplayChallengeLineup,
|
||||
DisplayActiveState = DisplayActiveState,
|
||||
DisplayRecentlyState = DisplayRecentlyState,
|
||||
DisplayBattleRecord = DisplayBattleRecord,
|
||||
DisplayCollection = DisplayCollection
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class PacketGetBasicInfoScRsp : BasePacket
|
||||
CurDay = 1,
|
||||
NextRecoverTime = player.Data.NextStaminaRecover / 1000,
|
||||
GameplayBirthday = (uint)player.Data.Birthday,
|
||||
PlayerSettingInfo = new PlayerSettingInfo(),
|
||||
PlayerSettingInfo = player.Data.PrivacySettings.ToSettingProto(),
|
||||
Gender = (uint)player.Data.CurrentGender
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user