AuthResponse
- Added new command Components - Added `AUTH_RESPONSE` Container - Added support for `AuthResponse`
This commit is contained in:
parent
6e3d86c6cd
commit
2900ba8bcd
|
@ -92,6 +92,15 @@ public enum CommandType
|
|||
*/
|
||||
AUTH_COMMAND,
|
||||
|
||||
/**
|
||||
* Authentication response
|
||||
*
|
||||
* Sent from server back
|
||||
* to client in reply to
|
||||
* an authentication command
|
||||
*/
|
||||
AUTH_RESPONSE,
|
||||
|
||||
/**
|
||||
* Server linkg request
|
||||
*
|
||||
|
|
|
@ -115,6 +115,11 @@ public class BaseMessage
|
|||
import davinci.c2s.auth : AuthMessage;
|
||||
message.command = Command.decodeTo!(AuthMessage)(payload);
|
||||
}
|
||||
else if(message.commandType == CommandType.AUTH_RESPONSE)
|
||||
{
|
||||
import davinci.c2s.auth : AuthResponse;
|
||||
message.command = Command.decodeTo!(AuthResponse)(payload);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -23,4 +23,29 @@ public final class AuthMessage : Command
|
|||
{
|
||||
this.password = password;
|
||||
}
|
||||
}
|
||||
|
||||
public final class AuthResponse : Command
|
||||
{
|
||||
private bool status;
|
||||
|
||||
this()
|
||||
{
|
||||
registerClass!(typeof(this));
|
||||
}
|
||||
|
||||
public void good()
|
||||
{
|
||||
this.status = true;
|
||||
}
|
||||
|
||||
public void bad()
|
||||
{
|
||||
this.status = false;
|
||||
}
|
||||
|
||||
public bool didAuthSucceed()
|
||||
{
|
||||
return this.status;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue