@@ -62,7 +62,8 @@ public function searchPlayers($search, $options = null)
62
62
$ returned = $ this ->request ("accountSearch " , [
63
63
"search " => $ search ,
64
64
"limit " => !empty ($ options ['limit ' ]) ? $ options ['limit ' ] : 100 ,
65
- "method " => !empty ($ options ['method ' ]) ? $ options ['method ' ] : "startswith "
65
+ "method " => !empty ($ options ['method ' ]) ? $ options ['method ' ] : "startswith " ,
66
+ "region " => !empty ($ options ['region ' ]) ? $ options ['region ' ] : $ this ->region
66
67
]);
67
68
68
69
return [
@@ -85,7 +86,8 @@ public function searchPlayer($accounts_id = [])
85
86
}
86
87
87
88
$ returned = $ this ->request ("accountId " , [
88
- "accounts " => $ accounts
89
+ "accounts " => $ accounts ,
90
+ "region " => !empty ($ options ['region ' ]) ? $ options ['region ' ] : $ this ->region
89
91
]);
90
92
91
93
return [
@@ -102,16 +104,15 @@ public function searchPlayer($accounts_id = [])
102
104
*/
103
105
public function serverInfo ($ region = null )
104
106
{
105
- $ region = !empty ($ region ) ? $ region : $ this ->region ;
106
107
107
108
$ returned = $ this ->request ("serverInfo " , [
108
- "region " => $ region
109
- ])[ ' data ' ] ;
109
+ "region " => ! empty ( $ region ) ? $ region : $ this -> region
110
+ ]);
110
111
111
112
return [
112
- "wotb " => $ returned ['wotb ' ],
113
- "wot " => $ returned ['wot ' ],
114
- "wows " => $ returned ['wows ' ]
113
+ "wotb " => $ returned ['data ' ][ ' wotb ' ],
114
+ "wot " => $ returned ['data ' ][ ' wot ' ],
115
+ "wows " => $ returned ['data ' ][ ' wows ' ]
115
116
];
116
117
117
118
}
@@ -142,7 +143,8 @@ public function searchClans($search, $option = null)
142
143
$ returned = $ this ->request ("clansSearch " , [
143
144
"search " => $ search ,
144
145
"limit " => !empty ($ options ['limit ' ]) ? $ options ['limit ' ] : 100 ,
145
- "pagination " => !empty ($ options ['pagination ' ]) ? $ options ['pagination ' ] : 1
146
+ "pagination " => !empty ($ options ['pagination ' ]) ? $ options ['pagination ' ] : 1 ,
147
+ "region " => !empty ($ options ['region ' ]) ? $ options ['region ' ] : $ this ->region
146
148
]);
147
149
148
150
return [
@@ -169,12 +171,14 @@ private function request($ref, $options)
169
171
$ link = str_replace ("{search} " , $ options ['search ' ], $ link );
170
172
$ link = str_replace ("{limit} " , $ options ['limit ' ], $ link );
171
173
$ link = str_replace ("{method} " , $ options ['method ' ], $ link );
174
+ $ link = str_replace ("{region} " , $ options ['region ' ], $ link );
172
175
break ;
173
176
174
177
case "accountId " :
175
178
176
179
//Replace data of the link
177
180
$ link = str_replace ("{accounts} " , $ options ['accounts ' ], $ link );
181
+ $ link = str_replace ("{region} " , $ options ['region ' ], $ link );
178
182
break ;
179
183
180
184
case "clansSearch " :
@@ -183,6 +187,7 @@ private function request($ref, $options)
183
187
$ link = str_replace ("{search} " , $ options ['search ' ], $ link );
184
188
$ link = str_replace ("{limit} " , $ options ['limit ' ], $ link );
185
189
$ link = str_replace ("{pagination} " , $ options ['pagination ' ], $ link );
190
+ $ link = str_replace ("{region} " , $ options ['region ' ], $ link );
186
191
break ;
187
192
188
193
case "serverInfo " :
0 commit comments