Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uuid更新失败 #179

Open
SkyIce0229 opened this issue Mar 23, 2023 · 6 comments
Open

uuid更新失败 #179

SkyIce0229 opened this issue Mar 23, 2023 · 6 comments

Comments

@SkyIce0229
Copy link

我验证完后在个人资料按更新uuid过了几秒钟出现uuid更新失败弹窗
image

@vltown
Copy link

vltown commented Jul 18, 2023

我也是这种情况,请问您解决这个问题了吗,我找不到原因所在

@AsColdnet
Copy link

我也是,请问有解决方法没

@D3adEr1c
Copy link

#186 (comment)

@Illusionika
Copy link

刚从正版服转外置登录.也遇到这个问题了.
API接口没了的话,感觉可以直接数据库里update
我看了下,进行完正版验证后 mojang_verifications 这个表里面是有正确的正版UUID和PID的

@D3adEr1c
Copy link

它 post("/mojang/update-uuid") 后 call AccountController@uuid

public function uuid()
    {
        $uuid = MojangVerification::where('user_id', auth()->id())->value('uuid');
        try{
           $response = Http::withOptions(['verify' => CaBundle::getSystemCaRootBundlePath()])
                ->get("https://api.mojang.com/user/profiles/$uuid/names");
            $name = $response->json()[0]['name'];

            DB::table('uuid')->updateOrInsert(['name' => $name], ['uuid' => $uuid]);

            return json(trans('GPlane\Mojang::uuid.success'), 0);
        }catch (\Exception $e) {
            Log::channel('mojang-verification')->error($e);
            return json(trans('GPlane\Mojang::uuid.failed'), 1);
        }
    }

目的应该是通过 uuid 获取最新名称
然后我是 AccountController.php 改成了 https://sessionserver.mojang.com/session/minecraft/profile/$uuid

@Illusionika
Copy link

上面的API确实能用,不过下面的$name也要去掉[0],改成这样就行了
$response = Http::withOptions(['verify' => CaBundle::getSystemCaRootBundlePath()])
->get("https://sessionserver.mojang.com/session/minecraft/profile/$uuid");
$name = $response->json()['name'];

另外又找了个第三方的API https://minecraft-api.com/uuid/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants