File tree Expand file tree Collapse file tree
player-counter/src/Models Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -44,17 +44,23 @@ public function eggs(): BelongsToMany
4444 /** @return array<string, mixed> */
4545 public function runQuery (Allocation $ allocation ): array
4646 {
47- $ ip = is_ipv6 ($ allocation ->ip ) ? '[ ' . $ allocation ->ip . '] ' : $ allocation ->ip ;
48- $ port = $ allocation ->port + ($ this ->query_port_offset ?? 0 );
49- $ host = $ ip . ': ' . $ port ;
47+ $ host = (is_ipv6 ($ allocation ->ip ) ? '[ ' . $ allocation ->ip . '] ' : $ allocation ->ip ) . ': ' . $ allocation ->port ;
5048
5149 try {
52- $ gameQ = new GameQ ();
53-
54- $ gameQ ->addServer ([
50+ $ data = [
5551 'type ' => $ this ->query_type ->value ,
5652 'host ' => $ host ,
57- ]);
53+ ];
54+
55+ if ($ this ->query_port_offset ) {
56+ $ data ['options ' ] = [
57+ 'query_port ' => $ allocation ->port + $ this ->query_port_offset ,
58+ ];
59+ }
60+
61+ $ gameQ = new GameQ ();
62+
63+ $ gameQ ->addServer ($ data );
5864
5965 $ gameQ ->setOption ('debug ' , config ('app.debug ' ));
6066
You can’t perform that action at this time.
0 commit comments