Files
90CNServer/server/pkg/protocol/game_schema_gen.go
T
hanfuit 645b64fe21 DNF90 服务端与启动器完整源码(含 GM 工具功能增强)
服务端(Go):
- GM 塞背包/带属性装备发放:在线角色推送 op14 增量物品行,背包实时刷新,无需回角色选择界面
- GM 改金币/改等级:去掉在线拒绝,落库后推送 op14 钱包/op37 等级状态,在线实时刷新
- 等级端点统一切换到新版 GMSetCharacterLevel(自带在线刷新)
- 无限/锁死疲劳模式 + 燃烧疲劳:每房间消耗 2 点、打怪与通关经验双倍
- 燃烧疲劳开关时给所有在线角色推送系统提示(op12 mode 0)
- 深渊史诗掉率:GM 全局倍率 + 城镇增益药剂窗口倍率,真实接入掉落结算

启动器(Python/JS):
- 标题栏自绘、窗口 1204x717、禁止拖拽改大小、仅最小化/关闭
- GM 工具:疲劳与燃烧、深渊史诗掉率、拍卖行上架(单一定价对齐)
- 拍卖行上架前端对齐服务端单一价格语义,修复 400 报错
2026-11-04 14:31:55 +08:00

487 lines
12 KiB
Go

package protocol
// Code generated by protogen; DO NOT EDIT.
import "google.golang.org/protobuf/encoding/protowire"
const (
MessageOnConnection = uint32(1)
MessageEnterWorld = uint32(2)
MessageAddCurrency = uint32(10001)
MessageReadMail = uint32(10002)
MessagePushCreateProfile = uint32(30141)
MessageNoticePush = uint32(30142)
)
type MessageDescriptor struct {
MsgID uint32 `json:"msg_id"`
Name string `json:"name"`
Constant string `json:"constant"`
Description string `json:"description,omitempty"`
}
var genMsgDescs = []MessageDescriptor{
{MsgID: MessageOnConnection, Name: "OnConnection", Constant: "MessageOnConnection", Description: ""},
{MsgID: MessageEnterWorld, Name: "EnterWorld", Constant: "MessageEnterWorld", Description: ""},
{MsgID: MessageAddCurrency, Name: "AddCurrency", Constant: "MessageAddCurrency", Description: ""},
{MsgID: MessageReadMail, Name: "ReadMail", Constant: "MessageReadMail", Description: ""},
{MsgID: MessagePushCreateProfile, Name: "PushCreateProfile", Constant: "MessagePushCreateProfile", Description: ""},
{MsgID: MessageNoticePush, Name: "NoticePush", Constant: "MessageNoticePush", Description: ""},
}
func MessageDescriptors() []MessageDescriptor {
return append([]MessageDescriptor(nil), genMsgDescs...)
}
func MessageName(msgID uint32) (string, bool) {
switch msgID {
case MessageOnConnection:
return "OnConnection", true
case MessageEnterWorld:
return "EnterWorld", true
case MessageAddCurrency:
return "AddCurrency", true
case MessageReadMail:
return "ReadMail", true
case MessagePushCreateProfile:
return "PushCreateProfile", true
case MessageNoticePush:
return "NoticePush", true
default:
return "", false
}
}
type CreateProfilePush struct {
}
type NoticePush struct {
NoticeID string
DeliveryID string
Title string
Body string
AttachmentRef string
CreatedAt int64
}
type EnterWorldResponse struct {
AccountID string
RoleID string
Name string
Level int
ServerTime int64
Gold int64
Diamond int64
InventoryCount int
QuestCount int
UnreadMail int
}
type AddCurrencyRequest struct {
Currency string
Delta int64
}
type AddCurrencyResponse struct {
AccountID string
Currency string
Balance int64
ServerTime int64
}
type ReadMailRequest struct {
MailID string
}
type ReadMailResponse struct {
AccountID string
MailID string
Changed bool
UnreadMail int
ServerTime int64
}
func EncodeCreateProfilePush(value CreateProfilePush) []byte {
return []byte{}
}
func EncodeNoticePush(value NoticePush) []byte {
body := make([]byte, 0, 88)
body = appendStringField(body, 1, value.NoticeID)
body = appendStringField(body, 2, value.DeliveryID)
body = appendStringField(body, 3, value.Title)
body = appendStringField(body, 4, value.Body)
body = appendStringField(body, 5, value.AttachmentRef)
body = appendInt64Varint(body, 6, value.CreatedAt)
return body
}
func EncodeEnterWorldResponse(value EnterWorldResponse) []byte {
body := make([]byte, 0, 104)
body = appendStringField(body, 1, value.AccountID)
body = appendStringField(body, 2, value.RoleID)
body = appendStringField(body, 3, value.Name)
body = appendIntVarintField(body, 4, value.Level)
body = appendInt64Varint(body, 5, value.ServerTime)
body = appendInt64Varint(body, 6, value.Gold)
body = appendInt64Varint(body, 7, value.Diamond)
body = appendIntVarintField(body, 8, value.InventoryCount)
body = appendIntVarintField(body, 9, value.QuestCount)
body = appendIntVarintField(body, 10, value.UnreadMail)
return body
}
func EncodeAddCurrencyRequest(value AddCurrencyRequest) []byte {
body := make([]byte, 0, 24)
body = appendStringField(body, 1, value.Currency)
body = appendInt64Varint(body, 2, value.Delta)
return body
}
func EncodeAddCurrencyResponse(value AddCurrencyResponse) []byte {
body := make([]byte, 0, 48)
body = appendStringField(body, 1, value.AccountID)
body = appendStringField(body, 2, value.Currency)
body = appendInt64Varint(body, 3, value.Balance)
body = appendInt64Varint(body, 4, value.ServerTime)
return body
}
func EncodeReadMailRequest(value ReadMailRequest) []byte {
body := make([]byte, 0, 16)
body = appendStringField(body, 1, value.MailID)
return body
}
func EncodeReadMailResponse(value ReadMailResponse) []byte {
body := make([]byte, 0, 56)
body = appendStringField(body, 1, value.AccountID)
body = appendStringField(body, 2, value.MailID)
body = appendBoolField(body, 3, value.Changed)
body = appendIntVarintField(body, 4, value.UnreadMail)
body = appendInt64Varint(body, 5, value.ServerTime)
return body
}
func DecodeNoticePush(body []byte) NoticePush {
var value NoticePush
for len(body) > 0 {
fieldNumber, typ, consumed := protowire.ConsumeTag(body)
if consumed < 0 {
return value
}
body = body[consumed:]
switch {
case fieldNumber == 1 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.NoticeID = fieldValue
body = body[n:]
case fieldNumber == 2 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.DeliveryID = fieldValue
body = body[n:]
case fieldNumber == 3 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.Title = fieldValue
body = body[n:]
case fieldNumber == 4 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.Body = fieldValue
body = body[n:]
case fieldNumber == 5 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.AttachmentRef = fieldValue
body = body[n:]
case fieldNumber == 6 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.CreatedAt = int64FromVarint(fieldValue)
body = body[n:]
default:
n := protowire.ConsumeFieldValue(fieldNumber, typ, body)
if n < 0 {
return value
}
body = body[n:]
}
}
return value
}
func DecodeEnterWorldResponse(body []byte) EnterWorldResponse {
var value EnterWorldResponse
for len(body) > 0 {
fieldNumber, typ, consumed := protowire.ConsumeTag(body)
if consumed < 0 {
return value
}
body = body[consumed:]
switch {
case fieldNumber == 1 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.AccountID = fieldValue
body = body[n:]
case fieldNumber == 2 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.RoleID = fieldValue
body = body[n:]
case fieldNumber == 3 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.Name = fieldValue
body = body[n:]
case fieldNumber == 4 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.Level = intFromVarint(fieldValue)
body = body[n:]
case fieldNumber == 5 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.ServerTime = int64FromVarint(fieldValue)
body = body[n:]
case fieldNumber == 6 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.Gold = int64FromVarint(fieldValue)
body = body[n:]
case fieldNumber == 7 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.Diamond = int64FromVarint(fieldValue)
body = body[n:]
case fieldNumber == 8 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.InventoryCount = intFromVarint(fieldValue)
body = body[n:]
case fieldNumber == 9 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.QuestCount = intFromVarint(fieldValue)
body = body[n:]
case fieldNumber == 10 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.UnreadMail = intFromVarint(fieldValue)
body = body[n:]
default:
n := protowire.ConsumeFieldValue(fieldNumber, typ, body)
if n < 0 {
return value
}
body = body[n:]
}
}
return value
}
func DecodeAddCurrencyRequest(body []byte) AddCurrencyRequest {
var value AddCurrencyRequest
for len(body) > 0 {
fieldNumber, typ, consumed := protowire.ConsumeTag(body)
if consumed < 0 {
return value
}
body = body[consumed:]
switch {
case fieldNumber == 1 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.Currency = fieldValue
body = body[n:]
case fieldNumber == 2 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.Delta = int64FromVarint(fieldValue)
body = body[n:]
default:
n := protowire.ConsumeFieldValue(fieldNumber, typ, body)
if n < 0 {
return value
}
body = body[n:]
}
}
return value
}
func DecodeAddCurrencyResponse(body []byte) AddCurrencyResponse {
var value AddCurrencyResponse
for len(body) > 0 {
fieldNumber, typ, consumed := protowire.ConsumeTag(body)
if consumed < 0 {
return value
}
body = body[consumed:]
switch {
case fieldNumber == 1 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.AccountID = fieldValue
body = body[n:]
case fieldNumber == 2 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.Currency = fieldValue
body = body[n:]
case fieldNumber == 3 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.Balance = int64FromVarint(fieldValue)
body = body[n:]
case fieldNumber == 4 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.ServerTime = int64FromVarint(fieldValue)
body = body[n:]
default:
n := protowire.ConsumeFieldValue(fieldNumber, typ, body)
if n < 0 {
return value
}
body = body[n:]
}
}
return value
}
func DecodeReadMailRequest(body []byte) ReadMailRequest {
var value ReadMailRequest
for len(body) > 0 {
fieldNumber, typ, consumed := protowire.ConsumeTag(body)
if consumed < 0 {
return value
}
body = body[consumed:]
switch {
case fieldNumber == 1 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.MailID = fieldValue
body = body[n:]
default:
n := protowire.ConsumeFieldValue(fieldNumber, typ, body)
if n < 0 {
return value
}
body = body[n:]
}
}
return value
}
func DecodeReadMailResponse(body []byte) ReadMailResponse {
var value ReadMailResponse
for len(body) > 0 {
fieldNumber, typ, consumed := protowire.ConsumeTag(body)
if consumed < 0 {
return value
}
body = body[consumed:]
switch {
case fieldNumber == 1 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.AccountID = fieldValue
body = body[n:]
case fieldNumber == 2 && typ == protowire.BytesType:
fieldValue, n := protowire.ConsumeString(body)
if n < 0 {
return value
}
value.MailID = fieldValue
body = body[n:]
case fieldNumber == 3 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.Changed = fieldValue != 0
body = body[n:]
case fieldNumber == 4 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.UnreadMail = intFromVarint(fieldValue)
body = body[n:]
case fieldNumber == 5 && typ == protowire.VarintType:
fieldValue, n := protowire.ConsumeVarint(body)
if n < 0 {
return value
}
value.ServerTime = int64FromVarint(fieldValue)
body = body[n:]
default:
n := protowire.ConsumeFieldValue(fieldNumber, typ, body)
if n < 0 {
return value
}
body = body[n:]
}
}
return value
}