wsapi

package
v0.0.0-...-8d7dea8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 19, 2019 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EventTypeActorMove           = "actor-move"
	EventTypeActorAdminRelocate  = "actor-admin-relocate"
	EventTypeActorAddToZone      = "actor-add-to-zone"
	EventTypeActorRemoveFromZone = "actor-remove-from-zone"
	EventTypeActorDeath          = "actor-death"
	EventTypeActorMigrateIn      = "actor-migrate-in"
	EventTypeActorMigrateOut     = "actor-migrate-out"
	EventTypeActorSpeak          = "actor-speak"
	//EventTypeLocationAddToZone
	//EventTypeLocationRemoveFromZone
	//EventTypeLocationUpdate
	//EventTypeExitAddToZone
	//EventTypeExitUpdate
	//EventTypeExitRemoveFromZone
	EventTypeObjectAddToZone        = "object-add-to-zone"
	EventTypeObjectRemoveFromZone   = "object-remove-from-zone"
	EventTypeObjectMove             = "object-move"
	EventTypeObjectMoveSubcontainer = "object-move-subcontainers"
	EventTypeObjectAdminRelocate    = "object-admin-relocate"
	//EventTypeObjectMigrateIn
	//EventTypeObjectMigrateOut
	//EventTypeZoneSetDefaultLocation
	EventTypeCombatMeleeDamage = "combat-melee-damage"
	EventTypeCombatDodge       = "combat-dodge"
)
View Source
const (
	MessageTypeProcessingError               = "processing-error"
	MessageTypeListActorsCommand             = "list-actors"
	MessageTypeListActorsComplete            = "actors-list"
	MessageTypeAttachActorCommand            = "attach-actor"
	MessageTypeAttachActorComplete           = "actor-attached"
	MessageTypeMoveActorCommand              = "move-actor"
	MessageTypeMoveActorComplete             = "move-actor-complete"
	MessageTypeLookAtOtherActorCommand       = "look-at-other-actor"
	MessageTypeLookAtOtherActorComplete      = "look-at-other-actor-complete"
	MessageTypeLookAtObjectCommand           = "look-at-object"
	MessageTypeLookAtObjectComplete          = "look-at-object-complete"
	MessageTypeMeleeCombatCommand            = "combat-melee"
	MessageTypeMeleeCombatComplete           = "combat-melee-complete"
	MessageTypeMoveObjectCommand             = "move-object"
	MessageTypeMoveObjectComplete            = "move-object-complete"
	MessageTypeMoveObjectSubcontainer        = "move-object-subcontainer"
	MessageTypeEvent                         = "event"
	MessageTypeGetCurrentLocationInfoCommand = "get-current-location-info"
	MessageTypeCurrentLocationInfoComplete   = "current-location-info"
)
View Source
const (
	DefaultMessageSendQueueLen = 4
	DefaultListenAddr          = ":4001"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ActorAddToZoneEventBody

type ActorAddToZoneEventBody struct {
	ActorID            uuid.UUID `json:"actorID"`
	Name               string    `json:"name"`
	StartingLocationID uuid.UUID `json:"startingLocationID"`
}

type ActorAdminRelocateEventBody

type ActorAdminRelocateEventBody struct {
	ActorID      uuid.UUID `json:"actorID"`
	ToLocationID uuid.UUID `json:"toLocationID"`
}

type ActorDeathEventBody

type ActorDeathEventBody struct {
	ActorID uuid.UUID `json:"actorID"`
}

type ActorMigrateInEventBody

type ActorMigrateInEventBody struct {
	ActorID    uuid.UUID `json:"actorID"`
	Name       string    `json:"name"`
	FromLocID  uuid.UUID `json:"fromLocID"`
	FromZoneID uuid.UUID `json:"fromZoneID"`
	ToLocID    uuid.UUID `json:"toLocID"`
}

type ActorMigrateOutEventBody

type ActorMigrateOutEventBody struct {
	ActorID   uuid.UUID `json:"actorID"`
	FromLocID uuid.UUID `json:"fromLocID"`
	ToZoneID  uuid.UUID `json:"toZoneID"`
	ToLocID   uuid.UUID `json:"toLocID"`
}

type ActorMoveEventBody

type ActorMoveEventBody struct {
	FromLocationID uuid.UUID `json:"fromLocationID"`
	ToLocationID   uuid.UUID `json:"toLocationID"`
	ActorID        uuid.UUID `json:"actorID"`
}

type ActorRemoveFromZoneEventBody

type ActorRemoveFromZoneEventBody struct {
	ActorID uuid.UUID `json:"actorID"`
}

type ActorSpeakEventBody

type ActorSpeakEventBody struct {
	ActorID uuid.UUID `json:"actorID"`
	Speech  string
}

type AuthService

type AuthService interface {
	DoLogin(user, pass string) (uuid.UUID, *auth.AuthZDescriptor, error)
	GetActorIDsForAccountID(accountID uuid.UUID) []uuid.UUID
}

type CombatDodgeEventBody

type CombatDodgeEventBody struct {
	DamageType string
	AttackerID uuid.UUID
	TargetID   uuid.UUID
}

type CombatMeleeDamageEventBody

type CombatMeleeDamageEventBody struct {
	DamageType  string    `json:"damageType"`
	AttackerID  uuid.UUID `json:"attackerID"`
	TargetID    uuid.UUID `json:"targetID"`
	PhysicalDmg int       `json:"physicalDmg"`
	StaminaDmg  int       `json:"staminaDmg"`
	FocusDmg    int       `json:"focusDmg"`
}

type CommandAttachActor

type CommandAttachActor struct {
	ActorID uuid.UUID `json:"actorID"`
}

type CommandLookAtObject

type CommandLookAtObject struct {
	ObjectID uuid.UUID `json:"objectID"`
}

type CommandLookAtOtherActor

type CommandLookAtOtherActor struct {
	ActorID uuid.UUID `json:"actorID"`
}

type CommandMeleeCombat

type CommandMeleeCombat struct {
	AttackType string    `json:"attackType"`
	TargetID   uuid.UUID `json:"targetID"`
}

type CommandMoveActor

type CommandMoveActor struct {
	Direction string
}

type CommandMoveObject

type CommandMoveObject struct {
	ObjectID       uuid.UUID `json:"objectID"`
	FromLocationID uuid.UUID
	FromActorID    uuid.UUID
	FromObjectID   uuid.UUID
	ToLocationID   uuid.UUID
	ToActorID      uuid.UUID
	ToObjectID     uuid.UUID
	ToSubcontainer string
}

type CompleteAttachActor

type CompleteAttachActor struct {
	ActorID uuid.UUID `json:"actorID"`
}

type CompleteListActors

type CompleteListActors struct {
	ActorIDs []uuid.UUID `json:"actorIDs"`
}

type CurrentLocationInfo

type CurrentLocationInfo commands.LocationInfo

type Event

type Event struct {
	EventType string          `json:"eventType"`
	Version   int             `json:"version"`
	ZoneID    uuid.UUID       `json:"zoneID"`
	Body      json.RawMessage `json:"body"`
}

type Message

type Message struct {
	Type      string
	MessageID uuid.UUID `json:"messageID"`
	Payload   json.RawMessage
}

type ObjectAddToZoneEventBody

type ObjectAddToZoneEventBody struct {
	ObjectID            uuid.UUID `json:"objectID"`
	Name                string    `json:"name"`
	LocationContainerID uuid.UUID `json:"locationContainerID"`
	ActorContainerID    uuid.UUID `json:"actorContainerID"`
	ObjectContainerID   uuid.UUID `json:"objectContainerID"`
}

type ObjectAdminRelocateEventBody

type ObjectAdminRelocateEventBody struct {
	ObjectID              uuid.UUID `json:"objectID"`
	ToLocationContainerID uuid.UUID `json:"toLocationContainerID"`
	ToActorContainerID    uuid.UUID `json:"toActorContainerID"`
	ToObjectContainerID   uuid.UUID `json:"toObjectContainerID"`
	ToSubcontainer        string    `json:"toSubcontainer"`
}

type ObjectMoveEventBody

type ObjectMoveEventBody struct {
	ObjectID                uuid.UUID `json:"objectID"`
	FromLocationContainerID uuid.UUID `json:"fromLocationContainerID"`
	FromActorContainerID    uuid.UUID `json:"fromActorContainerID"`
	FromObjectContainerID   uuid.UUID `json:"fromObjectContainerID"`
	ToLocationContainerID   uuid.UUID `json:"toLocationContainerID"`
	ToActorContainerID      uuid.UUID `json:"toActorContainerID"`
	ToObjectContainerID     uuid.UUID `json:"toObjectContainerID"`
}

type ObjectMoveSubcontainerEventBody

type ObjectMoveSubcontainerEventBody struct {
	ObjectID         uuid.UUID `json:"objectID"`
	FromSubcontainer string    `json:"fromSubcontainer"`
	ToSubcontainer   string    `json:"toSubcontainer"`
	ActorID          uuid.UUID `json:"actorID"`
}

type ObjectRemoveFromZoneEventBody

type ObjectRemoveFromZoneEventBody struct {
	ObjectID uuid.UUID `json:"objectID"`
	Name     string    `json:"name"`
}

type Server

type Server struct {
	ListenAddrString string
	AuthService      AuthService
	// This is the length of outstanding messages we're willing to queue to send
	// to a single client. If we back up farther than this, we will disconnect
	// the client to protect our core (which will be making blocking calls to
	// add items to our queue-channel).
	MessageSendQueueLen int
	World               *core.World
	// contains filtered or unexported fields
}

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, req *http.Request)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL