diff --git a/GServer.Client/Program.cs b/GServer.Client/Program.cs index 869f1ab..50cbc86 100644 --- a/GServer.Client/Program.cs +++ b/GServer.Client/Program.cs @@ -2,6 +2,7 @@ using System.Net.Sockets; using GServer.Common; using GServer.Common.Networking.Enums; +using GServer.Common.Networking.Messages.Client; using GServer.Common.Networking.Messages.Server; internal class Program diff --git a/GServer.Server/Program.cs b/GServer.Server/Program.cs index 8ba3812..f814c33 100644 --- a/GServer.Server/Program.cs +++ b/GServer.Server/Program.cs @@ -3,6 +3,7 @@ using System.Net.Sockets; using System.Text; using GServer.Common; using GServer.Common.Networking.Enums; +using GServer.Common.Networking.Messages.Client; using GServer.Common.Networking.Messages.Server; internal class Program diff --git a/README.md b/README.md new file mode 100644 index 0000000..b68d4eb --- /dev/null +++ b/README.md @@ -0,0 +1,23 @@ +# GServer + +**Note:** still writing README... + +A rudimentary UDP game server mimicking the architecture of Graal Online's GServer from the 90s-00s. + +## Networking + +UDP packets are sent between the client and server to enable communication. UDP requests can be though of like 'messages', where each message has an ID that denotes the type of message (e.g. AUTH, LIST_SERVERS), followed by the message's data. + +The first byte of a message is used to denote its type, but no standard format is shared between messages for the data belonging to each message. + +For example: when authenticating, the following format is used: + +- Message ID (1 byte) +- Username length (1 byte) +- Username (x bytes, according to the username length) +- Password length (1 byte) +- Password (x bytes, according to the password length) + +`{message_id}{username_len}{username}{password_len}{password}` + +All possible client and server message IDs can be found in `Networking/Enums/ClientPacketIn.cs` or `Networking/Enums/ServerPacketIn.cs` respectively.