feat: 添加游戏模式:指挥官-莽!

main
NorthLan 2 years ago
parent 38956fbc72
commit 1b06af241c

@ -1,33 +1,33 @@
Server:
Debug: false
Listen: 0.0.0.0:22222
Listen: 0.0.0.0:8888
UserCenterRpc:
Etcd:
Hosts:
- 127.0.0.1:2379
Key: usercenter.rpc.dev
Key: usercenter.rpc
NonBlock: true
Kafka:
Danmaku:
Addr: [ "127.0.0.1:9093" ]
Topic: "danmaku-dev"
ConsumerGroup: "msgToPush-dev"
Topic: "danmaku"
ConsumerGroup: "msgToPush"
Gift:
Addr: [ "127.0.0.1:9093" ]
Topic: "gift-dev"
ConsumerGroup: "giftToPush-dev"
Topic: "gift"
ConsumerGroup: "giftToPush"
GuardBuy:
Addr: [ "127.0.0.1:9093" ]
Topic: "guardBuy-dev"
ConsumerGroup: "guardBuyConsumerG-dev"
Topic: "guardBuy"
ConsumerGroup: "guardBuyConsumerG"
RewardPool:
Addr: [ "127.0.0.1:9093" ]
Topic: "rewardPool-dev"
ConsumerGroup: "rewardPoolConsumerG-dev"
Topic: "rewardPool"
ConsumerGroup: "rewardPoolConsumerG"
UserCoin:
Addr: [ "127.0.0.1:9093" ]
Topic: "notify-user-coin-dev"
ConsumerGroup: "notifyUserCoinConsumerG-dev"
Topic: "notify-user-coin"
ConsumerGroup: "notifyUserCoinConsumerG"
Game:
# 30213831837876229 地球
AdminUserId: [30096265903603717, 30213831837876229]
@ -40,16 +40,18 @@ Game:
GameType: ZHGWW2
- ID: 4
GameType: TEST
- ID: 5
GameType: ZHGMang
Zhg:
# 1元=10 Coin (1元40个步兵)
CoinFoodRatio: 4
OutbreakCount: 3
OutbreakMaxCount: 30 # 3x10=30
OutbreakMaxCount: 30 # 5*4=20字符 4x10=40 (最多40兵)
OutbreakBaseCost: 5
OutbreakCostDict:
1: 1 # 步兵
2: 2.333 # 骑兵
3: 1.333 # 弓箭手
2: 2.34 # 骑兵
3: 1.34 # 弓箭手
4: 1 # 法师
Zhghz:
Zhgfb:
@ -114,23 +116,31 @@ Game:
GiftEffect:
# 辣条
Free: [ 1 ]
# 牛哇牛哇
RestoreHealth: [ 31039, 31477, 31225, 31214, 31202 ]
# 打call
RestoreHealth: [31485, 31641, 31212, 31037, 31278 ]
SupportSkill: [ ]
# 告白气球,这个好诶
Paratroops: [ 31702, 31639, 30758, 30971, 31213, 31478 ]
# 打call
Reborn: [ 31485, 31641, 31212, 31037, 31278 ]
# 小花花
Overtime: [ 31036, 31476 ]
Reborn: [ 31036, 31476 ]
# 牛哇牛哇
Overtime: [ 31039, 31477, 31225, 31214, 31202 ]
# 粉丝团灯牌
Commander: [ 31164,31738 ]
# 盛典门票
Tank: [ 30727 ]
Tank: [ 30727, 32051, 32057 ]
TankRatio: 0.1
TankMulThreshold: 40000
TankMulRatio: 0.2
OvertimeRatio: 6
Zhgmang:
GiftEffect:
# 辣条
Free: [ 1 ]
# 清屏 心动盲盒
ClearScreen: [32124]
# 随机加成 粉丝团灯牌
RandomAddon: [31164,31738]
Log:
Console:
Level: debug

@ -6,6 +6,7 @@ UserCenterRpc:
Hosts:
- 127.0.0.1:2379
Key: usercenter.rpc
NonBlock: true
Kafka:
Danmaku:
Addr: [ "127.0.0.1:9093" ]
@ -30,16 +31,28 @@ Kafka:
Game:
# 30213831837876229 地球
AdminUserId: [30096265903603717, 30213831837876229]
DefaultRooms:
- ID: 1
GameType: ZHG
- ID: 2
GameType: ZHGZD
- ID: 3
GameType: ZHGWW2
- ID: 4
GameType: TEST
- ID: 5
GameType: ZHGMang
Zhg:
# 1元=10 Coin (1元40个步兵)
CoinFoodRatio: 4
OutbreakCount: 3
OutbreakMaxCount: 30 # 5*4=20字符 4x10=40 (最多40兵)
OutbreakBaseCost: 5
OutbreakCostDict:
1: 3 # 步兵
2: 7 # 骑兵
3: 4 # 弓箭手
4: 3 # 法师
1: 1 # 步兵
2: 2.34 # 骑兵
3: 1.34 # 弓箭手
4: 1 # 法师
Zhghz:
Zhgfb:
Zhgzd:
@ -99,6 +112,35 @@ Game:
SuperSkill:
# 干杯 超级技能
GiftIds: [30606, 31049, 31251, 31116]
Zhgww2:
GiftEffect:
# 辣条
Free: [ 1 ]
# 打call
RestoreHealth: [31485, 31641, 31212, 31037, 31278 ]
SupportSkill: [ ]
# 告白气球,这个好诶
Paratroops: [ 31702, 31639, 30758, 30971, 31213, 31478 ]
# 小花花
Reborn: [ 31036, 31476 ]
# 牛哇牛哇
Overtime: [ 31039, 31477, 31225, 31214, 31202 ]
# 粉丝团灯牌
Commander: [ 31164,31738 ]
# 盛典门票
Tank: [ 30727, 32051, 32057 ]
TankRatio: 0.1
TankMulThreshold: 40000
TankMulRatio: 0.2
OvertimeRatio: 6
Zhgmang:
GiftEffect:
# 辣条
Free: [ 1 ]
# 清屏 心动盲盒
ClearScreen: [32124]
# 随机加成 粉丝团灯牌
RandomAddon: [31164,31738]
Log:
Console:
Level: info

