From e1e781bb2135ef78592226f1a3eaba4925702f1f Mon Sep 17 00:00:00 2001 From: Fuwn Date: Mon, 3 May 2021 16:38:41 -0700 Subject: :star: --- NET/worlds/network/ServerURL.java | 101 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 NET/worlds/network/ServerURL.java (limited to 'NET/worlds/network/ServerURL.java') diff --git a/NET/worlds/network/ServerURL.java b/NET/worlds/network/ServerURL.java new file mode 100644 index 0000000..7d6ac4a --- /dev/null +++ b/NET/worlds/network/ServerURL.java @@ -0,0 +1,101 @@ +/* */ package NET.worlds.network; +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ +/* */ public class ServerURL +/* */ { +/* 38 */ private String _serverType = null; +/* 39 */ private String _serverHost = null; +/* 40 */ private String _serverOptions = null; +/* */ +/* */ public String getHost() { +/* 43 */ return this._serverHost; +/* */ } +/* */ +/* */ public String getType() { +/* 47 */ return this._serverType; +/* */ } +/* */ +/* */ public ServerURL(String serverURL) throws InvalidServerURLException +/* */ { +/* 52 */ String origServerURL = serverURL; +/* 53 */ int txtPos = serverURL.indexOf("://"); +/* 54 */ if (txtPos >= 0) { +/* 55 */ String protocol = serverURL.substring(0, txtPos); +/* 56 */ assert (protocol.equals("worldserver")); +/* 57 */ serverURL = serverURL.substring(txtPos + 3); +/* */ } +/* */ +/* 60 */ int typePos = serverURL.indexOf('/'); +/* 61 */ if (typePos >= 0) { +/* 62 */ this._serverHost = serverURL.substring(0, typePos); +/* 63 */ serverURL = serverURL.substring(typePos + 1); +/* */ } +/* */ else { +/* 66 */ this._serverHost = serverURL; +/* 67 */ serverURL = "AutoServer"; +/* */ } +/* */ +/* 70 */ int optPos = serverURL.indexOf('/'); +/* 71 */ if (optPos >= 0) { +/* 72 */ this._serverType = serverURL.substring(0, optPos); +/* 73 */ serverURL = serverURL.substring(optPos + 1); +/* */ } +/* */ else { +/* 76 */ this._serverType = serverURL; +/* 77 */ serverURL = ""; +/* */ } +/* */ +/* 80 */ this._serverOptions = serverURL; +/* */ +/* 82 */ if (this._serverHost.length() == 0) +/* 83 */ throw new InvalidServerURLException("Invalid server URL: " + +/* 84 */ origServerURL); +/* 85 */ if (this._serverType.length() == 0) { +/* 86 */ this._serverType = "AutoServer"; +/* */ } +/* */ } +/* */ +/* */ public String toString() +/* */ { +/* 92 */ return +/* 93 */ "worldserver://" + this._serverHost + "/" + this._serverType + "/" + this._serverOptions; +/* */ } +/* */ } + + +/* Location: C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\network\ServerURL.class + * Java compiler version: 6 (50.0) + * JD-Core Version: 0.7.1 + */ \ No newline at end of file -- cgit v1.2.3