1
0
mirror of https://github.com/deavmi/birchwood synced 2024-09-20 13:22:52 +02:00

ChecksMode

- Defined as the mode describes how birchwood will act when encounterin invalid characters that were provided BY the user TO birchwood

ConnectionInfo

- Use `ChecksMode.EASY` by default
This commit is contained in:
Tristan B. Velloza Kildaire 2023-06-21 13:49:22 +02:00
parent f54e6d9d9b
commit 5bcbdf72cd

View File

@ -7,6 +7,27 @@ import std.socket : SocketException, Address, getAddress;
import birchwood.client.exceptions; import birchwood.client.exceptions;
import std.conv : to, ConvException; import std.conv : to, ConvException;
/**
* The mode describes how birchwood will act
* when encounterin invalid characters that
* were provided BY the user TO birchwood
*/
public enum ChecksMode
{
/**
* In this mode any invalid characters
* will be automatically stripped
*/
EASY,
/**
* In this mode any invalid characters
* will result in the throwing of a
* `BirchwoodException`
*/
HARDCORE
}
/** /**
* Represents the connection details for a server * Represents the connection details for a server
* to connect to * to connect to
@ -59,6 +80,8 @@ public shared struct ConnectionInfo
/* TODO: before publishing change this bulk size */ /* TODO: before publishing change this bulk size */
private ChecksMode mode;
/** /**
* Constructs a new ConnectionInfo instance with the * Constructs a new ConnectionInfo instance with the
* provided details * provided details
@ -81,6 +104,9 @@ public shared struct ConnectionInfo
// Set the default fakelag to 1 // Set the default fakelag to 1
this.fakeLag = 1; this.fakeLag = 1;
// Set the validity mode to easy
this.mode = ChecksMode.EASY;
} }
/** /**