mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 08:39:04 +00:00
Multiple Changes Check Commits (#48)
* Temp Hiscores & SettingsLoader changes Registered Accounts cycle count change * EverythingRS Heatmap
This commit is contained in:
committed by
Daniel Ginovker
parent
83e612b50f
commit
5b4c669d64
@@ -1 +1 @@
|
||||
discord.json
|
||||
secrets.json
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
{"bot-token":"","powpass":""}
|
||||
Binary file not shown.
@@ -51,6 +51,7 @@ import redone.world.clip.Region;
|
||||
public class Server {
|
||||
|
||||
|
||||
public static String ersSecret;
|
||||
public static int[] cannonsX = new int [50];
|
||||
public static int[] cannonsY = new int [50];
|
||||
public static String[] cannonsO = new String [50];
|
||||
@@ -156,6 +157,23 @@ public class Server {
|
||||
System.out.println("Server listening on port "
|
||||
+ serverlistenerPort);
|
||||
|
||||
if(!ersSecret.equals("")) {
|
||||
com.everythingrs.service.Service.scheduledService.scheduleAtFixedRate(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
com.everythingrs.heatmaps.Heatmap.getMap().clear();
|
||||
for (Player player : PlayerHandler.players) {
|
||||
if (player != null) {
|
||||
com.everythingrs.heatmaps.Heatmap.getMap().put(player.playerName,
|
||||
new com.everythingrs.heatmaps.Heatmap(player.playerName, player.absX, player.absY,
|
||||
player.heightLevel));
|
||||
}
|
||||
}
|
||||
com.everythingrs.heatmaps.Heatmap.update(ersSecret);
|
||||
}
|
||||
}, 0, 10, java.util.concurrent.TimeUnit.SECONDS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Main Server Tick
|
||||
*/
|
||||
|
||||
@@ -87,6 +87,8 @@ import redone.world.ObjectManager;
|
||||
|
||||
public class Client extends Player {
|
||||
|
||||
public static String ersSecret;
|
||||
|
||||
public byte buffer[] = null;
|
||||
public Stream inStream = null, outStream = null;
|
||||
private IoSession session;
|
||||
@@ -154,7 +156,6 @@ public class Client extends Player {
|
||||
return dwarfCannon;
|
||||
}
|
||||
|
||||
|
||||
public ChallengePlayer getChallengePlayer() {
|
||||
return challengePlayer;
|
||||
}
|
||||
@@ -567,6 +568,11 @@ public class Client extends Player {
|
||||
if (clanId >= 0) {
|
||||
Server.clanChat.leaveClan(playerId, clanId);
|
||||
}
|
||||
|
||||
if(!ersSecret.equals("")) {
|
||||
boolean debugMessage = false;
|
||||
com.everythingrs.hiscores.Hiscores.update(ersSecret, "Normal Mode", this.playerName, this.playerRights, this.playerXP, debugMessage);
|
||||
}
|
||||
Misc.println("[DEREGISTERED]: " + playerName + "");
|
||||
HostList.getHostList().remove(session);
|
||||
CycleEventHandler.getSingleton().stopEvents(this);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class PlayersOnlineWebsite {
|
||||
}
|
||||
} else if (hasntwared) {
|
||||
hasntwared = false;
|
||||
System.out.println("No Players Online On Website Password Set So Task Stopped");
|
||||
System.out.println("No Website Password Set So Website Integration Tasks Stopped");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,13 +16,13 @@ public class RegisteredAccsWebsite {
|
||||
url.openStream().close();
|
||||
}
|
||||
|
||||
private static int count = 50;
|
||||
private static int count = 25;
|
||||
public static void addUpdateRegisteredUsersTask() {
|
||||
if (password != null && !password.equals("")) {
|
||||
if (count == 0) {
|
||||
try {
|
||||
setAccountsRegistered(new File("data/characters/").list().length);
|
||||
count = 50;
|
||||
count = 150;
|
||||
} catch (Exception e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
@@ -32,7 +32,6 @@ public class RegisteredAccsWebsite {
|
||||
}
|
||||
} else if (hasntwarned) {
|
||||
hasntwarned = false;
|
||||
System.out.println("You need to provide the powpass secret to use this!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package redone.integrations;
|
||||
|
||||
import org.json.JSONObject;
|
||||
import redone.Server;
|
||||
import redone.game.players.Client;
|
||||
import redone.integrations.discord.JavaCord;
|
||||
|
||||
import java.io.*;
|
||||
@@ -11,7 +13,8 @@ public class SettingsLoader {
|
||||
JSONObject main = new JSONObject();
|
||||
main
|
||||
.put("bot-token", "")
|
||||
.put("powpass", "");
|
||||
.put("websitepass", "")
|
||||
.put("erssecret", "");
|
||||
try {
|
||||
BufferedWriter br = new BufferedWriter(new FileWriter("data/secrets.json"));
|
||||
br.write(main.toString());
|
||||
@@ -25,7 +28,7 @@ public class SettingsLoader {
|
||||
if (!new File("data/secrets.json").exists()) {
|
||||
initialize();
|
||||
System.out.println("Please open \"data/secrets.json\" file and enter your discord token bot there!");
|
||||
System.out.println("Please open \"data/secrets.json\" file and enter your Players Online On Website Password there!");
|
||||
System.out.println("Please open \"data/secrets.json\" file and enter your Website Password there!");
|
||||
|
||||
} else {
|
||||
BufferedReader br = new BufferedReader(new FileReader("data/secrets.json"));
|
||||
@@ -33,7 +36,10 @@ public class SettingsLoader {
|
||||
JSONObject obj = new JSONObject(out);
|
||||
|
||||
JavaCord.token = obj.getString("bot-token");
|
||||
PlayersOnlineWebsite.password = obj.getString("powpass");
|
||||
PlayersOnlineWebsite.password = obj.getString("websitepass");
|
||||
RegisteredAccsWebsite.password = obj.getString("websitepass");
|
||||
Client.ersSecret = obj.getString("erssecret");
|
||||
Server.ersSecret = obj.getString("erssecret");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user