public class AgisLoginPlugin extends LoginPlugin
Engine
database.LoginPlugin.CharacterCreateMessage, LoginPlugin.CharacterCreateResponseMessage, LoginPlugin.CharacterDeleteMessage, LoginPlugin.CharacterDeleteResponseMessage, LoginPlugin.CharacterRequestMessage, LoginPlugin.CharacterResponseMessage, LoginPlugin.CharacterSelectRequestMessage, LoginPlugin.CharacterSelectResponseMessage, LoginPlugin.HeartbeatMessage, LoginPlugin.HeartbeatResponseMessage, LoginPlugin.ServerListRequestMessage, LoginPlugin.ServerListResponseMessage, LoginPlugin.SocketHandler
EnginePlugin.DeleteHook, EnginePlugin.DeleteSubObjHook, EnginePlugin.GenerateSubObjectHook, EnginePlugin.GetPropertyMessage, EnginePlugin.GetPropertyNamesMessage, EnginePlugin.LoadHook, EnginePlugin.LoadSubObjHook, EnginePlugin.PluginActivateHook, EnginePlugin.PluginStateMessage, EnginePlugin.SaveHook, EnginePlugin.SaveSubObjHook, EnginePlugin.SetPropertyMessage, EnginePlugin.SubObjData, EnginePlugin.TransferFilter, EnginePlugin.TransferObjectMessage, EnginePlugin.UnloadHook, EnginePlugin.UnloadSubObjHook
Modifier and Type | Field and Description |
---|---|
static int |
ACCOUNT_ADMIN |
static int |
ACCOUNT_GM |
static int |
ACCOUNT_NORMAL |
protected AccountDatabase |
aDB |
protected AuthDatabase |
authDB |
static boolean |
CHARACTER_NAME_ALLOW_NUMBERS |
static boolean |
CHARACTER_NAME_ALLOW_SPACES |
static int |
CHARACTER_NAME_MAX_LENGTH |
static int |
CHARACTER_NAME_MIN_LENGTH |
protected static java.util.Map<Namespace,java.util.Set<java.lang.String>> |
characterProps |
static java.util.Map<java.lang.String,CharacterTemplate> |
characterTemplates
A CharacterTemplate Map that has keys based on Race and Class (combined into one String).
|
static int |
PLAYER_PERCEPTION_RADIUS |
LOGIN_IDLE_TIMEOUT, MSGCODE_CHARACTER_CREATE, MSGCODE_CHARACTER_CREATE_RESPONSE, MSGCODE_CHARACTER_DELETE, MSGCODE_CHARACTER_DELETE_RESPONSE, MSGCODE_CHARACTER_REQUEST, MSGCODE_CHARACTER_RESPONSE, MSGCODE_CHARACTER_SELECT_REQUEST, MSGCODE_CHARACTER_SELECT_RESPONSE, MSGCODE_HEARTBEAT, MSGCODE_HEARTBEAT_RESPONSE, MSGCODE_SECURE_CHARACTER_REQUEST, MSGCODE_SERVER_LIST_REQUEST, MSGCODE_SERVER_LIST_RESPONSE, SecureToken, TokenValidTime, WorldId
deleteSubObjectSubscription, dumpAllThreadSubscription, dumpAllThreadSubscriptionLock, loadSubObjectSubscription, lock, MSG_TYPE_DUMP_ALL_THREAD_STACKS, MSG_TYPE_GET_PROPERTY, MSG_TYPE_GET_PROPERTY_NAMES, MSG_TYPE_PLUGIN_STATE, MSG_TYPE_SET_PROPERTY, MSG_TYPE_SET_PROPERTY_NONBLOCK, MSG_TYPE_TRANSFER_OBJECT, pluginStateSubscription, propertySubscription, saveSubObjectSubscription, selectionFilter, selectionSubscription, setSubObjectPersistenceSubscription, subObjectSubscription, unloadSubObjectSubscription
NO_FLAGS, RESPONSE_EXPECTED
Constructor and Description |
---|
AgisLoginPlugin() |
Modifier and Type | Method and Description |
---|---|
protected DisplayContext |
getDisplayContext(Entity entity)
Gets the Display Context for the player.
|
protected LoginPlugin.CharacterCreateResponseMessage |
handleCharacterCreateMessage(LoginPlugin.CharacterCreateMessage message,
LoginPlugin.SocketHandler clientSocket)
Create a character.
|
protected LoginPlugin.CharacterDeleteResponseMessage |
handleCharacterDeleteMessage(LoginPlugin.CharacterDeleteMessage message,
LoginPlugin.SocketHandler clientSocket)
Delete a character.
|
protected LoginPlugin.CharacterResponseMessage |
handleCharacterRequestMessage(LoginPlugin.CharacterRequestMessage message,
LoginPlugin.SocketHandler clientSocket)
Return character list.
|
protected LoginPlugin.ServerListResponseMessage |
handleServerListRequestMessage(LoginPlugin.ServerListRequestMessage message,
LoginPlugin.SocketHandler clientSocket)
Returns a list of servers that the player can connect to.
|
java.lang.String |
isNameTaken(java.lang.String name)
Checks if the name is already used by another player.
|
void |
loadCharacterFactoryTemplatesFromDatabase()
Loads in Character Creation Templates from the Content Database.
|
protected java.lang.String |
marshallDisplayContext(DisplayContext displayContext)
Converts the display context into a String for sending to the client.
|
void |
onActivate()
for developers extending the EnginePlugin object, it may
be easier to use the onActivate() method which gets
called when the plugin is being activated by the Engine.
|
static void |
registerCharacterProperty(Namespace namespace,
java.lang.String propName)
Registers a property into the characterProps Map.
|
protected void |
setCharacterProperties(java.util.Map<java.lang.String,java.io.Serializable> props,
Entity entity)
Fills the props Map with properties from the character.
|
dbConnect, getCharacterGenerator, getTCPPort, handleCharacterSelectRequestMessage, handleHeartbeatMessage, onTcpAccept, selectBestProxy, selectProxyPlugin, setProxyProperties, setTCPPort
activate, createMBeanInstance, createSubscription, getHookManager, getMessageHandler, getName, getObjectLockManager, getObjectProperties, getObjectProperties, getObjectProperty, getObjectPropertyNames, getPercentCPULoad, getPluginAvailable, getPluginInfo, getPluginNamespaces, getPluginState, getPluginStatus, getPluginType, getPropertyImpl, getPropertyNamesImpl, getStatusMap, handleMessage, handleMessageImpl, logDepsOutstanding, processKeysAndValues, registerActivateHook, registerDeleteHook, registerLoadHook, registerPluginNamespace, registerPluginNamespaces, registerPluginNamespaces, registerPluginNamespaces, registerSaveHook, registerTransferHook, registerUnloadHook, sendSubObjectResponse, sendSubObjectResponse, sendSubObjectResponse, setMessageHandler, setName, setObjectProperties, setObjectProperties, setObjectProperties, setObjectPropertiesNoResponse, setObjectPropertiesNoResponse, setObjectPropertiesNoResponse, setObjectProperty, setObjectPropertyNoResponse, setPercentCPULoad, setPluginAvailable, setPluginInfo, setPluginType, setPropertyImpl, transferObject
protected static java.util.Map<Namespace,java.util.Set<java.lang.String>> characterProps
public static java.util.Map<java.lang.String,CharacterTemplate> characterTemplates
protected AccountDatabase aDB
protected AuthDatabase authDB
public static final int ACCOUNT_ADMIN
public static final int ACCOUNT_GM
public static final int ACCOUNT_NORMAL
public static int CHARACTER_NAME_MIN_LENGTH
public static int CHARACTER_NAME_MAX_LENGTH
public static boolean CHARACTER_NAME_ALLOW_SPACES
public static boolean CHARACTER_NAME_ALLOW_NUMBERS
public static int PLAYER_PERCEPTION_RADIUS
public void onActivate()
EnginePlugin
onActivate
in class LoginPlugin
public void loadCharacterFactoryTemplatesFromDatabase()
protected LoginPlugin.CharacterResponseMessage handleCharacterRequestMessage(LoginPlugin.CharacterRequestMessage message, LoginPlugin.SocketHandler clientSocket)
This implementation does not truly authorize the auth token. The auth token should contain a 32-bit integer which is taken as the account id. (bitwise negated if SecureToken is true).
The returned world token is a fixed place holder.
handleCharacterRequestMessage
in class LoginPlugin
message
- Character request message.clientSocket
- Socket to the client.protected LoginPlugin.CharacterDeleteResponseMessage handleCharacterDeleteMessage(LoginPlugin.CharacterDeleteMessage message, LoginPlugin.SocketHandler clientSocket)
On an internal failure, the returned properties contain only:
handleCharacterDeleteMessage
in class LoginPlugin
message
- Character delete message.clientSocket
- Socket to the client.protected LoginPlugin.CharacterCreateResponseMessage handleCharacterCreateMessage(LoginPlugin.CharacterCreateMessage message, LoginPlugin.SocketHandler clientSocket)
If the properties contains "errorMessage" after calling the character factory, the character is not saved, and the properties are returned to the client.
On an internal failure, the returned properties contain only:
handleCharacterCreateMessage
in class LoginPlugin
message
- Character create message.clientSocket
- Socket to the client.protected LoginPlugin.ServerListResponseMessage handleServerListRequestMessage(LoginPlugin.ServerListRequestMessage message, LoginPlugin.SocketHandler clientSocket)
handleServerListRequestMessage
in class LoginPlugin
message
- Server List request message.clientSocket
- Socket to the client.public java.lang.String isNameTaken(java.lang.String name)
name
- protected DisplayContext getDisplayContext(Entity entity)
entity
- protected java.lang.String marshallDisplayContext(DisplayContext displayContext)
displayContext
- protected void setCharacterProperties(java.util.Map<java.lang.String,java.io.Serializable> props, Entity entity)
props
- entity
- public static void registerCharacterProperty(Namespace namespace, java.lang.String propName)
namespace
- propName
-