@@ -73,6 +73,12 @@ class Server {
73
73
* @var PersistentState Persistent state.
74
74
*/
75
75
protected PersistentState $ state ;
76
+ /**
77
+ * The persistent state.
78
+ *
79
+ * @var SS14PersistentState Persistent state.
80
+ */
81
+ protected SS14PersistentState $ ss14state ;
76
82
77
83
/**
78
84
* Whether the server has been initialized.
@@ -117,6 +123,11 @@ public function __construct(
117
123
$ this ->addr = $ array [0 ];
118
124
$ this ->port = (int ) $ array [1 ];
119
125
}
126
+ $ this ->afterConstruct ();
127
+ }
128
+ protected function afterConstruct (): void
129
+ {
130
+ //$this->endpoints['/usps'] = new USPSEndpoint($_ENV['USPS_USERID'] ?? getenv('USPS_USERID'));
120
131
}
121
132
122
133
/**
@@ -486,6 +497,10 @@ public function getState(): ?PersistentState
486
497
{
487
498
return $ this ->state ?? null ;
488
499
}
500
+ public function getSS14State (): ?SS14PersistentState
501
+ {
502
+ return $ this ->SS14state ?? null ;
503
+ }
489
504
490
505
public function getSessions (): array
491
506
{
@@ -536,7 +551,13 @@ public function setState(array|PersistentState $state): void
536
551
if (is_array ($ state )) $ state = new PersistentState (...$ state );
537
552
$ this ->state = $ state ;
538
553
$ this ->__setVerifiedEndpoint ($ state );
539
- //$this->endpoints['/usps'] = new USPSEndpoint($_ENV['USPS_USERID'] ?? getenv('USPS_USERID'));
554
+ }
555
+ public function setSS14State (array |SS14PersistentState $ ss14state ): void
556
+ {
557
+ if (isset ($ this ->ss14state )) return ;
558
+ if (is_array ($ ss14state )) $ ss14state = new SS14PersistentState (...$ ss14state );
559
+ $ this ->ss14state = $ ss14state ;
560
+ $ this ->__setSS14VerifiedEndpoint ($ ss14state );
540
561
}
541
562
542
563
/**
@@ -551,6 +572,10 @@ private function __setVerifiedEndpoint(PersistentState &$state): void
551
572
$ this ->endpoints ['/verified ' ] = new VerifiedEndpoint ($ state );
552
573
$ this ->endpoints ['/ ' ] = &$ this ->endpoints ['/verified ' ];
553
574
}
575
+ private function __setSS14VerifiedEndpoint (PersistentState &$ state ): void
576
+ {
577
+ //$this->endpoints['/ss14verified'] = new VerifiedEndpoint($state);
578
+ }
554
579
555
580
public function setSS14OAuth2Endpoint (
556
581
string $ client_id ,
0 commit comments