@ -44,6 +44,7 @@ type (
}
Zhgzd Zhgzd // Zhgzd 指挥官-阵地
Zhgww2 Zhgww2 // Zhgww2 指挥官-二战
Zhgmang Zhgmang // Zhgmang 指挥官-莽
}
// RPC

@ -0,0 +1,40 @@
package config
// Zhgmang 指挥官-莽
type (
Zhgmang struct {
GiftEffect struct {
Free []int64 // 免费礼物
ClearScreen []int64 // 清屏礼物
RandomAddon []int64 // 随机加成礼物
}
}
ZhgmangGiftType int32
)
const (
ZhgmangGiftUnknown ZhgmangGiftType = iota
ZhgmangGiftFree
ZhgmangGiftClearScreen
ZhgmangGiftRandomAddon
)
func (z Zhgmang) ParseGiftType(id int64) ZhgmangGiftType {
if z.isContains(id, z.GiftEffect.Free) {
return ZhgmangGiftFree
} else if z.isContains(id, z.GiftEffect.ClearScreen) {
return ZhgmangGiftClearScreen
} else if z.isContains(id, z.GiftEffect.RandomAddon) {
return ZhgmangGiftRandomAddon
}
return ZhgmangGiftUnknown
}
func (z Zhgmang) isContains(id int64, arr []int64) bool {
for _, s := range arr {
if s == id {
return true
}
}
return false
}

