1. Вы находитесь в сообществе Rubukkit. Мы - администраторы серверов Minecraft, разрабатываем собственные плагины и переводим на различные языки плагины наших коллег из других стран.
    Скрыть объявление
Скрыть объявление
В преддверии глобального обновления, мы проводим исследования, которые помогут нам сделать опыт пользования форумом ещё удобнее. Помогите нам, примите участие!

Сборник ссылок MCPC+, Cauldron, KCauldron, Thermos [Forge & Bukkit] [1.4.7-1.7.10]

Тема в разделе "Руководства, инструкции, утилиты", создана пользователем DragonX, 27 мар 2013.

  1. iSemka

    iSemka Старожил Пользователь

    Баллы:
    103
    Skype:
    semen2015
    Имя в Minecraft:
    iSemka
    YggdrasilMinecraftSessionService.class
     
  2. 5FriendsChannel

    5FriendsChannel Новичок Пользователь

    Баллы:
    11
    Skype:
    leo007marin
    Имя в Minecraft:
    5FriendsChannel
    И куда тут вписывать?!

    package com.mojang.authlib.yggdrasil;

    import com.google.common.collect.Iterables;
    import com.google.gson.Gson;
    import com.google.gson.GsonBuilder;
    import com.google.gson.JsonParseException;
    import com.mojang.authlib.GameProfile;
    import com.mojang.authlib.HttpAuthenticationService;
    import com.mojang.authlib.exceptions.AuthenticationException;
    import com.mojang.authlib.exceptions.AuthenticationUnavailableException;
    import com.mojang.authlib.minecraft.HttpMinecraftSessionService;
    import com.mojang.authlib.minecraft.InsecureTextureException;
    import com.mojang.authlib.minecraft.MinecraftProfileTexture;
    import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
    import com.mojang.authlib.properties.Property;
    import com.mojang.authlib.properties.PropertyMap;
    import com.mojang.authlib.yggdrasil.request.JoinMinecraftServerRequest;
    import com.mojang.authlib.yggdrasil.response.HasJoinedMinecraftServerResponse;
    import com.mojang.authlib.yggdrasil.response.MinecraftProfilePropertiesResponse;
    import com.mojang.authlib.yggdrasil.response.MinecraftTexturesPayload;
    import com.mojang.authlib.yggdrasil.response.Response;
    import com.mojang.util.UUIDTypeAdapter;
    import java.net.URL;
    import java.security.KeyFactory;
    import java.security.PublicKey;
    import java.security.spec.X509EncodedKeySpec;
    import java.util.HashMap;
    import java.util.Map;
    import java.util.UUID;
    import org.apache.commons.codec.Charsets;
    import org.apache.commons.codec.binary.Base64;
    import org.apache.commons.io.IOUtils;
    import org.apache.logging.log4j.LogManager;
    import org.apache.logging.log4j.Logger;

    public class YggdrasilMinecraftSessionService extends HttpMinecraftSessionService
    {
    private static final Logger LOGGER = LogManager.getLogger();
    private static final String BASE_URL = "https://sessionserver.mojang.com/session/minecraft/";
    private static final URL JOIN_URL = HttpAuthenticationService.constantURL("https://sessionserver.mojang.com/session/minecraft/join");
    private static final URL CHECK_URL = HttpAuthenticationService.constantURL("https://sessionserver.mojang.com/session/minecraft/hasJoined");
    private final PublicKey publicKey;
    private final Gson gson = new GsonBuilder().registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).create();

    protected YggdrasilMinecraftSessionService(YggdrasilAuthenticationService authenticationService) {
    super(authenticationService);
    try
    {
    X509EncodedKeySpec spec = new X509EncodedKeySpec(IOUtils.toByteArray(YggdrasilMinecraftSessionService.class.getResourceAsStream("/yggdrasil_session_pubkey.der")));
    KeyFactory keyFactory = KeyFactory.getInstance("RSA");
    this.publicKey = keyFactory.generatePublic(spec);
    } catch (Exception e) {
    throw new Error("Missing/invalid yggdrasil public key!");
    }
    }

    public void joinServer(GameProfile profile, String authenticationToken, String serverId) throws AuthenticationException
    {
    JoinMinecraftServerRequest request = new JoinMinecraftServerRequest();
    request.accessToken = authenticationToken;
    request.selectedProfile = profile.getId();
    request.serverId = serverId;

    getAuthenticationService().makeRequest(JOIN_URL, request, Response.class);
    }

    public GameProfile hasJoinedServer(GameProfile user, String serverId) throws AuthenticationUnavailableException
    {
    Map arguments = new HashMap();

    arguments.put("username", user.getName());
    arguments.put("serverId", serverId);

    URL url = HttpAuthenticationService.concatenateURL(CHECK_URL, HttpAuthenticationService.buildQuery(arguments));
    try
    {
    HasJoinedMinecraftServerResponse response = (HasJoinedMinecraftServerResponse)getAuthenticationService().makeRequest(url, null, HasJoinedMinecraftServerResponse.class);

    if ((response != null) && (response.getId() != null)) {
    GameProfile result = new GameProfile(response.getId(), user.getName());

    if (response.getProperties() != null) {
    result.getProperties().putAll(response.getProperties());
    }

    return result;
    }
    return null;
    }
    catch (AuthenticationUnavailableException e) {
    throw e; } catch (AuthenticationException e) {
    }
    return null;
    }

    public Map<MinecraftProfileTexture.Type, MinecraftProfileTexture> getTextures(GameProfile profile, boolean requireSecure)
    {
    Property textureProperty = (Property)Iterables.getFirst(profile.getProperties().get("textures"), null);

    if (textureProperty == null) {
    return new HashMap();
    }

    if (requireSecure) {
    if (!textureProperty.hasSignature()) {
    LOGGER.error("Signature is missing from textures payload");
    throw new InsecureTextureException("Signature is missing from textures payload");
    }

    if (!textureProperty.isSignatureValid(this.publicKey)) {
    LOGGER.error("Textures payload has been tampered with (signature invalid)");
    throw new InsecureTextureException("Textures payload has been tampered with (signature invalid)");
    }
    }
    MinecraftTexturesPayload result;
    try
    {
    String json = new String(Base64.decodeBase64(textureProperty.getValue()), Charsets.UTF_8);
    result = (MinecraftTexturesPayload)this.gson.fromJson(json, MinecraftTexturesPayload.class);
    } catch (JsonParseException e) {
    LOGGER.error("Could not decode textures payload", e);
    return new HashMap();
    }

    return result.getTextures() == null ? new HashMap() : result.getTextures();
    }

    public GameProfile fillProfileProperties(GameProfile profile, boolean requireSecure)
    {
    if (profile.getId() == null) {
    return profile;
    }
    try
    {
    URL url = HttpAuthenticationService.constantURL(new StringBuilder().append("https://sessionserver.mojang.com/session/minecraft/profile/").append(UUIDTypeAdapter.fromUUID(profile.getId())).toString());
    url = HttpAuthenticationService.concatenateURL(url, new StringBuilder().append("unsigned=").append(!requireSecure).toString());
    MinecraftProfilePropertiesResponse response = (MinecraftProfilePropertiesResponse)getAuthenticationService().makeRequest(url, null, MinecraftProfilePropertiesResponse.class);

    if (response == null) {
    LOGGER.debug(new StringBuilder().append("Couldn't fetch profile properties for ").append(profile).append(" as the profile does not exist").toString());
    return profile;
    }
    GameProfile result = new GameProfile(response.getId(), response.getName());
    result.getProperties().putAll(response.getProperties());
    profile.getProperties().putAll(response.getProperties());
    LOGGER.debug(new StringBuilder().append("Successfully fetched profile properties for ").append(profile).toString());
    return result;
    }
    catch (AuthenticationException e) {
    LOGGER.warn(new StringBuilder().append("Couldn't look up profile properties for ").append(profile).toString(), e);
    }return profile;
    }

    public YggdrasilAuthenticationService getAuthenticationService()
    {
    return (YggdrasilAuthenticationService)super.getAuthenticationService();
    }
    }
     
  3. ZeeK

    ZeeK Активный участник Пользователь

    Баллы:
    63
    Java работает, т.к обычный баккит спокойно запускается, джарник сервера тоже на месте.
    Если я не ошибаюсь, то как раз сюда:

    public class YggdrasilMinecraftSessionService extends HttpMinecraftSessionService
    {
    private static final Logger LOGGER = LogManager.getLogger();
    private static final String BASE_URL = "https://sessionserver.mojang.com/session/minecraft/";
    private static final URL JOIN_URL = HttpAuthenticationService.constantURL("https://sessionserver.mojang.com/session/minecraft/join");
    private static final URL CHECK_URL = HttpAuthenticationService.constantURL("https://sessionserver.mojang.com/session/minecraft/hasJoined");
    private final PublicKey publicKey;
    private final Gson gson = new GsonBuilder().registerTypeAdapter(UUID.class, new UUIDTypeAdapter()).create();
     
  4. 5FriendsChannel

    5FriendsChannel Новичок Пользователь

    Баллы:
    11
    Skype:
    leo007marin
    Имя в Minecraft:
    5FriendsChannel
    А что куда именно вписывать
     
  5. Автор темы
    DragonX

    DragonX Старожил Пользователь

    Баллы:
    173
    Мне кажется, что в версиях выше 1.7.2 уже нельзя будет делать подмену ссылки. Пока кто-нибудь не сделает копию их новой системы авторизации UUID.
     
  6. iSemka

    iSemka Старожил Пользователь

    Баллы:
    103
    Skype:
    semen2015
    Имя в Minecraft:
    iSemka
    Код:
    2014-08-14 19:47:25 [SEVERE] ------------------------------
    2014-08-14 19:47:25 [SEVERE] Current Thread: Thread-1
    2014-08-14 19:47:25 [SEVERE]     PID: 10 | Suspended: false | Native: false | State: RUNNABLE | Blocked Time: -1 | Blocked Count: 43
    2014-08-14 19:47:25 [SEVERE]     Stack:
    2014-08-14 19:47:25 [SEVERE]         java.lang.Thread.currentThread(Native Method)
    2014-08-14 19:47:25 [SEVERE]         java.lang.Thread.interrupted(Thread.java:982)
    2014-08-14 19:47:25 [SEVERE]         java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireInterruptibly(AbstractQueuedSynchronizer.java:1218)
    2014-08-14 19:47:25 [SEVERE]         java.util.concurrent.locks.ReentrantLock.lockInterruptibly(ReentrantLock.java:340)
    2014-08-14 19:47:25 [SEVERE]         java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:439)
    2014-08-14 19:47:25 [SEVERE]         cpw.mods.fml.relauncher.FMLRelaunchLog$ConsoleLogThread.run(FMLRelaunchLog.java:81)
    2014-08-14 19:47:25 [SEVERE]         java.lang.Thread.run(Thread.java:744)
    2014-08-14 19:47:25 [SEVERE] ------------------------------
    2014-08-14 19:47:25 [SEVERE] Current Thread: Signal Dispatcher
    2014-08-14 19:47:25 [SEVERE]     PID: 5 | Suspended: false | Native: false | State: RUNNABLE | Blocked Time: -1 | Blocked Count: 0
    2014-08-14 19:47:25 [SEVERE]     Stack:
    2014-08-14 19:47:25 [SEVERE] ------------------------------
    2014-08-14 19:47:25 [INFO] Startup script './start.sh' does not exist! Stopping server.
    2014-08-14 19:47:32 [INFO] Starting minecraft server version 1.6.4
    2014-08-14 19:47:32 [INFO] MinecraftForge v
    2014-08-14 19:47:32 [INFO] 9.11.1.965
    2014-08-14 19:47:32 [INFO]  Initialized
    
    2014-08-14 19:47:32 [INFO] Replaced 111 ore recipies
    2014-08-14 19:47:37 [INFO] Loading properties
    2014-08-14 19:47:37 [INFO] Default game type: SURVIVAL
    2014-08-14 19:47:37 [INFO] This server is running Cauldron-MCPC-Plus version git-Cauldron-MCPC-Plus1.6.4-1.965.21.0 (MC: 1.6.4) (Implementing API version 1.6.4-R2.1-SNAPSHOT)
    2014-08-14 19:47:37 [INFO] Generating keypair
    2014-08-14 19:47:37 [INFO] Starting Minecraft server on *:25565
    2014-08-14 19:47:37 [WARNING] **** FAILED TO BIND TO PORT!
    2014-08-14 19:47:37 [WARNING] The exception was: {0}
    2014-08-14 19:47:37 [WARNING] Perhaps a server is already running on that port?
    
    Сервер вырубается постоянно, иногда вообще не запускается, иногда работает и через какое-то время вырубается. В чем проблема?
     
  7. Автор темы
    DragonX

    DragonX Старожил Пользователь

    Баллы:
    173
    Я похож на разработчика Cauldron?
    Вы используете тот билд, на который я дал ссылку, или другой?
     
  8. iSemka

    iSemka Старожил Пользователь

    Баллы:
    103
    Skype:
    semen2015
    Имя в Minecraft:
    iSemka
    Я использую тот билд, который вы мне собрали:whistle:
     
  9. Alexgrist

    Alexgrist Старожил Пользователь

    Баллы:
    173
    2014-08-14 19:47:37 [WARNING] **** FAILED TO BIND TO PORT!
    Ни о чём не говорит?
     
  10. ZeeK

    ZeeK Активный участник Пользователь

    Баллы:
    63
    На место первой ссылки - путь до папки с лаунчером
    На место второй - путь до файла j.php
    На место третьей - путь до файла h.php
     
  11. iSemka

    iSemka Старожил Пользователь

    Баллы:
    103
    Skype:
    semen2015
    Имя в Minecraft:
    iSemka
    Прикол в том, что мой порт не 25565, а 25001.
     
  12. Alexgrist

    Alexgrist Старожил Пользователь

    Баллы:
    173
    В server.properties указан 25565. Иначе откуда берёт сервер?
     
    Последнее редактирование: 14 авг 2014
  13. iSemka

    iSemka Старожил Пользователь

    Баллы:
    103
    Skype:
    semen2015
    Имя в Minecraft:
    iSemka
    в server.properties 25001
     
  14. Автор темы
    DragonX

    DragonX Старожил Пользователь

    Баллы:
    173
    Ну так откройте этот чёртов порт!
     
  15. iSemka

    iSemka Старожил Пользователь

    Баллы:
    103
    Skype:
    semen2015
    Имя в Minecraft:
    iSemka
    ну так открыт и иногда сервер запускается без этой ошибки
     
  16. Автор темы
    DragonX

    DragonX Старожил Пользователь

    Баллы:
    173
    Давайте я вам позже соберу на актуальных исходниках Cauldron 1.7.2. Может, это были проблемы самого билда.
     
  17. iSemka

    iSemka Старожил Пользователь

    Баллы:
    103
    Skype:
    semen2015
    Имя в Minecraft:
    iSemka
    Так у меня 1.6.4
     
  18. Автор темы
    DragonX

    DragonX Старожил Пользователь

    Баллы:
    173
    А. Забыл.
    Значит не соберу :D
     
  19. iSemka

    iSemka Старожил Пользователь

    Баллы:
    103
    Skype:
    semen2015
    Имя в Minecraft:
    iSemka
    :lol:
     
    Последнее редактирование: 15 авг 2014
  20. TEEN

    TEEN Активный участник Пользователь

    Баллы:
    88
    Skype:
    teen_true
    Имя в Minecraft:
    TEEN
    Похожую шляпу поймал.
    Я не знаю, что точно мне помогло. Думаю, свежая ява и права админа.
    Что делал, чтобы исправить:
    - удалил все java
    - удалил к черту полученную папку cauldron
    - поставил новую jdk 1.7
    - отредактировал JAVA_HOME
    - перезагрузился
    - запустил Git bash с правами локального админа
    - повторил всё, как уважаемый crimento завещал, но без правок(простой тест сборки)
    - после всех темных делишек получил
    Код:
    BUILD SUCCESSFUL
    
    Total time: 9 mins 45.508 secs
    - затем выполнил нужные изменения и успешно повторил сборку

    Пы.Сы. Собирал cauldron-1.6.4-1.965.21.0-server
    А вообще вручную патчить автоматические патчи - офигенно круто. Почему авторы сорцов не могут вынести ссылки в файл настроек???
     

Поделиться этой страницей