fix support for chinese player names
This commit is contained in:
parent
c0363f5915
commit
b72252d109
@ -41,6 +41,8 @@ class TextureController extends BaseController
|
||||
|
||||
public function skin($player_name, $model = "")
|
||||
{
|
||||
$player_name = \Option::get('allow_chinese_playername') ? $GLOBALS['player_name'] : $player_name;
|
||||
|
||||
$player = new Player(0, $player_name);
|
||||
|
||||
if ($player->is_banned)
|
||||
@ -55,6 +57,8 @@ class TextureController extends BaseController
|
||||
|
||||
public function cape($player_name)
|
||||
{
|
||||
$player_name = \Option::get('allow_chinese_playername') ? $GLOBALS['player_name'] : $player_name;
|
||||
|
||||
$player = new Player(0, $player_name);
|
||||
|
||||
if ($player->is_banned)
|
||||
|
@ -113,12 +113,20 @@ Route::group(['middleware' => 'App\Middlewares\CheckAdminMiddl
|
||||
*/
|
||||
Route::group(['middleware' => 'App\Middlewares\CheckPlayerExistMiddleware'], function()
|
||||
{
|
||||
// Json profile
|
||||
Route::get('/{player_name}.json', 'TextureController@json')->where(['player_name' => '[^\\/]+?']);
|
||||
Route::get('/{api}/{player_name}.json', 'TextureController@jsonWithApi')->where(['player_name' => '[^\\/]+?']);
|
||||
// Legacy links
|
||||
Route::get('/skin/{player_name}.png', 'TextureController@skin');
|
||||
Route::get('/cape/{player_name}.png', 'TextureController@cape');
|
||||
// Fix for fucking chinese player names
|
||||
if (Option::get('allow_chinese_playername')) {
|
||||
// Json profile
|
||||
Route::get('/{player_name}.json', 'TextureController@json')->where(['player_name' => '[^\\/]+?']);
|
||||
Route::get('/{api}/{player_name}.json', 'TextureController@jsonWithApi')->where(['player_name' => '[^\\/]+?']);
|
||||
// Legacy links
|
||||
Route::get('/skin/{player_name}.png', 'TextureController@skin')->where(['player_name' => '[^\\/]+?']);
|
||||
Route::get('/cape/{player_name}.png', 'TextureController@cape')->where(['player_name' => '[^\\/]+?']);
|
||||
} else {
|
||||
Route::get('/{player_name}.json', 'TextureController@json');
|
||||
Route::get('/{api}/{player_name}.json', 'TextureController@jsonWithApi');
|
||||
Route::get('/skin/{player_name}.png', 'TextureController@skin');
|
||||
Route::get('/cape/{player_name}.png', 'TextureController@cape');
|
||||
}
|
||||
});
|
||||
|
||||
Route::get('/avatar/{base64_email}.png', 'TextureController@avatar');
|
||||
|
Loading…
Reference in New Issue
Block a user