|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.rmi.server.RemoteObject | +--java.rmi.server.RemoteServer | +--java.rmi.server.UnicastRemoteObject | +--JavaQuest.Client.CClient
Main connection class, to control the connection from client to server and from server to client
CClientFrame
,
CPlayer
,
IClientThreadProxy
,
CUtils
, Serialized FormField Summary | |
private boolean |
m_bOn
Is the client to the server or not |
private boolean |
m_Bool
return Component for all boolean |
private boolean |
m_bTimeRemaining
Is the client on turn or not |
private javax.swing.DefaultListModel |
m_defaultListModel
Contents all entries of a JList |
protected CClientFrame |
m_oClientFrame
Reference on CClientFrame |
private IClientThreadProxy |
m_oServer
Communication partner on Server |
private CPlayer |
m_Player
Reference to Player on Server |
private java.lang.String |
m_sIP
stores Server IP |
private java.lang.String |
m_sName
The alias-Name of the client |
private java.lang.String |
m_String
return Component for all Strings |
private java.util.Vector |
m_Vector
return Component for all Vectors |
Fields inherited from class java.rmi.server.UnicastRemoteObject |
csf, port, portFactoryParamTypes, portParamTypes, serialVersionUID, ssf |
Fields inherited from class java.rmi.server.RemoteServer |
log, logname |
Fields inherited from class java.rmi.server.RemoteObject |
ref |
Constructor Summary | |
CClient(java.lang.String _sName,
CClientFrame _oClientFrame,
java.lang.String _sIP)
Constructor |
Method Summary | |
boolean |
activate(int _iSeconds)
activate Method for the server to initiate the beginTurn-Method |
boolean |
activateItem(int _iItem)
activateItem Method for the client to activate an Item on the server |
boolean |
deactivate()
deactivate Method for the server to initiate the endTurn-Method, if the time is over |
boolean |
deactivateItem(int _iItem)
deactivateItem Method for the client to deactivate an Item on the server |
void |
endThread()
endThread is used to end the communication-thread |
void |
endTurn()
endTurn Method for the client to end the turn on the server |
protected boolean |
execute(int _iCmdIndex)
execute Method for the client to execute a command on the server |
void |
gameover()
gameOver Method for the server to let the hero die, if his Health-Points are zero |
protected java.lang.String |
getInfo(CField _oField)
getInfo Method for the client to get Info about a Field on the Map |
protected java.util.Vector |
getItemsActive()
getItemsActive Method for the client to get an Vector of the active Items from the server |
protected java.util.Vector |
getItemsInactive()
getItemsInactive Method for the client to get an Vector of the inactive Items from the server |
CPlayer |
getPlayer()
getPlayer get the Player to locate the Position for center the Map |
java.util.Vector |
getPossibleCommands(CField _oField)
getPossibleCommands get the possible commands from server to show it as Popup Menuitems |
boolean |
getServerReference()
getServerReference to get the reference to the server when connecting |
protected boolean |
getTimeRemaining()
getTimeRemaining returns if the client has some time |
protected void |
ListRefresh()
ListRefresh is used to refresh the lists with the active and inactive items it will be initiated on maprefresh and an activateItem, deactivateItem |
void |
maprefresh(CMap _oMap)
maprefresh Method for the server to refresh the GUI after an action was made by client |
void |
printMessage(java.lang.String _sMessage,
boolean _bPopup)
printMessage Method for the server to popup a DialogBox or log the message in the errorlogfile |
void |
run()
run the "main"-Method for all JAVA-Threads on communication |
protected void |
setTimeRemaining(boolean _bTimeRemaining)
setTimeRemaining sets false when the time is over |
void |
shutdown()
shutdown Method for the server to shutdown all clients, if the server is going shutdown |
void |
updateVitalForceValues()
updateVitalForceValues Method to update the Health, Moveability, CubesAttack, CubesDefense |
private javax.swing.DefaultListModel |
Vector2ListModel(java.util.Vector _vector)
Vector2ListModel parse a vector to an DefaultListModel Object |
Methods inherited from class java.rmi.server.UnicastRemoteObject |
|
Methods inherited from class java.rmi.server.RemoteServer |
getClientHost, getLog, setLog |
Methods inherited from class java.rmi.server.RemoteObject |
equals, getRef, hashCode, toString, toStub, writeObject |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, registerNatives, wait, wait, wait |
Field Detail |
private javax.swing.DefaultListModel m_defaultListModel
private boolean m_bOn
private boolean m_bTimeRemaining
private java.lang.String m_sName
private IClientThreadProxy m_oServer
protected CClientFrame m_oClientFrame
private CPlayer m_Player
private java.lang.String m_sIP
private java.lang.String m_String
private java.util.Vector m_Vector
private boolean m_Bool
Constructor Detail |
public CClient(java.lang.String _sName, CClientFrame _oClientFrame, java.lang.String _sIP) throws java.rmi.RemoteException
String
- _sName the Aliasname of the playerCClientFrame
- _oClientFrame reference to CClientFrameString
- _sIP the IP-Adress to connectjava.rmi.RemoteException
- Method Detail |
protected java.lang.String getInfo(CField _oField)
CField
- _oField the clicked Field on the Mappublic boolean activateItem(int _iItem)
int
- _iItempublic boolean deactivateItem(int _iItem)
int
- _iItemprotected boolean execute(int _iCmdIndex)
int
- _iCmdIndexprotected java.util.Vector getItemsActive()
protected java.util.Vector getItemsInactive()
public java.util.Vector getPossibleCommands(CField _oField)
CField
- _oFieldpublic void endTurn()
public CPlayer getPlayer()
public void maprefresh(CMap _oMap) throws java.rmi.RemoteException
maprefresh
in interface IClientProxy
CMap
- _oMappublic void updateVitalForceValues()
public void shutdown() throws java.rmi.RemoteException
shutdown
in interface IClientProxy
java.rmi.RemoteException
- public void gameover() throws java.rmi.RemoteException
gameover
in interface IClientProxy
java.rmi.RemoteException
- public void printMessage(java.lang.String _sMessage, boolean _bPopup) throws java.rmi.RemoteException
printMessage
in interface IClientProxy
String
- _sMessage the message wich the server tells boolean
- _bPopup if true, a DialogBox will be openedjava.rmi.RemoteException
- public boolean activate(int _iSeconds) throws java.rmi.RemoteException
activate
in interface IClientProxy
int
- _iSeconds time for the client in a turnjava.rmi.RemoteException
- public boolean deactivate() throws java.rmi.RemoteException
deactivate
in interface IClientProxy
java.rmi.RemoteException
- private javax.swing.DefaultListModel Vector2ListModel(java.util.Vector _vector)
Vector
- _vectorpublic boolean getServerReference()
protected boolean getTimeRemaining()
protected void setTimeRemaining(boolean _bTimeRemaining)
boolean
- public void endThread()
protected void ListRefresh()
public void run()
run
in interface java.lang.Runnable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |