summaryrefslogtreecommitdiff
path: root/NET/worlds/network/ServerURL.java
diff options
context:
space:
mode:
authorFuwn <[email protected]>2021-05-03 16:38:41 -0700
committerFuwn <[email protected]>2021-05-03 16:38:41 -0700
commite1e781bb2135ef78592226f1a3eaba4925702f1f (patch)
tree8a5b590463ed413e1c6eabb719130e701b95ca63 /NET/worlds/network/ServerURL.java
downloadworlds.jar-main.tar.xz
worlds.jar-main.zip
:star:HEADmain
Diffstat (limited to 'NET/worlds/network/ServerURL.java')
-rw-r--r--NET/worlds/network/ServerURL.java101
1 files changed, 101 insertions, 0 deletions
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