models

package
v1.6.8 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: AGPL-3.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CloudFolder = filepath.Join(responsesFolder, "cloud")

Functions

func CreateSession

func CreateSession(gameId string, userId int32) string

Types

type CloudFiles

type CloudFiles struct {
	Value       map[string]CloudfilesIndex
	Credentials *Credentials
	// contains filtered or unexported fields
}

func BuildCloudfilesIndex

func BuildCloudfilesIndex(configFolder string, baseFolder string) *CloudFiles

func (*CloudFiles) GetByKey

func (m *CloudFiles) GetByKey(key string) (string, *CloudfilesIndex, bool)

func (*CloudFiles) ReadFile

func (m *CloudFiles) ReadFile(name string) ([]byte, error)

type CloudfilesIndex

type CloudfilesIndex struct {
	Id       int    `json:"id"`
	Key      string `json:"key"`
	Type     string `json:"type"`
	Version  string `json:"version"`
	ETag     string `json:"etag"`
	Created  string `json:"created"`
	Length   int
	Checksum string
}

type Credential

type Credential struct {
	// contains filtered or unexported fields
}

func (*Credential) Expired

func (cred *Credential) Expired() bool

func (*Credential) GetExpiry

func (cred *Credential) GetExpiry() time.Time

func (*Credential) GetKey

func (cred *Credential) GetKey() string

func (*Credential) GetSignature

func (cred *Credential) GetSignature() string

type Credentials

type Credentials struct {
	// contains filtered or unexported fields
}

func (*Credentials) CreateCredentials

func (creds *Credentials) CreateCredentials(key string) *Credential

func (*Credentials) Delete

func (creds *Credentials) Delete(signature string)

func (*Credentials) GetCredentials

func (creds *Credentials) GetCredentials(signature string) (*Credential, bool)

func (*Credentials) Initialize

func (creds *Credentials) Initialize()

type Game

type Game interface {
	Resources() *MainResources
	Users() *MainUsers
	Advertisements() *MainAdvertisements
	ChatChannels() *MainChatChannels
	Title() string
}

func CreateGame

func CreateGame(gameId string, rssKeyedFilenames mapset.Set[string]) Game

func G

func G(r *http.Request) Game

type MainAdvertisement

type MainAdvertisement struct {
	// contains filtered or unexported fields
}

func (*MainAdvertisement) AddMessage

func (adv *MainAdvertisement) AddMessage(broadcast bool, content string, typeId uint8, sender *MainUser, receivers []*MainUser) *MainMessage

func (*MainAdvertisement) Encode

func (adv *MainAdvertisement) Encode(gameId string) i.A

func (*MainAdvertisement) EncodePeers

func (adv *MainAdvertisement) EncodePeers() i.A

func (*MainAdvertisement) GetAppBinaryChecksum

func (adv *MainAdvertisement) GetAppBinaryChecksum() int32

func (*MainAdvertisement) GetDataChecksum

func (adv *MainAdvertisement) GetDataChecksum() int32

func (*MainAdvertisement) GetDescription

func (adv *MainAdvertisement) GetDescription() string

func (*MainAdvertisement) GetHost

func (adv *MainAdvertisement) GetHost() *MainUser

func (*MainAdvertisement) GetId

func (adv *MainAdvertisement) GetId() int32

func (*MainAdvertisement) GetIp

func (adv *MainAdvertisement) GetIp() string

func (*MainAdvertisement) GetJoinable

func (adv *MainAdvertisement) GetJoinable() bool

func (*MainAdvertisement) GetMatchType

func (adv *MainAdvertisement) GetMatchType() uint8

func (*MainAdvertisement) GetModDllChecksum

func (adv *MainAdvertisement) GetModDllChecksum() int32

func (*MainAdvertisement) GetModDllFile

func (adv *MainAdvertisement) GetModDllFile() string

func (*MainAdvertisement) GetModName

func (adv *MainAdvertisement) GetModName() string

func (*MainAdvertisement) GetModVersion

func (adv *MainAdvertisement) GetModVersion() string

func (*MainAdvertisement) GetObserversDelay added in v1.6.0

func (adv *MainAdvertisement) GetObserversDelay() uint32

func (*MainAdvertisement) GetPasswordValue

func (adv *MainAdvertisement) GetPasswordValue() string

func (*MainAdvertisement) GetPeer

func (adv *MainAdvertisement) GetPeer(user *MainUser) (*MainPeer, bool)

func (*MainAdvertisement) GetPeers

func (adv *MainAdvertisement) GetPeers() *orderedmap.OrderedMap[*MainUser, *MainPeer]

func (*MainAdvertisement) GetPlatformSessionId

func (adv *MainAdvertisement) GetPlatformSessionId() uint64

func (*MainAdvertisement) GetRelayRegion

func (adv *MainAdvertisement) GetRelayRegion() string

func (*MainAdvertisement) GetStartTime

func (adv *MainAdvertisement) GetStartTime() int64

func (*MainAdvertisement) GetState

func (adv *MainAdvertisement) GetState() int8

func (*MainAdvertisement) GetVersionFlags

func (adv *MainAdvertisement) GetVersionFlags() uint32

func (*MainAdvertisement) GetVisible

func (adv *MainAdvertisement) GetVisible() bool

func (*MainAdvertisement) UpdatePeer

func (adv *MainAdvertisement) UpdatePeer(user *MainUser, race int32, team int32)

func (*MainAdvertisement) UpdatePlatformSessionId

func (adv *MainAdvertisement) UpdatePlatformSessionId(sessionId uint64)

func (*MainAdvertisement) UpdateState

func (adv *MainAdvertisement) UpdateState(state int8)

type MainAdvertisements

type MainAdvertisements struct {
	// contains filtered or unexported fields
}

func (*MainAdvertisements) Delete

func (advs *MainAdvertisements) Delete(adv *MainAdvertisement)

func (*MainAdvertisements) FindAdvertisements

func (advs *MainAdvertisements) FindAdvertisements(matches func(adv *MainAdvertisement) bool) []*MainAdvertisement

func (*MainAdvertisements) FindAdvertisementsEncoded

func (advs *MainAdvertisements) FindAdvertisementsEncoded(gameId string, matches func(adv *MainAdvertisement) bool) []i.A

func (*MainAdvertisements) GetAdvertisement

func (advs *MainAdvertisements) GetAdvertisement(id int32) (*MainAdvertisement, bool)

func (*MainAdvertisements) Initialize

func (advs *MainAdvertisements) Initialize(users *MainUsers)

func (*MainAdvertisements) NewPeer

func (advs *MainAdvertisements) NewPeer(adv *MainAdvertisement, u *MainUser, race int32, team int32) *MainPeer

func (*MainAdvertisements) RemovePeer

func (advs *MainAdvertisements) RemovePeer(adv *MainAdvertisement, user *MainUser)

func (*MainAdvertisements) Store

func (*MainAdvertisements) Update

type MainChatChannel

type MainChatChannel struct {
	Id   int32
	Name string
	// contains filtered or unexported fields
}

func (*MainChatChannel) AddMessage

func (channel *MainChatChannel) AddMessage(sender *MainUser, text string)

func (*MainChatChannel) AddUser

func (channel *MainChatChannel) AddUser(user *MainUser) internal.A

func (*MainChatChannel) Encode

func (channel *MainChatChannel) Encode() internal.A

func (*MainChatChannel) EncodeUsers

func (channel *MainChatChannel) EncodeUsers() internal.A

func (*MainChatChannel) GetId

func (channel *MainChatChannel) GetId() int32

func (*MainChatChannel) GetName

func (channel *MainChatChannel) GetName() string

func (*MainChatChannel) GetUsers

