Skip to content

Commit b6f3065

Browse files
committed
Merge remote-tracking branch 'origin/master' into config-options-resizable-and-render-flames
# Conflicts: # config/client-435.conf.example.yaml
2 parents 726c1f1 + 4926d1d commit b6f3065

File tree

10 files changed

+218
-56
lines changed

10 files changed

+218
-56
lines changed

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,8 @@ artifacts/
4040
.DS_Store
4141
.classpath
4242
.project
43-
.settings/org.eclipse.jdt.core.prefs
43+
.settings/org.eclipse.jdt.core.prefs
44+
45+
# as of 2024-09-04, prebuilt dir is deprecated in favor of releases due to
46+
# increasing binary blob file sizes
47+
/prebuilt

.vscode/settings.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
// do not autoformat java files in this repository
3+
"[java]": {
4+
"editor.formatOnSave": false,
5+
"editor.formatOnPaste": false,
6+
"editor.formatOnType": false,
7+
},
8+
}

README.md

Lines changed: 65 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,22 @@
11
# RuneJS Java Client #435
22

3-
A RuneScape game client from October 2006 which has been modified to work with RuneJS, a RuneScape game server written in NodeJS and TypeScript. **This client is not for OldSchool RuneScape** - client #435 pre-dates the very first OSRS client by quite some time.
3+
A RuneScape game client from October 2006 which has been modified to work with RuneJS, a RuneScape game server written in NodeJS and TypeScript. **This client is not for OldSchool RuneScape** - client #435 pre-dates the very first OSRS client by quite some time.
44

55
We've no interest in OSRS client hacking, this client exists as a means to develop on RuneJS game servers and will not work with other server emulators.
66

77
## Usage
88

9-
Running the client can be done either with the pre-built client JAR file or by building the Java code and running it manually in an IDE.
9+
Running the client can be done either with the pre-built client `.jar` file from this repository's [releases](https://github.com/runejs/refactored-client-435/releases) page, or by building the Java code and running it manually in an IDE.
1010

1111
### Pre-Built Client
1212

13-
Running the pre-built client requires having Java installed: https://www.java.com/en/
13+
Running the pre-built client requires having Java installed: <https://www.java.com/en/>
1414

15-
Once installed, go into the `/prebuilt/` and simply double-click the JAR file to run it. Alternatively if executing the JAR does not work, the command `java -jar client-435-0.3.jar` may be used from within the `/prebuilt/` directory.
15+
Once installed, go to the [releases](https://github.com/runejs/refactored-client-435/releases) page, download the latest release, and simply double-click the `.jar` file file to run it. Alternatively if executing the `.jar` file does not work, the command `java -jar client-435-0.3.jar` can be used.
1616

1717
The client will use a set of default configurations if no file is provided. The default client configuration matches up to the default RuneJS server configuration for quick and easy initial setup. It's highly advised that you generate your own RSA public and private keys for long term use.
1818

19-
To provide your own configurations, create a file named `client-435.conf.yaml` in your User Home directory with the following content:
20-
21-
```yaml
22-
net:
23-
address: 127.0.0.1
24-
game_port: 43594
25-
cache:
26-
cacheDir: .filestore_435
27-
rsa:
28-
rsaPub: YOUR_RSA_PUBLIC_KEY (default dev pair provided in the example file)
29-
rsaModulus: YOUR_RSA_PRIVATE_KEY (default dev pair provided in the example file)
30-
login:
31-
useStaticCredentials: true
32-
username: a
33-
password: a
34-
game:
35-
roofsEnabled: true
36-
freeTeleports: false
37-
debugContextMenu: true
38-
serverDisplayName: Build 435
39-
```
40-
41-
Make sure to modify the given configuration for your specific needs.
19+
To provide your own configurations, copy the file [`./config/client-435.conf.example.yml`](./config/client-435.conf.example.yaml) to `client-435.conf.yaml` in your user's home directory, and modify the given configuration for your specific needs.
4220

4321
### Gradle
4422

@@ -47,20 +25,76 @@ without the help of an IDE such as IntelliJ. Gradle is also configured to automa
4725

4826
The following examples use the unix executable `./gradlew`, however Windows can replace these with `./gradlew.bat`.
4927

50-
**Running via Gradle**
28+
#### Running via Gradle
5129

5230
The `application` gradle plugin provides the `run` task, which starts up the Main client class. With this option,
5331
arguments can be provided via `--args`.
5432

55-
```
33+
```bash
5634
./gradlew run
5735
```
5836

59-
**Building a Jar**
37+
#### Building a `.jar` file
6038

6139
The `jar` task can be used to build a jar, which is generated in the `build/libs` directory.
6240

63-
```
41+
```bash
6442
./gradlew jar
6543
java -jar ./build/libs/client-435-0.3.jar
6644
```
45+
46+
#### Gradle and Java versions
47+
48+
As of 2024-09-04, our manual builds are done with the following Gradle and Java versions - both appear to produce a similar result:
49+
50+
```bash
51+
gradle -v
52+
```
53+
54+
```text
55+
------------------------------------------------------------
56+
Gradle 8.10
57+
------------------------------------------------------------
58+
59+
Build time: 2024-08-14 12:23:39 UTC
60+
Revision: <unknown>
61+
62+
Kotlin: 1.9.24
63+
Groovy: 3.0.22
64+
Ant: Apache Ant(TM) version 1.10.14 compiled on August 16 2023
65+
Launcher JVM: 1.8.0_422 (Arch Linux 25.422-b05)
66+
Daemon JVM: /usr/lib/jvm/java-8-openjdk (no JDK specified, using current Java home)
67+
OS: Linux 6.10.6-arch1-1 amd64
68+
```
69+
70+
```text
71+
------------------------------------------------------------
72+
Gradle 7.2
73+
------------------------------------------------------------
74+
75+
Build time: 2021-08-17 09:59:03 UTC
76+
Revision: a773786b58bb28710e3dc96c4d1a7063628952ad
77+
78+
Kotlin: 1.5.21
79+
Groovy: 3.0.8
80+
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
81+
JVM: 17.0.10 (Azul Systems, Inc. 17.0.10+7-LTS)
82+
OS: Mac OS X 14.4.1 aarch64
83+
```
84+
85+
You can also view our [GitHub actions workflow](./.github/workflows/build-and-publish.yml) to see the automated build setup.
86+
87+
## Creating tags and releases
88+
89+
Our [GitHub actions workflow](./.github/workflows/build-and-publish.yml) is configured to build a new `.jar` file upon a `tag` push event. If you create a release in GitHub, the workflow will fail, because its purpose is to *create* the release.
90+
91+
The proper process for creating a new build is as follows:
92+
93+
1. `git fetch --all` (ensures everything is up to date - helps prevent creating a tag that someone else already created)
94+
2. `git pull origin master` (sync your local repository with the latest changes)
95+
3. `git tag -a -s v0.0.X`
96+
4. `git push origin v0.0.X`
97+
98+
Swap out `v0.0.X` for your actual version, and please try to use the `-s` flag if you can - using GPG keys to sign tags is preferred.
99+
100+
In a few minutes, a new `.jar` and release will be ready on the releases page!

config/client-435.conf.example.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ game:
1616
debugContextMenu: true
1717
renderFlames: true
1818
resizable: false
19+
shiftClickModifier: true
1920
serverDisplayName: Build 435

prebuilt/client-435-0.3.jar

-996 KB
Binary file not shown.

src/main/java/org/runejs/Configuration.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public static void read() {
3939
USERNAME = (String) login.get("username");
4040
PASSWORD = (String) login.get("password");
4141
ROOFS_ENABLED = (boolean) game.get("roofsEnabled");
42+
SHIFT_CLICK_MODIFIER = (boolean) game.get("shiftClickModifier");
4243
SOUND_MUTED = (boolean) game.get("soundMuted");
4344
FREE_TELEPORTS = (boolean) game.get("freeTeleports");
4445
DEBUG_CONTEXT = (boolean) game.get("debugContextMenu");
@@ -80,6 +81,7 @@ public static void read() {
8081

8182
Map<String, Object> game = new HashMap<String, Object>();
8283
game.put("roofsEnabled", ROOFS_ENABLED);
84+
game.put("shiftClickModifier", SHIFT_CLICK_MODIFIER);
8385
game.put("freeTeleports", FREE_TELEPORTS);
8486
game.put("debugContextMenu", DEBUG_CONTEXT);
8587
game.put("soundMuted", SOUND_MUTED);
@@ -175,6 +177,13 @@ public static void read() {
175177
*/
176178
public static boolean ROOFS_ENABLED = true;
177179

180+
/**
181+
* If true, the shift key will cause the second-highest menu item to be
182+
* shown instead of the first, and if there is a "Drop" value present, it
183+
* will be prioritized.
184+
*/
185+
public static boolean SHIFT_CLICK_MODIFIER = true;
186+
178187
/**
179188
* Always light up teleports
180189
*/

src/main/java/org/runejs/client/Game.java

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,14 @@ public class Game {
116116
public static int playerRights = 0;
117117
public static Timer gameTimer;
118118
public static int idleLogout = 0;
119+
120+
/**
121+
* If the shift key has been pressed, this reflects the state, but only
122+
* `Game.isShiftModifierActive()` should be used for confirming that the key
123+
* is pressed as well as checking that player's client's configuration
124+
* allows shift modifiers to be leveraged.
125+
*/
126+
public static boolean shiftPressed = false;
119127
/**
120128
* Backup port if the first one fails?
121129
*/
@@ -990,7 +998,7 @@ public static void drawGameScreen() {
990998
ChatBox.redrawChatbox = true;
991999
}
9921000
}
993-
1001+
9941002
if(flashingTabId != -1) {
9951003
GameInterface.drawTabIcons = true;
9961004
}
@@ -2058,4 +2066,14 @@ public void startup() {
20582066
MovedStatics.showFps = true;
20592067
chatboxInterface = new GameInterface();
20602068
}
2069+
2070+
/**
2071+
* Checks if the shift modifiers are enabled and active.
2072+
*
2073+
* @return true if the player is currently pressing the shift key and if
2074+
* player has configured their client to accept shift modifiers.
2075+
*/
2076+
public static boolean isShiftModifierActive() {
2077+
return Game.shiftPressed == true && Configuration.SHIFT_CLICK_MODIFIER;
2078+
}
20612079
}

0 commit comments

Comments
 (0)