-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
132 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
using MineSharp.Core.Common; | ||
|
||
namespace MineSharp.Protocol; | ||
|
||
/// <summary> | ||
/// Describes client settings | ||
/// </summary> | ||
public record ClientSettings | ||
{ | ||
/// <summary> | ||
/// Default client settings | ||
/// </summary> | ||
public static readonly ClientSettings Default = new ClientSettings( | ||
"en_GB", | ||
24, | ||
ChatMode.Enabled, | ||
true, | ||
0x7F, | ||
PlayerHand.MainHand, | ||
false, | ||
true); | ||
|
||
/// <summary> | ||
/// Locale (e.g. 'en_GB') | ||
/// </summary> | ||
public string Locale { get; } | ||
|
||
/// <summary> | ||
/// The client's view distance | ||
/// </summary> | ||
public byte ViewDistance { get; } | ||
|
||
/// <summary> | ||
/// What the client want's to see in chat (currently ignored) | ||
/// </summary> | ||
public ChatMode ChatMode { get; } // TODO: #31 | ||
|
||
/// <summary> | ||
/// Whether the client allows colored chat (currently ignored) | ||
/// </summary> | ||
public bool ColoredChat { get; } // TODO: #31 | ||
|
||
/// <summary> | ||
/// Bitmask of skin parts displayed by the client (not used) | ||
/// </summary> | ||
public byte DisplayedSkinParts { get; } | ||
|
||
/// <summary> | ||
/// The clients main hand | ||
/// </summary> | ||
public PlayerHand MainHand { get; } | ||
|
||
/// <summary> | ||
/// Whether to filter chat messages (currently ignored) | ||
/// </summary> | ||
public bool EnableTextFiltering { get; } // TODO: #31 | ||
|
||
/// <summary> | ||
/// Whether you want to show up in a server's online players list | ||
/// </summary> | ||
public bool AllowServerListings { get; } | ||
|
||
/// <summary> | ||
/// Constructor | ||
/// </summary> | ||
public ClientSettings(string locale, byte viewDistance, ChatMode chatMode, bool coloredChat, byte displayedSkinParts, PlayerHand mainHand, bool enableTextFiltering, bool allowServerListings) | ||
{ | ||
Locale = locale; | ||
ViewDistance = viewDistance; | ||
ChatMode = chatMode; | ||
ColoredChat = coloredChat; | ||
DisplayedSkinParts = displayedSkinParts; | ||
MainHand = mainHand; | ||
EnableTextFiltering = enableTextFiltering; | ||
AllowServerListings = allowServerListings; | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Specifies the chat mode | ||
/// </summary> | ||
public enum ChatMode | ||
{ | ||
/// <summary> | ||
/// Show all chat messages | ||
/// </summary> | ||
Enabled = 0, | ||
|
||
/// <summary> | ||
/// Only command messages | ||
/// </summary> | ||
CommandsOnly = 1, | ||
|
||
/// <summary> | ||
/// No player messages nor command messages | ||
/// </summary> | ||
Hidden = 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters