games647 / ChangeSkin

Allows your players to change their skin by command
https://dev.bukkit.org/bukkit-plugins/changeskin/
MIT License
187 stars 33 forks source link

Tried converting player name to uuid from third-party api #55

Closed ziceptor closed 7 years ago

ziceptor commented 7 years ago

forge-1.11.2-13.20.0.2201-universal.jar spongeforge-1.11.2-2201-6.0.0-BETA-2023.jar ChangeSkin.jar latest

`[19:55:32] [Server thread/INFO] [nucleus]: ziceptor ran the command: /setskin blabla

Exception in thread "Thread-18"  эт 11, 2017 7:55:33 PM com.github.games647.changeskin.core.MojangSkinApi getUUIDFromAPI SEVERE: Tried converting player name to uuid from third-party api com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 at com.google.gson.Gson.fromJson(Gson.java:815) at com.google.gson.Gson.fromJson(Gson.java:768) at com.google.gson.Gson.fromJson(Gson.java:717) at com.google.gson.Gson.fromJson(Gson.java:689) at com.github.games647.changeskin.core.MojangSkinApi.getUUIDFromAPI(MojangSkinApi.java:103) at com.github.games647.changeskin.core.MojangSkinApi.getUUID(MojangSkinApi.java:61) at com.github.games647.changeskin.sponge.tasks.NameResolver.run(NameResolver.java:42) at org.spongepowered.api.scheduler.Task$Builder.lambda$execute$0(Task.java:138) at org.spongepowered.common.scheduler.SchedulerBase.lambda$startTask$0(SchedulerBase.java:183) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.IllegalStateException: Expected BEGIN_ARRAY but was BEGIN_OBJECT at line 1 column 2 at com.google.gson.stream.JsonReader.beginArray(JsonReader.java:338) at com.google.gson.internal.bind.ArrayTypeAdapter.read(ArrayTypeAdapter.java:70) at com.google.gson.Gson.fromJson(Gson.java:803) ... 13 more `

games647 commented 7 years ago

Response of the third-party author

{
"error": "This API has been removed due to causing more issues than it's worth fixing."
}

Sadly. mcapi.ca was the best service so far.

ziceptor commented 7 years ago

I'm not sure. Maybe this will help? Unfortunately there is no English. But you can use a translator. http://docs.ely.by/skin-system.html

games647 commented 7 years ago

It doesn't provide the data I need. A digital signature by Mojang is required otherwise the minecraft client will decline to accept the skin data.

ziceptor commented 7 years ago

This will help in solving the problem?

https://mineskin.org/ MineSkin.org allows you to generate skin texture data signed by Mojang. These can be used on ingame skull blocks or to change a player's skin using some packet magic :).

[Lib] MineskinSponge - Easy texture to skin conversion https://forums.spongepowered.org/t/lib-mineskinsponge-easy-texture-to-skin-conversion/16293

games647 commented 7 years ago

The goal of mineskin is only to generate custom skins not download them.

ziceptor commented 7 years ago

Any news?

games647 commented 7 years ago

I found no alternative solution sorry.

ziceptor commented 7 years ago

Another question. Request to mojang is sent at every change of skin? Or load from the cache?

games647 commented 7 years ago

No it caches it in memory and in the database

ziceptor commented 7 years ago

That is enough to have one license client? Others will be able to install from the cache?

games647 commented 7 years ago

yes they will be only downloaded once

ziceptor commented 7 years ago

TLauncher (http://tlaun.ch/jar) somehow works with Ely.by. Unfortunately there is no source code. It is possible to decompile. Is it possible to integrate the plugin?

games647 commented 7 years ago

So this is a mod?

ziceptor commented 7 years ago

This is an unofficial client.

ziceptor commented 7 years ago

Not the same. TLauncher is patch supported version of Minecraft automatically.

ziceptor commented 7 years ago

Sad. A dead end.

ziceptor commented 7 years ago

There is a plugin (Bukkit/Spigot/Sponge). In 1.11.2 doesn't work. On 1.10.2 is not checked. I think you would be interested. ely.by/skinsystem-plugin/elyby-skinsystem-0.1.1.jar

http://ely.by/u1080182/posts/172288