eee
This commit is contained in:
+23
-4
@@ -8,14 +8,33 @@ use Swoole\Http\Response;
|
||||
|
||||
class Struct
|
||||
{
|
||||
public int $userId;
|
||||
|
||||
public int $fd;
|
||||
|
||||
public int $connectedAt;
|
||||
|
||||
public int $lastSeenAt;
|
||||
|
||||
public AuthorizationInterface $user;
|
||||
public Request $request;
|
||||
public Response $ws;
|
||||
|
||||
public Request $request;
|
||||
|
||||
public Response $ws;
|
||||
|
||||
public function __construct(AuthorizationInterface $user, Request $request, Response $ws)
|
||||
{
|
||||
$this->user = $user;
|
||||
$this->request = $request;
|
||||
$this->user = $user;
|
||||
$this->ws = $ws;
|
||||
$this->ws = $ws;
|
||||
$this->userId = $user->getUniqueId();
|
||||
$this->fd = (int)($request->fd ?? 0);
|
||||
$this->connectedAt = time();
|
||||
$this->lastSeenAt = $this->connectedAt;
|
||||
}
|
||||
|
||||
public function touch(): void
|
||||
{
|
||||
$this->lastSeenAt = time();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user