Documentation ¶
Index ¶
- func CreateEntityAnywhere(typeName string) common.EntityID
- func CreateEntityLocally(typeName string) common.EntityID
- func CreateSpaceAnywhere(kind int) common.EntityID
- func CreateSpaceLocally(kind int) common.EntityID
- func Entities() entity.EntityMap
- func Exists(typeName string, entityID common.EntityID, callback storage.ExistsCallbackFunc)
- func GetEntity(id common.EntityID) *entity.Entity
- func GetGameID() uint16
- func GetKVDB(key string, callback kvdb.KVDBGetCallback)
- func GetOrPutKVDB(key string, val string, callback kvdb.KVDBGetOrPutCallback)
- func GetServiceProviders(serviceName string) entity.EntityIDSet
- func ListAttr() *entity.ListAttr
- func ListEntityIDs(typeName string, callback storage.ListCallbackFunc)
- func LoadEntityAnywhere(typeName string, entityID common.EntityID)
- func MapAttr() *entity.MapAttr
- func Post(callback post.PostCallback)
- func PutKVDB(key string, val string, callback kvdb.KVDBPutCallback)
- func RegisterEntity(typeName string, entityPtr entity.IEntity, isPersistent, useAOI bool)
- func RegisterSpace(spacePtr entity.ISpace)
- func Run(delegate game.IGameDelegate)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEntityAnywhere ¶
CreateEntityAnywhere creates a entity on any server
func CreateEntityLocally ¶
CreateEntityLocally creates a entity on the local server
returns EntityID
func CreateSpaceAnywhere ¶
CreateSpaceAnywhere creates a space with specified kind in any game server
func CreateSpaceLocally ¶
CreateSpaceLocally creates a space with specified kind in the local game server
returns the space EntityID
func Exists ¶
func Exists(typeName string, entityID common.EntityID, callback storage.ExistsCallbackFunc)
Exists checks if entityID exists in entity storage
returns result in callback
func GetGameID ¶
func GetGameID() uint16
GetGameID gets the local server ID
server ID is a uint16 number starts from 1, which should be different for each servers server ID is also in the game config section name of goworld.ini
func GetKVDB ¶
func GetKVDB(key string, callback kvdb.KVDBGetCallback)
GetKVDB gets value of key from KVDB
func GetOrPutKVDB ¶
func GetOrPutKVDB(key string, val string, callback kvdb.KVDBGetOrPutCallback)
GetOrPut gets value of key from KVDB, if val not exists or is "", put key-value to KVDB.
func GetServiceProviders ¶
func GetServiceProviders(serviceName string) entity.EntityIDSet
GetServiceProviders get the set of EntityIDs that provides the specified service
func ListEntityIDs ¶
func ListEntityIDs(typeName string, callback storage.ListCallbackFunc)
ListEntityIDs gets all saved entity ids in storage, may take long time and block the main routine
returns result in callback
func LoadEntityAnywhere ¶
LoadEntityAnywhere loads the specified entity from entity storage
func PutKVDB ¶
func PutKVDB(key string, val string, callback kvdb.KVDBPutCallback)
PutKVDB puts key-value to KVDB
func RegisterEntity ¶
RegisterEntity registers the entity type so that entities can be created or loaded
returns the entity type description object which can be used to define more properties of entity type
func RegisterSpace ¶
RegisterSpace registers the space entity type.
All spaces will be created as an instance of this type
func Run ¶
func Run(delegate game.IGameDelegate)
Run runs the server endless loop
This is the main routine for the server and all entity logic, and this function never quit
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
components
|
|
engine
|
|
lib/gwsnappy
Package snappy implements the snappy block-based compression format.
|
Package snappy implements the snappy block-based compression format. |
examples
|
|
ext
|
|