|
|||||||||
Atavism Version 2018.1 | AGIS API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectatavism.server.engine.EnginePlugin
atavism.server.worldmgr.LoginPlugin
atavism.agis.plugins.AgisLoginPlugin
public class AgisLoginPlugin
Agis LoginPlugin implementation. Reads and stores characters using
the Engine
database.
Nested Class Summary |
---|
Field Summary | |
---|---|
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
|
Fields inherited from interface atavism.msgsys.MessageCallback |
---|
NO_FLAGS, RESPONSE_EXPECTED |
Constructor Summary | |
---|---|
AgisLoginPlugin()
|
Method Summary | |
---|---|
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. |
Methods inherited from class atavism.server.worldmgr.LoginPlugin |
---|
dbConnect, getCharacterGenerator, getTCPPort, handleCharacterSelectRequestMessage, handleHeartbeatMessage, onTcpAccept, selectBestProxy, selectProxyPlugin, setProxyProperties, setTCPPort |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public AgisLoginPlugin()
Method Detail |
---|
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
-
|
Copyright © 2018 Dragonsan Studios Sp. z o.o. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |