define

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StdAuthServerPhoenixAPI = "http://127.0.0.1:8080"
	StdAuthServerAddress    = "http://127.0.0.1:8080/eulogist_api"
)
View Source
const (
	UserPasswordSlat = "YoRHa"
	DefaultPageSize  = 5
)
View Source
const (
	AuthServerAccountTypeStd uint8 = iota
	AuthServerAccountTypeCustom
)
View Source
const (
	UserPermissionSystem = iota
	UserPermissionAdmin
	UserPermissionManager
	UserPermissionNormal
	UserPermissionNone
	UserPermissionDefault = UserPermissionNormal
)
View Source
const EulogistConfigFileName = "eulogist_config.json"

Variables

View Source
var GameSavesEncryptKey *rsa.PrivateKey

Functions

func EncodeAuthServerAccount

func EncodeAuthServerAccount(account AuthServerAccount) []byte

EncodeAuthServerAccount ..

func EncodeEulogistUser

func EncodeEulogistUser(user EulogistUser) []byte

EncodeEulogistUser ..

func WriteConfig

func WriteConfig(config *LocalConfig) error

WriteConfig 将 config 指示的赞颂者配置写入到对应的配置文件。 如果给出的 config 为 nil,则相应的配置文件将被删除

Types

type AllowListConfig

type AllowListConfig struct {
	EulogistUserUniqueID     string
	DisableOpertorVerify     bool
	CanGetGameSavesKeyCipher bool
}

AllowListConfig ..

func (*AllowListConfig) Marshal

func (a *AllowListConfig) Marshal(io protocol.IO)

type AuthServerAccount

type AuthServerAccount interface {
	AuthServerAddress() string
	AuthServerSecret() string
	FormatInGame() string
	IsStdAccount() bool
	UpdateData(newData map[string]any)
}

AuthServerAccount ..

func DecodeAuthServerAccount

func DecodeAuthServerAccount(payload []byte) AuthServerAccount

DecodeAuthServerAccount ..

type CustomAuthServerAccount

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

CustomAuthServerAccount ..

func (*CustomAuthServerAccount) AuthServerAddress

func (c *CustomAuthServerAccount) AuthServerAddress() string

func (*CustomAuthServerAccount) AuthServerSecret

func (c *CustomAuthServerAccount) AuthServerSecret() string

func (*CustomAuthServerAccount) FormatInGame

func (c *CustomAuthServerAccount) FormatInGame() string

func (*CustomAuthServerAccount) InternalAccountID

func (c *CustomAuthServerAccount) InternalAccountID() uint32

func (*CustomAuthServerAccount) IsStdAccount

func (c *CustomAuthServerAccount) IsStdAccount() bool

func (*CustomAuthServerAccount) UpdateData

func (c *CustomAuthServerAccount) UpdateData(newData map[string]any)

type EulogistUser

type EulogistUser struct {
	UserUniqueID        string
	UserName            string
	UserPermissionLevel uint8

	UserPasswordSum256 []byte
	EulogistToken      string
	UnbanUnixTime      int64

	MultipleAuthServerAccounts  []AuthServerAccount
	RentalServerConfig          []RentalServerConfig
	RentalServerCanManage       []string
	InternalIncreasingAccountID uint32

	CurrentAuthServerAccount   protocol.Optional[AuthServerAccount]
	ProvidedPeAuthData         string
	DisableGlobalOpertorVerify bool
	CanAccessAnyRentalServer   bool
	CanGetGameSavesKeyCipher   bool
	CanGetHelperToken          bool
}

EulogistUser ..

func DecodeEulogistUser

func DecodeEulogistUser(payload []byte) (user EulogistUser)

EncodeEulogistUser ..

type LocalConfig

type LocalConfig struct {
	EulogistToken    string             `json:"eulogist_token"`
	LastServerConfig RentalServerConfig `json:"last_server_config"`
}

LocalConfig 是赞颂者本地储存的配置数据

func DefaultLocalConfig

func DefaultLocalConfig() *LocalConfig

DefaultLocalConfig 创建并返回一个非 nil 的默认赞颂者配置

func ReadConfig

func ReadConfig() (config *LocalConfig, err error)

ReadConfig 从赞颂者配置文件阅读对应的配置。 如果配置文件不存在,则返回的 config 为 nil

type RentalServerConfig

type RentalServerConfig struct {
	ServerNumber   string `json:"server_number"`
	ServerPassCode string `json:"server_passcode"`
}

func (*RentalServerConfig) Marshal

func (r *RentalServerConfig) Marshal(io protocol.IO)

type StdAuthServerAccount

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

StdAuthServerAccount ..

func (*StdAuthServerAccount) AuthServerAddress

func (s *StdAuthServerAccount) AuthServerAddress() string

func (*StdAuthServerAccount) AuthServerSecret

func (s *StdAuthServerAccount) AuthServerSecret() string

func (*StdAuthServerAccount) FormatInGame

func (s *StdAuthServerAccount) FormatInGame() string

func (*StdAuthServerAccount) G79UserUID

func (s *StdAuthServerAccount) G79UserUID() string

func (*StdAuthServerAccount) IsStdAccount

func (s *StdAuthServerAccount) IsStdAccount() bool

func (*StdAuthServerAccount) UpdateData

func (s *StdAuthServerAccount) UpdateData(newData map[string]any)

Jump to

Keyboard shortcuts

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