goworld: github.com/xiaonanln/goworld Index | Files | Directories

package goworld

import "github.com/xiaonanln/goworld"

Index

Package Files

goworld.go

func CreateEntityAnywhere Uses

func CreateEntityAnywhere(typeName string)

CreateEntityAnywhere creates a entity on any server

func CreateEntityLocally Uses

func CreateEntityLocally(typeName string) common.EntityID

CreateEntityLocally creates a entity on the local server

returns EntityID

func CreateSpaceAnywhere Uses

func CreateSpaceAnywhere(kind int)

CreateSpaceAnywhere creates a space with specified kind in any game server

func CreateSpaceLocally Uses

func CreateSpaceLocally(kind int) common.EntityID

CreateSpaceLocally creates a space with specified kind in the local game server

returns the space EntityID

func Entities Uses

func Entities() entity.EntityMap

Entities gets all entities as an EntityMap (do not modify it!)

func Exists Uses

func Exists(typeName string, entityID common.EntityID, callback storage.ExistsCallbackFunc)

Exists checks if entityID exists in entity storage

returns result in callback

func GetEntity Uses

func GetEntity(id common.EntityID) *entity.Entity

GetEntity gets the entity by EntityID

func GetGameID Uses

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 Uses

func GetKVDB(key string, callback kvdb.KVDBGetCallback)

GetKVDB gets value of key from KVDB

func GetOrPutKVDB Uses

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 Uses

func GetServiceProviders(serviceName string) entity.EntityIDSet

GetServiceProviders get the set of EntityIDs that provides the specified service

func ListAttr Uses

func ListAttr() *entity.ListAttr

ListAttr creates a new ListAttr

func ListEntityIDs Uses

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 Uses

func LoadEntityAnywhere(typeName string, entityID common.EntityID)

LoadEntityAnywhere loads the specified entity from entity storage

func MapAttr Uses

func MapAttr() *entity.MapAttr

MapAttr creates a new MapAttr

func Post Uses

func Post(callback post.PostCallback)

Post posts a callback to be executed

func PutKVDB Uses

func PutKVDB(key string, val string, callback kvdb.KVDBPutCallback)

PutKVDB puts key-value to KVDB

func RegisterEntity Uses

func RegisterEntity(typeName string, entityPtr entity.IEntity, isPersistent, useAOI bool)

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 Uses

func RegisterSpace(spacePtr entity.ISpace)

RegisterSpace registers the space entity type.

All spaces will be created as an instance of this type

func Run Uses

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

Directories

PathSynopsis
components/dispatcher
components/dispatcher/dispatcherclient
components/game
components/gate
engine/async
engine/binutil
engine/common
engine/config
engine/consts
engine/crontab
engine/entity
engine/gwioutil
engine/gwlog
engine/gwutils
engine/kvdb
engine/kvdb/backend/kvdb_mongodb
engine/kvdb/backend/kvdbmysql
engine/kvdb/backend/kvdbredis
engine/kvdb/types
engine/lib/gwsnappyPackage snappy implements the snappy block-based compression format.
engine/netutil
engine/netutil/compress
engine/opmon
engine/post
engine/proto
engine/storage
engine/storage/backend/filesystem
engine/storage/backend/mongodb
engine/storage/backend/mysql
engine/storage/backend/redis
engine/storage/storage_common
engine/uuid

Package goworld imports 6 packages (graph). Updated 2017-12-08. Refresh now. Tools for package owners.