diff --git a/2006Redone Client/src/Client.java b/2006Redone Client/src/Client.java new file mode 100644 index 00000000..38fb15cb --- /dev/null +++ b/2006Redone Client/src/Client.java @@ -0,0 +1,22 @@ +import java.net.InetAddress; +import java.net.UnknownHostException; + +public final class Client { + + public static void main(String[] args) { + ClientSettings.SERVER_IP = "127.0.0.1"; + try { + Game game = new Game(); + Game.nodeID = 10; + Game.portOff = 0; + Game.setHighMem(); + Game.isMembers = true; + Signlink.storeid = 32; + Signlink.startpriv(InetAddress.getLocalHost()); + game.createClientFrame(503, 765); + } catch (UnknownHostException e) { + e.printStackTrace(); + } + } + +} \ No newline at end of file diff --git a/2006Redone Client/src/Game.java b/2006Redone Client/src/Game.java index bf3274c2..8bdf08d2 100644 --- a/2006Redone Client/src/Game.java +++ b/2006Redone Client/src/Game.java @@ -6536,7 +6536,7 @@ public class Game extends RSApplet { } catch(IOException _ex) { - s = "connection problem"; + s = "Connection problem -- Make sure FileServer is running!!"; expectedCRCs[8] = 0; } catch(Exception _ex) diff --git a/2006Redone Client/src/Main.java b/2006Redone Client/src/Main.java index 096c90c1..7f954aba 100644 --- a/2006Redone Client/src/Main.java +++ b/2006Redone Client/src/Main.java @@ -3,6 +3,18 @@ import java.net.UnknownHostException; public final class Main { + /* + + DEAR DEVELOPER! + + If you want to run the client locally, the easiest way to do that is run the class "Client.java" instead! + + If you REALLY want to use this class, add two random program arguments. + But seriously, Client.java is just a copy-paste of this class and does it locally. Use that instead! + + + */ + public static void main(String[] args) { if (args.length > 1) { diff --git a/2006Redone Server/src/redone/Server.java b/2006Redone Server/src/redone/Server.java index 40800ac8..cc9e3af8 100644 --- a/2006Redone Server/src/redone/Server.java +++ b/2006Redone Server/src/redone/Server.java @@ -1,5 +1,6 @@ package redone; +import java.io.File; import java.io.IOException; import java.net.InetSocketAddress; @@ -91,6 +92,20 @@ public class Server { System.out.println("@@@@ DEBUG MODE IS ENABLED @@@@"); } + if (!new File("data").exists()) + { + System.out.println("************************************"); + System.out.println("************************************"); + System.out.println("************************************"); + System.out.println("WARNING: I could not find the /data folder. You are LIKELY running this in the wrong directory!"); + System.out.println("In IntelliJ, fix it by clicking \"Server\" > Edit Configurations at the top of your screen"); + System.out.println("Then changing the \"Working Directory\" to be in \"2006rebotted/2006Redone Server\", instead of just \"2006rebotted\""); + System.out.println("************************************"); + System.out.println("************************************"); + System.out.println("************************************"); + System.exit(1); + } + /** * Starting Up Server */ @@ -128,7 +143,7 @@ public class Server { /** * Server Successfully Loaded */ - System.out.println("Server listening on port 85.214.117.88: " + System.out.println("Server listening on port " + serverlistenerPort); /** diff --git a/2006Redone file_server/src/org/apollo/jagcached/FileServer.java b/2006Redone file_server/src/org/apollo/jagcached/FileServer.java index fd19a26d..07e67874 100644 --- a/2006Redone file_server/src/org/apollo/jagcached/FileServer.java +++ b/2006Redone file_server/src/org/apollo/jagcached/FileServer.java @@ -1,5 +1,6 @@ package org.apollo.jagcached; +import java.io.File; import java.net.InetSocketAddress; import java.net.SocketAddress; import java.util.concurrent.ExecutorService; @@ -68,6 +69,20 @@ public final class FileServer { * @throws Exception if an error occurs. */ public void start() throws Exception { + if (!new File("cache").exists()) + { + System.out.println("************************************"); + System.out.println("************************************"); + System.out.println("************************************"); + System.out.println("WARNING: I could not find the /cache folder. You are LIKELY running this in the wrong directory!"); + System.out.println("In IntelliJ, fix it by clicking \"FileServer\" > Edit Configurations at the top of your screen"); + System.out.println("Then changing the \"Working Directory\" to be in \"2006rebotted/2006Redone file_server\", instead of just \"2006rebotted\""); + System.out.println("************************************"); + System.out.println("************************************"); + System.out.println("************************************"); + System.exit(1); + } + logger.info("Starting workers..."); pool.start(); diff --git a/CompiledServer/production/2006rebotted/Client.class b/CompiledServer/production/2006rebotted/Client.class new file mode 100644 index 00000000..40cf1d98 Binary files /dev/null and b/CompiledServer/production/2006rebotted/Client.class differ diff --git a/CompiledServer/production/2006rebotted/Game.class b/CompiledServer/production/2006rebotted/Game.class index 1daa74d6..6a508d24 100644 Binary files a/CompiledServer/production/2006rebotted/Game.class and b/CompiledServer/production/2006rebotted/Game.class differ diff --git a/CompiledServer/production/2006rebotted/Main.class b/CompiledServer/production/2006rebotted/Main.class index 8fc698da..af342052 100644 Binary files a/CompiledServer/production/2006rebotted/Main.class and b/CompiledServer/production/2006rebotted/Main.class differ diff --git a/CompiledServer/production/2006rebotted/org/apollo/jagcached/FileServer.class b/CompiledServer/production/2006rebotted/org/apollo/jagcached/FileServer.class index 40b848a9..e39c106a 100644 Binary files a/CompiledServer/production/2006rebotted/org/apollo/jagcached/FileServer.class and b/CompiledServer/production/2006rebotted/org/apollo/jagcached/FileServer.class differ diff --git a/CompiledServer/production/2006rebotted/redone/Server.class b/CompiledServer/production/2006rebotted/redone/Server.class index 66dc5d84..d90f473a 100644 Binary files a/CompiledServer/production/2006rebotted/redone/Server.class and b/CompiledServer/production/2006rebotted/redone/Server.class differ diff --git a/CompiledServer/production/2006rebotted/redone/game/content/skills/core/Woodcutting$4.class b/CompiledServer/production/2006rebotted/redone/game/content/skills/core/Woodcutting$4.class index 44d46967..786f2f1e 100644 Binary files a/CompiledServer/production/2006rebotted/redone/game/content/skills/core/Woodcutting$4.class and b/CompiledServer/production/2006rebotted/redone/game/content/skills/core/Woodcutting$4.class differ diff --git a/CompiledServer/production/2006rebotted/redone/game/content/skills/core/Woodcutting.class b/CompiledServer/production/2006rebotted/redone/game/content/skills/core/Woodcutting.class index bbf84b84..9e0e79be 100644 Binary files a/CompiledServer/production/2006rebotted/redone/game/content/skills/core/Woodcutting.class and b/CompiledServer/production/2006rebotted/redone/game/content/skills/core/Woodcutting.class differ diff --git a/README.md b/README.md index fc937b98..3ba0ba9d 100644 --- a/README.md +++ b/README.md @@ -46,13 +46,20 @@ Step 16: Navigate to your 2006rebotted folder, open `2006Redone file_server` > ` Step 17: Hit OK in the project structure screen after all your JARs are imported: ([Image](https://i.imgur.com/Yv3SX1q.png)) -Step 18: Navigate to the FileServer class and hit Run. It will fail since we need to start it in the right directory: [Image](https://i.imgur.com/LFkr39U.png) +Step 18: Navigate to the FileServer class (`2006Redone file_server/src/org/apollo/jagcached/FileServer.java`), Right Click -> Run. It will fail since we need to start it in the right directory: [Image](https://i.imgur.com/LFkr39U.png) -Step 19: To fix the directory issue, click File Server and hit Edit Configurations at the top: [Image](https://i.imgur.com/lJdBPCs.png) +Step 19: To fix the directory issue, click FileServer and hit Edit Configurations at the top: [Image](https://i.imgur.com/lJdBPCs.png) Step 20: Under Working Directory, add `2006Redone file_server` to the path (on Windows, you may need a \\ for paths instead of a /. Not sure): [Image](https://i.imgur.com/ANkbgBl.png) -Step 21: Repeat for Server & Client. Note for Client, to play locally, you also have to append any 2 arguments to the Arguments section to run it locally (it's a quick hack for now). +Step 21: Navigate to the Server class (`2006Redone Server/src/redone/Server.java`), Right Click -> Run. It will fail since we need to start it in the right directory + +Step 22: To fix the directory issue, click Server and hit Edit Configurations at the top + +Step 23: Under Working Directory, add `2006Redone Server` to the path ([Image]("/home/dr_cookie/Projects/2006rebotted/2006Redone Client/src/Client.java")) + +Step 24: Navigate to the Client class (`2006Redone Client/src/Client.java`), Right Click -> Run. + ### Server source layout