Browse Source

* Moved MyInfo and ServerInfo into seperate classes

* Hacked Server to make it work with the new IRCParser interface

git-svn-id: http://svn.dmdirc.com/trunk@42 00569f92-eb28-0410-84fd-f71c24880f
tags/0.1
Chris Smith 17 years ago
parent
commit
c4bd274739

+ 1
- 3
src/dmdirc/Server.java View File

@@ -78,9 +78,7 @@ public class Server {
78 78
             }
79 79
         });
80 80
         
81
-        try {
82
-            parser.connect(server, port);
83
-            
81
+        try {           
84 82
             Thread thread = new Thread(parser);
85 83
             thread.start();
86 84
         } catch (Exception ex) {

+ 0
- 12
src/dmdirc/parser/IRCParser.java View File

@@ -39,18 +39,6 @@ public class IRCParser implements Runnable {
39 39
 	private PrintWriter out = null;
40 40
 	private BufferedReader in = null;
41 41
 
42
-	public class MyInfo {
43
-		public String sNickname = "IRCParser";
44
-		public String sAltNickname = "IRC-Parser"; // Alternative nickname, if this fails, we start prepending _ to sNickname
45
-		public String sRealname = "Java Test IRCParser";
46
-		public String sUsername = "IRCParser";
47
-	}
48
-	public class ServerInfo {
49
-		public String sHost = "uk.quakenet.org";
50
-		public String sPassword = "";
51
-		public int nPort = 6667;
52
-	}
53
-
54 42
 	public MyInfo me = new MyInfo(); // This is what the user wants, nickname here is *not* fact.
55 43
 	public ServerInfo server = new ServerInfo(); // Server Info requested by user
56 44
 

+ 34
- 0
src/dmdirc/parser/MyInfo.java View File

@@ -0,0 +1,34 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package dmdirc.parser;
24
+
25
+/**
26
+ *
27
+ * @author chris
28
+ */
29
+public class MyInfo {
30
+    public String sNickname = "IRCParser";
31
+    public String sAltNickname = "IRC-Parser"; // Alternative nickname, if this fails, we start prepending _ to sNickname
32
+    public String sRealname = "Java Test IRCParser";
33
+    public String sUsername = "IRCParser";
34
+}

+ 33
- 0
src/dmdirc/parser/ServerInfo.java View File

@@ -0,0 +1,33 @@
1
+/*
2
+ * Copyright (c) 2006-2007 Chris Smith, Shane Mc Cormack
3
+ *
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
10
+ *
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20
+ * SOFTWARE.
21
+ */
22
+
23
+package dmdirc.parser;
24
+
25
+/**
26
+ *
27
+ * @author chris
28
+ */
29
+public class ServerInfo {
30
+    public String sHost = "irc.quakenet.org";
31
+    public String sPassword = "";
32
+    public int nPort = 6667;
33
+}

Loading…
Cancel
Save