@ -66,6 +66,17 @@ func InitLiveManager(svcCtx *svc.ServiceContext) {
zhgww2Logic.WithGiftHandler(),
)
LiveManager.registerLogic(NewLiveGameLogic(opts...))
opts = opts[:1]
zhgmang := NewZhgmangLiveGameLogic(svcCtx)
opts = append(opts, WithGiftHandler(commonLogic.GiftHandler()))
opts = append(opts,
zhgmang.WithGameType(),
zhgmang.WithCmdHandlers(),
zhgmang.WithCmdParserLogic(commonLogic.CmdParserPatterns()),
zhgmang.WithGiftHandler(),
)
LiveManager.registerLogic(NewLiveGameLogic(opts...))
}
func (m *Manager) registerLogic(h LiveLogic) {

@ -0,0 +1,278 @@
package live_logic
import (
"dcg/app/user_center/usercenter"
"dcg/config"
"dcg/game/manager"
"dcg/game/pb"
pbCommon "dcg/game/pb/common"
pbGameZhgMang "dcg/game/pb/game/zhgmang"
pbMq "dcg/game/pb/mq"
pbRoom "dcg/game/pb/room"
"dcg/game/svc"
"dcg/pkg/cmd"
"git.noahlan.cn/northlan/ntools-go/logger"
"strconv"
"strings"
)
type ZhgmangGameLogic struct {
svcCtx *svc.ServiceContext
}
func NewZhgmangLiveGameLogic(svcCtx *svc.ServiceContext) *ZhgmangGameLogic {
return &ZhgmangGameLogic{
svcCtx: svcCtx,
}
}
func (h *ZhgmangGameLogic) WithGameType() LogicOption {
return WithGameType(pbRoom.GameType_name[int32(pbRoom.GameType_ZHGMang)])
}
func (h *ZhgmangGameLogic) WithCmdParserLogic(p []cmd.Pattern) LogicOption {
pattern := []cmd.Pattern{
{
Prefix: "j",
Alias: []string{"加入", "加入游戏"},
ContentMaxLen: 1,
}, {
Prefix: "c",
Alias: []string{"抽卡"},
ContentMaxLen: 1,
}, {
Prefix: "w",
Alias: []string{"我在哪"},
ContentMaxLen: 0,
}, {
Prefix: "g",
Alias: []string{"苟"},
ContentMaxLen: 0,
}, {
Prefix: "m",
Alias: []string{"莽"},
ContentMaxLen: 0,
}, {
Prefix: "l",
Alias: []string{"升级"},
ContentMaxLen: 0,
}, {
Prefix: "n",
ContentMaxLen: 8,
},
}
pattern = append(pattern, p...)
cmdParser := cmd.NewCMDParser(pattern...)
cmdParser.SetDistinct(false)
return WithCmdParser(cmdParser)
}
func (h *ZhgmangGameLogic) WithCmdHandlers() LogicOption {
return func(logic LiveLogic) {
logic.RegisterCMDHandler(h.handleJoinGame, "j")
logic.RegisterCMDHandler(h.handleAddUnit, "c")
logic.RegisterCMDHandler(h.handleWai, "w")
logic.RegisterCMDHandler(h.handleLevelUp, "l")
logic.RegisterCMDHandler(h.handleMockGift, "n")
}
}
func (h *ZhgmangGameLogic) WithGiftHandler() LogicOption {
return WithGiftHandler(func(next GiftHandlerFunc) GiftHandlerFunc {
return func(liveRoom *LiveRoom, user *pbCommon.PbUser, gift *pbMq.MqGift) {
h.handleGift(liveRoom, user, gift)
next(liveRoom, user, gift)
}
})
}
func (h *ZhgmangGameLogic) handleJoinGame(liveRoom *LiveRoom, _ string, _ []rune, user *pbCommon.PbUser) {
room, err := manager.GameManager.RoomByLiveRoom(liveRoom.RoomId, liveRoom.Platform)
if err != nil {
return
}
details, err := h.svcCtx.UserCenterRpc.GetUserDetails(h.svcCtx.Ctx, &usercenter.UserIdReq{
UserId: user.UserId,
})
if err != nil {
return
}
resp := &pbGameZhgMang.JoinGame{
User: user,
NobilityLevel: details.NobilityLevel,
}
logger.SLog.Debugf("用户 [%s] 加入游戏", user.Username)
room.Broadcast(pb.PushZhgmangJoinGame, resp)
}
func (h *ZhgmangGameLogic) handleAddUnit(liveRoom *LiveRoom, _ string, content []rune, user *pbCommon.PbUser) {
room, err := manager.GameManager.RoomByLiveRoom(liveRoom.RoomId, liveRoom.Platform)
if err != nil {
return
}
if len(content) < 1 {
return
}
var card int32
if len(content) > 0 {
t, err := strconv.ParseInt(string(content[0]), 10, 32)
if err == nil {
card = int32(t)
}
}
if card > 5 {
return
}
logger.SLog.Debugf("用户 [%s] 抽卡 [%d]", user.Username, card)
room.Broadcast(pb.PushZhgmangAddUnit, &pbGameZhgMang.AddUnit{
User: user,
Card: card,
})
}
func (h *ZhgmangGameLogic) handleWai(liveRoom *LiveRoom, _ string, _ []rune, user *pbCommon.PbUser) {
room, err := manager.GameManager.RoomByLiveRoom(liveRoom.RoomId, liveRoom.Platform)
if err != nil {
return
}
logger.SLog.Debugf("用户 [%s] 我在哪", user.Username)
room.Broadcast(pb.PushZhgmangWai, &pbGameZhgMang.Wai{User: user})
}
func (h *ZhgmangGameLogic) handleLevelUp(liveRoom *LiveRoom, _ string, _ []rune, user *pbCommon.PbUser) {
room, err := manager.GameManager.RoomByLiveRoom(liveRoom.RoomId, liveRoom.Platform)
if err != nil {
return
}
logger.SLog.Debugf("用户 [%s] 基地升级", user.Username)
room.Broadcast(pb.PushZhgmangLevelUp, &pbGameZhgMang.LevelUp{
User: user,
})
}
func (h *ZhgmangGameLogic) handleMockGift(liveRoom *LiveRoom, _ string, content []rune, user *pbCommon.PbUser) {
var err error
room, err := manager.GameManager.RoomByLiveRoom(liveRoom.RoomId, liveRoom.Platform)
if err != nil {
return
}
var isAdminUser bool
for _, i := range h.svcCtx.Config.Game.AdminUserId {
if user.UserId == i {
isAdminUser = true
break
}
}
if !isAdminUser {
return
}
if len(content) < 1 {
return
}
contentStr := string(content)
spaceIdx := strings.Index(contentStr, " ")
if spaceIdx < 0 {
return
}
giftType := contentStr[:spaceIdx]
var count int64 = 1
if count, err = strconv.ParseInt(contentStr[spaceIdx+1:], 10, 32); err != nil {
return
}
if count <= 0 {
count = 1
}
logger.SLog.Debugf("用户 [%s] gift [%s] count [%d]", user.Username, giftType, count)
// 禁止 c w l n j
switch giftType {
case "tt":
h.goldSpeedUp(room, user, float64(count)*0.1)
case "qp":
h.clearScreen(room, user)
case "rd":
h.randomAddon(room, user)
case "hb":
h.redPackAddon(room, user)
default:
h.goldSpeedUp(room, user, float64(count))
}
}
/*
*/
func (h *ZhgmangGameLogic) handleGift(liveRoom *LiveRoom, user *pbCommon.PbUser, gift *pbMq.MqGift) {
room, err := manager.GameManager.RoomByLiveRoom(liveRoom.RoomId, liveRoom.Platform)
if err != nil {
return
}
cfg := h.svcCtx.Config.Game.Zhgmang
cfgGiftType := cfg.ParseGiftType(gift.GiftId)
switch gift.Type {
case pbMq.MqGift_NORMAL:
switch cfgGiftType {
case config.ZhgmangGiftFree:
h.goldSpeedUp(room, user, float64(gift.GiftNum)*0.1)
case config.ZhgmangGiftClearScreen:
for i := 0; i < int(gift.GiftNum); i++ {
h.clearScreen(room, user)
}
case config.ZhgmangGiftRandomAddon:
for i := 0; i < int(gift.GiftNum); i++ {
h.randomAddon(room, user)
}
default:
h.goldSpeedUp(room, user, float64(gift.GiftNum*gift.Price)*0.01)
}
case pbMq.MqGift_PACK:
if cfgGiftType == config.ZhgmangGiftClearScreen {
for i := 0; i < int(gift.GiftNum); i++ {
h.clearScreen(room, user)
}
} else {
h.goldSpeedUp(room, user, float64(gift.GiftNum)*0.01)
}
case pbMq.MqGift_RED_PACK:
// 红包
h.redPackAddon(room, user)
}
}
func (h *ZhgmangGameLogic) goldSpeedUp(room *manager.Room, user *pbCommon.PbUser, battery float64) {
room.Broadcast(pb.PushZhgmangGoldSpeedUp, &pbGameZhgMang.SpeedUp{
User: user,
Second: int32(battery * 10),
})
}
func (h *ZhgmangGameLogic) clearScreen(room *manager.Room, user *pbCommon.PbUser) {
room.Broadcast(pb.PushZhgmangClearScreen, &pbGameZhgMang.ClearScreen{
User: user,
})
}
func (h *ZhgmangGameLogic) randomAddon(room *manager.Room, user *pbCommon.PbUser) {
room.Broadcast(pb.PushZhgmangRandomAddon, &pbGameZhgMang.RandomAddon{
User: user,
})
}
func (h *ZhgmangGameLogic) redPackAddon(room *manager.Room, user *pbCommon.PbUser) {
room.Broadcast(pb.PushZhgmangRedPackAddon, &pbGameZhgMang.RedPackAddon{
User: user,
})
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,914 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.4
// source: game/zhgmang/command.proto
package pbGameZhgMang
import (
common "dcg/game/pb/common"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// 加入游戏指令j push -> game.join
type JoinGame struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
NobilityLevel int32 `protobuf:"varint,2,opt,name=nobilityLevel,proto3" json:"nobilityLevel,omitempty"` // 贵族等级 3舰长 0总督
}
func (x *JoinGame) Reset() {
*x = JoinGame{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *JoinGame) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*JoinGame) ProtoMessage() {}
func (x *JoinGame) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use JoinGame.ProtoReflect.Descriptor instead.
func (*JoinGame) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{0}
}
func (x *JoinGame) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
func (x *JoinGame) GetNobilityLevel() int32 {
if x != nil {
return x.NobilityLevel
}
return 0
}
// 抽卡 push -> game.c
type AddUnit struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
Card int32 `protobuf:"varint,2,opt,name=card,proto3" json:"card,omitempty"` // 1 2 3 4 5
}
func (x *AddUnit) Reset() {
*x = AddUnit{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AddUnit) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AddUnit) ProtoMessage() {}
func (x *AddUnit) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AddUnit.ProtoReflect.Descriptor instead.
func (*AddUnit) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{1}
}
func (x *AddUnit) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
func (x *AddUnit) GetCard() int32 {
if x != nil {
return x.Card
}
return 0
}
// 购买基地升级,提升金币上限,提升人口上限
type LevelUp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *LevelUp) Reset() {
*x = LevelUp{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LevelUp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LevelUp) ProtoMessage() {}
func (x *LevelUp) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LevelUp.ProtoReflect.Descriptor instead.
func (*LevelUp) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{2}
}
func (x *LevelUp) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
// 金币加速(礼物) push -> game.speedUp
type SpeedUp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
Second int32 `protobuf:"varint,2,opt,name=second,proto3" json:"second,omitempty"` // 加速时间
}
func (x *SpeedUp) Reset() {
*x = SpeedUp{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SpeedUp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SpeedUp) ProtoMessage() {}
func (x *SpeedUp) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SpeedUp.ProtoReflect.Descriptor instead.
func (*SpeedUp) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{3}
}
func (x *SpeedUp) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
func (x *SpeedUp) GetSecond() int32 {
if x != nil {
return x.Second
}
return 0
}
// 清屏(礼物) push -> game.clearScreen
type ClearScreen struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *ClearScreen) Reset() {
*x = ClearScreen{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ClearScreen) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ClearScreen) ProtoMessage() {}
func (x *ClearScreen) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ClearScreen.ProtoReflect.Descriptor instead.
func (*ClearScreen) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{4}
}
func (x *ClearScreen) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
// 苟 push -> game.gou
type Gou struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *Gou) Reset() {
*x = Gou{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Gou) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Gou) ProtoMessage() {}
func (x *Gou) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Gou.ProtoReflect.Descriptor instead.
func (*Gou) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{5}
}
func (x *Gou) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
// 莽 push -> game.rua
type Rua struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *Rua) Reset() {
*x = Rua{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Rua) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Rua) ProtoMessage() {}
func (x *Rua) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Rua.ProtoReflect.Descriptor instead.
func (*Rua) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{6}
}
func (x *Rua) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
// 随机加成(礼物) push -> game.randomAddon
type RandomAddon struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *RandomAddon) Reset() {
*x = RandomAddon{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RandomAddon) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RandomAddon) ProtoMessage() {}
func (x *RandomAddon) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RandomAddon.ProtoReflect.Descriptor instead.
func (*RandomAddon) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{7}
}
func (x *RandomAddon) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
// 红包加成 push -> game.redPackAddon
type RedPackAddon struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *RedPackAddon) Reset() {
*x = RedPackAddon{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[8]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RedPackAddon) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RedPackAddon) ProtoMessage() {}
func (x *RedPackAddon) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[8]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RedPackAddon.ProtoReflect.Descriptor instead.
func (*RedPackAddon) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{8}
}
func (x *RedPackAddon) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
// 查询位置 push -> game.w
type Wai struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *Wai) Reset() {
*x = Wai{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[9]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Wai) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Wai) ProtoMessage() {}
func (x *Wai) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[9]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Wai.ProtoReflect.Descriptor instead.
func (*Wai) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{9}
}
func (x *Wai) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
// 查询信息通知 push -> user.query
type UserQueryMsg struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *common.PbUser `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` // 用户信息
}
func (x *UserQueryMsg) Reset() {
*x = UserQueryMsg{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserQueryMsg) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserQueryMsg) ProtoMessage() {}
func (x *UserQueryMsg) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserQueryMsg.ProtoReflect.Descriptor instead.
func (*UserQueryMsg) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{10}
}
func (x *UserQueryMsg) GetUser() *common.PbUser {
if x != nil {
return x.User
}
return nil
}
// RankItem 排行数据结构
type UserQueryMsg_RankItem struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
RankType int32 `protobuf:"varint,1,opt,name=rankType,proto3" json:"rankType,omitempty"` // 排行榜类型 (与pbGameZhg.RankType一致)
Score int64 `protobuf:"varint,2,opt,name=score,proto3" json:"score,omitempty"` // 具体分数
Rank int32 `protobuf:"varint,3,opt,name=rank,proto3" json:"rank,omitempty"` // 具体排名,不上榜为0
}
func (x *UserQueryMsg_RankItem) Reset() {
*x = UserQueryMsg_RankItem{}
if protoimpl.UnsafeEnabled {
mi := &file_game_zhgmang_command_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserQueryMsg_RankItem) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserQueryMsg_RankItem) ProtoMessage() {}
func (x *UserQueryMsg_RankItem) ProtoReflect() protoreflect.Message {
mi := &file_game_zhgmang_command_proto_msgTypes[11]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserQueryMsg_RankItem.ProtoReflect.Descriptor instead.
func (*UserQueryMsg_RankItem) Descriptor() ([]byte, []int) {
return file_game_zhgmang_command_proto_rawDescGZIP(), []int{10, 0}
}
func (x *UserQueryMsg_RankItem) GetRankType() int32 {
if x != nil {
return x.RankType
}
return 0
}
func (x *UserQueryMsg_RankItem) GetScore() int64 {
if x != nil {
return x.Score
}
return 0
}
func (x *UserQueryMsg_RankItem) GetRank() int32 {
if x != nil {
return x.Rank
}
return 0
}
var File_game_zhgmang_command_proto protoreflect.FileDescriptor
var file_game_zhgmang_command_proto_rawDesc = []byte{
0x0a, 0x1a, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x7a, 0x68, 0x67, 0x6d, 0x61, 0x6e, 0x67, 0x2f, 0x63,
0x6f, 0x6d, 0x6d, 0x61, 0x6e, 0x64, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f, 0x70, 0x62,
0x2e, 0x67, 0x61, 0x6d, 0x65, 0x2e, 0x7a, 0x68, 0x67, 0x6d, 0x61, 0x6e, 0x67, 0x1a, 0x13, 0x63,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0x57, 0x0a, 0x08, 0x4a, 0x6f, 0x69, 0x6e, 0x47, 0x61, 0x6d, 0x65, 0x12, 0x25,
0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52,
0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x24, 0x0a, 0x0d, 0x6e, 0x6f, 0x62, 0x69, 0x6c, 0x69, 0x74,
0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0d, 0x6e, 0x6f,
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0x44, 0x0a, 0x07, 0x41,
0x64, 0x64, 0x55, 0x6e, 0x69, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2e, 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x12, 0x0a,
0x04, 0x63, 0x61, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x63, 0x61, 0x72,
0x64, 0x22, 0x30, 0x0a, 0x07, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x55, 0x70, 0x12, 0x25, 0x0a, 0x04,
0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75,
0x73, 0x65, 0x72, 0x22, 0x48, 0x0a, 0x07, 0x53, 0x70, 0x65, 0x65, 0x64, 0x55, 0x70, 0x12, 0x25,
0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52,
0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x22, 0x34, 0x0a,
0x0b, 0x43, 0x6c, 0x65, 0x61, 0x72, 0x53, 0x63, 0x72, 0x65, 0x65, 0x6e, 0x12, 0x25, 0x0a, 0x04,
0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75,
0x73, 0x65, 0x72, 0x22, 0x2c, 0x0a, 0x03, 0x47, 0x6f, 0x75, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73,
0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65,
0x72, 0x22, 0x2c, 0x0a, 0x03, 0x52, 0x75, 0x61, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72,
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22,
0x34, 0x0a, 0x0b, 0x52, 0x61, 0x6e, 0x64, 0x6f, 0x6d, 0x41, 0x64, 0x64, 0x6f, 0x6e, 0x12, 0x25,
0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52,
0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x35, 0x0a, 0x0c, 0x52, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b,
0x41, 0x64, 0x64, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x2c, 0x0a, 0x03,
0x57, 0x61, 0x69, 0x12, 0x25, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x62,
0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x87, 0x01, 0x0a, 0x0c, 0x55,
0x73, 0x65, 0x72, 0x51, 0x75, 0x65, 0x72, 0x79, 0x4d, 0x73, 0x67, 0x12, 0x25, 0x0a, 0x04, 0x75,
0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x50, 0x62, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73,
0x65, 0x72, 0x1a, 0x50, 0x0a, 0x08, 0x52, 0x61, 0x6e, 0x6b, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x1a,
0x0a, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x08, 0x72, 0x61, 0x6e, 0x6b, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x73, 0x63,
0x6f, 0x72, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x73, 0x63, 0x6f, 0x72, 0x65,
0x12, 0x12, 0x0a, 0x04, 0x72, 0x61, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04,
0x72, 0x61, 0x6e, 0x6b, 0x42, 0x28, 0x5a, 0x26, 0x64, 0x63, 0x67, 0x2f, 0x67, 0x61, 0x6d, 0x65,
0x2f, 0x70, 0x62, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x7a, 0x68, 0x67, 0x6d, 0x61, 0x6e, 0x67,
0x3b, 0x70, 0x62, 0x47, 0x61, 0x6d, 0x65, 0x5a, 0x68, 0x67, 0x4d, 0x61, 0x6e, 0x67, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_game_zhgmang_command_proto_rawDescOnce sync.Once
file_game_zhgmang_command_proto_rawDescData = file_game_zhgmang_command_proto_rawDesc
)
func file_game_zhgmang_command_proto_rawDescGZIP() []byte {
file_game_zhgmang_command_proto_rawDescOnce.Do(func() {
file_game_zhgmang_command_proto_rawDescData = protoimpl.X.CompressGZIP(file_game_zhgmang_command_proto_rawDescData)
})
return file_game_zhgmang_command_proto_rawDescData
}
var file_game_zhgmang_command_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
var file_game_zhgmang_command_proto_goTypes = []interface{}{
(*JoinGame)(nil), // 0: pb.game.zhgmang.JoinGame
(*AddUnit)(nil), // 1: pb.game.zhgmang.AddUnit
(*LevelUp)(nil), // 2: pb.game.zhgmang.LevelUp
(*SpeedUp)(nil), // 3: pb.game.zhgmang.SpeedUp
(*ClearScreen)(nil), // 4: pb.game.zhgmang.ClearScreen
(*Gou)(nil), // 5: pb.game.zhgmang.Gou
(*Rua)(nil), // 6: pb.game.zhgmang.Rua
(*RandomAddon)(nil), // 7: pb.game.zhgmang.RandomAddon
(*RedPackAddon)(nil), // 8: pb.game.zhgmang.RedPackAddon
(*Wai)(nil), // 9: pb.game.zhgmang.Wai
(*UserQueryMsg)(nil), // 10: pb.game.zhgmang.UserQueryMsg
(*UserQueryMsg_RankItem)(nil), // 11: pb.game.zhgmang.UserQueryMsg.RankItem
(*common.PbUser)(nil), // 12: pb.common.PbUser
}
var file_game_zhgmang_command_proto_depIdxs = []int32{
12, // 0: pb.game.zhgmang.JoinGame.user:type_name -> pb.common.PbUser
12, // 1: pb.game.zhgmang.AddUnit.user:type_name -> pb.common.PbUser
12, // 2: pb.game.zhgmang.LevelUp.user:type_name -> pb.common.PbUser
12, // 3: pb.game.zhgmang.SpeedUp.user:type_name -> pb.common.PbUser
12, // 4: pb.game.zhgmang.ClearScreen.user:type_name -> pb.common.PbUser
12, // 5: pb.game.zhgmang.Gou.user:type_name -> pb.common.PbUser
12, // 6: pb.game.zhgmang.Rua.user:type_name -> pb.common.PbUser
12, // 7: pb.game.zhgmang.RandomAddon.user:type_name -> pb.common.PbUser
12, // 8: pb.game.zhgmang.RedPackAddon.user:type_name -> pb.common.PbUser
12, // 9: pb.game.zhgmang.Wai.user:type_name -> pb.common.PbUser
12, // 10: pb.game.zhgmang.UserQueryMsg.user:type_name -> pb.common.PbUser
11, // [11:11] is the sub-list for method output_type
11, // [11:11] is the sub-list for method input_type
11, // [11:11] is the sub-list for extension type_name
11, // [11:11] is the sub-list for extension extendee
0, // [0:11] is the sub-list for field type_name
}
func init() { file_game_zhgmang_command_proto_init() }
func file_game_zhgmang_command_proto_init() {
if File_game_zhgmang_command_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_game_zhgmang_command_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*JoinGame); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AddUnit); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LevelUp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SpeedUp); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ClearScreen); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Gou); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Rua); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RandomAddon); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RedPackAddon); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Wai); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserQueryMsg); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_game_zhgmang_command_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserQueryMsg_RankItem); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_game_zhgmang_command_proto_rawDesc,
NumEnums: 0,
NumMessages: 12,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_game_zhgmang_command_proto_goTypes,
DependencyIndexes: file_game_zhgmang_command_proto_depIdxs,
MessageInfos: file_game_zhgmang_command_proto_msgTypes,
}.Build()
File_game_zhgmang_command_proto = out.File
file_game_zhgmang_command_proto_rawDesc = nil
file_game_zhgmang_command_proto_goTypes = nil
file_game_zhgmang_command_proto_depIdxs = nil
}

