mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 00:31:51 +00:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 997ccce97f | |||
| cb3686a9f5 | |||
| 374b03a691 | |||
| 7bc2b8bf7a | |||
| fab3c3eac7 | |||
| f254773b39 | |||
| 0481b9327d | |||
| 860adc8194 | |||
| 8b3bdc8045 | |||
| d061f18128 | |||
| 3e00708936 | |||
| 315d103f01 | |||
| 5f4a5ef8b6 |
@@ -11,9 +11,7 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Set up JDK 1.8
|
||||
@@ -21,4 +19,18 @@ jobs:
|
||||
with:
|
||||
java-version: 1.8
|
||||
- name: Build with Maven
|
||||
run: mvn -B clean install
|
||||
id: build
|
||||
run: |
|
||||
mvn -B clean package
|
||||
mkdir -p ~/artifacts
|
||||
cp "2006Scape Client/target/client-1.0-jar-with-dependencies.jar" ~/artifacts/Client.jar
|
||||
cp "2006Scape Server/target/server-1.0-jar-with-dependencies.jar" ~/artifacts/Server.jar
|
||||
cp "2006Scape Server/ServerConfig.Sample.json" ~/artifacts/ServerConfig.json
|
||||
cp SinglePlayer.bat ~/artifacts/
|
||||
cp -r "2006Scape Server/plugins" ~/artifacts/
|
||||
cp -r "2006Scape Server/data" ~/artifacts/
|
||||
- name: Publish build to GH Actions
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
path: ~/artifacts/*
|
||||
name: 2006Scape-Build
|
||||
|
||||
@@ -21,7 +21,7 @@ public class ClientSettings {
|
||||
* You don't have to change this, the client will automatically connect to the server
|
||||
* on localhost (Assuming you're running Client and LocalGame respectively)
|
||||
*/
|
||||
public static String SERVER_IP = "www.2006Scape.org";
|
||||
public static String SERVER_IP = "server.2006Scape.org";
|
||||
/**
|
||||
* The Servers World
|
||||
* This Determines The Port The Server Will Connect On
|
||||
|
||||
@@ -15,6 +15,18 @@ public final class Main {
|
||||
try {
|
||||
// Process server/ip address to connect to
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
switch(args[i]) {
|
||||
case "-dev" :
|
||||
case "-local":
|
||||
case "-offline":
|
||||
ClientSettings.SERVER_IP = "localhost";
|
||||
ClientSettings.CHECK_CRC = false;
|
||||
break;
|
||||
case "-no-crc":
|
||||
case "-no-cache-crc":
|
||||
ClientSettings.CHECK_CRC = false;
|
||||
break;
|
||||
}
|
||||
if (args[i].startsWith("-") && (i + 1) < args.length && !args[i + 1].startsWith("-")) {
|
||||
switch(args[i]) {
|
||||
case "-s":
|
||||
@@ -22,16 +34,6 @@ public final class Main {
|
||||
case "-ip":
|
||||
ClientSettings.SERVER_IP = args[++i];
|
||||
break;
|
||||
case "-no-crc":
|
||||
case "-no-cache-crc":
|
||||
ClientSettings.CHECK_CRC = false;
|
||||
break;
|
||||
case "-dev" :
|
||||
case "-local":
|
||||
case "-offline":
|
||||
ClientSettings.SERVER_IP = "localhost";
|
||||
ClientSettings.CHECK_CRC = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,12 +4,11 @@
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
final class RSFrame extends Frame {
|
||||
|
||||
public RSFrame(RSApplet RSApplet_, int i, int j) {
|
||||
rsApplet = RSApplet_;
|
||||
setTitle(ClientSettings.SERVER_NAME);
|
||||
setTitle(ClientSettings.SERVER_NAME + " World: " + ClientSettings.SERVER_WORLD);
|
||||
setResizable(false);
|
||||
setMinimumSize(new Dimension(i + 8, j + 28));
|
||||
setVisible(true);
|
||||
|
||||
@@ -19,5 +19,5 @@
|
||||
"timeout": 60,
|
||||
"item_requirements": true,
|
||||
"max_players": 200,
|
||||
"website_total_characters_integration": false
|
||||
"website_integration": false
|
||||
}
|
||||
@@ -10970,7 +10970,7 @@
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"maxHit": 16,
|
||||
"maxHit": 8,
|
||||
"strength": 150,
|
||||
"attack": 250,
|
||||
"x": 3425,
|
||||
@@ -10980,7 +10980,7 @@
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"maxHit": 16,
|
||||
"maxHit": 8,
|
||||
"strength": 150,
|
||||
"attack": 250,
|
||||
"x": 3428,
|
||||
@@ -10990,7 +10990,7 @@
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"maxHit": 16,
|
||||
"maxHit": 8,
|
||||
"strength": 150,
|
||||
"attack": 250,
|
||||
"x": 3425,
|
||||
@@ -11000,7 +11000,7 @@
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"maxHit": 16,
|
||||
"maxHit": 8,
|
||||
"strength": 150,
|
||||
"attack": 250,
|
||||
"x": 3423,
|
||||
@@ -11010,7 +11010,7 @@
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"maxHit": 16,
|
||||
"maxHit": 8,
|
||||
"strength": 150,
|
||||
"attack": 250,
|
||||
"x": 3427,
|
||||
@@ -11020,7 +11020,7 @@
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"maxHit": 16,
|
||||
"maxHit": 8,
|
||||
"strength": 150,
|
||||
"attack": 250,
|
||||
"x": 3416,
|
||||
@@ -11030,7 +11030,7 @@
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"maxHit": 16,
|
||||
"maxHit": 8,
|
||||
"strength": 150,
|
||||
"attack": 250,
|
||||
"x": 3413,
|
||||
@@ -11040,7 +11040,7 @@
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"maxHit": 16,
|
||||
"maxHit": 8,
|
||||
"strength": 150,
|
||||
"attack": 250,
|
||||
"x": 3410,
|
||||
@@ -11050,7 +11050,7 @@
|
||||
"height": 2
|
||||
},
|
||||
{
|
||||
"maxHit": 16,
|
||||
"maxHit": 8,
|
||||
"strength": 150,
|
||||
"attack": 250,
|
||||
"x": 3413,
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package plugin.npc.fadli
|
||||
|
||||
import com.rs2.event.EventContext
|
||||
import com.rs2.event.EventSubscriber
|
||||
import com.rs2.event.SubscribesTo
|
||||
import com.rs2.event.impl.NpcSecondClickEvent
|
||||
import com.rs2.game.players.Player
|
||||
|
||||
@SubscribesTo(NpcSecondClickEvent::class)
|
||||
class SecondClick : EventSubscriber<NpcSecondClickEvent> {
|
||||
|
||||
override fun subscribe(context: EventContext, player: Player, event: NpcSecondClickEvent) {
|
||||
if (event.npc == 958) {
|
||||
player.packetSender.openUpBank()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,7 @@
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<properties>
|
||||
<kotlin.version>1.5.31</kotlin.version>
|
||||
<kotlin.version>1.6.10</kotlin.version>
|
||||
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
|
||||
</properties>
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.10.5.1</version>
|
||||
<version>2.13.4.1</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.json/json -->
|
||||
<dependency>
|
||||
@@ -134,19 +134,19 @@
|
||||
<dependency>
|
||||
<groupId>org.javacord</groupId>
|
||||
<artifactId>javacord-api</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>3.3.2</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/org.javacord/javacord-core -->
|
||||
<dependency>
|
||||
<groupId>org.javacord</groupId>
|
||||
<artifactId>javacord-core</artifactId>
|
||||
<version>3.1.1</version>
|
||||
<version>3.3.2</version>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.google.code.gson/gson -->
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.6</version>
|
||||
<version>2.8.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.everythingrs</groupId>
|
||||
|
||||
@@ -64,8 +64,8 @@ public class ConfigLoader {
|
||||
GameConstants.VARIABLE_XP_RATES[i] = rates.optInt(i);
|
||||
}
|
||||
}
|
||||
if(obj.has("website_total_characters_integration"))
|
||||
GameConstants.WEBSITE_TOTAL_CHARACTERS_INTEGRATION = obj.getBoolean("website_total_characters_integration");
|
||||
if(obj.has("website_integration"))
|
||||
GameConstants.WEBSITE_INTEGRATION = obj.getBoolean("website_integration");
|
||||
}
|
||||
|
||||
private static void initialize() {
|
||||
|
||||
@@ -26,6 +26,7 @@ public class GameConstants {
|
||||
* VARIABLE_XP_RATE Allows Players To Choose An XP Rate Set In VARIABLE_XP_RATES
|
||||
* VARIABLE_XP_RATES Defines The XP Rates That Should Be Available To Players When VARIABLE_XP_RATES is true(Array Must Contain Four Entries)
|
||||
* XP_RATE Sets The XP Rate Multiplier For All Players/Skills If VARIABLE_XP_RATES is false
|
||||
* WEBSITE_INTEGRATION Enables/Disables Website Features(Total Accounts Registered & Players Online)
|
||||
*/
|
||||
public static String SERVER_NAME = "2006Scape", WEBSITE_LINK = "https://2006Scape.org";
|
||||
public static int WORLD = 1, MAX_PLAYERS = 200, TIMEOUT = 60, SAVE_TIMER = 120,
|
||||
@@ -33,7 +34,7 @@ public class GameConstants {
|
||||
public static boolean FILE_SERVER = true, SERVER_DEBUG = false, MEMBERS_ONLY = false, TUTORIAL_ISLAND = false,
|
||||
PARTY_ROOM_DISABLED = false, CLUES_ENABLED = true, ITEM_REQUIREMENTS = true,
|
||||
ADMIN_CAN_TRADE = false, ADMIN_DROP_ITEMS = false, ADMIN_CAN_SELL_ITEMS = false, VARIABLE_XP_RATE = false,
|
||||
WEBSITE_TOTAL_CHARACTERS_INTEGRATION = false;
|
||||
WEBSITE_INTEGRATION = false;
|
||||
public static int[] VARIABLE_XP_RATES = new int[] {1, 2, 5, 10};
|
||||
public static double TEST_VERSION = 2.3, XP_RATE = 1.0;
|
||||
|
||||
|
||||
@@ -104,7 +104,6 @@ public class GameEngine {
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static String ersSecret;
|
||||
public static int[] cannonsX = new int[50];
|
||||
public static int[] cannonsY = new int[50];
|
||||
@@ -143,7 +142,6 @@ public class GameEngine {
|
||||
case "-c":
|
||||
case "-config":
|
||||
try {
|
||||
//TODO Load A Default Config File When Arg Not Used
|
||||
System.out.println("Loading External Config..");
|
||||
ConfigLoader.loadSettings(args[++i]);
|
||||
System.out.println("Loaded Config File " + args[i]);
|
||||
@@ -161,8 +159,7 @@ public class GameEngine {
|
||||
System.out.println("@@@@ DEBUG MODE IS ENABLED @@@@");
|
||||
}
|
||||
|
||||
if (!new File("data").exists())
|
||||
{
|
||||
if (!new File("data").exists()) {
|
||||
System.out.println("************************************");
|
||||
System.out.println("************************************");
|
||||
System.out.println("************************************");
|
||||
@@ -267,8 +264,8 @@ public class GameEngine {
|
||||
objectHandler.process();
|
||||
MageTrainingArena.process();
|
||||
CycleEventHandler.getSingleton().process();
|
||||
if (GameConstants.WEBSITE_INTEGRATION) {
|
||||
PlayersOnlineWebsite.addUpdatePlayersOnlineTask();
|
||||
if(GameConstants.WEBSITE_TOTAL_CHARACTERS_INTEGRATION) {
|
||||
RegisteredAccsWebsite.addUpdateRegisteredUsersTask();
|
||||
}
|
||||
if (DiscordActivity.playerCount) {
|
||||
@@ -328,6 +325,4 @@ public class GameEngine {
|
||||
|
||||
public static boolean playerExecuted = false;
|
||||
private static BufferedReader minuteFile;
|
||||
|
||||
|
||||
}
|
||||
@@ -508,8 +508,7 @@ public class NpcCombat {
|
||||
NpcHandler.npcs[i].projectileId = 448;
|
||||
} else if (r3 == 1) {
|
||||
NpcHandler.npcs[i].attackType = 1;
|
||||
NpcHandler.npcs[i].endGfx = 451;
|
||||
NpcHandler.npcs[i].projectileId = -1;
|
||||
NpcHandler.npcs[i].projectileId = 451;
|
||||
} else if (r3 == 2) {
|
||||
NpcHandler.npcs[i].attackType = 0;
|
||||
NpcHandler.npcs[i].projectileId = -1;
|
||||
|
||||
@@ -11,7 +11,9 @@ import com.rs2.game.players.Player;
|
||||
|
||||
public enum NpcEmotes {
|
||||
MAN(new int[] {1, 2, 3, 4, 5, 6}, 422, 1834, 836),
|
||||
GUARD(new int[] {9, 10}, 412, 404, 836),
|
||||
AL_KHARID_WARRIOR(new int[] {18}, 451, 1156, 836),
|
||||
GUARD(new int[] {9}, 412, 1156, 836),
|
||||
GUARD_NO_SHIELD(new int[] {10}, 412, 404, 836),
|
||||
GARGOYLE(new int[] {1610, 1611}, 1517, 1519, 1518),
|
||||
SKELETAL_WYVERN(new int[] {3068}, 2989, 2988, 2987),
|
||||
BAT(new int[] {412, 78}, 30, 31, 36),
|
||||
|
||||
@@ -24,7 +24,7 @@ public class Food {
|
||||
MANTA(391, 22, "Manta Ray", 0, "Food", false),
|
||||
SHARK(385, 20, "Shark", 0, "Food", false),
|
||||
LOBSTER(379, 12, "Lobster", 0, "Food", false),
|
||||
KARAMBWAN(3144, 2 + Misc.random(4), "Karambwan", 0, "Food", false),
|
||||
KARAMBWAN(3144, 18, "Karambwan", 0, "Food", false),
|
||||
TROUT(333, 7, "Trout", 0, "Food", false),
|
||||
SALMON(329, 9, "Salmon", 0, "Food", false),
|
||||
SWORDFISH(373, 14, "Swordfish", 0, "Food", false),
|
||||
|
||||
@@ -39,7 +39,8 @@ public class Cooking extends SkillHandler {
|
||||
SWORDFISH(371, 373, 375, 50, 140, 86, 81, "swordfish"),
|
||||
MONKFISH(7944, 7946, 7948, 62, 150, 92, 90, "monkfish"),
|
||||
SHARK(383, 385, 387, 76, 210, 100, 94, "shark"),
|
||||
MANTA_RAY(389, 391, 393, 91, 169, 100, 100, "manta ray"),
|
||||
SEA_TURTLE(395, 397, 399, 82, 211, 100, 100, "sea turtle"),
|
||||
MANTA_RAY(389, 391, 393, 91, 216, 100, 100, "manta ray"),
|
||||
SEAWEED(401, 1781, 1781, 1, 1, 1, 1, "sea weed"),
|
||||
CURRY(2009, 2011, 2013, 60, 280, 74, 74, "curry");
|
||||
|
||||
|
||||
@@ -1049,10 +1049,14 @@ public class NpcHandler {
|
||||
// These npcs shouldn't have drops
|
||||
return;
|
||||
}
|
||||
boolean isDropped = false;
|
||||
for (ItemDrop possible_drop : NPCDropsHandler.getNpcDrops(getNpcListName(npcs[i].npcType).toLowerCase().replace(" ", "_"), npcs[i].npcType)) {
|
||||
if (Misc.random(possible_drop.getChance()) == 0) {
|
||||
if (Misc.random(possible_drop.getChance()) == 0 && !isDropped) {
|
||||
int amt = possible_drop.getAmount();
|
||||
GameEngine.itemHandler.createGroundItem(c, possible_drop.getItemID(), npcs[i].absX, npcs[i].absY, amt, c.playerId);
|
||||
//Making sure items that always drop don't cost us our drop table roll
|
||||
if (possible_drop.getChance() > 1)
|
||||
isDropped = true;
|
||||
}
|
||||
}
|
||||
switch (npcs[i].npcType) {
|
||||
|
||||
@@ -229,6 +229,8 @@ public class Climbing {
|
||||
} else if (client.objectX == 2603 && client.objectY == 3078) {
|
||||
client.getPlayerAssistant().feature("using this staircase");
|
||||
client.resetWalkingQueue();
|
||||
} else if (client.objectX == 3058 && client.objectY == 3376) {
|
||||
client.resetWalkingQueue();
|
||||
} else if (client.absX != 3186) {
|
||||
client.getPlayerAssistant().movePlayer(client.absX,
|
||||
client.absY + 6393, 0);
|
||||
|
||||
@@ -75,6 +75,7 @@ public abstract class Player {
|
||||
public byte buffer[] = null;
|
||||
public String lastConnectedFrom;
|
||||
public static int xpRate = 1;
|
||||
public String discordCode;
|
||||
private Compost compost = new Compost(this);
|
||||
private Allotments allotment = new Allotments(this);
|
||||
private Flowers flower = new Flowers(this);
|
||||
@@ -155,6 +156,10 @@ public abstract class Player {
|
||||
|
||||
public void setXPRate(int xpRate) { this.xpRate = xpRate; }
|
||||
|
||||
public String getDiscordCode() { return discordCode; }
|
||||
|
||||
public void setDiscordCode(String code) { this.discordCode = code; }
|
||||
|
||||
public boolean isPreaching() {
|
||||
return preaching;
|
||||
}
|
||||
|
||||
@@ -433,6 +433,9 @@ public class PlayerSave {
|
||||
case "unlocked-bones-to-peaches":
|
||||
player.unlockedBonesToPeaches = Boolean.parseBoolean(token2);
|
||||
break;
|
||||
case "discord-user-id":
|
||||
player.discordCode = token2;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
@@ -823,6 +826,8 @@ public class PlayerSave {
|
||||
}
|
||||
characterfile.write("void = " + voidStatus.trim());
|
||||
characterfile.newLine();
|
||||
characterfile.write("discord-user-id = " + player.discordCode);
|
||||
characterfile.newLine();
|
||||
characterfile.newLine();
|
||||
|
||||
/* EQUIPMENT */
|
||||
|
||||
@@ -2,9 +2,7 @@ package com.rs2.integrations.discord;
|
||||
|
||||
import com.rs2.GameConstants;
|
||||
import com.rs2.integrations.discord.commands.*;
|
||||
import com.rs2.integrations.discord.commands.admin.GameKick;
|
||||
import com.rs2.integrations.discord.commands.admin.MoveHome;
|
||||
import com.rs2.integrations.discord.commands.admin.Update;
|
||||
import com.rs2.integrations.discord.commands.admin.*;
|
||||
import org.javacord.api.DiscordApi;
|
||||
import org.javacord.api.DiscordApiBuilder;
|
||||
import org.javacord.api.entity.channel.TextChannel;
|
||||
@@ -34,14 +32,20 @@ public class JavaCord {
|
||||
api.addListener(new Forum());
|
||||
api.addListener(new Hiscores());
|
||||
api.addListener(new Issues());
|
||||
api.addListener(new Link());
|
||||
api.addListener(new Online());
|
||||
api.addListener(new Players());
|
||||
api.addListener(new Vote());
|
||||
api.addListener(new Website());
|
||||
//Admin Commands
|
||||
api.addListener(new AdminCommands());
|
||||
api.addListener(new GameKick());
|
||||
api.addListener(new MoveHome());
|
||||
api.addListener(new Update());
|
||||
api.addListener(new Pin());
|
||||
api.addListener(new Purge());
|
||||
//api.addListener(new Link());
|
||||
//api.addListener(new WelcomeMessage());
|
||||
if(!DiscordActivity.playerCount) {
|
||||
api.updateActivity(GameConstants.WEBSITE_LINK);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.rs2.integrations.discord;
|
||||
|
||||
import com.rs2.GameConstants;
|
||||
import org.javacord.api.event.server.member.ServerMemberJoinEvent;
|
||||
import org.javacord.api.listener.server.member.ServerMemberJoinListener;
|
||||
|
||||
public class WelcomeMessage implements ServerMemberJoinListener {
|
||||
@Override
|
||||
public void onServerMemberJoin(ServerMemberJoinEvent event) {
|
||||
String welcomeMessageChannel = "655143683083206667";
|
||||
if (GameConstants.WORLD == 1) {
|
||||
event.getApi().getTextChannelById(welcomeMessageChannel).get().
|
||||
sendMessage("Hello " + event.getUser().getMentionTag() + " And Welcome To " + JavaCord.serverName + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,17 +12,21 @@ public class Commands implements MessageCreateListener {
|
||||
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " commands")) {
|
||||
event.getChannel().sendMessage("```fix"
|
||||
+ System.lineSeparator() +
|
||||
JavaCord.commandPrefix + " forum/" + JavaCord.commandPrefix + " forums"
|
||||
"::link"
|
||||
+ System.lineSeparator() +
|
||||
"::forum/::forums"
|
||||
+ System.lineSeparator() +
|
||||
JavaCord.commandPrefix + " gamekick(if account id linked)"
|
||||
+ System.lineSeparator() +
|
||||
JavaCord.commandPrefix + " hiscores/" + JavaCord.commandPrefix + " highscores"
|
||||
+ System.lineSeparator() +
|
||||
JavaCord.commandPrefix + " issues/" + JavaCord.commandPrefix + " bugs"
|
||||
"::issues/::bugs"
|
||||
+ System.lineSeparator() +
|
||||
JavaCord.commandPrefix + " online"
|
||||
+ System.lineSeparator() +
|
||||
JavaCord.commandPrefix + " vote"
|
||||
"::vote"
|
||||
+ System.lineSeparator() +
|
||||
JavaCord.commandPrefix + " website/" + JavaCord.commandPrefix + " site"
|
||||
"::website/::site"
|
||||
+ "```");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.rs2.integrations.discord.commands;
|
||||
|
||||
import com.rs2.integrations.discord.JavaCord;
|
||||
import org.javacord.api.entity.message.Message;
|
||||
import org.javacord.api.event.message.MessageCreateEvent;
|
||||
import org.javacord.api.listener.message.MessageCreateListener;
|
||||
@@ -11,8 +10,10 @@ public class Forum implements MessageCreateListener {
|
||||
@Override
|
||||
public void onMessageCreate(MessageCreateEvent event) {
|
||||
Message message = event.getMessage();
|
||||
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " forum") || message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " forums")) {
|
||||
if (message.getContent().equalsIgnoreCase("::forum") || message.getContent().equalsIgnoreCase("::forums")) {
|
||||
if (GameConstants.WORLD == 1) {
|
||||
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK + "/forums/index.php");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.rs2.integrations.discord.commands;
|
||||
|
||||
import com.rs2.integrations.discord.JavaCord;
|
||||
import com.rs2.GameConstants;
|
||||
import org.javacord.api.entity.message.Message;
|
||||
import org.javacord.api.event.message.MessageCreateEvent;
|
||||
import org.javacord.api.listener.message.MessageCreateListener;
|
||||
@@ -9,8 +9,10 @@ public class Issues implements MessageCreateListener {
|
||||
@Override
|
||||
public void onMessageCreate(MessageCreateEvent event) {
|
||||
Message message = event.getMessage();
|
||||
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " issues") || message.getContent().equalsIgnoreCase(JavaCord.commandPrefix+ " bugs")) {
|
||||
if (message.getContent().equalsIgnoreCase("::issues") || message.getContent().equalsIgnoreCase("::bugs")) {
|
||||
if (GameConstants.WORLD == 1) {
|
||||
event.getChannel().sendMessage("https://github.com/2006-Scape/2006Scape/issues");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.rs2.integrations.discord.commands;
|
||||
|
||||
import org.javacord.api.entity.message.Message;
|
||||
import org.javacord.api.entity.user.User;
|
||||
import org.javacord.api.event.message.MessageCreateEvent;
|
||||
import org.javacord.api.listener.message.MessageCreateListener;
|
||||
|
||||
public class Link implements MessageCreateListener {
|
||||
@Override
|
||||
public void onMessageCreate(MessageCreateEvent event) {
|
||||
Message message = event.getMessage();
|
||||
User user = message.getAuthor().asUser().get();
|
||||
if (message.getContent().equalsIgnoreCase("::link")) {
|
||||
event.getChannel().sendMessage(user.getMentionTag() + ", Please check your DM's to continue.");
|
||||
user.sendMessage("Please copy/paste the following in-game to link your Discord account: \n ```::link " + user.getIdAsString() + "```");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.rs2.integrations.discord.commands;
|
||||
|
||||
import com.rs2.integrations.discord.JavaCord;
|
||||
import org.javacord.api.entity.message.Message;
|
||||
import org.javacord.api.event.message.MessageCreateEvent;
|
||||
import org.javacord.api.listener.message.MessageCreateListener;
|
||||
@@ -11,9 +10,11 @@ public class Vote implements MessageCreateListener {
|
||||
@Override
|
||||
public void onMessageCreate(MessageCreateEvent event) {
|
||||
Message message = event.getMessage();
|
||||
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " vote")) {
|
||||
if (message.getContent().equalsIgnoreCase("::vote")) {
|
||||
if (GameConstants.WORLD == 1) {
|
||||
event.getChannel().sendMessage("Visit " + GameConstants.WEBSITE_LINK + "/vote.html then type \"::claimvote\" in-game to receive your reward!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.rs2.integrations.discord.commands;
|
||||
|
||||
import com.rs2.integrations.discord.JavaCord;
|
||||
import org.javacord.api.entity.message.Message;
|
||||
import org.javacord.api.event.message.MessageCreateEvent;
|
||||
import org.javacord.api.listener.message.MessageCreateListener;
|
||||
@@ -11,8 +10,10 @@ public class Website implements MessageCreateListener {
|
||||
@Override
|
||||
public void onMessageCreate(MessageCreateEvent event) {
|
||||
Message message = event.getMessage();
|
||||
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " website") || message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " site")) {
|
||||
if (message.getContent().equalsIgnoreCase("::website") || message.getContent().equalsIgnoreCase("::site")) {
|
||||
if (GameConstants.WORLD == 1) {
|
||||
event.getChannel().sendMessage(GameConstants.WEBSITE_LINK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.rs2.integrations.discord.commands.admin;
|
||||
|
||||
import com.rs2.integrations.discord.JavaCord;
|
||||
import org.javacord.api.entity.message.Message;
|
||||
import org.javacord.api.event.message.MessageCreateEvent;
|
||||
import org.javacord.api.listener.message.MessageCreateListener;
|
||||
|
||||
public class AdminCommands implements MessageCreateListener {
|
||||
@Override
|
||||
public void onMessageCreate(MessageCreateEvent event) {
|
||||
Message message = event.getMessage();
|
||||
if (message.getContent().equalsIgnoreCase(JavaCord.commandPrefix + " admincommands")) {
|
||||
if (event.getMessageAuthor().isServerAdmin()) {
|
||||
event.getChannel().sendMessage("```fix"
|
||||
+ System.lineSeparator() +
|
||||
"::pin/::unpin(Pins/Un-Pins The Replied Mesage)"
|
||||
+ System.lineSeparator() +
|
||||
"::purge(Purges The Specified Amount Of Messages From Discord Channel)"
|
||||
+ System.lineSeparator() +
|
||||
JavaCord.commandPrefix + " gamekick(Kicks The Specified Player From The GameServer)"
|
||||
+ System.lineSeparator() +
|
||||
JavaCord.commandPrefix + " movehome(Moves The Specified Player To Lumbridge)"
|
||||
+ System.lineSeparator() +
|
||||
JavaCord.commandPrefix + " update(Triggers A GameServer Update In The Specified Amount Of Seconds)"
|
||||
+ "```");
|
||||
} else {
|
||||
event.getChannel().sendMessage("You do not have permission to perform this command");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-4
@@ -7,26 +7,28 @@ import com.rs2.integrations.discord.JavaCord;
|
||||
import org.javacord.api.event.message.MessageCreateEvent;
|
||||
import org.javacord.api.listener.message.MessageCreateListener;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class GameKick implements MessageCreateListener {
|
||||
@Override
|
||||
public void onMessageCreate(MessageCreateEvent event) {
|
||||
if (event.getMessageContent().startsWith(JavaCord.commandPrefix + " gamekick")) {
|
||||
if (event.getMessageAuthor().isServerAdmin()) {
|
||||
String playerToKick = event.getMessageContent().replace( JavaCord.commandPrefix + " gamekick ", "");
|
||||
for (Player player2 : PlayerHandler.players) {
|
||||
if (player2 != null) {
|
||||
if (player2.playerName.equalsIgnoreCase(playerToKick)) {
|
||||
Client c2 = (Client) player2;
|
||||
if (event.getMessageAuthor().isServerAdmin() || Objects.equals(event.getMessageAuthor().getIdAsString(), c2.discordCode)) {
|
||||
event.getChannel().sendMessage(playerToKick + " was kicked by " + event.getMessageAuthor().getDisplayName() + ".");
|
||||
c2.disconnected = true;
|
||||
c2.logout(true);
|
||||
} else {
|
||||
event.getChannel().sendMessage("You do not have permission to perform this command");
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
event.getChannel().sendMessage("You do not have permission to perform this command");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.rs2.integrations.discord.commands.admin;
|
||||
|
||||
import com.rs2.GameConstants;
|
||||
import org.javacord.api.entity.message.Message;
|
||||
import org.javacord.api.event.message.MessageCreateEvent;
|
||||
import org.javacord.api.listener.message.MessageCreateListener;
|
||||
|
||||
public class Pin implements MessageCreateListener {
|
||||
@Override
|
||||
public void onMessageCreate(MessageCreateEvent event) {
|
||||
Message message = event.getMessage();
|
||||
if (message.getContent().startsWith("::pin")) {
|
||||
if (event.getMessageAuthor().isServerAdmin()) {
|
||||
if(GameConstants.WORLD == 1) {
|
||||
if (message.getReferencedMessage().isPresent()) {
|
||||
Message messageToPin = message.getReferencedMessage().get();
|
||||
messageToPin.pin();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
event.getChannel().sendMessage("You do not have permission to perform this command");
|
||||
}
|
||||
}
|
||||
if (message.getContent().startsWith("::unpin")) {
|
||||
if (event.getMessageAuthor().isServerAdmin()) {
|
||||
if(GameConstants.WORLD == 1) {
|
||||
if (message.getReferencedMessage().isPresent()) {
|
||||
Message messageToUnpin = message.getReferencedMessage().get();
|
||||
messageToUnpin.unpin();
|
||||
event.getChannel().sendMessage("Un-Pinned Message: " + messageToUnpin.getLink());
|
||||
|
||||
}
|
||||
}
|
||||
} else {
|
||||
event.getChannel().sendMessage("You do not have permission to perform this command");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.rs2.integrations.discord.commands.admin;
|
||||
|
||||
import com.rs2.GameConstants;
|
||||
import org.javacord.api.entity.message.Message;
|
||||
import org.javacord.api.event.message.MessageCreateEvent;
|
||||
import org.javacord.api.listener.message.MessageCreateListener;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
public class Purge implements MessageCreateListener {
|
||||
@Override
|
||||
public void onMessageCreate(MessageCreateEvent event) {
|
||||
Message message = event.getMessage();
|
||||
if (message.getContent().startsWith("::purge")) {
|
||||
if (event.getMessageAuthor().isServerAdmin()) {
|
||||
if(GameConstants.WORLD == 1) {
|
||||
int messagesToPurge = Integer.parseInt(event.getMessageContent().replace("::purge ", ""));
|
||||
if (messagesToPurge > 50) {
|
||||
event.getChannel().sendMessage("Can't purge more than 50 messages at once.");
|
||||
return;
|
||||
}
|
||||
try {
|
||||
event.getChannel().sendMessage("Purging " + messagesToPurge + " Messages.");
|
||||
message.getMessagesBefore(messagesToPurge).get().deleteAll();
|
||||
Message Purge = message.getMessagesAfter(1).get().getNewestMessage().get();
|
||||
Purge.edit("Purged " + messagesToPurge + " Messages.");
|
||||
TimeUnit.SECONDS.sleep(5);
|
||||
message.delete();
|
||||
Purge.delete();
|
||||
} catch (InterruptedException | ExecutionException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
event.getChannel().sendMessage("You do not have permission to perform this command");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -8,17 +8,17 @@ import org.javacord.api.listener.message.MessageCreateListener;
|
||||
public class Update implements MessageCreateListener {
|
||||
@Override
|
||||
public void onMessageCreate(MessageCreateEvent event) {
|
||||
if(event.getMessageAuthor().isServerAdmin()) {
|
||||
String seconds = event.getMessageContent().replace(JavaCord.commandPrefix + " update ", "");
|
||||
if (event.getMessageContent().startsWith(JavaCord.commandPrefix + " update")) {
|
||||
if (event.getMessageAuthor().isServerAdmin()) {
|
||||
PlayerHandler.updateSeconds = Integer.parseInt(seconds);
|
||||
PlayerHandler.updateAnnounced = false;
|
||||
PlayerHandler.updateRunning = true;
|
||||
PlayerHandler.updateStartTime = System.currentTimeMillis();
|
||||
event.getChannel().sendMessage("Server update will begin in " + seconds + " seconds.");
|
||||
}
|
||||
} else {
|
||||
event.getChannel().sendMessage("You do not have permission to perform this command");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,7 +154,7 @@ public class ClickObject implements PacketType {
|
||||
if (player.spiritTree == false && player.clickedTree == false) {
|
||||
player.getPacketSender().sendMessage("You attempt to chop the tree, and a tree spirit appears !");
|
||||
player.getPacketSender().sendSound(300, 100, 1);
|
||||
NpcHandler.spawnNpc(player, 655, player.getX(), player.getY(), 0, 0, 225, 20, 80, 80, true, true);
|
||||
NpcHandler.spawnNpc(player, 655, player.getX(), player.getY(), 0, 0, 85, 10, 80, 80, true, true);
|
||||
player.clickedTree = true;
|
||||
} else if (player.spiritTree && player.lostCity >= 2) {
|
||||
Woodcutting.startWoodcutting(player, player.objectId, player.objectX, player.objectY, player.clickObjectType);
|
||||
|
||||
@@ -44,6 +44,11 @@ public class Commands implements PacketType {
|
||||
|
||||
public static void playerCommands(Player player, String playerCommand, String[] arguments) {
|
||||
switch (playerCommand.toLowerCase()) {
|
||||
case "link":
|
||||
player.setDiscordCode(arguments[0]);
|
||||
player.getPacketSender().sendMessage("Your Account has now been linked with Discord User ID:");
|
||||
player.getPacketSender().sendMessage(player.getDiscordCode());
|
||||
break;
|
||||
case "myxprate":
|
||||
case "checkxprate":
|
||||
if(GameConstants.VARIABLE_XP_RATE) {
|
||||
|
||||
@@ -22,31 +22,14 @@
|
||||
|
||||
To compile any module from the command line, run `mvn clean install`
|
||||
|
||||
## Using Parabot with your local server: (OUTDATED)
|
||||
- **1:** Download the latest `localhost_2006Scape.jar` from [here](https://github.com/2006-Scape/2006Scape/releases) (or, if testing server changes, compile it yourself like [this](https://i.imgur.com/uDrF0gl.png))
|
||||
- **2:** Download the latest `Provider-version.jar` file from [here](http://v3.bdn.parabot.org/api/bot/download/default-provider?nightly=false)
|
||||
- **3:** Create a file called `localhost.json` in `{user}\Documents\Parabot\servers`
|
||||
- **4:** Put the following in the file
|
||||
```json
|
||||
{
|
||||
"name": "localhost",
|
||||
"author": "RedSparr0w",
|
||||
"version": 1.0,
|
||||
"client-class": "LocalGame",
|
||||
"locations":{
|
||||
"provider": "pathToYourJar/Provider-1.21.5.jar",
|
||||
"server": "pathToYourJar/localhost_2006Scape.jar",
|
||||
"hooks": "http://bdn.parabot.org/data/hooks/carmeuses/2006rebotted_hooks.xml"
|
||||
}
|
||||
}
|
||||
```
|
||||
_(you will need to put the path to the jar files yourself)_
|
||||
- 5: Run the parabot client with the following args:
|
||||
## Using Parabot with your local server:
|
||||
- **1:** Download the latest `2006-Scape Fork Of Parabot` from [here](https://github.com/2006-Scape/Parabot/actions/workflows/maven.yml)
|
||||
- **2:** Run the parabot client with the following args:
|
||||
```fix
|
||||
java -jar Client-2.8.1.jar -login username password -loadlocal -v -clearcache
|
||||
java -jar Parabot-V3.0.0.jar -login username password -loadlocal -v -clearcache
|
||||
```
|
||||
- **6:** ???
|
||||
- **7:** PROFIT
|
||||
- **3:** ???
|
||||
- **4:** PROFIT
|
||||
|
||||
### Server source layout
|
||||
|
||||
@@ -56,4 +39,4 @@ java -jar Client-2.8.1.jar -login username password -loadlocal -v -clearcache
|
||||
|
||||
## Building from command line
|
||||
|
||||
Run `mvn -B clean install`
|
||||
Run `mvn -B clean package`
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
:: Runs The Server & FileServer
|
||||
start cmd /k java -jar Server.jar -c ServerConfig.json
|
||||
:: Used To Wait 6 Seconds Before Running The Client
|
||||
PING localhost -n 6 >NUL
|
||||
:: Starts The Client
|
||||
start cmd /k java -jar Client.jar -s localhost
|
||||
Reference in New Issue
Block a user