Search in sources :

Example 11 with Reply

use of me.semx11.autotip.api.reply.Reply in project Hyperium by HyperiumClient.

the class LoginRequest method execute.

@Override
public LoginReply execute() {
    HttpUriRequest request = GetBuilder.of(this).addParameter("username", profile.getName()).addParameter("uuid", profile.getId().toString().replace("-", "")).addParameter("tips", tips).addParameter("v", autotip.getVersion()).addParameter("mc", autotip.getMcVersion()).addParameter("os", System.getProperty("os.name")).addParameter("hash", hash).build();
    Optional<Reply> optional = RequestHandler.getReply(this, request.getURI());
    return optional.map(reply -> (LoginReply) reply).orElseGet(() -> new LoginReply(false));
}
Also used : HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) Autotip(me.semx11.autotip.Autotip) RequestHandler(me.semx11.autotip.api.RequestHandler) RequestType(me.semx11.autotip.api.RequestType) GameProfile(com.mojang.authlib.GameProfile) LoginReply(me.semx11.autotip.api.reply.impl.LoginReply) GetBuilder(me.semx11.autotip.api.GetBuilder) Reply(me.semx11.autotip.api.reply.Reply) Optional(java.util.Optional) HttpUriRequest(org.apache.http.client.methods.HttpUriRequest) Request(me.semx11.autotip.api.request.Request) LoginReply(me.semx11.autotip.api.reply.impl.LoginReply) LoginReply(me.semx11.autotip.api.reply.impl.LoginReply) Reply(me.semx11.autotip.api.reply.Reply)

Aggregations

Reply (me.semx11.autotip.api.reply.Reply)7 Optional (java.util.Optional)6 GetBuilder (me.semx11.autotip.api.GetBuilder)6 RequestHandler (me.semx11.autotip.api.RequestHandler)6 RequestType (me.semx11.autotip.api.RequestType)6 Request (me.semx11.autotip.api.request.Request)6 HttpUriRequest (org.apache.http.client.methods.HttpUriRequest)6 Autotip (me.semx11.autotip.Autotip)3 SessionKey (me.semx11.autotip.api.SessionKey)3 GameProfile (com.mojang.authlib.GameProfile)2 LocaleReply (me.semx11.autotip.api.reply.impl.LocaleReply)2 LogoutReply (me.semx11.autotip.api.reply.impl.LogoutReply)2 SettingsReply (me.semx11.autotip.api.reply.impl.SettingsReply)2 Version (me.semx11.autotip.util.Version)2 JsonParseException (com.google.gson.JsonParseException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 HttpURLConnection (java.net.HttpURLConnection)1 Locale (java.util.Locale)1 KeepAliveReply (me.semx11.autotip.api.reply.impl.KeepAliveReply)1