samba/proto/other.go
2025-06-04 09:51:39 +08:00

183 lines
4.5 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package proto
// Other 服务器处理/发送的请求
//--- Server Server功能部分 ---
const (
// ReqModifyTimeOffsetId 请求修改系统时间偏移量
ReqModifyTimeOffsetId = "ReqModifyTimeOffset"
// RspModifyTimeOffsetId 响应修改系统时间偏移量
RspModifyTimeOffsetId = "RspModifyTimeOffset"
)
type ReqModifyTimeOffset struct {
// 系统时间偏移量
Offset int64 `json:"o"`
}
type RspModifyTimeOffset struct {
// 错误码
Code ErrorCode `json:"c"`
// 设置结果key为服务名称
Ts map[string]TimeResult `json:"t"`
}
type TimeResult struct {
// 服务器返回修改前时间字符串
TimeBeforeStr string `json:"tb"`
// 服务器返回修改后时间字符串
TimeAfterStr string `json:"ta"`
}
//--- Server Server功能部分 ---
// --- Code 兑换码功能部分 ---
const (
// ReqGenerateCodeId 请求生成兑换码
ReqGenerateCodeId = "ReqGenerateCodeId"
// RspGenerateCodeId 响应生成的兑换码
RspGenerateCodeId = "RspGenerateCodeId"
// ReqUseCodeId 使用兑换码
ReqUseCodeId = "ReqUseCodeId"
// RspUseCodeId 响应使用兑换码
RspUseCodeId = "RspUseCodeId"
// ReqCodeUseQueryId 请求查询兑换码使用情况
ReqCodeUseQueryId = "ReqCodeUseQueryId"
// RspCodeUseQueryId 响应查询兑换码使用情况
RspCodeUseQueryId = "RspCodeUseQueryId"
// ReqCodeUsePlayerQueryId 请求查询兑换码使用玩家信息
ReqCodeUsePlayerQueryId = "ReqCodeUsePlayerQueryId"
// RspCodeUsePlayerQueryId 响应查询兑换码使用玩家信息
RspCodeUsePlayerQueryId = "RspCodeUsePlayerQueryId"
)
// ReqGenerateCode 请求生成兑换码
type ReqGenerateCode struct {
// 兑换码本身
Code string `json:"c" `
// 生效时间
StartTime int64 `json:"st" `
// 截止时间
EndTime int64 `json:"et" `
// 可兑换次数
Count int `json:"co"`
// 兑换物品map,key为idvalue为数量
Item map[int]int `json:"i" `
// 兑换规则
Rule Rule `json:"r" `
}
// Rule 兑换规则
type Rule struct {
// 用户注册开始时间
UserRegStartTime int64 `json:"urs"`
// 用户注册结束时间
UserRegEndTime int64 `json:"ure"`
// 用户最后登录时间
UserLastOnlineTime int64 `json:"ulo"`
// 最低Vip等级
MinVip int `json:"mv"`
// 最低用户等级
MinLevel int `json:"ml"`
// 最低支付金额
MinPay float64 `json:"mp"`
}
// RspGenerateCode 响应生成的兑换码
type RspGenerateCode struct {
// 错误码
Code ErrorCode `json:"c"`
// 错误信息
Msg string `json:"m"`
}
// ReqUseCode 使用兑换码
type ReqUseCode struct {
Code string `json:"c"`
}
// RspUseCode 响应使用兑换码
type RspUseCode struct {
// 错误码
Code ErrorCode `json:"c"`
}
// ReqCodeUseQuery 请求查询兑换码
type ReqCodeUseQuery struct {
// 分页查询的limit
Limit int `json:"l"`
// 分页查询的offset
Offset int `json:"o"`
}
// RspCodeUseQuery 响应查询兑换码
type RspCodeUseQuery struct {
// 错误码
Code ErrorCode `json:"c"`
// 错误信息
Msg string `json:"m"`
// 兑换码使用情况
CodeUse []CodeUse `json:"cu"`
// 结果总数
Count int64 `json:"co"`
}
// CodeUse 兑换码详情
type CodeUse struct {
// 兑换码
Code string `json:"c"`
// 兑换物品map,key为idvalue为数量
Item map[int]int `json:"i"`
// 兑换码允许使用的次数(0为无限)
Count int `json:"co"`
// 兑换码已使用次数
UsedCount int `json:"u"`
// 兑换码状态(1 未发布 2 已发布 3 已过期)
Status int `json:"s"`
// 生效时间段(年月日 - 年月日)
ValidDuration string `json:"vd"`
// 兑换码创建时间
CreateTime int64 `json:"ct"`
}
// ReqCodeUsePlayerQuery 请求查询兑换码使用玩家信息
type ReqCodeUsePlayerQuery struct {
// 对应的兑换码
Code string `json:"c"`
// 分页查询的limit
Limit int `json:"l"`
// 分页查询的offset
Offset int `json:"o"`
}
// RspCodeUsePlayerQuery 响应查询兑换码使用玩家信息
type RspCodeUsePlayerQuery struct {
// 错误码
Code ErrorCode `json:"c"`
// 错误信息
Msg string `json:"m"`
// 兑换码玩家使用情况
CodeUsePlayer []CodeUsePlayer `json:"cu"`
// 结果总数
Count int64 `json:"co"`
}
// CodeUsePlayer 兑换码使用玩家详情
type CodeUsePlayer struct {
// 兑换码
Code string `json:"c"`
// 兑换物品map,key为idvalue为数量
Item map[int]int `json:"i"`
// 兑换码使用玩家id
Uid int64 `json:"u"`
// 玩家昵称
MNick string `json:"mn"`
// 玩家注册时间
MTime int64 `json:"mt"`
// 使用时间
UseTime int64 `json:"ut"`
// 注册渠道
Api int `json:"a"`
}
// --- Code 兑换码功能部分 ---