From 5bcbdf72cd2a6bbbd123b3425183f0f82a14fff1 Mon Sep 17 00:00:00 2001 From: "Tristan B. Velloza Kildaire" Date: Wed, 21 Jun 2023 13:49:22 +0200 Subject: [PATCH] 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 --- source/birchwood/config/conninfo.d | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source/birchwood/config/conninfo.d b/source/birchwood/config/conninfo.d index 8960a54..e0e9fff 100644 --- a/source/birchwood/config/conninfo.d +++ b/source/birchwood/config/conninfo.d @@ -7,6 +7,27 @@ import std.socket : SocketException, Address, getAddress; import birchwood.client.exceptions; 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 * to connect to @@ -59,6 +80,8 @@ public shared struct ConnectionInfo /* TODO: before publishing change this bulk size */ + private ChecksMode mode; + /** * Constructs a new ConnectionInfo instance with the * provided details @@ -81,6 +104,9 @@ public shared struct ConnectionInfo // Set the default fakelag to 1 this.fakeLag = 1; + + // Set the validity mode to easy + this.mode = ChecksMode.EASY; } /**