@ -0,0 +1,72 @@
syntax = "proto3";
package pb.game.zhgmang;
import "common/common.proto";
option go_package = "dcg/game/pb/game/zhgmang;pbGameZhgMang";
// j push -> game.join
message JoinGame{
pb.common.PbUser user = 1;
int32 nobilityLevel = 2; // 3 0
}
// push -> game.c
message AddUnit {
pb.common.PbUser user = 1;
int32 card = 2; // 1 2 3 4 5
}
// ,
message LevelUp {
pb.common.PbUser user = 1;
}
// () push -> game.speedUp
message SpeedUp {
pb.common.PbUser user = 1;
int32 second = 2; //
}
// () push -> game.clearScreen
message ClearScreen {
pb.common.PbUser user = 1;
}
// push -> game.gou
message Gou {
pb.common.PbUser user = 1;
}
// push -> game.rua
message Rua {
pb.common.PbUser user = 1;
}
// push -> game.randomAddon
message RandomAddon {
pb.common.PbUser user = 1;
}
// push -> game.redPackAddon
message RedPackAddon {
pb.common.PbUser user = 1;
}
// push -> game.w
message Wai{
pb.common.PbUser user = 1;
}
// push -> user.query
message UserQueryMsg {
// RankItem
message RankItem {
int32 rankType = 1; // (pbGameZhg.RankType)
int64 score = 2; //
int32 rank = 3; // ,0
}
pb.common.PbUser user = 1; //
}

