Documentation
¶
Index ¶
- Constants
- Variables
- func EditEntity(entities *[]maps.Entity, edit P.EditEntity)
- func IsValidAlias(alias string) bool
- func NewEntity(entities *[]maps.Entity, index int, entity maps.Entity) *maps.Entity
- type Edit
- type EditingState
- func (e *EditingState) Apply(edits []*Edit) error
- func (e *EditingState) Checkpoint(ctx context.Context) error
- func (e *EditingState) ClearClipboard(sender ingress.ClientID)
- func (e *EditingState) Destroy()
- func (e *EditingState) IsOpenEdit() bool
- func (e *EditingState) LoadMap(map_ *maps.GameMap) error
- func (e *EditingState) Process(sender ingress.ClientID, message P.Message)
- func (e *EditingState) SavePeriodically(ctx context.Context)
- func (e *EditingState) SetOpenEdit(val bool)
- type Link
- type Map
- func (m *Map) GetID() string
- func (m *Map) GetMap(ctx context.Context) (*state.MapPointer, *state.Map, error)
- func (m *Map) GetPointer(ctx context.Context) (*state.MapPointer, error)
- func (m *Map) LoadGameMap(ctx context.Context) (*maps.GameMap, error)
- func (m *Map) LoadMapData(ctx context.Context) ([]byte, error)
- func (m *Map) SaveGameMap(ctx context.Context, creator *state.User, gameMap *maps.GameMap) (*state.Map, error)
- type SpaceConfig
- type SpaceInstance
- func (s *SpaceInstance) GetAlias(ctx context.Context) (string, error)
- func (s *SpaceInstance) GetDescription(ctx context.Context) (string, error)
- func (s *SpaceInstance) GetID() string
- func (s *SpaceInstance) GetLinks(ctx context.Context) ([]Link, error)
- func (s *SpaceInstance) GetMap(ctx context.Context) (string, error)
- func (s *SpaceInstance) GetServerInfo(ctx context.Context) (string, error)
- func (s *SpaceInstance) IsOpenEdit() bool
- func (s *SpaceInstance) PollEdits(ctx context.Context)
- type SpaceManager
- func (s *SpaceManager) DoExploreMode(ctx context.Context, gameServer *gameServers.GameServer, skipRoot string)
- func (s *SpaceManager) FindInstance(server *gameServers.GameServer) *SpaceInstance
- func (s *SpaceManager) Logger() zerolog.Logger
- func (s *SpaceManager) SearchSpace(ctx context.Context, id string) (*UserSpace, error)
- func (s *SpaceManager) StartPresetSpace(ctx context.Context, presetSpace config.PresetSpace) (*SpaceInstance, error)
- func (s *SpaceManager) StartSpace(ctx context.Context, id string) (*SpaceInstance, error)
- func (s *SpaceManager) WatchInstance(ctx context.Context, space *SpaceInstance)
- type UserSpace
- func (s *UserSpace) GetConfig(ctx context.Context) (*SpaceConfig, error)
- func (u *UserSpace) GetID() string
- func (s *UserSpace) GetMap(ctx context.Context) (*Map, error)
- func (s *UserSpace) GetSpace(ctx context.Context) (*state.Space, error)
- func (u *UserSpace) Reference() string
- func (s *UserSpace) SetAlias(ctx context.Context, alias string) error
- func (s *UserSpace) SetDescription(ctx context.Context, description string) error
- type Verse
- func (v *Verse) FindMap(ctx context.Context, needle string) (*Map, error)
- func (v *Verse) FindSpace(ctx context.Context, needle string) (*UserSpace, error)
- func (v *Verse) GetMap(ctx context.Context, id string) (*Map, error)
- func (v *Verse) GetSpace(ctx context.Context, id string) (*UserSpace, error)
- func (v *Verse) HaveMap(ctx context.Context, id string) (bool, error)
- func (v *Verse) HaveSpace(ctx context.Context, id string) (bool, error)
- func (v *Verse) NewMap(ctx context.Context, creator *state.User) (*Map, error)
- func (v *Verse) NewSpace(ctx context.Context, creator *state.User) (*UserSpace, error)
- func (v *Verse) NewSpaceID(ctx context.Context) (string, error)
Constants ¶
View Source
const (
MAP_EXPIRE = time.Hour * 24
)
Variables ¶
View Source
var (
SPACE_ALIAS_REGEX = regexp.MustCompile(`^[a-z0-9-_.:]+$`)
)
Functions ¶
func EditEntity ¶
func EditEntity(entities *[]maps.Entity, edit P.EditEntity)
func IsValidAlias ¶
Types ¶
type EditingState ¶
type EditingState struct {
Clipboards map[ingress.ClientID]worldio.Editinfo
Edits []*Edit
GameMap *maps.GameMap
Map *Map
Space *UserSpace
OpenEdit bool
// contains filtered or unexported fields
}
func NewEditingState ¶
func NewEditingState(verse *Verse, space *UserSpace, map_ *Map) *EditingState
func (*EditingState) Apply ¶
func (e *EditingState) Apply(edits []*Edit) error
func (*EditingState) Checkpoint ¶
func (e *EditingState) Checkpoint(ctx context.Context) error
Apply all of the edits to the map.
func (*EditingState) ClearClipboard ¶
func (e *EditingState) ClearClipboard(sender ingress.ClientID)
func (*EditingState) Destroy ¶
func (e *EditingState) Destroy()
func (*EditingState) IsOpenEdit ¶
func (e *EditingState) IsOpenEdit() bool
func (*EditingState) Process ¶
func (e *EditingState) Process(sender ingress.ClientID, message P.Message)
func (*EditingState) SavePeriodically ¶
func (e *EditingState) SavePeriodically(ctx context.Context)
func (*EditingState) SetOpenEdit ¶
func (e *EditingState) SetOpenEdit(val bool)
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
func (*Map) GetPointer ¶
type SpaceConfig ¶
type SpaceInstance ¶
type SpaceInstance struct {
utils.Session
SpaceConfig
Space *UserSpace
PresetSpace *config.PresetSpace
Editing *EditingState
Server *gameServers.GameServer
// contains filtered or unexported fields
}
func (*SpaceInstance) GetAlias ¶
func (s *SpaceInstance) GetAlias(ctx context.Context) (string, error)
func (*SpaceInstance) GetDescription ¶
func (s *SpaceInstance) GetDescription(ctx context.Context) (string, error)
func (*SpaceInstance) GetID ¶
func (s *SpaceInstance) GetID() string
func (*SpaceInstance) GetLinks ¶
func (s *SpaceInstance) GetLinks(ctx context.Context) ([]Link, error)
func (*SpaceInstance) GetServerInfo ¶
func (s *SpaceInstance) GetServerInfo(ctx context.Context) (string, error)
Combine the description and alias (or ID) to make the servinfo string.
func (*SpaceInstance) IsOpenEdit ¶
func (s *SpaceInstance) IsOpenEdit() bool
func (*SpaceInstance) PollEdits ¶
func (s *SpaceInstance) PollEdits(ctx context.Context)
type SpaceManager ¶
func NewSpaceManager ¶
func NewSpaceManager(servers *gameServers.ServerManager, maps *assets.AssetFetcher) *SpaceManager
func (*SpaceManager) DoExploreMode ¶
func (s *SpaceManager) DoExploreMode(ctx context.Context, gameServer *gameServers.GameServer, skipRoot string)
func (*SpaceManager) FindInstance ¶
func (s *SpaceManager) FindInstance(server *gameServers.GameServer) *SpaceInstance
func (*SpaceManager) Logger ¶
func (s *SpaceManager) Logger() zerolog.Logger
func (*SpaceManager) SearchSpace ¶
func (*SpaceManager) StartPresetSpace ¶
func (s *SpaceManager) StartPresetSpace(ctx context.Context, presetSpace config.PresetSpace) (*SpaceInstance, error)
func (*SpaceManager) StartSpace ¶
func (s *SpaceManager) StartSpace(ctx context.Context, id string) (*SpaceInstance, error)
func (*SpaceManager) WatchInstance ¶
func (s *SpaceManager) WatchInstance(ctx context.Context, space *SpaceInstance)
type UserSpace ¶
func (*UserSpace) GetConfig ¶
func (s *UserSpace) GetConfig(ctx context.Context) (*SpaceConfig, error)
Click to show internal directories.
Click to hide internal directories.