function

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: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ActionTypeAddStdEmailHelper uint8 = iota
	ActionTypeAddCustomHelper
)
View Source
const (
	ActionTypeOpenNewTransaction uint8 = iota // Open new transaction
	ActionTypeReLogin                         // Need verify -> Pass verify -> Relogin
	ActionTypeFinishLogin                     // Get SMS Code -> Finish login
)
View Source
const (
	ResponseTypeClientNeedSendSMS    uint8 = iota // User need send SMS to NetEase
	ResponseTypeClientNeedReceiveSMS              // User need receive SMS from NetEase
	ResponseTypeLoginSuccess                      // SMS Login success
	ResponseTypeMeetError                         // SMS Login meet error
)
View Source
const (
	ActionTypeEditManageServer uint8 = iota
	ActionTypeRemoveManageServer
	ActionTypeRequestServerList
)
View Source
const (
	ActionTypeEditRentalServer uint8 = iota
	ActionTypeRemoveRentalServer
)
View Source
const (
	RequestTypeGetUserInfoNormal uint8 = iota
	RequestTypeGetUserInfoAdmin
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowListDeleteRequest

type AllowListDeleteRequest struct {
	Token              string `json:"token,omitempty"`
	RentalServerNumber string `json:"rental_server_number,omitempty"`
	EulogistUserName   string `json:"eulogist_user_name,omitempty"`
}

AllowListDeleteRequest ..

type AllowListDeleteResponse

type AllowListDeleteResponse struct {
	ErrorInfo string `json:"error_info"`
	Success   bool   `json:"success"`
}

AllowListDeleteResponse ..

type AllowListGetRequest

type AllowListGetRequest struct {
	Token              string `json:"token,omitempty"`
	RentalServerNumber string `json:"rental_server_number,omitempty"`
}

AllowListGetRequest ..

type AllowListGetResponse

type AllowListGetResponse struct {
	ErrorInfo                string   `json:"error_info"`
	Success                  bool     `json:"success"`
	UserNames                []string `json:"user_names"`
	DisableOpertorVerify     []bool   `json:"disbale_operator_verify"`
	CanGetGameSavesKeyCipher []bool   `json:"can_get_game_saves_key_cipher"`
}

AllowListGetResponse ..

type AllowListUpdateRequest

type AllowListUpdateRequest struct {
	Token                    string `json:"token,omitempty"`
	RentalServerNumber       string `json:"rental_server_number,omitempty"`
	EulogistUserName         string `json:"eulogist_user_name,omitempty"`
	DisableOpertorVerify     bool   `json:"disbale_operator_verify"`
	CanGetGameSavesKeyCipher bool   `json:"can_get_game_saves_key_cipher"`
}

AllowListUpdateRequest ..

type AllowListUpdateResponse

type AllowListUpdateResponse struct {
	ErrorInfo string `json:"error_info"`
	Success   bool   `json:"success"`
}

UserSearchResponse ..

type ChangeMainConfigRequest

type ChangeMainConfigRequest struct {
	Token            string `json:"token,omitempty"`
	EulogistUserName string `json:"eulogist_user_name,omitempty"`
	NewUserData      []byte `json:"new_user_data"`
}

ChangeMainConfigRequest ..

type ChangeMainConfigResponse

type ChangeMainConfigResponse struct {
	ErrorInfo string `json:"error_info"`
	Success   bool   `json:"success"`
}

ChangeMainConfigResponse ..

type CustomHelperModifyRequest

type CustomHelperModifyRequest struct {
	Token             string `json:"token,omitempty"`
	Index             uint   `json:"index"`
	AuthServerAddress string `json:"auth_server_address"`
	AuthServerToken   string `json:"auth_server_token"`
}

CustomHelperModifyRequest ..

type CustomHelperModifyResponse

type CustomHelperModifyResponse struct {
	ErrorInfo string `json:"error_info"`
	Success   bool   `json:"success"`
}

CustomHelperModifyResponse ..

type DevTokenAsk

type DevTokenAsk struct {
	Token          string `json:"token,omitempty"`
	HelperUniqueID string `json:"helper_unique_id,omitempty"`
}

DevTokenAsk ..

type DevTokenResp

type DevTokenResp struct {
	ErrorInfo string `json:"error_info"`
	Success   bool   `json:"success"`
	Token     string `json:"token"`
}

DevTokenResp ..

type Function

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

Function 是基于 server.Interact 实现的赞颂者功能

func NewFunction

func NewFunction(interact *server.Interact) (result *Function, err error)

NewFunction 根据 interact 创建并返回一个新的 Function

func (*Function) AddNewHelper

func (f *Function) AddNewHelper() error

AddNewHelper 为客户端打开添加验证服务账户的表单

func (*Function) AddNewRentalServerConfig

func (f *Function) AddNewRentalServerConfig() error

AddNewRentalServerConfig ..

func (*Function) AdminChangeMainConfig

func (f *Function) AdminChangeMainConfig(eulogistUserName string) error

AdminChangeMainConfig ..

func (*Function) AdminChangeManager

func (f *Function) AdminChangeManager(eulogistUserName string) error

AdminChangeManager ..

func (*Function) BeforePlayPrepare

func (f *Function) BeforePlayPrepare(rentalServerNumber string) (aesCipher []byte, err error)

BeforePlayPrepare ..

func (*Function) ChangeCurrentHelper

func (f *Function) ChangeCurrentHelper() error

ChangeCurrentHelper 向用户展示其已有的所有 MC 账户, 以供用户切换当前正在使用的 MC 账户

func (*Function) DeleteHelper

func (f *Function) DeleteHelper() error

DeleteHelper 打开表单以使用户其已有的删除 MC 账户

func (*Function) DevAskToken

func (f *Function) DevAskToken() error

DevAskToken ..

func (*Function) EulogistConfig

func (f *Function) EulogistConfig() *define.LocalConfig

EulogistConfig 返回赞颂者配置文件

func (*Function) EulogistUserData

func (f *Function) EulogistUserData() *define.EulogistUser

EulogistUserData 返回赞颂者用户数据

func (*Function) GetGameSavesKey

func (f *Function) GetGameSavesKey() error

GetGameSavesKey ..

func (*Function) Interact

func (f *Function) Interact() *server.Interact

Interact 返回表单交互实现

func (*Function) ListServerCanManage

func (f *Function) ListServerCanManage() (rentalServerNumber string, isUserCancel bool, err error)

ListServerCanManage ..

func (*Function) MessageChannel

func (f *Function) MessageChannel() *MessageChannel

MessageChannel 返回 *MessageChannel

func (*Function) ModifyCustomHelper

func (f *Function) ModifyCustomHelper() error

ModifyCustomHelper 向用户打开表单, 用于修改已添加的第三方验证服务账户

func (*Function) ModifyRentalServerConfig

func (f *Function) ModifyRentalServerConfig() error

func (*Function) RegisterOrLogin

func (f *Function) RegisterOrLogin() (exitGame bool, err error)

RegisterOrLogin 使用户注册或登录赞颂者账户。 exitGame 指示用户是否希望关闭赞颂者并退出假 MC 服务器

func (*Function) RemoveRentalServerConfig

func (f *Function) RemoveRentalServerConfig() error

RemoveRentalServerConfig ..

func (*Function) RentalServerManage

func (f *Function) RentalServerManage(
	afterSelectRentalServer func(rentalServerNumber string) error,
) (isUserCancel bool, err error)

RentalServerManage ..

func (*Function) RentalServerManageAddNew

func (f *Function) RentalServerManageAddNew(rentalServerNumber string) error

RentalServerManageAddNew ..

func (*Function) RentalServerManageDelete

func (f *Function) RentalServerManageDelete(rentalServerNumber string) error

RentalServerManageDelete ..

func (*Function) RentalServerManageModify

func (f *Function) RentalServerManageModify(rentalServerNumber string) error

RentalServerManageModify ..

func (*Function) RequestUserInfo

func (f *Function) RequestUserInfo(isReGet bool) error

RequestUserInfo 请求用户的赞颂者账户数据。 如果 isReGet 为假且之前已经成功得到了数据, 则不进行任何操作

func (*Function) SelectRentalServerAndStartPlay

func (f *Function) SelectRentalServerAndStartPlay() (
	backedMessage *MessageFromBacked,
	err error,
)

SelectRentalServerAndStartPlay ..

func (*Function) SetPEAuth

func (f *Function) SetPEAuth() error

SetPEAuth 打开表单以使用户设置其所使用的 PE Auth

func (*Function) ShowAuthServerError

func (f *Function) ShowAuthServerError(
	neteaseRequireVerify bool,
	verifyURl string,
	errorInfo string,
) (isUserCancel bool, err error)

ShowAuthServerError 以表单的形式显示验证服务的错误回应。 neteaseRequireVerify 指示是否是因为操作 MC 账号时触发网易验证, verifyURl 则是验证所用的链接。errorInfo 指示验证服务返回的错误信息

func (*Function) ShowEulogistSearch

func (f *Function) ShowEulogistSearch() (eulogistUserName string, isUserCancel bool, err error)

ShowEulogistSearch ..

func (*Function) ShowHelperDetails

func (f *Function) ShowHelperDetails() error

ShowHelperDetails 向客户端展示其当前正在使用的 MC 账户的信息。 即便该用户当前没有正在使用的 MC 账号,调用 ShowHelperDetails 也是安全的

func (*Function) StartPlayByLastConfig

func (f *Function) StartPlayByLastConfig() (
	backedMessage *MessageFromBacked,
	err error,
)

StartPlayByLastConfig ..

type GameSavesKeyRequest

type GameSavesKeyRequest struct {
	Token              string `json:"token,omitempty"`
	RentalServerNumber string `json:"rental_server_number,omitempty"`
}

GameSavesKeyRequest ..

type GameSavesKeyResponse

type GameSavesKeyResponse struct {
	ErrorInfo string `json:"error_info"`
	Success   bool   `json:"success"`
	AESCipher []byte `json:"encrypted_aes_cipher"`
}

GameSavesKeyResponse ..

type HelperAddRequest

type HelperAddRequest struct {
	Token      string `json:"token,omitempty"`
	ActionType uint8  `json:"action_type"`

	TransactionUUID string `json:"transaction_uuid,omitempty"`
	Email           string `json:"email,omitempty"`
	MD5Password     string `json:"md5_password,omitempty"`

	AuthServerAddress string `json:"auth_server_address,omitempty"`
	AuthServerToken   string `json:"auth_server_token,omitempty"`
}

HelperAddRequest ..

type HelperAddResponse

type HelperAddResponse struct {
	ErrorInfo            string `json:"error_info"`
	NetEaseRequireVerify bool   `json:"netease_require_verify"`
	VerifyURL            string `json:"verify_url"`
	Success              bool   `json:"success"`
	HelperUniqueID       string `json:"helper_unique_id"`
	GameNickName         string `json:"game_nick_name"`
	G79UserUID           string `json:"g79_user_uid"`
}

HelperAddResponse ..

type HelperChangeRequest

type HelperChangeRequest struct {
	Token string `json:"token,omitempty"`
	Index uint   `json:"index"`
}

HelperChangeRequest ..

type HelperChangeResponse

type HelperChangeResponse struct {
	ErrorInfo            string `json:"error_info"`
	NetEaseRequireVerify bool   `json:"netease_require_verify"`
	VerifyURL            string `json:"verify_url"`
	Success              bool   `json:"success"`
	GameNickName         string `json:"game_nick_name"`
	G79UserUID           string `json:"g79_user_uid"`
}

HelperChangeResponse ..

type HelperDeleteRequest

type HelperDeleteRequest struct {
	Token string `json:"token,omitempty"`
	Index uint   `json:"index"`
}

HelperAddRequest ..

type HelperDeleteResponse

type HelperDeleteResponse struct {
	ErrorInfo string `json:"error_info"`
	Success   bool   `json:"success"`
}

HelperAddResponse ..

type HelperInfoRequest

type HelperInfoRequest struct {
	Token string `json:"token,omitempty"`
}

HelperInfoRequest ..

type HelperInfoResponse

type HelperInfoResponse struct {
	ErrorInfo            string `json:"error_info"`
	NetEaseRequireVerify bool   `json:"netease_require_verify"`
	VerifyURL            string `json:"verify_url"`
	Success              bool   `json:"success"`
	GameNickName         string `json:"game_nick_name"`
	G79UserUID           string `json:"g79_user_uid"`
}

UserInfoResponse ..

type LoginRequest

type LoginRequest struct {
	IsRegister         bool   `json:"is_register"`
	UserName           string `json:"user_name,omitempty"`
	UserPasswordSum256 []byte `json:"user_password_sum256,omitempty"`
}

LoginRequest ..

type LoginResponse

type LoginResponse struct {
	ErrorInfo     string `json:"error_info"`
	Success       bool   `json:"success"`
	EulogistToken string `json:"eulogist_token"`
}

LoginResponse ..

type ManagerChangeRequest

type ManagerChangeRequest struct {
	Token            string `json:"token,omitempty"`
	ActionType       uint8  `json:"action_type"`
	EulogistUserName string `json:"eulogist_user_name,omitempty"`
	ServerNumber     string `json:"server_number,omitempty"`
}

ManagerChangeRequest ..

type ManagerChangeResponse

type ManagerChangeResponse struct {
	ErrorInfo       string   `json:"error_info"`
	Success         bool     `json:"success"`
	ServerCanManage []string `json:"server_can_manage"`
}

ManagerChangeResponse ..

type MessageChannel

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

MessageChannel ..

func NewMessageChannel

func NewMessageChannel() *MessageChannel

NewMessageChannel ..

func (*MessageChannel) BackedMessageChannel

func (m *MessageChannel) BackedMessageChannel() <-chan MessageFromBacked

ReceiveBackedMessage ..

func (*MessageChannel) FrontedMessageChannel

func (m *MessageChannel) FrontedMessageChannel() <-chan MessageFromFronted

ReceiveFrontedMessage ..

func (*MessageChannel) NotifyToBacked

func (m *MessageChannel) NotifyToBacked(message MessageFromFronted)

NotifyToBacked ..

func (*MessageChannel) NotifyToFronted

func (m *MessageChannel) NotifyToFronted(message MessageFromBacked)

NotifyToFronted ..

type MessageFromBacked

type MessageFromBacked struct {
	CanTerminate         bool
	LoginServerMeetError bool
	LoginServrErrorInfo  string
	TransferAddress      string
	TransferPort         uint16
}

MessageFromBacked ..

type MessageFromFronted

type MessageFromFronted struct {
	RentalServerNumber   string
	RentalServerPasscode string
	AuthServerAddress    string
	AuthServerToken      string
	ProvidedPeAuthData   string
	EulogistUniqueID     string
	GameSavesAESCipher   []byte
}

MessageFromFronted ..

type PEAuthSetRequest

type PEAuthSetRequest struct {
	Token  string `json:"token,omitempty"`
	PEAuth string `json:"pe_auth,omitempty"`
}

PEAuthSetRequest ..

type PEAuthSetResponse

type PEAuthSetResponse struct {
	ErrorInfo string `json:"error_info"`
	Success   bool   `json:"success"`
}

PEAuthSetResponse ..

type RentalServerListRequest

type RentalServerListRequest struct {
	Token          string `json:"token,omitempty"`
	ActionType     uint8  `json:"action_type"`
	ServerNumber   string `json:"server_number,omitempty"`
	ServerPassCode string `json:"server_passcode,omitempty"`
}

RentalServerListRequest ..

type RentalServerListResponse

type RentalServerListResponse struct {
	ErrorInfo string `json:"error_info"`
	Success   bool   `json:"success"`
}

RentalServerListResponse ..

type SMSHelperAddRequest

type SMSHelperAddRequest struct {
	Token           string `json:"token,omitempty"`
	TransactionUUID string `json:"transaction_uuid"`
	ActionType      uint8  `json:"action_type"`
	Mobile          string `json:"mobile,omitempty"`
	SMSVerifyCode   string `json:"sms_verify_code,omitempty"`
}

SMSHelperAddRequest ..

type SMSHelperAddResponse

type SMSHelperAddResponse struct {
	ErrorInfo      string `json:"error_info"`
	ResponseType   uint8  `json:"response_type"`
	VerifyURL      string `json:"verify_url"`
	HelperUniqueID string `json:"helper_unique_id"`
	GameNickName   string `json:"game_nick_name"`
	G79UserUID     string `json:"g79_user_uid"`
}

SMSHelperAddResponse ..

type UserInfoRequest

type UserInfoRequest struct {
	Token            string `json:"token,omitempty"`
	RequestType      uint8  `json:"request_type"`
	EulogistUserName string `json:"eulogist_user_name,omitempty"`
}

UserInfoRequest ..

type UserInfoResponse

type UserInfoResponse struct {
	ErrorInfo string `json:"error_info"`
	Success   bool   `json:"success"`
	Payload   []byte `json:"payload"`
}

UserInfoResponse ..

type UserSearchRequest

type UserSearchRequest struct {
	Token        string `json:"token,omitempty"`
	FilterString string `json:"filter_string,omitempty"`
}

UserSearchRequest ..

type UserSearchResponse

type UserSearchResponse struct {
	ErrorInfo   string   `json:"error_info"`
	Success     bool     `json:"success"`
	HitUserName []string `json:"hit_user_name"`
}

UserSearchResponse ..

Jump to

Keyboard shortcuts

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