Documentation
¶
Index ¶
- func CreateEntityAnywhere(typeName string)
- func CreateEntityLocally(typeName string) EntityID
- func CreateSpaceAnywhere(kind int)
- func CreateSpaceLocally(kind int) EntityID
- func Exists(typeName string, entityID EntityID, callback storage.ExistsCallbackFunc)
- func GetEntity(id EntityID) *entity.Entity
- func GetGameID() uint16
- func GetServiceProviders(serviceName string) entity.EntityIDSet
- func ListAttr() *entity.ListAttr
- func ListEntityIDs(typeName string, callback storage.ListCallbackFunc)
- func LoadEntityAnywhere(typeName string, entityID EntityID)
- func MapAttr() *entity.MapAttr
- func RegisterEntity(typeName string, entityPtr entity.IEntity) *entity.EntityTypeDesc
- func RegisterSpace(spacePtr entity.ISpace)
- func Run(delegate game.IGameDelegate)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEntityAnywhere ¶
func CreateEntityAnywhere(typeName string)
Create a entity on any server
func CreateEntityLocally ¶
func CreateEntityLocally(typeName string) EntityID
Create a entity on the local server
returns EntityID
func CreateSpaceAnywhere ¶
func CreateSpaceAnywhere(kind int)
Create a space with specified kind in any game server
func CreateSpaceLocally ¶
func CreateSpaceLocally(kind int) EntityID
Create a space with specified kind in the local game server
returns the space EntityID
func Exists ¶
func Exists(typeName string, entityID EntityID, callback storage.ExistsCallbackFunc)
Check if entityID exists in entity storage
returns result in callback
func GetGameID ¶
func GetGameID() uint16
Get 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 GetServiceProviders ¶
func GetServiceProviders(serviceName string) entity.EntityIDSet
Get the set of EntityIDs that provides the specified service
func ListEntityIDs ¶
func ListEntityIDs(typeName string, callback storage.ListCallbackFunc)
Get all saved entity ids in storage, may take long time and block the main routine
returns result in callback
func LoadEntityAnywhere ¶
func LoadEntityAnywhere(typeName string, entityID EntityID)
Load the specified entity from entity storage
func RegisterEntity ¶
func RegisterEntity(typeName string, entityPtr entity.IEntity) *entity.EntityTypeDesc
Register the entity type
returns the entity type description object which can be used to define more properties of entity type
func RegisterSpace ¶
Register the space entity type
All spaces will be created as an instance of this type
func Run ¶
func Run(delegate game.IGameDelegate)
Run the server
This is the main routine for the server and all entity logic, and this function never quit
Types ¶
This section is empty.