--- /dev/null
+/* Compile:
+ *
+ * javac -classpath ./smack_3_0_4/smack.jar Loa.java
+ *
+ * Run:
+ *
+ * java -classpath .:./smack_3_0_4/smack.jar:./smack_3_0_4/smackx.jar Loa
+ */
+
+import org.jivesoftware.smack.*;
+import org.jivesoftware.smack.packet.*;
+
+/**
+ * Loa: A Java implementation of Lines of Action (eventually, anyway)
+ *
+ * @author Carl Worth
+ */
+public class Loa
+{
+ public static void main(String[] args) {
+ ConnectionConfiguration config;
+ XMPPConnection conn;
+ ChatManager chat_manager;
+ Chat chat;
+
+ config = new ConnectionConfiguration ("jabber.friendlygames.org", 5222);
+ conn = new XMPPConnection(config);
+
+ try {
+ conn.connect();
+ } catch (XMPPException e) {
+ System.out.println ("connect() failed");
+ }
+
+ try {
+ conn.login ("test", "19zulu.");
+ } catch (XMPPException e) {
+ System.out.println ("login() failed");
+ }
+
+ try {
+ chat_manager = conn.getChatManager();
+ chat = chat_manager.createChat("cworth@jabber.friendlygames.org",
+ new MessageListener() {
+ public void processMessage (Chat chat, Message message) {
+ System.out.println ("Received message: " + message);
+ }
+ });
+
+ chat.sendMessage ("Hello, from smack.");
+ } catch (XMPPException e) {
+ System.out.println ("sendMessage() failed");
+ }
+
+ while (true) {
+ Long one_second = 1000L;
+ try {
+ Thread.sleep (one_second);
+ } catch (InterruptedException e) {
+ }
+ }
+ }
+}