mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-07 16:49:07 +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 class Server {
|
||||||
|
|
||||||
|
|
||||||
|
public static String ersSecret;
|
||||||
public static int[] cannonsX = new int [50];
|
public static int[] cannonsX = new int [50];
|
||||||
public static int[] cannonsY = new int [50];
|
public static int[] cannonsY = new int [50];
|
||||||
public static String[] cannonsO = new String [50];
|
public static String[] cannonsO = new String [50];
|
||||||
@@ -156,6 +157,23 @@ public class Server {
|
|||||||
System.out.println("Server listening on port "
|
System.out.println("Server listening on port "
|
||||||
+ serverlistenerPort);
|
+ 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
|
* Main Server Tick
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ import redone.world.ObjectManager;
|
|||||||
|
|
||||||
public class Client extends Player {
|
public class Client extends Player {
|
||||||
|
|
||||||
|
public static String ersSecret;
|
||||||
|
|
||||||
public byte buffer[] = null;
|
public byte buffer[] = null;
|
||||||
public Stream inStream = null, outStream = null;
|
public Stream inStream = null, outStream = null;
|
||||||
private IoSession session;
|
private IoSession session;
|
||||||
@@ -154,7 +156,6 @@ public class Client extends Player {
|
|||||||
return dwarfCannon;
|
return dwarfCannon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ChallengePlayer getChallengePlayer() {
|
public ChallengePlayer getChallengePlayer() {
|
||||||
return challengePlayer;
|
return challengePlayer;
|
||||||
}
|
}
|
||||||
@@ -567,6 +568,11 @@ public class Client extends Player {
|
|||||||
if (clanId >= 0) {
|
if (clanId >= 0) {
|
||||||
Server.clanChat.leaveClan(playerId, clanId);
|
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 + "");
|
Misc.println("[DEREGISTERED]: " + playerName + "");
|
||||||
HostList.getHostList().remove(session);
|
HostList.getHostList().remove(session);
|
||||||
CycleEventHandler.getSingleton().stopEvents(this);
|
CycleEventHandler.getSingleton().stopEvents(this);
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class PlayersOnlineWebsite {
|
|||||||
}
|
}
|
||||||
} else if (hasntwared) {
|
} else if (hasntwared) {
|
||||||
hasntwared = false;
|
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();
|
url.openStream().close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static int count = 50;
|
private static int count = 25;
|
||||||
public static void addUpdateRegisteredUsersTask() {
|
public static void addUpdateRegisteredUsersTask() {
|
||||||
if (password != null && !password.equals("")) {
|
if (password != null && !password.equals("")) {
|
||||||
if (count == 0) {
|
if (count == 0) {
|
||||||
try {
|
try {
|
||||||
setAccountsRegistered(new File("data/characters/").list().length);
|
setAccountsRegistered(new File("data/characters/").list().length);
|
||||||
count = 50;
|
count = 150;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// TODO Auto-generated catch block
|
// TODO Auto-generated catch block
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -32,7 +32,6 @@ public class RegisteredAccsWebsite {
|
|||||||
}
|
}
|
||||||
} else if (hasntwarned) {
|
} else if (hasntwarned) {
|
||||||
hasntwarned = false;
|
hasntwarned = false;
|
||||||
System.out.println("You need to provide the powpass secret to use this!");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
package redone.integrations;
|
package redone.integrations;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
import redone.Server;
|
||||||
|
import redone.game.players.Client;
|
||||||
import redone.integrations.discord.JavaCord;
|
import redone.integrations.discord.JavaCord;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.*;
|
||||||
@@ -11,7 +13,8 @@ public class SettingsLoader {
|
|||||||
JSONObject main = new JSONObject();
|
JSONObject main = new JSONObject();
|
||||||
main
|
main
|
||||||
.put("bot-token", "")
|
.put("bot-token", "")
|
||||||
.put("powpass", "");
|
.put("websitepass", "")
|
||||||
|
.put("erssecret", "");
|
||||||
try {
|
try {
|
||||||
BufferedWriter br = new BufferedWriter(new FileWriter("data/secrets.json"));
|
BufferedWriter br = new BufferedWriter(new FileWriter("data/secrets.json"));
|
||||||
br.write(main.toString());
|
br.write(main.toString());
|
||||||
@@ -25,7 +28,7 @@ public class SettingsLoader {
|
|||||||
if (!new File("data/secrets.json").exists()) {
|
if (!new File("data/secrets.json").exists()) {
|
||||||
initialize();
|
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 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 {
|
} else {
|
||||||
BufferedReader br = new BufferedReader(new FileReader("data/secrets.json"));
|
BufferedReader br = new BufferedReader(new FileReader("data/secrets.json"));
|
||||||
@@ -33,7 +36,10 @@ public class SettingsLoader {
|
|||||||
JSONObject obj = new JSONObject(out);
|
JSONObject obj = new JSONObject(out);
|
||||||
|
|
||||||
JavaCord.token = obj.getString("bot-token");
|
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