@ -2,4 +2,4 @@ protoc --go_opt=paths=source_relative ^
--go-grpc_opt=paths=source_relative ^
--go-grpc_opt=require_unimplemented_servers=false ^
--go_out=. --go-grpc_out=. --proto_path=. ^
./vars/*.proto ./mq/*.proto ./common/*.proto ./room/*.proto ./game/zhg/*.proto ./game/zhghz/*.proto ./game/zhgzd/*.proto ./game/zhgww2/*.proto
./vars/*.proto ./mq/*.proto ./common/*.proto ./room/*.proto ./game/zhg/*.proto ./game/zhghz/*.proto ./game/zhgzd/*.proto ./game/zhgww2/*.proto ./game/zhgmang/*.proto

@ -6,3 +6,4 @@ protoc --csharp_out=./game/zhg --proto_path=. --proto_path=./vars --proto_path=.
protoc --csharp_out=./game/zhghz --proto_path=. --proto_path=./vars --proto_path=./game/zhghz ./game/zhghz/*.proto
protoc --csharp_out=./game/zhgzd --proto_path=. --proto_path=./vars --proto_path=./game/zhgzd ./game/zhgzd/*.proto
protoc --csharp_out=./game/zhgww2 --proto_path=. --proto_path=./vars --proto_path=./game/zhgww2 ./game/zhgww2/*.proto
protoc --csharp_out=./game/zhgmang --proto_path=. --proto_path=./vars --proto_path=./game/zhgmang ./game/zhgmang/*.proto

@ -30,10 +30,10 @@ namespace Pb.Room {
"ZXEuTGl2ZVJvb20SIwoIR2FtZVR5cGUYAiABKA4yES5wYi5yb29tLkdhbWVU",
"eXBlEg4KBnJvb21JZBgDIAEoAxowCghMaXZlUm9vbRISCgpsaXZlUm9vbUlk",
"GAEgASgDEhAKCHBsYXRmb3JtGAIgASgJIiwKDEpvaW5Sb29tUmVzcBIMCgRD",
"b2RlGAEgASgDEg4KBlJlc3VsdBgCIAEoCSpKCghHYW1lVHlwZRIHCgNaSEcQ",
"b2RlGAEgASgDEg4KBlJlc3VsdBgCIAEoCSpXCghHYW1lVHlwZRIHCgNaSEcQ",
"ABIJCgVaSEdIWhABEgkKBVpIR0ZCEAISCQoFWkhHWkQQAxIKCgZaSEdXVzIQ",
"BBIICgRURVNUEApCGVoXZGNnL2dhbWUvcGIvcm9vbTtwYlJvb21iBnByb3Rv",
"Mw=="));
"BBILCgdaSEdNYW5nEAUSCAoEVEVTVBBkQhlaF2RjZy9nYW1lL3BiL3Jvb207",
"cGJSb29tYgZwcm90bzM="));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Pb.Room.GameType), }, null, new pbr::GeneratedClrTypeInfo[] {
@ -71,9 +71,13 @@ namespace Pb.Room {
/// </summary>
[pbr::OriginalName("ZHGWW2")] Zhgww2 = 4,
/// <summary>
/// 指挥官-二战
/// </summary>
[pbr::OriginalName("ZHGMang")] Zhgmang = 5,
/// <summary>
/// 测试
/// </summary>
[pbr::OriginalName("TEST")] Test = 10,
[pbr::OriginalName("TEST")] Test = 100,
}
#endregion

@ -29,7 +29,8 @@ const (
GameType_ZHGFB GameType = 2 // 指挥官-副本
GameType_ZHGZD GameType = 3 // 指挥官-阵地
GameType_ZHGWW2 GameType = 4 // 指挥官-二战
GameType_TEST GameType = 10 // 测试
GameType_ZHGMang GameType = 5 // 指挥官-二战
GameType_TEST GameType = 100 // 测试
)
// Enum value maps for GameType.
@ -40,7 +41,8 @@ var (
2: "ZHGFB",
3: "ZHGZD",
4: "ZHGWW2",
10: "TEST",
5: "ZHGMang",
100: "TEST",
}
GameType_value = map[string]int32{
"ZHG": 0,
@ -48,7 +50,8 @@ var (
"ZHGFB": 2,
"ZHGZD": 3,
"ZHGWW2": 4,
"TEST": 10,
"ZHGMang": 5,
"TEST": 100,
}
)
@ -325,14 +328,14 @@ var file_room_room_proto_rawDesc = []byte{
0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x65,
0x73, 0x75, 0x6c, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x52, 0x65, 0x73, 0x75,
0x6c, 0x74, 0x2a, 0x4a, 0x0a, 0x08, 0x47, 0x61, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07,
0x6c, 0x74, 0x2a, 0x57, 0x0a, 0x08, 0x47, 0x61, 0x6d, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x07,
0x0a, 0x03, 0x5a, 0x48, 0x47, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x5a, 0x48, 0x47, 0x48, 0x5a,
0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x5a, 0x48, 0x47, 0x46, 0x42, 0x10, 0x02, 0x12, 0x09, 0x0a,
0x05, 0x5a, 0x48, 0x47, 0x5a, 0x44, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x5a, 0x48, 0x47, 0x57,
0x57, 0x32, 0x10, 0x04, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x45, 0x53, 0x54, 0x10, 0x0a, 0x42, 0x19,
0x5a, 0x17, 0x64, 0x63, 0x67, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x6f,
0x6f, 0x6d, 0x3b, 0x70, 0x62, 0x52, 0x6f, 0x6f, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
0x57, 0x32, 0x10, 0x04, 0x12, 0x0b, 0x0a, 0x07, 0x5a, 0x48, 0x47, 0x4d, 0x61, 0x6e, 0x67, 0x10,
0x05, 0x12, 0x08, 0x0a, 0x04, 0x54, 0x45, 0x53, 0x54, 0x10, 0x64, 0x42, 0x19, 0x5a, 0x17, 0x64,
0x63, 0x67, 0x2f, 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x62, 0x2f, 0x72, 0x6f, 0x6f, 0x6d, 0x3b,
0x70, 0x62, 0x52, 0x6f, 0x6f, 0x6d, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (

@ -11,7 +11,8 @@ enum GameType {
ZHGFB = 2; // -
ZHGZD = 3; // -
ZHGWW2 = 4; // -
TEST = 10; //
ZHGMang = 5; // -
TEST = 100; //
}
message CreateRoomReq {

@ -56,3 +56,18 @@ const (
PushZhgww2Overtime = "game.control.overtime"
PushZhgww2BecomeCommander = "game.become.commander"
)
// zhgmang
const (
PushZhgmangJoinGame = "game.join"
PushZhgmangAddUnit = "game.c"
PushZhgmangWai = "game.w"
PushZhgmangGou = "game.gou"
PushZhgmangRua = "game.rua"
PushZhgmangLevelUp = "game.levelUp"
PushZhgmangGoldSpeedUp = "game.goldSpeedUp"
PushZhgmangClearScreen = "game.clearScreen"
PushZhgmangRandomAddon = "game.randomAddon"
PushZhgmangRedPackAddon = "game.redPackAddon"
)

@ -0,0 +1,13 @@
2022-10-03 13:51:10.687+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:弹幕对应直播间未加入游戏房间
2022-10-03 13:53:46.344+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:弹幕对应直播间未加入游戏房间
2022-10-03 13:54:34.097+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:弹幕对应直播间未加入游戏房间
2022-10-03 13:54:37.909+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:弹幕对应直播间未加入游戏房间
2022-10-03 13:54:43.738+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:弹幕对应直播间未加入游戏房间
2022-10-03 13:55:33.699+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:弹幕对应直播间未加入游戏房间
2022-10-03 13:55:34.421+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:弹幕对应直播间未加入游戏房间
2022-10-03 13:55:51.325+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:弹幕对应直播间未加入游戏房间
2022-10-03 13:55:58.791+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:弹幕对应直播间未加入游戏房间
2022-10-03 13:57:39.824+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:未找到当前直播间支持的游戏逻辑
2022-10-03 13:57:43.134+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:未找到当前直播间支持的游戏逻辑
2022-10-03 13:58:02.000+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:未找到当前直播间支持的游戏逻辑
2022-10-03 13:59:32.995+08 error E:/Projects/dm-game/dcg/game/live_logic/manager.go:104 获取游戏逻辑失败, err:弹幕对应直播间未加入游戏房间
Loading…
Cancel
Save