Add session flags management and encryption key support

This commit is contained in:
netkas 2024-12-10 13:30:08 -05:00
parent 790262db08
commit 1d452bc71b
8 changed files with 209 additions and 76 deletions

View file

@ -31,6 +31,7 @@ enum StandardError : int
case PEER_NOT_FOUND = -4000;
case INVALID_USERNAME = -4001;
case USERNAME_ALREADY_EXISTS = -4002;
case NOT_REGISTERED = -4003;
/**
* Returns the default generic message for the error
@ -62,7 +63,8 @@ enum StandardError : int
self::PEER_NOT_FOUND => 'The requested peer was not found',
self::INVALID_USERNAME => 'The given username is invalid, it must be Alphanumeric with a minimum of 3 character but no greater than 255 characters',
self::USERNAME_ALREADY_EXISTS => 'The given username already exists on the network'
self::USERNAME_ALREADY_EXISTS => 'The given username already exists on the network',
self::NOT_REGISTERED => 'The given username is not registered on the server',
};
}

View file

@ -3,6 +3,7 @@
namespace Socialbox\Enums;
use Socialbox\Classes\StandardMethods\CreateSession;
use Socialbox\Classes\StandardMethods\Identify;
use Socialbox\Classes\StandardMethods\VerificationAnswerImageCaptcha;
use Socialbox\Classes\StandardMethods\VerificationGetImageCaptcha;
use Socialbox\Classes\StandardMethods\GetMe;
@ -18,6 +19,7 @@ enum StandardMethods : string
case PING = 'ping';
case CREATE_SESSION = 'createSession';
case REGISTER = 'register';
case IDENTIFY = 'identify';
case GET_ME = 'getMe';
case VERIFICATION_GET_IMAGE_CAPTCHA = 'verificationGetImageCaptcha';
case VERIFICATION_ANSWER_IMAGE_CAPTCHA = 'verificationAnswerImageCaptcha';
@ -35,6 +37,7 @@ enum StandardMethods : string
self::PING => Ping::execute($request, $rpcRequest),
self::CREATE_SESSION => CreateSession::execute($request, $rpcRequest),
self::REGISTER => Register::execute($request, $rpcRequest),
self::IDENTIFY => Identify::execute($request, $rpcRequest),
self::GET_ME => GetMe::execute($request, $rpcRequest),
self::VERIFICATION_GET_IMAGE_CAPTCHA => VerificationGetImageCaptcha::execute($request, $rpcRequest),
self::VERIFICATION_ANSWER_IMAGE_CAPTCHA => VerificationAnswerImageCaptcha::execute($request, $rpcRequest),