func (channel *MainChatChannel) GetUsers() []*MainUser

func (*MainChatChannel) HasUser

func (channel *MainChatChannel) HasUser(user *MainUser) bool

func (*MainChatChannel) RemoveUser

func (channel *MainChatChannel) RemoveUser(user *MainUser)

type MainChatChannelMessage

type MainChatChannelMessage struct {
	// contains filtered or unexported fields
}

type MainChatChannels

type MainChatChannels struct {
	// contains filtered or unexported fields
}

func (*MainChatChannels) Encode

func (channels *MainChatChannels) Encode() internal.A

func (*MainChatChannels) GetById

func (channels *MainChatChannels) GetById(id int32) (*MainChatChannel, bool)

func (*MainChatChannels) Initialize

func (channels *MainChatChannels) Initialize(chatChannels map[string]MainChatChannel)

type MainGame

type MainGame struct {
	// contains filtered or unexported fields
}

func (*MainGame) Advertisements

func (g *MainGame) Advertisements() *MainAdvertisements

func (*MainGame) ChatChannels

func (g *MainGame) ChatChannels() *MainChatChannels

func (*MainGame) Resources

func (g *MainGame) Resources() *MainResources

func (*MainGame) Title

func (g *MainGame) Title() string

func (*MainGame) Users

func (g *MainGame) Users() *MainUsers

type MainMessage

type MainMessage struct {
	// contains filtered or unexported fields
}

func (*MainMessage) Encode

func (message *MainMessage) Encode() i.A

func (*MainMessage) GetAdvertisementId

func (message *MainMessage) GetAdvertisementId() int32

func (*MainMessage) GetBroadcast

func (message *MainMessage) GetBroadcast() bool

func (*MainMessage) GetContent

func (message *MainMessage) GetContent() string

func (*MainMessage) GetReceivers

func (message *MainMessage) GetReceivers() []*MainUser

func (*MainMessage) GetSender

func (message *MainMessage) GetSender() *MainUser

func (*MainMessage) GetTime

func (message *MainMessage) GetTime() int64

func (*MainMessage) GetType

func (message *MainMessage) GetType() uint8

type MainPeer

type MainPeer struct {
	// contains filtered or unexported fields
}

func (*MainPeer) Encode

func (peer *MainPeer) Encode() i.A

func (*MainPeer) GetAdvertisementId

func (peer *MainPeer) GetAdvertisementId() int32

func (*MainPeer) GetRace

func (peer *MainPeer) GetRace() int32

func (*MainPeer) GetTeam

func (peer *MainPeer) GetTeam() int32

func (*MainPeer) GetUser

func (peer *MainPeer) GetUser() *MainUser

func (*MainPeer) Invite

func (peer *MainPeer) Invite(user *MainUser)

func (*MainPeer) IsInvited

func (peer *MainPeer) IsInvited(user *MainUser) bool

func (*MainPeer) Uninvite

func (peer *MainPeer) Uninvite(user *MainUser)

func (*MainPeer) Update

func (peer *MainPeer) Update(race int32, team int32)

type MainResources

type MainResources struct {
	Login        *orderedmap.OrderedMap[string, string]
	ChatChannels map[string]MainChatChannel
	LoginData    []i.A
	ArrayFiles   map[string]i.A
	KeyedFiles   map[string][]byte

	CloudFiles CloudFiles
	// contains filtered or unexported fields
}

func (*MainResources) Initialize

func (r *MainResources) Initialize(gameId string, keyedFilenames mapset.Set[string])

func (*MainResources) ReturnSignedAsset

func (r *MainResources) ReturnSignedAsset(name string, w *http.ResponseWriter, req *http.Request, keyedResponse bool)

type MainUser

type MainUser struct {
	// contains filtered or unexported fields
}

func (*MainUser) GetAdvertisement

func (u *MainUser) GetAdvertisement() *MainAdvertisement

