Base cache server module class.

Constructor

new (srv:ServerClass)

Fields

name:String

Module name.

Methods

inline _acquire ():Void

Acquires module-wide mutex.

inline _release ():Void

Releases module-wide mutex.

dynamic call (c:SlaveClient, type:String, params:Params):Dynamic

Method call entry-point. Every call made to cache server leads to the call() method of appropriate module.

Parameters:

c

Slave client that made the call.

type

Full method type.

params

Call parameters.

Returns:

Response to send to this slave client. Can be null (no response).

dynamic editAdd (c:SlaveClient, type:String, params:Params):Dynamic

The editor wants to add something to this server module. You can read about the editor functionality in detail in Editor Notifications article.

Parameters:

c

Slave client that made the call.

type

Full call type.

params

Editor call parameters.

Returns:

Response to the editor. If it has "noSlaves" field set to true, the event will not propagate to slave servers.

dynamic editDel (c:SlaveClient, type:String, params:Params):Dynamic

The editor wants to delete something from this server module. You can read about the editor functionality in detail in Editor Notifications article.

Parameters:

c

Slave client that made the call.

type

Full call type.

params

Editor call parameters.

Returns:

Response to the editor. If it has "noSlaves" field set to true, the event will not propagate to slave servers.

dynamic editGet (c:SlaveClient, type:String, params:Params):Dynamic

The editor wants to get something from this server module. You can read about the editor functionality in detail in Editor Notifications article.

Parameters:

c

Slave client that made the call.

type

Full call type.

params

Editor call parameters.

Returns:

Response to the editor.

dynamic editReload (c:SlaveClient, type:String, params:Params):Dynamic

The editor notifies the server that something needs to be reloaded. By default this method calls ModuleCache.loadTables() and returns null. You can read about the editor functionality in detail in Editor Notifications article.

Parameters:

c

Slave client that made the call.

type

Full call type.

params

Editor call parameters.

Returns:

Response to the editor. If it has "noSlaves" field set to true, the event will not propagate to slave servers.

dynamic editUpdate (c:SlaveClient, type:String, params:Params):Dynamic

The editor wants to update something in this server module. You can read about the editor functionality in detail in Editor Notifications article.

Parameters:

c

Slave client that made the call.

type

Full call type.

params

Editor call parameters.

Returns:

Response to the editor. If it has "noSlaves" field set to true, the event will not propagate to slave servers.

dynamic initPost ():Void

Called after all server modules have been instanced. Used when there is some additional module initialization dependent on other modules state.

dynamic loadTables ():Void

Called to load or reload static tables. It is called in module constructor and when the module is notified about any changes by the editor.

dynamic loginPost (c:SlaveClient, params:Params, response:Dynamic, query:_QueryFunc):Void

Event hook. Can be used to do work on cache server right after successful user login if the module is subscribed to it. You can subscribe the module to this event in the constructor like this:

server.subscribeModule("core/user.loginPost", this);

Note: This method is called from asynchronous worker.

Parameters:

c

Slave client that made the call.

params

User parameters. Has the following fields: "id", "name", "networkid", "networktype", "ipAddr".

response

Anonymous object that contains the response.

query

Function for making SQL queries. Will use the proper asynchronous worker connection.

dynamic logoutPost (c:SlaveClient, params:Params):Void

Event hook. Can be used to do work on cache server right after user logout if the module is subscribed to it. You can subscribe the module to this event in the constructor like this:

server.subscribeModule("core/user.logoutPost", this);

Parameters:

c

Slave client that made the call.

params

Logout call parameters. Has the following fields set:

id: Int - User ID.

networkid: String - User SNS ID.

networktype: String - User SNS type.

dynamic registerModify (params:Params, diffParams:Dynamic):Void

Event hook. Can be used to modify new user parameters on registration if the module is subscribed to it. You can subscribe the module to this event in the constructor like this:

server.subscribeModule("core/user.registerModify", this);

Parameters:

params

User registration call parameters.

diffParams

Anonymous object for the new user.

dynamic registerPost (serverID:Int, id:Int, query:_QueryFunc):Void

Event hook. Can be used to do work on cache server right after new user registration if the module is subscribed to it. You can subscribe the module to this event in the constructor like this:

server.subscribeModule("core/user.registerPost", this);

Note: This method is called from asynchronous worker.

Parameters:

serverID

Slave client ID.

id

New user ID.

query

Function for making SQL queries. Will use the proper asynchronous worker connection.