diff --git a/buildnum.properties b/buildnum.properties
index 7ba8df3..5f3b5f2 100644
--- a/buildnum.properties
+++ b/buildnum.properties
@@ -1,3 +1,3 @@
#ANT Task: ch.oscg.jreleaseinfo.BuildNumberHandler
-#Fri Apr 02 02:49:45 PDT 2010
-build.num.last=4
+#Mon Sep 13 14:45:55 PDT 2010
+build.num.last=5
diff --git a/mobibot.ipr b/mobibot.ipr
index 7059db9..1eac796 100644
--- a/mobibot.ipr
+++ b/mobibot.ipr
@@ -197,7 +197,9 @@
-
+
+
+
@@ -269,7 +271,7 @@
-
+
diff --git a/mobibot.iws b/mobibot.iws
index 881f463..e5f180f 100644
--- a/mobibot.iws
+++ b/mobibot.iws
@@ -28,17 +28,16 @@
-
+
-
-
-
+
+
@@ -139,16 +138,36 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
-
+
@@ -179,6 +198,10 @@
+
+
+
+
@@ -191,8 +214,9 @@
@@ -307,7 +331,7 @@
-
+
@@ -319,11 +343,7 @@
-
-
-
-
@@ -352,6 +372,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -372,14 +427,14 @@
-
+
-
-
+
+
@@ -408,8 +463,8 @@
-
+
@@ -419,8 +474,8 @@
-
+
@@ -439,22 +494,12 @@
-
-
-
-
-
-
-
-
-
-
-
+
-
+
@@ -542,6 +587,21 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -553,25 +613,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -681,7 +722,7 @@
-
+
@@ -691,6 +732,7 @@
+
C:\Users\erik\AppData\Roaming\Subversion
@@ -726,23 +768,23 @@
-
+
-
-
+
+
-
+
-
+
@@ -763,8 +805,8 @@
-
+
@@ -787,6 +829,8 @@
+
+
@@ -865,16 +909,6 @@
-
-
-
-
-
-
-
-
-
-
@@ -925,28 +959,42 @@
+
+
+
+
+
-
+
-
+
+
+
+
+
+
+
+
-
-
+
+
+
+
-
+
-
+
diff --git a/src/net/thauvin/erik/mobibot/Mobibot.java b/src/net/thauvin/erik/mobibot/Mobibot.java
index d5e13ef..ba82408 100644
--- a/src/net/thauvin/erik/mobibot/Mobibot.java
+++ b/src/net/thauvin/erik/mobibot/Mobibot.java
@@ -73,13 +73,35 @@ public class Mobibot extends PircBot
*/
public static final int CONNECT_TIMEOUT = 5000;
+ /**
+ * The HH:MM timestamp simple date format.
+ */
+ private static final SimpleDateFormat HHMM_SDF = new SimpleDateFormat("HH:mm");
+
+ /**
+ * The ISO (YYYY-MM-DD) simple date format.
+ */
+ private static final SimpleDateFormat ISO_SDF = new SimpleDateFormat("yyyy-MM-dd");
+
/**
* The info strings.
*/
- private static final String[] INFO_STRS = {"Mobibot v" + ReleaseInfo.getVersion() + '.'
- + ReleaseInfo.getBuildNumber()
- + " by Erik C. Thauvin (erik@thauvin.net)",
- "http://www.mobitopia.org/mobibot/"};
+ private static final String[] INFO_STRS =
+ {"Mobibot v" + ReleaseInfo.getVersion() + '.' + ReleaseInfo.getBuildNumber()
+ + " by Erik C. Thauvin (erik@thauvin.net)", "http://www.mobitopia.org/mobibot/"};
+
+ /**
+ * The version strings.
+ */
+ private static final String[] VERSION_STRS =
+ {"Version: " + ReleaseInfo.getVersion() + '.' + ReleaseInfo.getBuildNumber() + " ("
+ + ISO_SDF.format(ReleaseInfo.getBuildDate()) + ')',
+ "Platform: " + System.getProperty("os.name") + " (" + System.getProperty("os.version") + ", "
+ + System.getProperty("os.arch") + ", " + System.getProperty("user.country") + ')',
+ "Runtime: " + System.getProperty("java.runtime.name") + " (build "
+ + System.getProperty("java.runtime.version") + ')',
+ "VM: " + System.getProperty("java.vm.name") + " (build " + System.getProperty("java.vm.version") + ", "
+ + System.getProperty("java.vm.info") + ')'};
/**
* Debug command line argument.
@@ -296,6 +318,11 @@ public class Mobibot extends PircBot
*/
private static final String INFO_CMD = "info";
+ /**
+ * The version command.
+ */
+ private static final String VERSION_CMD = "version";
+
/**
* The view command.
*/
@@ -306,16 +333,6 @@ public class Mobibot extends PircBot
*/
public static final String WEATHER_CMD = "weather";
- /**
- * The HH:MM timestamp simple date format.
- */
- private static final SimpleDateFormat HHMM_SDF = new SimpleDateFormat("HH:mm");
-
- /**
- * The ISO (YYYY-MM-DD) simple date format.
- */
- private static final SimpleDateFormat ISO_SDF = new SimpleDateFormat("yyyy-MM-dd");
-
/**
* The start time.
*/
@@ -332,6 +349,7 @@ public class Mobibot extends PircBot
private static final int DEFAULT_PORT = 6667;
// Initialize the countries.
+
static
{
COUNTRIES_MAP.put("AU", "Australia/Sydney");
@@ -1048,6 +1066,14 @@ public class Mobibot extends PircBot
send(sender, DOUBLE_INDENT + bold("/msg " + getNick() + ' ' + SAY_CMD + " "));
}
}
+ else if (lcTopic.endsWith(VERSION_CMD))
+ {
+ if (isOp(sender))
+ {
+ send(sender, "To view the version data (bot, java, etc.):");
+ send(sender, DOUBLE_INDENT + bold("/msg " + getNick() + ' ' + VERSION_CMD));
+ }
+ }
else if (lcTopic.endsWith(MSG_CMD))
{
if (isOp(sender))
@@ -1085,17 +1111,21 @@ public class Mobibot extends PircBot
DOUBLE_INDENT + bold(
CALC_CMD + ' ' + CURRENCY_CMD + ' ' + DICE_CMD + ' ' + GOOGLE_CMD + ' ' + IGNORE_CMD));
send(sender,
- DOUBLE_INDENT + bold(INFO_CMD + ' ' + getChannel().substring(1) + ' ' + LOOKUP_CMD + ' '
- + HELP_POSTING_KEYWORD + ' ' + RECAP_CMD));
+ DOUBLE_INDENT + bold(
+ INFO_CMD + ' ' + getChannel().substring(1) + ' ' + LOOKUP_CMD + ' ' + HELP_POSTING_KEYWORD
+ + ' ' + RECAP_CMD));
send(sender,
- DOUBLE_INDENT + bold(SPELL_CMD + ' ' + STOCK_CMD + ' ' + HELP_TAGS_KEYWORD + ' ' + TIME_CMD + ' '
- + USERS_CMD + ' ' + VIEW_CMD));
+ DOUBLE_INDENT + bold(
+ SPELL_CMD + ' ' + STOCK_CMD + ' ' + HELP_TAGS_KEYWORD + ' ' + TIME_CMD + ' ' + USERS_CMD + ' '
+ + VIEW_CMD));
send(sender, DOUBLE_INDENT + bold(JAIKU_CMD + ' ' + TWITTER_CMD + ' ' + WEATHER_CMD));
if (isOp(sender))
{
send(sender, "The op commands are:");
- send(sender, DOUBLE_INDENT + bold(CYCLE_CMD + ' ' + ME_CMD + ' ' + MSG_CMD + ' ' + SAY_CMD));
+ send(sender,
+ DOUBLE_INDENT + bold(
+ CYCLE_CMD + ' ' + ME_CMD + ' ' + MSG_CMD + ' ' + SAY_CMD + ' ' + VERSION_CMD));
}
}
}
@@ -1377,6 +1407,10 @@ public class Mobibot extends PircBot
{
infoResponse(sender, false);
}
+ else if (cmd.equals(VERSION_CMD))
+ {
+ versionResponse(sender, false);
+ }
else if (cmd.equals(DICE_CMD))
{
final Random r = new Random();
@@ -1918,6 +1952,10 @@ public class Mobibot extends PircBot
{
infoResponse(sender, true);
}
+ else if (cmd.equals(VERSION_CMD))
+ {
+ versionResponse(sender, true);
+ }
else if (cmd.equals(DEBUG_CMD))
{
if (isOp(sender))
@@ -2497,6 +2535,23 @@ public class Mobibot extends PircBot
isPrivate);
}
+ /**
+ * Responds with the bot's version info.
+ *
+ * @param sender The nick of the person who sent the message.
+ * @param isPrivate Set to true is the response should be send as a private message.
+ */
+ private void versionResponse(String sender, boolean isPrivate)
+ {
+ if (isOp(sender))
+ {
+ for (int i = 0; i < VERSION_STRS.length; i++)
+ {
+ send(sender, VERSION_STRS[i], isPrivate);
+ }
+ }
+ }
+
/**
* Determines whether the specified nick should be ignored.
*
diff --git a/src/net/thauvin/erik/mobibot/ReleaseInfo.java b/src/net/thauvin/erik/mobibot/ReleaseInfo.java
index 3221270..c011d40 100644
--- a/src/net/thauvin/erik/mobibot/ReleaseInfo.java
+++ b/src/net/thauvin/erik/mobibot/ReleaseInfo.java
@@ -1,5 +1,5 @@
/* Created by JReleaseInfo AntTask from Open Source Competence Group */
-/* Creation date Fri Apr 02 02:49:45 PDT 2010 */
+/* Creation date Mon Sep 13 14:45:55 PDT 2010 */
package net.thauvin.erik.mobibot;
import java.util.Date;
@@ -20,21 +20,21 @@ public class ReleaseInfo {
}
- /** buildDate (set during build process to 1270201785391L). */
- private static final Date buildDate = new Date(1270201785391L);
+ /** buildDate (set during build process to 1284414355047L). */
+ private static final Date buildDate = new Date(1284414355047L);
/**
- * Get buildDate (set during build process to Fri Apr 02 02:49:45 PDT 2010).
+ * Get buildDate (set during build process to Mon Sep 13 14:45:55 PDT 2010).
* @return Date buildDate
*/
public static Date getBuildDate() { return buildDate; }
/**
- * Get buildNumber (set during build process to 4).
+ * Get buildNumber (set during build process to 5).
* @return int buildNumber
*/
- public static int getBuildNumber() { return 4; }
+ public static int getBuildNumber() { return 5; }
/** project (set during build process to "mobibot"). */