|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.gotoandplay.smartfoxserver.events.InternalEventObject
public class InternalEventObject
The InternalEventObject describes the type of event dispatched by the Server and contains the parameters passed by the Server.
Here's a list of the internal events dispatched by the Server and the parameters passed:
loginRequest
userJoin
userExit
userLost
logOut
newRoom
roomLost
spectatorSwitched
pubMsg
fileUpload
public class ExampleExtension extends AbstractExtension
{
private ExtensionHelper helper;
public void init()
{
helper = ExtensionHelper.instance();
}
public void handleInternalEvent(InternalEventObject evt)
{
String evtName = evt.getName();
if (evtName.equals("loginRequest"))
{
String nick = ieo.getParam("nick");
String pass = ieo.getParam("pass");
SocketChannel chan = (SocketChannel) ieo.getObject("chan");
if (nick.equals("test") && pass.equals("test"))
{
helper.trace("Nick and password correct!", this);
}
else
{
helper.trace("Wrong name or password", this);
}
}
}
}
| Constructor Summary | |
|---|---|
InternalEventObject(java.lang.String evtName)
Creates a new instance of EventObject |
|
| Method Summary | |
|---|---|
void |
addObject(java.lang.String key,
java.lang.Object o)
Adds an object to the event |
void |
addParam(java.lang.String key,
java.lang.String value)
|
java.lang.String |
getEventName()
|
java.lang.Object |
getObject(java.lang.String key)
|
java.lang.String |
getParam(java.lang.String key)
|
java.lang.Object[] |
getTypedObject(java.lang.String key)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public InternalEventObject(java.lang.String evtName)
| Method Detail |
|---|
public java.lang.String getEventName()
public void addParam(java.lang.String key,
java.lang.String value)
key - Name of the parameter to attach to the eventvalue - Value for the parameter. All values are represented through String objects.public java.lang.String getParam(java.lang.String key)
key - the name of the parameter to get
public void addObject(java.lang.String key,
java.lang.Object o)
key - the name of the parametero - the objectpublic java.lang.Object getObject(java.lang.String key)
key - the name of the object to get
public java.lang.Object[] getTypedObject(java.lang.String key)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||