mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-02 16:49:03 +00:00
Make new contributors welcome (#11)
* @mediabi3 * Fix up for guide and making server run easier
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
/**
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user