[Cherbot-commit] SF.net SVN: cherbot: [92] trunk/src/net/sf/cherbot/DaimoninConnection.java
Status: Alpha
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2007-06-24 17:10:35
|
Revision: 92
http://svn.sourceforge.net/cherbot/?rev=92&view=rev
Author: christianhujer
Date: 2007-06-24 10:10:25 -0700 (Sun, 24 Jun 2007)
Log Message:
-----------
DaimoninConnection now works. Tested with trunk and the current public B4 server.
Modified Paths:
--------------
trunk/src/net/sf/cherbot/DaimoninConnection.java
Modified: trunk/src/net/sf/cherbot/DaimoninConnection.java
===================================================================
--- trunk/src/net/sf/cherbot/DaimoninConnection.java 2007-06-24 15:55:22 UTC (rev 91)
+++ trunk/src/net/sf/cherbot/DaimoninConnection.java 2007-06-24 17:10:25 UTC (rev 92)
@@ -56,42 +56,22 @@
ArgParser.simpleParseAndRun(new DaimoninConnection(), args);
}
- /** Establishes a connection.
- * @throws IOException In case of connection problems.
- */
- @NotNull public Socket connect() throws IOException {
+ /** {@inheritDoc} */
+ @NotNull @Override public Socket connect() throws IOException {
final Socket socket = super.connect();
this.out = new BufferedOutputStream(socket.getOutputStream());
this.in = socket.getInputStream();
- // read server version
- readToNull();
-
- // send client version
- //textMsg("version 991023 991023 CherBot");
+ readToNull(); // "991023 991023 Daimonin Server"
textMsg("version 991023 991023 Daimonin SDL Client"); // we have to cheat or the server won't let us in.
-
- //textMsg("setup");
- //readToNull();
+ textMsg("setup bot 1"); // We are a bot
+ readToNull(); // "0x17 bot FALSE"
textMsg("addme");
- readToNull();
+ readToNull(); // 0x00 0x06 0x18 "4 QNO"
+ readToNull(); // 0x00 0x01 0x15
textMsg("reply L" + username);
- readToNull();
+ readToNull(); // 0x00 0x06 0x18 "4 QP0"
textMsg("reply " + password);
- // write 0x00 0x29 "version 991023 991023 Daimonin SDL Client"
- // TODO
- // read 0x00 0x1e 0x02 "991023 991023 Daimonin Server"
- // write 0x00 0x99 "setup sound 1 map2 cmd 1 mapsize 17x17 darkness 1 facecache 1 skf 3386|dd257ea spf 2737|404f6ead bpf 227483|8ab2a06 stf 2253|16d49f0f amf 262790|ec2627ee"
- // read 0x00 0x75 0x17 " sound 1 map2cmd 1 mapsize 17x17 darkness 1 facecache 1 skf OK spf OK bpf 227639|117ae13a stf OK amf 263415|ec0d5f79"
- // write 0x00 0x04 "rf 4"
- // read lots of data
- // write 0x00 0x04 "rf 3"
- // read lots of data
- // write 0x00 0x05 "addme"
- // read 0x00 0x06 0x18 "4 QN0" 0x00 0x01 0x15
- // write 0x00 0x12 "reply LFoobuzzer49" // L not part of name
- // read 0x00 0x06 0x18 "4 QP0"
- // write 0x00 0x0E "reply xxxxxxxx"
return socket;
}
@@ -152,7 +132,7 @@
/** {@inheritDoc} */
public int run(@NotNull final List<String> args) throws Exception {
connect();
- Thread.sleep(10000);
+ Thread.sleep(100000);
close();
return 0;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|