|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mega.gasp.client.doja.GASPClient
A game client logic running with GASP must implement this class, GASPClient.
Field Summary | |
protected static com.nttdocomo.io.HttpConnection |
connection
|
protected CustomTypes |
customTypes
|
private static java.io.DataInputStream |
dis
|
private static java.io.DataOutputStream |
dos
|
private static java.lang.String |
GASPServletUrl
Explanation: A Doja specific GASPClient has been created to reduce the number of methods (firstLogin, login, createAI, createPrivateAI, joinAI, joinAIRnd) because the code size is critical in IApplis. |
Constructor Summary | |
GASPClient()
|
Method Summary | |
private static void |
closeAllConnection()
Close all connection streams and the connection. |
protected void |
endAI(int aSID)
(Try to) End the game if the user is the owner of the application instance. |
private void |
eventsOf(java.io.DataInputStream dis)
Treats the events of the servlet response data input stream. |
protected void |
getEvents(int aSID)
Provide to get the events in user actorSession on the Platform. |
abstract void |
initCustomTypes()
|
abstract void |
onDataEvent(int actorSessionID,
java.util.Hashtable datas)
Method called when a DataEvent is received from the platform. |
abstract void |
onEndEvent(int actorSessionID)
Method called when a EndEvent is received from the platform. |
abstract void |
onJoinEvent(int actorSessionID,
java.lang.String username)
Method called when a JoinEvent is received from the platform. |
abstract void |
onQuitEvent(int actorSessionID)
Method called when a QuitEvent is received from the platform. |
abstract void |
onStartEvent(int actorSessionID)
Method called when a StartEvent is received from the platform. |
private static com.nttdocomo.io.HttpConnection |
openPostConnection(java.lang.String url)
|
protected void |
quit(int sID)
Quit the platform. |
protected void |
quitAI(int aSID)
Quit the ApplicationInstance joined. |
protected void |
sendData(int aSID,
java.util.Hashtable h)
Provide to send in game datas to the Platform. |
private java.io.DataInputStream |
servletRequest(java.lang.String servletName,
java.lang.String formData)
Send a request to the specified servlet with the http post parameters. |
private java.io.DataInputStream |
servletSendDataRequest(java.lang.String servletName,
int aSID,
java.util.Hashtable h)
Send the data in the hashtable to the specified servlet. |
protected void |
startAI(int aSID)
(Try to) Start the game if the user is the owner of the application instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static java.lang.String GASPServletUrl
protected CustomTypes customTypes
protected static com.nttdocomo.io.HttpConnection connection
private static java.io.DataOutputStream dos
private static java.io.DataInputStream dis
Constructor Detail |
public GASPClient()
Method Detail |
public abstract void initCustomTypes()
protected void getEvents(int aSID)
aSID
- the ActorSession ID
protected void startAI(int aSID)
aSID
- protected void endAI(int aSID)
aSID
- protected void quitAI(int aSID)
aSID
- the ActorSession IDprotected void sendData(int aSID, java.util.Hashtable h)
aSID
- the ActorSession IDh
- the hashtable of datas
private void eventsOf(java.io.DataInputStream dis) throws java.io.IOException
dis
- the data input strem
java.io.IOException
protected void quit(int sID)
sID
- the Session ID of the userprivate java.io.DataInputStream servletRequest(java.lang.String servletName, java.lang.String formData) throws java.lang.Exception
servletName
- the name of the servletformData
- the HTTP post parameters
java.io.IOException
java.lang.Exception
private java.io.DataInputStream servletSendDataRequest(java.lang.String servletName, int aSID, java.util.Hashtable h) throws java.lang.Exception
servletName
- the name of the servlet
java.io.IOException
java.lang.Exception
private static com.nttdocomo.io.HttpConnection openPostConnection(java.lang.String url) throws java.lang.Exception
java.lang.Exception
private static void closeAllConnection()
public abstract void onJoinEvent(int actorSessionID, java.lang.String username)
actorSessionID
- username
- public abstract void onStartEvent(int actorSessionID)
actorSessionID
- public abstract void onEndEvent(int actorSessionID)
actorSessionID
- public abstract void onQuitEvent(int actorSessionID)
actorSessionID
- public abstract void onDataEvent(int actorSessionID, java.util.Hashtable datas)
actorSessionID
- datas
- the hashtable of datas
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |