|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.starhope.vergil.net.smartFaux.SmartFauxClient
public class SmartFauxClient
A nearly drop-in replacement for the basics of porting a SmartFox Server Pro client application to use Appius Claudius Caecus.
Field Summary | |
---|---|
private String |
connectedHost
server to which we're connected |
private int |
connectedPort
server port to which we're connected |
private String |
connectedZone
server zone to which we're connected |
private boolean |
debug
WRITEME: Document this brpocock@star-hope.org |
private String |
defaultXt
WRITEME: Document this brpocock@star-hope.org |
private String |
gameCopyright
WRITEME: Document this brpocock@star-hope.org |
private String |
gameLicenseBrief
WRITEME: Document this brpocock@star-hope.org |
private String |
gameLicenseLong
WRITEME: Document this brpocock@star-hope.org |
private com.google.gwt.http.client.URL |
gameLicenseTextLink
WRITEME: Document this brpocock@star-hope.org |
private String |
gameShortID
WRITEME: Document this brpocock@star-hope.org |
private String |
gameSubtitle
WRITEME: Document this brpocock@star-hope.org |
private String |
gameTitle
WRITEME: Document this brpocock@star-hope.org |
boolean |
smartConnect
An ignored public boolean for compatibility purposes. |
private Socket |
socket
Server connection |
private String |
theApple
random key from server |
Constructor Summary | |
---|---|
SmartFauxClient(boolean b)
Constructor |
Method Summary | |
---|---|
void |
acceptEvent(String identifier,
Object... details)
WRITEME: Document this method brpocock@star-hope.org |
void |
addEventListener(String eventString,
SmartFauxEventListener eventHandler)
WRITEME: Document this method brpocock@star-hope.org |
private String |
chapPassword(String userPassword)
WRITEME: Document this method brpocock@star-hope.org |
void |
connect(String server)
Connect to a server, trying the default Smart Fox Server port (9339) and the default Appius port (2770). |
void |
connect(String server,
int port)
Connect to a server on a specific port. |
private com.google.gwt.json.client.JSONObject |
convert(org.json.JSONObject jsonObject)
WRITEME: Document this method brpocock@star-hope.org |
void |
disconnect()
Disconnect from the server, if connected. |
String |
getConnectedHost()
|
int |
getConnectedPort()
|
String |
getConnectedZone()
|
String |
getGameCopyright()
Examples: |
String |
getGameLicenseBrief()
Examples: |
String |
getGameLicenseLong()
Examples: |
com.google.gwt.http.client.URL |
getGameLicenseTextLink()
Get a link to the full text of the license agreement. |
String |
getGameShortIdentifier()
WRITEME: Document this method brpocock@star-hope.org |
String |
getGameSubtitle()
|
String |
getGameTitle()
|
String |
getRandomKey()
May return null if the apple hasn't yet been retrieved |
void |
getRoomList()
fetch and store the room list. |
boolean |
isDebug()
|
void |
joinRoom(int i)
WRITEME: Document this method brpocock@star-hope.org |
void |
joinRoom(String roomMoniker,
String roomPassword,
boolean b)
WRITEME: Document this method brpocock@star-hope.org |
void |
login(String zoneName,
String userName,
String password)
WRITEME: Document this method brpocock@star-hope.org |
void |
logout()
WRITEME: Document this method brpocock@star-hope.org |
void |
sendJson(String string)
WRITEME: Document this method brpocock@star-hope.org |
void |
sendPublicMessage(String string)
WRITEME: Document this method brpocock@star-hope.org |
void |
sendXtMessage(String xtName,
String xtCommand,
org.json.JSONObject jsonObject)
WRITEME: Document this method brpocock@star-hope.org |
void |
setDebug(boolean b)
WRITEME: Document this method brpocock@star-hope.org |
void |
setDefaultXt(String prefix)
Under SmartFox Server™, extensions are bundled into various prefices. |
void |
setUserVariables(Map<String,SFSVariable> vars)
WRITEME: Document this method brpocock@star-hope.org |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean smartConnect
private Socket socket
private String connectedHost
private int connectedPort
private final String connectedZone
private final String theApple
private boolean debug
private String gameCopyright
private String gameLicenseBrief
private String gameLicenseLong
private com.google.gwt.http.client.URL gameLicenseTextLink
private String gameShortID
private String gameSubtitle
private String gameTitle
private String defaultXt
Constructor Detail |
---|
public SmartFauxClient(boolean b)
b
- Whether to enable debugging modeMethod Detail |
---|
public void acceptEvent(String identifier, Object... details) throws EventNotHandledException
VergilEventHandler
acceptEvent
in interface VergilEventHandler
identifier
- WRITEMEdetails
- WRITEME
EventNotHandledException
- WRITEMEVergilEventHandler.acceptEvent(java.lang.String, java.lang.Object[])
public void addEventListener(String eventString, SmartFauxEventListener eventHandler)
eventString
- WRITEMEeventHandler
- WRITEMEprivate String chapPassword(String userPassword)
userPassword
- WRITEME
public void connect(String server) throws UnknownHostException
server
- The server to which to connect.
UnknownHostException
- if the server name can't be resolvedpublic void connect(String server, int port) throws UnknownHostException
server
- The server to which to connectport
- The port number on which to connect. The default for
SmartFox Server is 9339; the default for Appius is
2770.
UnknownHostException
- if the given server name can't be
resolvedprivate com.google.gwt.json.client.JSONObject convert(org.json.JSONObject jsonObject)
jsonObject
- WRITEME
public void disconnect()
public String getConnectedHost()
public int getConnectedPort()
public String getConnectedZone()
public String getGameCopyright()
GameImplementor
Examples:
Do not include the game's title, version/release information, or license terms (e.g. “All Rights Reserved”) in this string.
getGameCopyright
in interface GameImplementor
GameImplementor.getGameCopyright()
public String getGameLicenseBrief()
GameImplementor
Examples:
getGameLicenseBrief
in interface GameImplementor
GameImplementor.getGameLicenseBrief()
public String getGameLicenseLong()
GameImplementor
Examples:
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
You are free:
Under the following conditions:
getGameLicenseLong
in interface GameImplementor
GameImplementor.getGameLicenseLong()
public com.google.gwt.http.client.URL getGameLicenseTextLink()
GameImplementor
Get a link to the full text of the license agreement.
Some useful ones (for my own use):
getGameLicenseTextLink
in interface GameImplementor
GameImplementor.getGameLicenseTextLink()
public String getGameShortIdentifier()
GameImplementor
getGameShortIdentifier
in interface GameImplementor
GameImplementor.getGameShortIdentifier()
public String getGameSubtitle()
getGameSubtitle
in interface GameImplementor
GameImplementor.getGameSubtitle()
public String getGameTitle()
getGameTitle
in interface GameImplementor
GameImplementor.getGameTitle()
public String getRandomKey()
public void getRoomList()
public boolean isDebug()
isDebug
in interface GameImplementor
GameImplementor.isDebug()
public void joinRoom(int i)
i
- WRITEMEpublic void joinRoom(String roomMoniker, String roomPassword, boolean b)
roomMoniker
- WRITEMEroomPassword
- ignoredb
- ignoredpublic void login(String zoneName, String userName, String password)
zoneName
- WRITEMEuserName
- WRITEMEpassword
- WRITEMEpublic void logout()
public void sendJson(String string)
string
- something that might have once been JSONpublic void sendPublicMessage(String string)
string
- WRITEMEpublic void sendXtMessage(String xtName, String xtCommand, org.json.JSONObject jsonObject)
xtName
- WRITEMExtCommand
- WRITEMEjsonObject
- WRITEMEpublic void setDebug(boolean b)
b
- WRITEMEpublic void setDefaultXt(String prefix)
prefix
- The Xt code that should not be made into a prefix on server calls.public void setUserVariables(Map<String,SFSVariable> vars)
vars
- WRITEME
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |