transport

package
v0.0.0-...-6b96f8f Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeRequest

func DecodeRequest(rd RequestDecrypter, data []byte, v interface{}) error

DecodeRequest decodes the bytes from a request body into the target, v.

func WriteResponse

func WriteResponse(w io.Writer, rt ResponseType, data []byte) error

WriteResponse writes a gamestate response command and data to the given writer.

Types

type InvalidDecodeTargetError

type InvalidDecodeTargetError struct {
	Type reflect.Type
}

InvalidDecodeTargetError is returned when a request is attempted to be decoded into an invalid type (type must be a non-nil pointer).

func (InvalidDecodeTargetError) Error

func (i InvalidDecodeTargetError) Error() string

type RequestDecrypter

type RequestDecrypter interface {
	Decrypt([]byte) []byte
}

RequestDecrypter is the interface that wraps the basic Decrypt method.

Decrypt returns a byte slice containing the decrypted contents of the given input byte slice.

type ResponseType

type ResponseType int

ResponseType indicates to Demon's Souls the type of response being returned.

var (
	ResponseLogin                  ResponseType = 0x02
	ResponseAddQWCData             ResponseType = 0x09
	ResponseAddSummonSOSData       ResponseType = 0x0a
	ResponseCheckSOSData           ResponseType = 0x0b
	ResponseCharacterTendency      ResponseType = 0x0e
	ResponseGetWanderingGhost      ResponseType = 0x11
	ResponseMultiplayerOp          ResponseType = 0x15
	ResponseGeneric                ResponseType = 0x17
	ResponseAddData                ResponseType = 0x1d
	ResponseReplayData             ResponseType = 0x1e
	ResponseGetSOSData             ResponseType = 0x0f
	ResponseListData               ResponseType = 0x1f
	ResponseUpdateMsgGrade         ResponseType = 0x2a
	ResponseUpdateOtherPlayerGrade ResponseType = 0x2b
	ResponseFinaliseMultiplayer    ResponseType = 0x21
	ResponseTimeMsg                ResponseType = 0x22
	ResponseSummonMonk             ResponseType = 0x23
	ResponseDeleteBloodMsg         ResponseType = 0x27
	ResponseCharacterMPGrade       ResponseType = 0x28
	ResponseCharacterBloodMsgGrade ResponseType = 0x29
)

Directories

Path Synopsis
encoding
base64
Package base64 provides support for Demon's Souls base64 encoding.
Package base64 provides support for Demon's Souls base64 encoding.

Jump to

Keyboard shortcuts

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