|
||||||||||
| 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 mode| Method Detail |
|---|
public void acceptEvent(String identifier,
Object... details)
throws EventNotHandledException
VergilEventHandler
acceptEvent in interface VergilEventHandleridentifier - 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 resolved
public 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()
GameImplementorExamples:
Do not include the game's title, version/release information, or license terms (e.g. “All Rights Reserved”) in this string.
getGameCopyright in interface GameImplementorGameImplementor.getGameCopyright()public String getGameLicenseBrief()
GameImplementorExamples:
getGameLicenseBrief in interface GameImplementorGameImplementor.getGameLicenseBrief()public String getGameLicenseLong()
GameImplementorExamples:
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 GameImplementorGameImplementor.getGameLicenseLong()public com.google.gwt.http.client.URL getGameLicenseTextLink()
GameImplementorGet a link to the full text of the license agreement.
Some useful ones (for my own use):
getGameLicenseTextLink in interface GameImplementorGameImplementor.getGameLicenseTextLink()public String getGameShortIdentifier()
GameImplementor
getGameShortIdentifier in interface GameImplementorGameImplementor.getGameShortIdentifier()public String getGameSubtitle()
getGameSubtitle in interface GameImplementorGameImplementor.getGameSubtitle()public String getGameTitle()
getGameTitle in interface GameImplementorGameImplementor.getGameTitle()public String getRandomKey()
public void getRoomList()
public boolean isDebug()
isDebug in interface GameImplementorGameImplementor.isDebug()public void joinRoom(int i)
i - WRITEME
public void joinRoom(String roomMoniker,
String roomPassword,
boolean b)
roomMoniker - WRITEMEroomPassword - ignoredb - ignored
public 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 - WRITEME
public 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 | |||||||||