This commit is contained in:
JoshOOOWAH 2019-05-27 23:21:10 +05:00
parent bfb3511e8e
commit e30e11930a
6 changed files with 29 additions and 48 deletions

View file

@ -739,7 +739,7 @@ private void generateConfigIfNotExists(boolean testEnv) throws IOException {
newConfig.binaryName = "Launcher"; newConfig.binaryName = "Launcher";
newConfig.whitelistRejectString = "Вас нет в белом списке"; newConfig.whitelistRejectString = "Вас нет в белом списке";
newConfig.OAuthAppID = 0; newConfig.OAuthAppID = 0;
newConfig.OAuthAppSecret = null; newConfig.OAuthAppSecret = "";
newConfig.netty = new NettyConfig(); newConfig.netty = new NettyConfig();
newConfig.netty.fileServerEnabled = true; newConfig.netty.fileServerEnabled = true;

View file

@ -38,7 +38,7 @@ public void setEntry(Client client, ChannelHandlerContext ctx){
this.init = true; this.init = true;
this.client = client; this.client = client;
this.ctx = ctx; this.ctx = ctx;
LogHelper.subInfo("New Entry with IP " + IP()); LogHelper.subDebug("New Entry with IP " + IP());
this.mTimer = new Timer(); this.mTimer = new Timer();
this.mTimer.schedule(destroy, 300000L); this.mTimer.schedule(destroy, 300000L);
} }
@ -68,7 +68,7 @@ public String IP(){
public void run() { public void run() {
if(init == false) if(init == false)
return; return;
LogHelper.info("cache purged, IP: " + IP()); LogHelper.debug("cache purged, IP: " + IP());
init = false; init = false;
mTimer = null; mTimer = null;
client = null; client = null;
@ -116,6 +116,21 @@ public static Entry getUnused(){
return null; return null;
} }
public static Entry getEntry(String IP){
for(int i = 0; i < 5; i++ )
{
if(LaunchServer.server.cacheHandler.stageArea[i].isInit())
if(LaunchServer.server.cacheHandler.stageArea[i].IP().equals(IP))
return LaunchServer.server.cacheHandler.stageArea[i];
}
try {
throw new OAuthException("Not found in cache");
}catch (OAuthException e) {
e.printStackTrace();
}
return null;
}
public static Entry[] newEntryArray(){ public static Entry[] newEntryArray(){
return new Entry[]{new Entry(), new Entry(), new Entry(), new Entry(), new Entry()}; return new Entry[]{new Entry(), new Entry(), new Entry(), new Entry(), new Entry()};
} }

View file

@ -318,16 +318,6 @@ function doOAuth() {
}); });
return result; return result;
}) })
makeWaitAuth(function (result) {
FunctionalBridge.setAuthParams(result);
loginData = { pp: result.playerProfile , accessToken: result.accessToken, permissions: result.permissions,
auth_type: settings.auth};
overlay.hide(0, function () {
setCurrentScene(menuScene);
});
return result;
})
}); });
} }

View file

@ -152,7 +152,7 @@ .auth {
-fx-background-radius: 0; -fx-background-radius: 0;
-fx-background-color: #5fd97a; -fx-background-color: #5fd97a;
-fx-text-fill: #ffffff; -fx-text-fill: #ffffff;
-fx-pref-width: 200px; -fx-pref-width: 145px;
-fx-pref-height: 45px; -fx-pref-height: 45px;
-fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15, 0, 0, 3); -fx-effect: dropshadow(gaussian, rgba(23, 25, 29, 0.3), 15, 0, 0, 3);
} }

View file

@ -1,9 +1,13 @@
package ru.gravit.launcher.events.request; package ru.gravit.launcher.events.request;
import ru.gravit.launcher.LauncherNetworkAPI; import ru.gravit.launcher.LauncherNetworkAPI;
import ru.gravit.launcher.events.RequestEvent;
import ru.gravit.launcher.request.ResultInterface; import ru.gravit.launcher.request.ResultInterface;
import ru.gravit.utils.event.EventInterface;
public class LogEvent implements ResultInterface { import java.util.UUID;
public class LogEvent extends RequestEvent implements EventInterface {
@Override @Override
public String getType() { public String getType() {
return "log"; return "log";
@ -15,4 +19,9 @@ public String getType() {
public LogEvent(String string) { public LogEvent(String string) {
this.string = string; this.string = string;
} }
@Override
public UUID getUUID() {
return null;
}
} }

View file

@ -1,33 +0,0 @@
package ru.gravit.launcher.events.request;
import ru.gravit.launcher.LauncherNetworkAPI;
import ru.gravit.launcher.events.RequestEvent;
import ru.gravit.utils.event.EventInterface;
import java.util.UUID;
public class OAuthConfirmRequestEvent extends RequestEvent implements EventInterface {
private static final UUID uuid = UUID.fromString("77e1bfd7-adf9-4f5d-87d6-a7dd068deb74");
@LauncherNetworkAPI
public String str;
@Override
public UUID getUUID() {
return uuid;
}
@Override
public String getType() {
return "OAuthURL";
}
public OAuthConfirmRequestEvent(){
}
public OAuthConfirmRequestEvent(String str){
this.str = str;
}
}