mirror of
https://github.com/deavminet/dnetd
synced 2024-09-21 09:43:37 +02:00
Initial command processing code added, working on authentication for clients
This commit is contained in:
parent
cc59be180b
commit
e674538415
@ -88,12 +88,17 @@ public class DConnection : Thread
|
|||||||
/* Get the command byte */
|
/* Get the command byte */
|
||||||
byte commandByte = message.data[0];
|
byte commandByte = message.data[0];
|
||||||
|
|
||||||
/* If `auth` command */
|
/* If `auth` command (requires: unauthed) */
|
||||||
if(commandByte == 0 && !hasAuthed)
|
if(commandByte == 0 && !hasAuthed)
|
||||||
{
|
{
|
||||||
|
/* Get the length of the username */
|
||||||
|
byte usernameLength = message.data[1];
|
||||||
|
|
||||||
|
/* Get the username and password */
|
||||||
|
string username = cast(string)message.data[2..usernameLength];
|
||||||
|
string password = cast(string)message.data[cast(ubyte)2+usernameLength..message.data.length];
|
||||||
}
|
}
|
||||||
/* If `link` command */
|
/* If `link` command (requires: unauthed) */
|
||||||
else if(commandByte == 1 && !hasAuthed)
|
else if(commandByte == 1 && !hasAuthed)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user