File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -15,10 +15,12 @@ class PR2Client extends \chabot\SocketServerClient
15
15
public $ login_id ;
16
16
public $ process = false ;
17
17
public $ ip ;
18
+ public $ id ;
18
19
19
20
public function __construct ($ socket )
20
21
{
21
22
parent ::__construct ($ socket );
23
+ $ this ->id = spl_object_id ($ socket );
22
24
$ time = time ();
23
25
$ this ->last_action = $ time ;
24
26
$ this ->last_user_action = $ time ;
Original file line number Diff line number Diff line change @@ -91,9 +91,9 @@ private function cleanSockets()
91
91
{
92
92
# maybe could do this instead: $this->clients = array_filter($this->clients, fn($s) => !$s->disconnected && $this->socket instanceof \Socket)
93
93
foreach ($ this ->clients as $ socket ) {
94
- if ($ socket ->disconnected || !$ socket instanceof \Socket) {
95
- if (isset ($ this ->clients [spl_object_id ( $ socket ->socket ) ])) {
96
- unset($ this ->clients [spl_object_id ( $ socket ->socket ) ]);
94
+ if ($ socket ->disconnected || !$ socket-> socket instanceof \Socket) {
95
+ if (isset ($ this ->clients [$ socket ->id ])) {
96
+ unset($ this ->clients [$ socket ->id ]);
97
97
}
98
98
}
99
99
}
You can’t perform that action at this time.
0 commit comments