]>
jfr.im git - irc/Ozafy/borknet_p10_irc_services.git/blob - core/modules/v/V.java
3 # BorkNet Services Core
7 # Copyright (C) 2004 Ozafy - ozafy@borknet.org - http://www.borknet.org
9 # This program is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU General Public License
11 # as published by the Free Software Foundation; either version 2
12 # of the License, or (at your option) any later version.
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABotILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program; if not, write to the Free Software
21 # Foundation, Inc., 59 Temple Place - Suite 330, Botoston, MA 02111-1307, USA.
26 The actual module core.
28 Creates all needed classes.
30 It can be used to create both servers & clients.
36 import borknet_services
.core
.*;
38 public class V
implements Modules
42 private String description
= "";
43 private String nick
= "";
44 private String ident
= "";
45 private String host
= "";
46 private String numeric
= "";
47 private String num
= "AAA";
48 private String reportchan
= "";
49 private String vhost
= "";
50 private boolean automatic
= true;
51 private boolean qwebirc
= false;
52 private String qhost
= "webchat@borknet.org";
53 private String qident
= "webchat";
54 private ArrayList
<Object
> cmds
= new ArrayList
<Object
>();
55 private ArrayList
<String
> cmdn
= new ArrayList
<String
>();
61 public void start(Core C
)
65 numeric
= C
.get_numeric();
66 ser
= new Server(C
,this);
67 C
.cmd_create_service(num
, nick
, ident
, host
, "+oXwkgsr", description
);
68 reportchan
= C
.get_reportchan();
69 C
.cmd_join(numeric
, num
, reportchan
);
72 public void setCmnds(ArrayList
<Object
> cmds
,ArrayList
<String
> cmdn
)
78 public ArrayList
<Object
> getCmds()
83 public ArrayList
<String
> getCmdn()
90 C
.cmd_kill_service(numeric
+num
, "Quit: Soon will I rest, yes, forever sleep. Earned it I have. Twilight is upon me, soon night must fall.");
95 C
.cmd_kill_service(numeric
+num
, "Quit: Happens to every guy sometimes this does.");
98 private void load_conf()
102 ConfLoader loader
= new ConfLoader(C
,"core/modules/"+this.getClass().getName().toLowerCase()+"/"+this.getClass().getName().toLowerCase()+".conf");
104 Properties dataSrc
= loader
.getVars();
105 //set all the config file vars
106 description
= dataSrc
.getProperty("description");
107 nick
= dataSrc
.getProperty("nick");
108 ident
= dataSrc
.getProperty("ident");
109 host
= dataSrc
.getProperty("host");
110 /* remove the next line if you build a client only */
111 num
= dataSrc
.getProperty("numeric");
112 automatic
= Boolean
.parseBoolean(dataSrc
.getProperty("automatic"));
113 qwebirc
= Boolean
.parseBoolean(dataSrc
.getProperty("qwebirc"));
114 qhost
= dataSrc
.getProperty("qhost");
115 qident
= dataSrc
.getProperty("qident");
119 C
.printDebug("Error loading configfile.");
121 C
.die("SQL error, trying to die gracefully.");
125 public void parse(ArrayList
<String
> params
)
137 public String
get_num()
141 public String
get_corenum()
145 public String
get_nick()
149 public String
get_host()
153 public boolean get_automatic()
157 public String
get_vhost()
161 public boolean get_qwebirc()
165 public String
get_qhost()
169 public String
get_qident()