func (*MainUser) GetAlias

func (u *MainUser) GetAlias() string

func (*MainUser) GetChannels

func (u *MainUser) GetChannels() []*MainChatChannel

func (*MainUser) GetExtraProfileInfo

func (u *MainUser) GetExtraProfileInfo() i.A

func (*MainUser) GetId

func (u *MainUser) GetId() int32

func (*MainUser) GetPlatformId

func (u *MainUser) GetPlatformId() int

func (*MainUser) GetPlatformPath

func (u *MainUser) GetPlatformPath() string

func (*MainUser) GetPlatformUserID

func (u *MainUser) GetPlatformUserID() uint64

func (*MainUser) GetPresence

func (u *MainUser) GetPresence() int8

func (*MainUser) GetProfileId

func (u *MainUser) GetProfileId() int32

func (*MainUser) GetProfileInfo

func (u *MainUser) GetProfileInfo(includePresence bool) i.A

func (*MainUser) GetProfileMetadata

func (u *MainUser) GetProfileMetadata() string

func (*MainUser) GetProfileUintFlag1

func (u *MainUser) GetProfileUintFlag1() uint8

func (*MainUser) GetProfileUintFlag2 added in v1.6.0

func (u *MainUser) GetProfileUintFlag2() uint8
func (u *MainUser) GetReliclink() int32

func (*MainUser) GetStatId

func (u *MainUser) GetStatId() int32

func (*MainUser) JoinChatChannel

func (u *MainUser) JoinChatChannel(channel *MainChatChannel) i.A

func (*MainUser) LeaveChatChannel

func (u *MainUser) LeaveChatChannel(channel *MainChatChannel)

func (*MainUser) SendChatChannelMessage

func (u *MainUser) SendChatChannelMessage(channel *MainChatChannel, text string)

func (*MainUser) SetAdvertisement

func (u *MainUser) SetAdvertisement(adv *MainAdvertisement)

func (*MainUser) SetPresence

func (u *MainUser) SetPresence(value int8)

type MainUsers

type MainUsers struct {
	// contains filtered or unexported fields
}

func (*MainUsers) GetOrCreateUser

func (users *MainUsers) GetOrCreateUser(gameId string, remoteAddr string, isXbox bool, platformUserId uint64, alias string) *MainUser

func (*MainUsers) GetProfileInfo

func (users *MainUsers) GetProfileInfo(includePresence bool, matches func(user *MainUser) bool) []i.A

func (*MainUsers) GetUserById

func (users *MainUsers) GetUserById(id int32) (*MainUser, bool)

func (*MainUsers) GetUserByStatId

func (users *MainUsers) GetUserByStatId(id int32) (*MainUser, bool)

func (*MainUsers) GetUserIds

func (users *MainUsers) GetUserIds() []int32

func (*MainUsers) Initialize

func (users *MainUsers) Initialize()

type ModDll

type ModDll struct {
	// contains filtered or unexported fields
}

type Observers

type Observers struct {
	// contains filtered or unexported fields
}

type Password

type Password struct {
	// contains filtered or unexported fields
}

type Session

type Session struct {
	// contains filtered or unexported fields
}

func GetSessionById

func GetSessionById(sessionId string) (*Session, bool)

func GetSessionByUserId

func GetSessionByUserId(userId int32) (*Session, bool)

func (*Session) AddMessage

func (sess *Session) AddMessage(message internal.A)

func (*Session) Delete

func (sess *Session) Delete()

func (*Session) GetGameId

func (sess *Session) GetGameId() string

func (*Session) GetId

func (sess *Session) GetId() string

func (*Session) GetUserId

func (sess *Session) GetUserId() int32

func (*Session) ResetExpiryTimer

func (sess *Session) ResetExpiryTimer()

func (*Session) WaitForMessages

func (sess *Session) WaitForMessages(ackNum uint) (uint, []internal.A)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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