com.wjholden.kurosuke
Class NetworkLogic

java.lang.Object
  extended by java.lang.Thread
      extended by com.wjholden.kurosuke.NetworkLogic
All Implemented Interfaces:
KurosukeConstants, java.lang.Runnable

public class NetworkLogic
extends java.lang.Thread
implements KurosukeConstants

Author:
John

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
private  boolean closing
           
private  java.net.InetAddress group
           
static Handler handler
           
private  java.net.MulticastSocket socket
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface com.wjholden.kurosuke.KurosukeConstants
CLOSE, DEBUG, IP_GROUP, MENU_GROUP_EXTRA_OPTIONS, MENU_ITEM_EXIT, PORT, SEND_KEYS, TAG_GUI, TAG_NETWORK
 
Constructor Summary
NetworkLogic()
           
 
Method Summary
 void run()
          Most of this networking code comes directly from http://download.oracle.com/javase/7/docs/api/java/net/MulticastSocket.html 5683 = "love" on your telephone keypad
private  void sendKeys(Bundle b, int playerId)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

closing

private boolean closing

group

private java.net.InetAddress group

handler

public static Handler handler

socket

private java.net.MulticastSocket socket
Constructor Detail

NetworkLogic

public NetworkLogic()
Method Detail

run

public void run()
Most of this networking code comes directly from http://download.oracle.com/javase/7/docs/api/java/net/MulticastSocket.html 5683 = "love" on your telephone keypad

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

sendKeys

private void sendKeys(Bundle b,
                      int playerId)
Parameters:
b - - must contain integer keys: up, down, left, right, a, b
playerId - [1,4] indicator of which player it is