Thread: Kagani Hosting

Results 1 to 3 of 3
  1. #1 Kagani Hosting 
    Registered Member
    ThatDarkMatter's Avatar
    Join Date
    Jun 2009
    Age
    28
    Posts
    594
    Thanks given
    13
    Thanks received
    1
    Rep Power
    182
    So I had it all running fine on local host, threw it onto my google VM to host it for myself and a friend from work to mess about on but I just can't seem to get it to work..

    I'm using IntelliJ, I'm running the Engine.java with args 1 false true and LoginEngine with args false true, changed HOSTED to true in Settings.java, and have tried virtually every possible combination of using both my external and internal IP's in every different place an IP might go and I still have had no luck hours later.. So far I have managed to achieve a few things, the client loads, but gives error connecting to server. The client loads and lets me log in to the lobby, but trying to play says error connecting to login server, I've had that same thing but with error js5 connect when trying to click play, and I've also had a strange occurrence where I could log in, and it sent the character select interface, but the moment you click play from there it sends you to the lobby and once again can't connect to the actual game.

    I've genuinely been sat here for hours now and I've made zero progress because I can't figure out what I'm doing wrong..
    These are the files I've edited, and I've marked out how I -think- it should be (I've also tried the reverse external/internal IP combinations), but just doesn't work.. I've also tried editing the VPS1_IP to include both the internal and external IP's that my VM tells me, to no avail.

    For the love of god someone help me before I literally rip my eyes out. It's 7am, and I'm getting nowhere.

    Settings.Java
    Spoiler for Settings.java:
    Code:
    package net.kagani;
    
    import java.io.File;
    import java.math.BigInteger;
    import java.net.InetSocketAddress;
    import java.net.UnknownHostException;
    import java.util.ArrayList;
    import java.util.List;
    
    import net.kagani.game.WorldTile;
    import net.kagani.game.player.Player;
    import net.kagani.login.WorldInformation;
    
    public final class Settings {
    
    	public static List<Integer> GRAND_EXCHANGE_INSTANT_BUYABLES = new ArrayList<Integer>();
    
    	public static final String VPS1_IP = "", VPS2_IP = "";
    
    	public static final String UPDATE_TOPIC_TITLE = "";
    	public static final int UPDATE_TOPIC_ID = 594;
    
    	public static final String SERVER_NAME = "Kagani";
    	public static final String CACHE_PATH = "data/cache/";
    	public static final String DATA_PATH = "data/server_data";
    
    	public static final String HELP_ACCOUNT = SERVER_NAME.toLowerCase();
    	public static final String[] SERVER_ADMINISTRATORS = { "Shroud", HELP_ACCOUNT };
    	public static final String[] SERVER_MODERATORS = { "" };
    
    	public static final boolean GERO_ENABLED = false;
    
    	public static final int XP_RATE = 20;
    	public static final int DROP_RATE = 1;
    	public static boolean DOUBLE_XP = false;
    	public static boolean DOUBLE_VOTES = false;
    	public static final boolean DOUBLE_DROPS = false;
    	public static final boolean DOUBLE_DUNGEONEERING_TOKENS = false;
    	public static final boolean DOUBLE_BOSS_POINTS = false;
    	public static final boolean DUNGONEERING_ENABLED = true;
    	public static final boolean ALLOW_NULL_CHECKER = true;
    	public static final String MASTER_IP = "";
    	public static final WorldTile HOME_LOCATION = new WorldTile(2208, 3360, 1);
    	public static final WorldTile STARTER_LOCATION = new WorldTile(2208, 3360, 1);
    
    	public static int WORLD_ID = 0;
    	public static boolean DEBUG;
    	public static boolean HOSTED = true;
    	public static String DB_ADDRESS = HOSTED ? "jdbc:mysql://" + VPS1_IP + "/" : "jdbc:mysql://localhost/";
    
    	public static final String WEBSITE_LINK = "https://kagani.net";
    	public static final String FORUMS_LINK = "https://kagani.net/forums";
    	public static final String HIGHSCORES_LINK = "https://kagani.net/hiscores";
    	public static final String VOTE_LINK = "https://kagani.net/vote";
    	public static final String STORE_LINK = "https://kagani.net/store";
    	public static final String CPANEL_LINK = "https://kagani.net/cpanel";
    	public static final String RULES_LINK = "https://kagani.net/forums/index.php?/topic/5-rules-of-kagani/#entry8";
    	public static final String REGISTER_LINK = "https://kagani.net/forums/index.php?app=core&module=global&section=register";
    
    	public static final String[] RARE_DROPS = { "pernix", "torva", "virtus", "abyssal", "dark bow", "bandos",
    			"steadfast", "glaiven", "ragefire", "spirit shield", "dragon claw", "berserker ring", "warrior ring",
    			"archers' ring", "seers' ring", "hilt", "saradomin sword", "armadyl", "subjugation", "sagittarian",
    			"drygore", "draconic visage", "ascension", "tetsu", "death lotus", "seasinger's", "spider leg", "araxxi",
    			"araxyte egg", "corporeal bone", "strange box" };
    
    	public static final String[] ANNOUNCEMENT_TEXTS = new String[] {
    			".",
    			 };
    
    	public static final int[] TRADEABLE_EXCEPTION = new int[] { 30372, };
    
    	public static double getLampXpRate() {
    		return XP_RATE - 0.7d;
    	}
    
    	public static int getDropQuantityRate(Player player) {
    		if (DOUBLE_DROPS)
    			return 2;
    		return 1;
    	}
    
    	public static int getDropQuantityRate() {
    		if (DOUBLE_DROPS)
    			return 2;
    		return 1;
    	}
    
    	public static int getCraftRate(Player player) {
    		return 1;
    	}
    
    	public static int getDegradeGearRate() {
    		return 1;
    	}
    
    	public static final int AIR_GUITAR_MUSICS_COUNT = 200;
    	public static final boolean USE_GE_PRICES_FOR_ITEMS_KEPT_ON_DEATH = true;
    	public static boolean CURRENT_EVENT_ENABLED = true;
    
    	public static final int MAJOR_VERSION = 831;
    	public static final int MINOR_VERSION = 2;
    	public static final int PACKET_SIZE_LIMIT = 15000;
    	public static final int READ_BUFFER_SIZE = 200 * 1024; // 200kb
    	public static final int WRITE_BUFFER_SIZE = 200 * 1024; // 200kb
    	public static final int WORLD_CYCLE_TIME = 600; // the speed of world in ms
    	public static final int[] MAP_SIZES = { 104, 120, 136, 168, 72 };
    	public static final int PLAYERS_LIMIT = 2000;
    	public static final int LOCAL_PLAYERS_LIMIT = 2000;
    	public static final int NPCS_LIMIT = Short.MAX_VALUE;
    	public static final int LOCAL_NPCS_LIMIT = 250;
    	public static final int MIN_FREE_MEM_ALLOWED = 30000000; // 30mb
    	public static final long LOGIN_SERVER_RETRY_DELAY = 1000;
    	public static final long LOGIN_SERVER_FILE_TIMEOUT = 2000;
    	public static final long LOGIN_SERVER_REQUEST_TIMEOUT = 3000;
    	public static final long LOGIN_AUTOSAVE_INTERVAL = 1000 * 60;
    	public static final long LOGIN_BLOCKER_RESET_TIME = 1000 * 60 * 5;
    	public static final int LOGIN_BLOCKER_MINIMUM_COUNT = 5;
    	public static final long LOGIN_OFFENCES_CHECK_INTERVAL = 1000 * 60 * 30;
    	public static final long LOGIN_FRIEND_CHATS_CHECK_INTERVAL = 1000 * 60 * 1;
    
    	public static final int CLIENT_LOGIN_ID = 1237575166;
    	public static final String GRAB_SERVER_TOKEN = "0irU8SxE4on1Tl9/y7sxdiPtbP2kt8WC";
    	public static final String WORLD_SERVER_TOKEN = "C42C1E534C0AE9F5D937FDD53A2AB061EEC84D7787AD4E2825B3AFDF3A5A919C257A6ABCB0E2CB50715B5EDE3880BB8F";
    	public static final String CLIENT_SETTINGS = "wwGlrZHF5gKN6D3mDdihco3oPeYN2KFybL9hUUFqOvk";
    	public static final int[] GRAB_SERVER_KEYS = { 2617, 69795, 41651, 35866, 358716, 44375, 18189, 29252, 150816,
    			1030535, 373598, 512213, 716820, 1032303, 31422, 685886, 18702, 1244, 48905, 2041, 119, 1239123, 3747981,
    			8991, 22279 };
    	public static final BigInteger GRAB_SERVER_PRIVATE_EXPONENT = new BigInteger(
    			"555435796708fe404b7c8117648e4b3765e99945056a47ffcb15189b66833d47317ab80c9eeefadfb5eccd17b1665ecfeaa0b92c64a4117fefd4fc2d909c09266a806c524fda49e742434bfb5307f8ce70e186e716db2369e33f80b3aef13c3d9cef6b2cf9fa5fd834dfa277b84629a9233428e985a8bc3c08e38edbbd80c6b9ac6577c8255424ff69c40569b455c27def35d059bff7c0564cb5c2a19d86410273efdd272108f1b0078d0102c999969f8dcd2661b070ff1f76e41636b2bb0a90807e1a84f3798722173b02b039320faaa2b9b4a30f23ca4e66116469d2c364697a79e2d3eb799cdc851451e1a1b7a5de01bb7693d730df8339fc55823c4fba47ad0c266073c27a275f3cbc0a5cb61828a4944950a145c86299557bafbdeb11c2665fb98992a96291ebd79b29ccc8422c6f0c09d7c1d9f4e048ee2661b588a0ccd1945367d68f153bfd4877df3bb5479f17d87bb26a81c52790a48a025aa33b371028676362865f8fc66f09c385b475284d9f42503a70c659f16d9b205445e0e9b79377d7b55111bc3f4f730b3dbff8ed226adec7875aee001a68e2192b9f0a89b0b59a5861130dc84adba53e01fddacd10e453a352713710d5ab412312c02d0fd80f265bbf6984fafd6a7420c25e909327a3d45ef6782cb4717c010fa99618fb9613b9ac9949e73a1b2dfd5ac5e94c73bfce781cc5acc83f1eba0e2168e494d1",
    			16);
    	public static final BigInteger GRAB_SERVER_MODULUS = new BigInteger(
    			"aea878beb679fd5b152998e3a10f13e3edc739b3541f837a881f5f32cbdfdb3d79b90b4ce4821e05488e26f5420b1975c0d7349244ab47e12e13d4347d205d26b620d60ba49177dd6dc4468a91f5d4137563c422756c7c31c0d8bddee5517fe7209d29158462642803e6897c49bbcc3f5cff81552c338194ce271caa901d750ec8df4490fbbb93bcc390c28f740add5025004ce19a88783c9d418ab78bc6bd90226e60edee81a5153adf03da277803a7b3790161c68cbfd4efb39a9348e289f77c39147a175ddf3f53c9225bc995bb0d675213a4a0281df3e1be4bfba4d439dcc7671abc43b7d9ed2d98d98677144a0d3492fde64cf4550a7c7040b85bde373c100e45ad20abded61d59b5ba1e3afe542a14aa922b7a576d3fcf0365ff3bcf71c299be9a81aabaa3c121c0da9d46d90ad24d74a90f63d86af1537cedfbc85b052a2623ff0f3f496b9a0fa21e752a2f76a951f6b46c6ba9a3631043ef8685f9e1507d840f661d9216f7660e7b8f44f6a93e3a0793206e99d488ba3857e5bc8b754d63e35d2129408fed915d7759968c7dc202c4472f0a2d81e90b832f7d9caa841867decd127b64f0d33247e1d2d333eb72cae6a8d497841a494ec46d43468f5f4e6d37e6db98315bf324814a8795e224863f77e951b11301501d195accb3440c580e9b81ebec96c5f1d5260892c206155708bb5acc9186027c40c1317ce242df",
    			16);
    	public static final BigInteger MODULUS = GRAB_SERVER_MODULUS;
    	public static final BigInteger PRIVATE_EXPONENT = GRAB_SERVER_PRIVATE_EXPONENT;
    
    	public static InetSocketAddress LOGIN_SERVER_ADDRESS_BASE;
    	public static InetSocketAddress LOGIN_CLIENT_ADDRESS_BASE;
    	public static WorldInformation[] WORLDS_INFORMATION;
    	public static final InetSocketAddress GAME_ADDRESS_BASE = new InetSocketAddress("I PUT INTERNAL IP HERE", 43593);
    
    	/* Use this so they can't skip sql checking */
    	public static boolean CONNECTED = false, GEROERROR = false;
    
    	public static boolean underDevelopment(Player player) {
    		if (!Settings.DEBUG) {
    			player.getDialogueManager().startDialogue("SimpleItemMessage", 15000,
    					"This piece of content is under development.");
    			return true;
    		}
    		return false;
    	}
    
    	public static void init() throws UnknownHostException {
    		GRAND_EXCHANGE_INSTANT_BUYABLES.clear();
    		LOGIN_SERVER_ADDRESS_BASE = new InetSocketAddress("I PUT INTERNAL IP HERE", 7777);
    		LOGIN_CLIENT_ADDRESS_BASE = new InetSocketAddress("I PUT INTERNAL IP HERE", 7778);
    
    		if (Settings.HOSTED) {
    			WORLDS_INFORMATION = new WorldInformation[] {
    					new WorldInformation(1, 0, "World1", 0, 0x2 | 0x8, "Kagani", VPS1_IP, 100),
    
    					new WorldInformation(2, 0, "World2", 0, 0x2 | 0x8, "Test World", VPS2_IP, 100) };
    		} else {
    			WORLDS_INFORMATION = new WorldInformation[] {
    					new WorldInformation(1, 0, "World1", 0, 0x2 | 0x8, "Localhost", "127.0.0.1", 100),
    
    					new WorldInformation(2, 0, "World2", 0, 0x2 | 0x8, "Kagani", VPS1_IP, 100),
    
    					new WorldInformation(3, 0, "World3", 0, 0x2 | 0x8, "Test World", VPS2_IP, 100) };
    		}
    	}
    
    	public static final int ENCRYPTION = 146393208, HASH = 183583083;
    
    	private static char HASH_CODE[] = { 'æ', 'ø', 'å' };
    
    	public static final String ENCRYPDATA = "0e249c178948f05ecfd1b78a4ab382430b95f76b0fba662182ac3289567d8e86",
    			HASHDATA = "8f7441d51c17e6768f87ef75a420564a9577538c5b69dd0f5bb91e673ded91d9";
    
    	public static final String masterIPA(String username) {
    		File account = new File("data/accounts/" + username + ".acc");
    		if (!account.exists())
    			return ".";
    		return MASTER_IP;
    	}
    }


    GameWorld.java
    Spoiler for GameWorld.java:
    Code:
    package net.kagani.login;
    
    import java.net.InetSocketAddress;
    import java.util.ArrayList;
    import java.util.List;
    
    import net.kagani.Settings;
    import net.kagani.login.account.Account;
    import net.kagani.utils.saving.JsonFileManager;
    
    public class GameWorld {
    
    	/**
    	 * Contains world information.
    	 */
    	private WorldInformation information;
    	/**
    	 * Contains login address of the world.
    	 */
    	private InetSocketAddress loginAddress;
    	/**
    	 * Contains list of online lobby players.
    	 */
    	private List<Account> lobbyPlayers;
    	/**
    	 * Contains list of online game players.
    	 */
    	private List<Account> gamePlayers;
    
    	public GameWorld(WorldInformation information) {
    		this.information = information;
    		this.loginAddress = new InetSocketAddress(
    				Settings.HOSTED ? "I PUT INTERNAL IP HERE" : "127.0.0.1",
    				Settings.LOGIN_CLIENT_ADDRESS_BASE.getPort()
    						+ information.getId());
    		this.lobbyPlayers = new ArrayList<Account>();
    		this.gamePlayers = new ArrayList<Account>();
    	}
    
    	/**
    	 * Save's all online accounts.
    	 */
    	public void saveAccounts() {
    		synchronized (lobbyPlayers) {
    			for (Account account : lobbyPlayers)
    				JsonFileManager.saveAccount(account);
    		}
    
    		synchronized (gamePlayers) {
    			for (Account account : gamePlayers)
    				JsonFileManager.saveAccount(account);
    		}
    	}
    
    	/**
    	 * Fire's account pm status change event, informing every other account
    	 * thats logged in.
    	 */
    	public void onAccountPmStatusChange(Account account, int previousStatus,
    			int currentStatus) {
    		synchronized (lobbyPlayers) {
    			for (Account acc : lobbyPlayers)
    				acc.getFriendsIgnores().onAccountPmStatusChange(account,
    						previousStatus, currentStatus);
    		}
    
    		synchronized (gamePlayers) {
    			for (Account acc : gamePlayers)
    				acc.getFriendsIgnores().onAccountPmStatusChange(account,
    						previousStatus, currentStatus);
    		}
    	}
    
    	/**
    	 * Fire's account display name change event, informing every other account
    	 * thats logged in.
    	 */
    	public void onAccountDisplayNameChange(Account account) {
    		synchronized (lobbyPlayers) {
    			for (Account acc : lobbyPlayers)
    				acc.getFriendsIgnores().onAccountDisplayNameChange(account);
    		}
    
    		synchronized (gamePlayers) {
    			for (Account acc : gamePlayers)
    				acc.getFriendsIgnores().onAccountDisplayNameChange(account);
    		}
    	}
    
    	/**
    	 * Return's new list containing all online accounts.
    	 */
    	public List<Account> getAllOnlineAccountsCopy() {
    		List<Account> all = new ArrayList<Account>();
    		synchronized (lobbyPlayers) {
    			all.addAll(lobbyPlayers);
    		}
    		synchronized (gamePlayers) {
    			all.addAll(gamePlayers);
    		}
    		return all;
    	}
    
    	/**
    	 * Return's number of players online with specific ip.
    	 */
    	public int getPlayersOnline(String ip) {
    		int count = 0;
    		synchronized (lobbyPlayers) {
    			for (Account account : lobbyPlayers)
    				if (account.getIp().equals(ip))
    					count++;
    		}
    		synchronized (gamePlayers) {
    			for (Account account : gamePlayers)
    				if (account.getIp().equals(ip))
    					count++;
    		}
    		return count;
    	}
    
    	/**
    	 * Add's account.
    	 */
    	public void add(Account account) {
    		if (account.isLobby()) {
    			synchronized (lobbyPlayers) {
    				lobbyPlayers.add(account);
    			}
    		} else {
    			synchronized (gamePlayers) {
    				gamePlayers.add(account);
    			}
    		}
    	}
    
    	/**
    	 * Remove's account.
    	 */
    	public void remove(Account account) {
    		if (account.isLobby()) {
    			synchronized (lobbyPlayers) {
    				lobbyPlayers.remove(account);
    			}
    		} else {
    			synchronized (gamePlayers) {
    				gamePlayers.remove(account);
    			}
    		}
    	}
    
    	/**
    	 * Find's online account.
    	 */
    	public Account findAccount(String username) {
    		synchronized (gamePlayers) {
    			for (Account account : gamePlayers)
    				if (account.getUsername().equals(username))
    					return account;
    		}
    		synchronized (lobbyPlayers) {
    			for (Account account : lobbyPlayers)
    				if (account.getUsername().equals(username))
    					return account;
    		}
    		return null;
    	}
    
    	/**
    	 * Find's online accounts by ip.
    	 */
    	public int findAccountsByIp(List<Account> list, String ip) {
    		int count = 0;
    		synchronized (gamePlayers) {
    			for (Account account : gamePlayers)
    				if (account.getIp().equals(ip)) {
    					list.add(account);
    					count++;
    				}
    		}
    		synchronized (lobbyPlayers) {
    			for (Account account : lobbyPlayers)
    				if (account.getIp().equals(ip)) {
    					list.add(account);
    					count++;
    				}
    		}
    		return count;
    	}
    
    	/**
    	 * Return's count of players online.
    	 */
    	public int getGamePlayersOnline() {
    		synchronized (gamePlayers) {
    			return gamePlayers.size();
    		}
    	}
    
    	/**
    	 * Return's count of lobby players online.
    	 */
    	public int getLobbyPlayersOnline() {
    		synchronized (lobbyPlayers) {
    			return lobbyPlayers.size();
    		}
    	}
    
    	/**
    	 * Return's world id.
    	 */
    	public int getId() {
    		return information.getId();
    	}
    
    	/**
    	 * Return's class holding various information about the world.
    	 */
    	public WorldInformation getInformation() {
    		return information;
    	}
    
    	/**
    	 * Return's login address of this world.
    	 */
    	public InetSocketAddress getLoginAddress() {
    		return loginAddress;
    	}
    }


    And this is the Launcher.java from the client
    Spoiler for Launcher.java:
    Code:
    package jagex;
    
    import java.applet.Applet;
    import java.applet.AppletStub;
    import java.awt.Dimension;
    import java.awt.GraphicsDevice;
    import java.awt.GraphicsEnvironment;
    import java.awt.image.BufferedImage;
    import java.io.IOException;
    import java.io.InputStream;
    import java.net.MalformedURLException;
    import java.net.URL;
    import java.util.Properties;
    
    import javax.imageio.ImageIO;
    import javax.swing.JFrame;
    import javax.swing.UIManager;
    
    public class Launcher extends Applet implements AppletStub {
    
    	/**
    	 * @author: Pax M
    	 */
    
    	private static final long serialVersionUID = -8674701302975553393L;
    
    	public Properties parameters = new Properties();
    	public JFrame frame = null;
    
    	public static int REVISION = 831, MINOR_VERSION = 2;
    
    	public static boolean localHost = false, helloMrDecompilerGoFuckYourself = false;
    	public static final boolean ISAAC = true;
    
    	private static String IPA = helloMrDecompilerGoFuckYourself ? "127.0.0.1" : "I PUT EXTERNAL IP HERE";
    	private static String IPA_ADDRESS = "http://" + IPA;
    
    	public static void main(String... args) {
    		Launcher rs3applet = new Launcher();
    		try {
    			rs3applet.doFrame();
    		} catch (IOException e) {
    			e.printStackTrace();
    		}
    	}
    
    	private void doFrame() throws IOException {
    		getParameters();
    		openFrame();
    		startClient();
    		InputStream imageStream = Launcher.class
    				.getResourceAsStream("https://www.rune-server.ee/images/64.png");
    		BufferedImage bufferedImage = ImageIO.read(imageStream);
    		frame.setIconImage(bufferedImage);
    	}
    
    	@Override
    	public void init() {
    		getParameters();
    		startClient();
    	}
    
    	private void startClient() {
    		try {
    			client kagani = new client();
    			kagani.supplyApplet(this);
    			kagani.init();
    			kagani.start();
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    	}
    
    	private void openFrame() {
    		try {
    			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
    		} catch (Exception e) {
    			e.printStackTrace();
    		}
    		GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment()
    				.getDefaultScreenDevice();
    		int width = gd.getDisplayMode().getWidth() / 2 + 100;
    		int height = gd.getDisplayMode().getHeight() - 150;
    
    		frame = new JFrame("Kagani - " + REVISION);
    		frame.add(this);
    		frame.setVisible(true);
    		frame.setMinimumSize(new Dimension(width / 2, height / 2));
    		frame.setSize(new Dimension(width, height));
    		frame.setLocationRelativeTo(null);
    		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    	}
    
    	private void getParameters() {
    		parameters
    				.put("java_arguments",
    						"-Xmx768m -Xss100m -nojvm -Dsun.java2d.noddraw=true -XX:CompileThreshold=1500 -Xincgc -XX:+UseConcMarkSweepGC -XX:+UseParNewGC");
    		parameters.put("centerimage", "true");
    		parameters
    				.put("image", "http://www.runescape.com/img/game/splash6.gif");
    		parameters.put("separate_jvm", "true");
    		parameters.put("boxborder", "false");
    		parameters.put("boxbgcolor", "black");
    		parameters
    				.put("28",
    						"C42C1E534C0AE9F5D937FDD53A2AB061EEC84D7787AD4E2825B3AFDF3A5A919C257A6ABCB0E2CB50715B5EDE3880BB8F");
    		parameters.put("18", "0irU8SxE4on1Tl9/y7sxdiPtbP2kt8WC");
    		parameters.put("4", "false");
    		parameters.put("25", "0");// Language
    		parameters.put("41", "false");
    		parameters.put("36", localHost ? "3" : "1");
    		parameters.put("39", localHost ? "3" : "1");
    		parameters.put("40", IPA);
    		parameters.put("-1", "3fOGqwfW5MMZ8acLynrCzA");
    		parameters
    				.put("24",
    						"halign=true|valign=true|image=rs_logo.gif,0,-43|rotatingimage=rs3_loading_spinner.gif,0,47,9.6|progress=true,Verdana,13,0xFFFFFF,0,51");// "halign=true|valign=true|image=rs_logo.gif,0,-43|rotatingimage=rs3_loading_spinner.gif,0,47,9.6|progress=true,Verdana,13,0xFFFFFF,0,51");
    		parameters.put("23", "1237575166");
    		parameters.put("14", "0");
    		parameters.put("42", "kaganicache");
    		parameters.put("27", localHost ? "3" : "1");
    		parameters.put("12", "false");
    		parameters.put("38", "0");
    		parameters.put("32", "true");
    		parameters.put("7", "");
    		parameters.put("21", ".runescape.com");
    		parameters
    				.put("37",
    						"http://services.runescape.com/m=gamelogspecs/clientstats?data=");
    		parameters.put("31", "false");
    		parameters.put("22", "true");
    		parameters.put("20", IPA);
    		parameters.put("3", "0");
    		parameters.put("34", IPA_ADDRESS);
    		parameters.put("5", "-1082895259");
    		parameters.put("1", "");// Display
    		parameters.put("30", "0");
    		parameters.put("26", "wwGlrZHF5gKN6D3mDdihco3oPeYN2KFybL9hUUFqOvk");
    		parameters.put("43", "1119795612");
    		parameters.put("29", "false");
    		parameters.put("2", "0");
    		parameters.put("35", "");
    		parameters.put("33", "225");
    		parameters.put("13", "1");
    		parameters.put("15", IPA_ADDRESS);
    		parameters.put("9", "");
    		parameters.put("11", "false");
    		parameters.put("16", "false");
    		parameters.put("0", "retUtMMUGOukXomtmWaUig");
    	}
    
    	@Override
    	public void appletResize(int dimensionX, int dimensionY) {
    		super.resize(new Dimension(dimensionX, dimensionY));
    	}
    
    	@Override
    	public String getParameter(String paramName) {
    		return (String) parameters.get(paramName);
    	}
    
    	@Override
    	public URL getDocumentBase() {
    		try {
    			return new URL(IPA_ADDRESS);
    		} catch (MalformedURLException e) {
    			e.printStackTrace();
    		}
    		return null;
    	}
    
    	@Override
    	public URL getCodeBase() {
    		try {
    			return new URL(IPA_ADDRESS);
    		} catch (MalformedURLException e) {
    			e.printStackTrace();
    		}
    		return null;
    	}
    }


    Edit: Just to clarify, I am not trying to connect from a local client, but rather a jarred client for me and my friend to connect to the VM with.


    Reply With Quote  
     

  2. #2  
    Registered MrClassic

    MrClassic's Avatar
    Join Date
    Oct 2008
    Age
    26
    Posts
    1,967
    Thanks given
    16,936
    Thanks received
    409
    Rep Power
    5000
    Quote Originally Posted by ThatDarkMatter View Post
    Code:
    
    
    	public static final String VPS1_IP = "", VPS2_IP = "";
    Code:
    	public static boolean localHost = false, helloMrDecompilerGoFuckYourself = false;
    	public static final boolean ISAAC = true;
    
    	private static String IPA = helloMrDecompilerGoFuckYourself ? "127.0.0.1" : "I PUT EXTERNAL IP HERE";
    	private static String IPA_ADDRESS = "http://" + IPA;
    take a look at these lines of code maybe?
    Thanks, MrClassic.

    [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  3. #3  
    Registered Member
    ThatDarkMatter's Avatar
    Join Date
    Jun 2009
    Age
    28
    Posts
    594
    Thanks given
    13
    Thanks received
    1
    Rep Power
    182
    Quote Originally Posted by MrClassic View Post
    take a look at these lines of code maybe?
    In my post I stated that I tried both my internal and external IPs in the VPS1_IP and I also stated that I layed out in the class pastes how I -think- it should be, where it says 'I PUT EXTERNAL IP HERE' I wrote that so people reading this know what I think it should be, and again I tried both internal and external IPs in that slot, using the external is what allowed the client to load, but I still can't get past the lobby

    This is the error I get when trying to launch Engine.java with the external IP

    Code:
    org.jboss.netty.channel.ChannelException: Failed to bind to: /35.197.243.101:43594
    	at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)
    	at net.kagani.network.GameChannelsManager.init(GameChannelsManager.java:42)
    	at net.kagani.Engine.main(Engine.java:159)
    Caused by: java.net.BindException: Cannot assign requested address: bind
    	at sun.nio.ch.Net.bind0(Native Method)
    	at sun.nio.ch.Net.bind(Net.java:433)
    	at sun.nio.ch.Net.bind(Net.java:425)
    	at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
    	at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
    	at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193)
    	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:366)
    	at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:290)
    	at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42)
    	at org.jboss.netty.handler.execution.MemoryAwareThreadPoolExecutor$MemoryAwareRunnable.run(MemoryAwareThreadPoolExecutor.java:622)
    	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    	at java.lang.Thread.run(Thread.java:748)
    This is the error that I get when trying to use my external ipv4 for the LOGIN_SERVER_ADDRESS_BASE

    Code:
    java.net.BindException: Cannot assign requested address: Cannot bind
    	at java.net.DualStackPlainDatagramSocketImpl.socketBind(Native Method)
    	at java.net.DualStackPlainDatagramSocketImpl.bind0(DualStackPlainDatagramSocketImpl.java:84)
    	at java.net.AbstractPlainDatagramSocketImpl.bind(AbstractPlainDatagramSocketImpl.java:93)
    	at java.net.DatagramSocket.bind(DatagramSocket.java:392)
    	at java.net.DatagramSocket.<init>(DatagramSocket.java:242)
    	at net.kagani.network.UDPDevice.bind(UDPDevice.java:62)
    	at net.kagani.network.LoginServerChannelManager.init(LoginServerChannelManager.java:67)
    	at net.kagani.LoginEngine.main(LoginEngine.java:35)
    If I internal for both I get no errors but my client returns 'No reply from login server'

    Doesn't seem to matter what I do with VPS1_IP, it doesn't effect anything in terms of the results I'm getting regardless of what IP's I use in there

    Surely something has to use the external address somewhere otherwise how else would non local clients be able to connect?

    I'm at a mental block, I could really do with a hand lol..


    Edit: Literally just figured it out myself lol


    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 7
    Last Post: 11-05-2016, 05:31 AM
  2. Dedicated Server Hosts
    By Feared Gear in forum RS2 Server
    Replies: 1
    Last Post: 09-09-2007, 11:17 AM
  3. Anyone wana 1 Day Run on my Server Host?
    By Impulser in forum RS2 Server
    Replies: 2
    Last Post: 09-09-2007, 12:40 AM
  4. Hosting servers! (Sorry for all you poor folks!)
    By Ninja Cat in forum RS2 Server
    Replies: 54
    Last Post: 09-08-2007, 08:02 PM
  5. Hosting No-ip Servers For Rs Cash
    By 1337LilPimp in forum RS2 Server
    Replies: 6
    Last Post: 09-07-2007, 10:03 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •