diff --git a/common/constant.go b/common/constant.go index 56eb3c2..d05f2b9 100644 --- a/common/constant.go +++ b/common/constant.go @@ -99,6 +99,7 @@ const ( GameId_AngerUncle = 606 // 愤怒大叔 GameId_SmallRoket = 607 // 小火箭 GameId_Clawdoll = 608 // 娃娃机 + GameId_PushCoin = 609 // 推币机 __GameId_ThrGame_Min__ = 700 //################三方类################ GameId_Thr_Dg = 701 //DG Game GameId_Thr_XHJ = 901 ///DG Game diff --git a/data/DB_GameFree.dat b/data/DB_GameFree.dat index 752e96a..aa44140 100644 Binary files a/data/DB_GameFree.dat and b/data/DB_GameFree.dat differ diff --git a/data/DB_GameFree.json b/data/DB_GameFree.json index b0d59b6..a86be0c 100644 --- a/data/DB_GameFree.json +++ b/data/DB_GameFree.json @@ -4520,7 +4520,7 @@ { "Id": 2110001, "Name": "十三张四人", - "Title": "1", + "Title": "新手场", "GameId": 211, "GameRule": 21100, "GameType": 2, @@ -4574,7 +4574,7 @@ { "Id": 2110002, "Name": "十三张四人", - "Title": "2", + "Title": "小康场", "GameId": 211, "GameRule": 21100, "GameType": 2, @@ -4628,7 +4628,7 @@ { "Id": 2110003, "Name": "十三张四人", - "Title": "3", + "Title": "土豪场", "GameId": 211, "GameRule": 21100, "GameType": 2, @@ -4682,7 +4682,7 @@ { "Id": 2110004, "Name": "十三张四人", - "Title": "4", + "Title": "新手场", "GameId": 211, "GameRule": 21100, "GameType": 2, @@ -4736,7 +4736,7 @@ { "Id": 2110005, "Name": "十三张四人", - "Title": "5", + "Title": "小康场", "GameId": 211, "GameRule": 21100, "GameType": 2, @@ -4790,7 +4790,7 @@ { "Id": 2110006, "Name": "十三张四人", - "Title": "6", + "Title": "土豪场", "GameId": 211, "GameRule": 21100, "GameType": 2, @@ -4843,7 +4843,7 @@ { "Id": 2120001, "Name": "十三张八人", - "Title": "1", + "Title": "新手场", "GameId": 212, "GameRule": 21200, "GameType": 2, @@ -4897,7 +4897,7 @@ { "Id": 2120002, "Name": "十三张八人", - "Title": "2", + "Title": "小康场", "GameId": 212, "GameRule": 21200, "GameType": 2, @@ -4951,7 +4951,7 @@ { "Id": 2120003, "Name": "十三张八人", - "Title": "3", + "Title": "土豪场", "GameId": 212, "GameRule": 21200, "GameType": 2, @@ -5005,7 +5005,7 @@ { "Id": 2120004, "Name": "十三张八人", - "Title": "4", + "Title": "新手场", "GameId": 212, "GameRule": 21200, "GameType": 2, @@ -5059,7 +5059,7 @@ { "Id": 2120005, "Name": "十三张八人", - "Title": "5", + "Title": "小康场", "GameId": 212, "GameRule": 21200, "GameType": 2, @@ -5113,7 +5113,7 @@ { "Id": 2120006, "Name": "十三张八人", - "Title": "6", + "Title": "土豪场", "GameId": 212, "GameRule": 21200, "GameType": 2, @@ -7019,6 +7019,27 @@ "PlayerWaterRate": 100, "BetWaterRate": 100, "GameName": "娃娃机" + }, + { + "Id": 6090001, + "Name": "推币机", + "GameId": 609, + "GameRule": 60900, + "GameType": 5, + "SceneType": 1, + "ShowType": 3, + "ShowId": 60900, + "Turn": 60900, + "OtherIntParams": [ + 5000, + 10000, + 15000 + ], + "SameIpLimit": 1, + "GameDif": "609", + "GameClass": 2, + "PlatformName": "越南棋牌", + "GameName": "推币机" } ] } \ No newline at end of file diff --git a/data/DB_GameRule.dat b/data/DB_GameRule.dat index 5377feb..866c20c 100644 Binary files a/data/DB_GameRule.dat and b/data/DB_GameRule.dat differ diff --git a/data/DB_GameRule.json b/data/DB_GameRule.json index 4860e87..eacbcca 100644 --- a/data/DB_GameRule.json +++ b/data/DB_GameRule.json @@ -267,6 +267,12 @@ "Name": "娃娃机", "GameId": 608, "GameDif": "608" + }, + { + "Id": 60900, + "Name": "推币机", + "GameId": 609, + "GameDif": "609" } ] } \ No newline at end of file diff --git a/data/DB_NewYearRankReward.dat b/data/DB_NewYearRankReward.dat new file mode 100644 index 0000000..c92b5e9 --- /dev/null +++ b/data/DB_NewYearRankReward.dat @@ -0,0 +1,84 @@ + +""d" +""d" +""d" +""d +""c +""b +""a +""` +  ""_ + + +""^ +  ""] +  "\" +  ""[ +""Z +""Y +""X +""W +""V +""U +""T +""S +""R +""Q +""P +""O +""N +""M +""L +""K +""J +""I +  ""H +!!""G +""""F +##""E +$$""D +%%""C +&&"B" +''""A +(("@" +)""d" +*""d" ++"d"" +,""d +-""c +.""b +/""a +0""` +1 ""_ +2 +""^ +3 ""] +4 ""\ +5 ""[ +6""Z +7""Y +8"X" +9"W" +:""V +;""U +<""T +=""S +>"R" +?""Q +@""P +A""O +B""N +C""M +D""L +E""K +F"J" +G""I +H ""H +I!""G +J"""F +K#""E +L$""D +M%""C +N&""B +O'""A +P(""@ \ No newline at end of file diff --git a/data/DB_PropExchange.dat b/data/DB_PropExchange.dat index 4461b75..020eca0 100644 Binary files a/data/DB_PropExchange.dat and b/data/DB_PropExchange.dat differ diff --git a/data/DB_Task.dat b/data/DB_Task.dat index 295310b..bf04f72 100644 Binary files a/data/DB_Task.dat and b/data/DB_Task.dat differ diff --git a/data/gameconfig/pushcoin.json b/data/gameconfig/pushcoin.json new file mode 100644 index 0000000..d296208 --- /dev/null +++ b/data/gameconfig/pushcoin.json @@ -0,0 +1,9 @@ +{ + "GameName":"推币机", + "GameId":609, + "GameMode":[0], + "SceneType":[1], + "CanForceStart":true, + "MinPlayerCnt":1, + "DefaultPlayerCnt":1 +} \ No newline at end of file diff --git a/protocol/doc.md b/protocol/doc.md index e8d8f01..7d605b1 100644 --- a/protocol/doc.md +++ b/protocol/doc.md @@ -193,5 +193,9 @@ - 5660~5669 +### pushcoin.proto + +- 5670~5679 + ### game.proto(玩家离开) - 8000~8099 \ No newline at end of file diff --git a/protocol/pushcoin/pushcoin.pb.go b/protocol/pushcoin/pushcoin.pb.go new file mode 100644 index 0000000..c6219d5 --- /dev/null +++ b/protocol/pushcoin/pushcoin.pb.go @@ -0,0 +1,1156 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.27.1-devel +// protoc v3.19.4 +// source: protocol/pushcoin/pushcoin.proto + +package pushcoin + +import ( + 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) +) + +// 5670~5679 +type PushCoinPacketID int32 + +const ( + PushCoinPacketID_PACKET_PushCoin_ZERO PushCoinPacketID = 0 // 弃用消息号 + PushCoinPacketID_PACKET_SCPushCoinRoomInfo PushCoinPacketID = 5670 // 房间信息 + PushCoinPacketID_PACKET_SCPushCoinRoomState PushCoinPacketID = 5671 // 房间状态 + PushCoinPacketID_PACKET_CSPushCoinPlayerOp PushCoinPacketID = 5672 // 玩家操作 + PushCoinPacketID_PACKET_SCPushCoinPlayerOp PushCoinPacketID = 5673 // 玩家操作返回 +) + +// Enum value maps for PushCoinPacketID. +var ( + PushCoinPacketID_name = map[int32]string{ + 0: "PACKET_PushCoin_ZERO", + 5670: "PACKET_SCPushCoinRoomInfo", + 5671: "PACKET_SCPushCoinRoomState", + 5672: "PACKET_CSPushCoinPlayerOp", + 5673: "PACKET_SCPushCoinPlayerOp", + } + PushCoinPacketID_value = map[string]int32{ + "PACKET_PushCoin_ZERO": 0, + "PACKET_SCPushCoinRoomInfo": 5670, + "PACKET_SCPushCoinRoomState": 5671, + "PACKET_CSPushCoinPlayerOp": 5672, + "PACKET_SCPushCoinPlayerOp": 5673, + } +) + +func (x PushCoinPacketID) Enum() *PushCoinPacketID { + p := new(PushCoinPacketID) + *p = x + return p +} + +func (x PushCoinPacketID) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (PushCoinPacketID) Descriptor() protoreflect.EnumDescriptor { + return file_protocol_pushcoin_pushcoin_proto_enumTypes[0].Descriptor() +} + +func (PushCoinPacketID) Type() protoreflect.EnumType { + return &file_protocol_pushcoin_pushcoin_proto_enumTypes[0] +} + +func (x PushCoinPacketID) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use PushCoinPacketID.Descriptor instead. +func (PushCoinPacketID) EnumDescriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{0} +} + +type OpCodes int32 + +const ( + OpCodes_OP_Zero OpCodes = 0 + OpCodes_OP_Bet OpCodes = 1 // 下注 [下注金额] + OpCodes_OP_Gain OpCodes = 2 // 得分 [得分金额] + OpCodes_OP_Shake OpCodes = 3 // 震动 [消耗次数] + OpCodes_OP_Refresh OpCodes = 4 // 刷新 [桌面金额] + OpCodes_OP_Exchange OpCodes = 5 // 兑换 [兑换id] + OpCodes_OP_Draw OpCodes = 6 // 抽奖 [抽奖id] +) + +// Enum value maps for OpCodes. +var ( + OpCodes_name = map[int32]string{ + 0: "OP_Zero", + 1: "OP_Bet", + 2: "OP_Gain", + 3: "OP_Shake", + 4: "OP_Refresh", + 5: "OP_Exchange", + 6: "OP_Draw", + } + OpCodes_value = map[string]int32{ + "OP_Zero": 0, + "OP_Bet": 1, + "OP_Gain": 2, + "OP_Shake": 3, + "OP_Refresh": 4, + "OP_Exchange": 5, + "OP_Draw": 6, + } +) + +func (x OpCodes) Enum() *OpCodes { + p := new(OpCodes) + *p = x + return p +} + +func (x OpCodes) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OpCodes) Descriptor() protoreflect.EnumDescriptor { + return file_protocol_pushcoin_pushcoin_proto_enumTypes[1].Descriptor() +} + +func (OpCodes) Type() protoreflect.EnumType { + return &file_protocol_pushcoin_pushcoin_proto_enumTypes[1] +} + +func (x OpCodes) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OpCodes.Descriptor instead. +func (OpCodes) EnumDescriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{1} +} + +type OpResultCode int32 + +const ( + OpResultCode_OPRC_Success OpResultCode = 0 //成功 + OpResultCode_OPRC_Error OpResultCode = 1 //失败 +) + +// Enum value maps for OpResultCode. +var ( + OpResultCode_name = map[int32]string{ + 0: "OPRC_Success", + 1: "OPRC_Error", + } + OpResultCode_value = map[string]int32{ + "OPRC_Success": 0, + "OPRC_Error": 1, + } +) + +func (x OpResultCode) Enum() *OpResultCode { + p := new(OpResultCode) + *p = x + return p +} + +func (x OpResultCode) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (OpResultCode) Descriptor() protoreflect.EnumDescriptor { + return file_protocol_pushcoin_pushcoin_proto_enumTypes[2].Descriptor() +} + +func (OpResultCode) Type() protoreflect.EnumType { + return &file_protocol_pushcoin_pushcoin_proto_enumTypes[2] +} + +func (x OpResultCode) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use OpResultCode.Descriptor instead. +func (OpResultCode) EnumDescriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{2} +} + +//房间信息 +//PACKET_SCPushCoinRoomInfo +type SCPushCoinRoomInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + RoomId int32 `protobuf:"varint,1,opt,name=RoomId,proto3" json:"RoomId,omitempty"` //房间id + GameId int32 `protobuf:"varint,2,opt,name=GameId,proto3" json:"GameId,omitempty"` //游戏id + RoomMode int32 `protobuf:"varint,3,opt,name=RoomMode,proto3" json:"RoomMode,omitempty"` //游戏模式 + Params []int32 `protobuf:"varint,4,rep,packed,name=Params,proto3" json:"Params,omitempty"` //规则参数 + State int32 `protobuf:"varint,5,opt,name=State,proto3" json:"State,omitempty"` //房间当前状态 + TimeOut int32 `protobuf:"varint,6,opt,name=TimeOut,proto3" json:"TimeOut,omitempty"` //等待剩余时间 单位:秒 + Players []*PushCoinPlayerData `protobuf:"bytes,7,rep,name=Players,proto3" json:"Players,omitempty"` //房间内的玩家信息 + ExchangeList []*ExchangeInfo `protobuf:"bytes,8,rep,name=ExchangeList,proto3" json:"ExchangeList,omitempty"` //兑换信息 + DrawList []*DrawInfo `protobuf:"bytes,9,rep,name=DrawList,proto3" json:"DrawList,omitempty"` //抽奖信息 +} + +func (x *SCPushCoinRoomInfo) Reset() { + *x = SCPushCoinRoomInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_pushcoin_pushcoin_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCPushCoinRoomInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCPushCoinRoomInfo) ProtoMessage() {} + +func (x *SCPushCoinRoomInfo) ProtoReflect() protoreflect.Message { + mi := &file_protocol_pushcoin_pushcoin_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 SCPushCoinRoomInfo.ProtoReflect.Descriptor instead. +func (*SCPushCoinRoomInfo) Descriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{0} +} + +func (x *SCPushCoinRoomInfo) GetRoomId() int32 { + if x != nil { + return x.RoomId + } + return 0 +} + +func (x *SCPushCoinRoomInfo) GetGameId() int32 { + if x != nil { + return x.GameId + } + return 0 +} + +func (x *SCPushCoinRoomInfo) GetRoomMode() int32 { + if x != nil { + return x.RoomMode + } + return 0 +} + +func (x *SCPushCoinRoomInfo) GetParams() []int32 { + if x != nil { + return x.Params + } + return nil +} + +func (x *SCPushCoinRoomInfo) GetState() int32 { + if x != nil { + return x.State + } + return 0 +} + +func (x *SCPushCoinRoomInfo) GetTimeOut() int32 { + if x != nil { + return x.TimeOut + } + return 0 +} + +func (x *SCPushCoinRoomInfo) GetPlayers() []*PushCoinPlayerData { + if x != nil { + return x.Players + } + return nil +} + +func (x *SCPushCoinRoomInfo) GetExchangeList() []*ExchangeInfo { + if x != nil { + return x.ExchangeList + } + return nil +} + +func (x *SCPushCoinRoomInfo) GetDrawList() []*DrawInfo { + if x != nil { + return x.DrawList + } + return nil +} + +type ItemInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + ItemId int32 `protobuf:"varint,1,opt,name=ItemId,proto3" json:"ItemId,omitempty"` //道具id + ItemNum int32 `protobuf:"varint,2,opt,name=ItemNum,proto3" json:"ItemNum,omitempty"` //道具数量 +} + +func (x *ItemInfo) Reset() { + *x = ItemInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_pushcoin_pushcoin_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ItemInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ItemInfo) ProtoMessage() {} + +func (x *ItemInfo) ProtoReflect() protoreflect.Message { + mi := &file_protocol_pushcoin_pushcoin_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 ItemInfo.ProtoReflect.Descriptor instead. +func (*ItemInfo) Descriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{1} +} + +func (x *ItemInfo) GetItemId() int32 { + if x != nil { + return x.ItemId + } + return 0 +} + +func (x *ItemInfo) GetItemNum() int32 { + if x != nil { + return x.ItemNum + } + return 0 +} + +type ExchangeInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` //兑换id + Cost []*ItemInfo `protobuf:"bytes,2,rep,name=Cost,proto3" json:"Cost,omitempty"` //消耗道具 + Gain []*ItemInfo `protobuf:"bytes,3,rep,name=Gain,proto3" json:"Gain,omitempty"` //获得道具 + ShakeTimes int32 `protobuf:"varint,4,opt,name=ShakeTimes,proto3" json:"ShakeTimes,omitempty"` //获得震动次数 +} + +func (x *ExchangeInfo) Reset() { + *x = ExchangeInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_pushcoin_pushcoin_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ExchangeInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ExchangeInfo) ProtoMessage() {} + +func (x *ExchangeInfo) ProtoReflect() protoreflect.Message { + mi := &file_protocol_pushcoin_pushcoin_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 ExchangeInfo.ProtoReflect.Descriptor instead. +func (*ExchangeInfo) Descriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{2} +} + +func (x *ExchangeInfo) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *ExchangeInfo) GetCost() []*ItemInfo { + if x != nil { + return x.Cost + } + return nil +} + +func (x *ExchangeInfo) GetGain() []*ItemInfo { + if x != nil { + return x.Gain + } + return nil +} + +func (x *ExchangeInfo) GetShakeTimes() int32 { + if x != nil { + return x.ShakeTimes + } + return 0 +} + +type DrawInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int32 `protobuf:"varint,1,opt,name=Id,proto3" json:"Id,omitempty"` //抽奖id + ItemId int32 `protobuf:"varint,2,opt,name=ItemId,proto3" json:"ItemId,omitempty"` //道具id + ItemNum int32 `protobuf:"varint,3,opt,name=ItemNum,proto3" json:"ItemNum,omitempty"` //道具数量 + Coin int64 `protobuf:"varint,4,opt,name=Coin,proto3" json:"Coin,omitempty"` //价值 +} + +func (x *DrawInfo) Reset() { + *x = DrawInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_pushcoin_pushcoin_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DrawInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DrawInfo) ProtoMessage() {} + +func (x *DrawInfo) ProtoReflect() protoreflect.Message { + mi := &file_protocol_pushcoin_pushcoin_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 DrawInfo.ProtoReflect.Descriptor instead. +func (*DrawInfo) Descriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{3} +} + +func (x *DrawInfo) GetId() int32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *DrawInfo) GetItemId() int32 { + if x != nil { + return x.ItemId + } + return 0 +} + +func (x *DrawInfo) GetItemNum() int32 { + if x != nil { + return x.ItemNum + } + return 0 +} + +func (x *DrawInfo) GetCoin() int64 { + if x != nil { + return x.Coin + } + return 0 +} + +type PushCoinPlayerData struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` //名字 + SnId int32 `protobuf:"varint,2,opt,name=SnId,proto3" json:"SnId,omitempty"` //账号 + Head int32 `protobuf:"varint,3,opt,name=Head,proto3" json:"Head,omitempty"` //头像 + Sex int32 `protobuf:"varint,4,opt,name=Sex,proto3" json:"Sex,omitempty"` //性别 + Coin int64 `protobuf:"varint,5,opt,name=Coin,proto3" json:"Coin,omitempty"` //金币 + Flag int32 `protobuf:"varint,6,opt,name=Flag,proto3" json:"Flag,omitempty"` //二进制标记 第一位:是否掉线(0:在线 1:掉线) 第二位:是否准备(0:未准备 1:已准备) + Params []string `protobuf:"bytes,7,rep,name=Params,proto3" json:"Params,omitempty"` //其他数据 如:ip 等 + VIP int32 `protobuf:"varint,8,opt,name=VIP,proto3" json:"VIP,omitempty"` + RoleId int32 `protobuf:"varint,9,opt,name=RoleId,proto3" json:"RoleId,omitempty"` //使用中的角色id + Level int64 `protobuf:"varint,10,opt,name=Level,proto3" json:"Level,omitempty"` //玩家等级 + Exp int64 `protobuf:"varint,11,opt,name=Exp,proto3" json:"Exp,omitempty"` //玩家经验 + SkinId int32 `protobuf:"varint,12,opt,name=SkinId,proto3" json:"SkinId,omitempty"` //皮肤id + ShakeTimes int32 `protobuf:"varint,13,opt,name=ShakeTimes,proto3" json:"ShakeTimes,omitempty"` //可震动次数 + BaseCoin int64 `protobuf:"varint,14,opt,name=BaseCoin,proto3" json:"BaseCoin,omitempty"` //当前底分(单次投币金额) + PowerLine int64 `protobuf:"varint,15,opt,name=PowerLine,proto3" json:"PowerLine,omitempty"` // 当前能量值 + PowerLineMax int64 `protobuf:"varint,16,opt,name=PowerLineMax,proto3" json:"PowerLineMax,omitempty"` // 能量值上限 + RefreshTimes int64 `protobuf:"varint,17,opt,name=RefreshTimes,proto3" json:"RefreshTimes,omitempty"` // 刷新次数 +} + +func (x *PushCoinPlayerData) Reset() { + *x = PushCoinPlayerData{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_pushcoin_pushcoin_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *PushCoinPlayerData) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*PushCoinPlayerData) ProtoMessage() {} + +func (x *PushCoinPlayerData) ProtoReflect() protoreflect.Message { + mi := &file_protocol_pushcoin_pushcoin_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 PushCoinPlayerData.ProtoReflect.Descriptor instead. +func (*PushCoinPlayerData) Descriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{4} +} + +func (x *PushCoinPlayerData) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *PushCoinPlayerData) GetSnId() int32 { + if x != nil { + return x.SnId + } + return 0 +} + +func (x *PushCoinPlayerData) GetHead() int32 { + if x != nil { + return x.Head + } + return 0 +} + +func (x *PushCoinPlayerData) GetSex() int32 { + if x != nil { + return x.Sex + } + return 0 +} + +func (x *PushCoinPlayerData) GetCoin() int64 { + if x != nil { + return x.Coin + } + return 0 +} + +func (x *PushCoinPlayerData) GetFlag() int32 { + if x != nil { + return x.Flag + } + return 0 +} + +func (x *PushCoinPlayerData) GetParams() []string { + if x != nil { + return x.Params + } + return nil +} + +func (x *PushCoinPlayerData) GetVIP() int32 { + if x != nil { + return x.VIP + } + return 0 +} + +func (x *PushCoinPlayerData) GetRoleId() int32 { + if x != nil { + return x.RoleId + } + return 0 +} + +func (x *PushCoinPlayerData) GetLevel() int64 { + if x != nil { + return x.Level + } + return 0 +} + +func (x *PushCoinPlayerData) GetExp() int64 { + if x != nil { + return x.Exp + } + return 0 +} + +func (x *PushCoinPlayerData) GetSkinId() int32 { + if x != nil { + return x.SkinId + } + return 0 +} + +func (x *PushCoinPlayerData) GetShakeTimes() int32 { + if x != nil { + return x.ShakeTimes + } + return 0 +} + +func (x *PushCoinPlayerData) GetBaseCoin() int64 { + if x != nil { + return x.BaseCoin + } + return 0 +} + +func (x *PushCoinPlayerData) GetPowerLine() int64 { + if x != nil { + return x.PowerLine + } + return 0 +} + +func (x *PushCoinPlayerData) GetPowerLineMax() int64 { + if x != nil { + return x.PowerLineMax + } + return 0 +} + +func (x *PushCoinPlayerData) GetRefreshTimes() int64 { + if x != nil { + return x.RefreshTimes + } + return 0 +} + +//房间状态 +//PACKET_SCPushCoinRoomState +type SCPushCoinRoomState struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + State int32 `protobuf:"varint,1,opt,name=State,proto3" json:"State,omitempty"` //房间当前状态 + SubState int32 `protobuf:"varint,2,opt,name=SubState,proto3" json:"SubState,omitempty"` //房间当前子状态 + Params []int32 `protobuf:"varint,3,rep,packed,name=Params,proto3" json:"Params,omitempty"` //状态参数 +} + +func (x *SCPushCoinRoomState) Reset() { + *x = SCPushCoinRoomState{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_pushcoin_pushcoin_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCPushCoinRoomState) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCPushCoinRoomState) ProtoMessage() {} + +func (x *SCPushCoinRoomState) ProtoReflect() protoreflect.Message { + mi := &file_protocol_pushcoin_pushcoin_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 SCPushCoinRoomState.ProtoReflect.Descriptor instead. +func (*SCPushCoinRoomState) Descriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{5} +} + +func (x *SCPushCoinRoomState) GetState() int32 { + if x != nil { + return x.State + } + return 0 +} + +func (x *SCPushCoinRoomState) GetSubState() int32 { + if x != nil { + return x.SubState + } + return 0 +} + +func (x *SCPushCoinRoomState) GetParams() []int32 { + if x != nil { + return x.Params + } + return nil +} + +//玩家操作 +//PACKET_CSPushCoinPlayerOp +type CSPushCoinPlayerOp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpCode OpCodes `protobuf:"varint,1,opt,name=OpCode,proto3,enum=pushcoin.OpCodes" json:"OpCode,omitempty"` + OpParam []int64 `protobuf:"varint,2,rep,packed,name=OpParam,proto3" json:"OpParam,omitempty"` +} + +func (x *CSPushCoinPlayerOp) Reset() { + *x = CSPushCoinPlayerOp{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_pushcoin_pushcoin_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CSPushCoinPlayerOp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CSPushCoinPlayerOp) ProtoMessage() {} + +func (x *CSPushCoinPlayerOp) ProtoReflect() protoreflect.Message { + mi := &file_protocol_pushcoin_pushcoin_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 CSPushCoinPlayerOp.ProtoReflect.Descriptor instead. +func (*CSPushCoinPlayerOp) Descriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{6} +} + +func (x *CSPushCoinPlayerOp) GetOpCode() OpCodes { + if x != nil { + return x.OpCode + } + return OpCodes_OP_Zero +} + +func (x *CSPushCoinPlayerOp) GetOpParam() []int64 { + if x != nil { + return x.OpParam + } + return nil +} + +//PACKET_SCPushCoinPlayerOp +type SCPushCoinPlayerOp struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + OpRetCode OpResultCode `protobuf:"varint,1,opt,name=OpRetCode,proto3,enum=pushcoin.OpResultCode" json:"OpRetCode,omitempty"` + OpCode OpCodes `protobuf:"varint,2,opt,name=OpCode,proto3,enum=pushcoin.OpCodes" json:"OpCode,omitempty"` + Exchange *ExchangeInfo `protobuf:"bytes,3,opt,name=Exchange,proto3" json:"Exchange,omitempty"` // 兑换信息,加到背包 + Draw *DrawInfo `protobuf:"bytes,4,opt,name=Draw,proto3" json:"Draw,omitempty"` // 抽奖信息,掉落到桌面 +} + +func (x *SCPushCoinPlayerOp) Reset() { + *x = SCPushCoinPlayerOp{} + if protoimpl.UnsafeEnabled { + mi := &file_protocol_pushcoin_pushcoin_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SCPushCoinPlayerOp) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SCPushCoinPlayerOp) ProtoMessage() {} + +func (x *SCPushCoinPlayerOp) ProtoReflect() protoreflect.Message { + mi := &file_protocol_pushcoin_pushcoin_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 SCPushCoinPlayerOp.ProtoReflect.Descriptor instead. +func (*SCPushCoinPlayerOp) Descriptor() ([]byte, []int) { + return file_protocol_pushcoin_pushcoin_proto_rawDescGZIP(), []int{7} +} + +func (x *SCPushCoinPlayerOp) GetOpRetCode() OpResultCode { + if x != nil { + return x.OpRetCode + } + return OpResultCode_OPRC_Success +} + +func (x *SCPushCoinPlayerOp) GetOpCode() OpCodes { + if x != nil { + return x.OpCode + } + return OpCodes_OP_Zero +} + +func (x *SCPushCoinPlayerOp) GetExchange() *ExchangeInfo { + if x != nil { + return x.Exchange + } + return nil +} + +func (x *SCPushCoinPlayerOp) GetDraw() *DrawInfo { + if x != nil { + return x.Draw + } + return nil +} + +var File_protocol_pushcoin_pushcoin_proto protoreflect.FileDescriptor + +var file_protocol_pushcoin_pushcoin_proto_rawDesc = []byte{ + 0x0a, 0x20, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x63, + 0x6f, 0x69, 0x6e, 0x2f, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x12, 0x08, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x22, 0xcc, 0x02, 0x0a, + 0x12, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x47, + 0x61, 0x6d, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x47, 0x61, 0x6d, + 0x65, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x52, 0x6f, 0x6f, 0x6d, 0x4d, 0x6f, 0x64, 0x65, 0x12, + 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x05, 0x52, + 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x75, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, + 0x54, 0x69, 0x6d, 0x65, 0x4f, 0x75, 0x74, 0x12, 0x36, 0x0a, 0x07, 0x50, 0x6c, 0x61, 0x79, 0x65, + 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, + 0x6f, 0x69, 0x6e, 0x2e, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x52, 0x07, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, + 0x3a, 0x0a, 0x0c, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x18, + 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, + 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0c, 0x45, + 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x08, 0x44, + 0x72, 0x61, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, + 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x44, 0x72, 0x61, 0x77, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x08, 0x44, 0x72, 0x61, 0x77, 0x4c, 0x69, 0x73, 0x74, 0x22, 0x3c, 0x0a, 0x08, 0x49, + 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, + 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, + 0x18, 0x0a, 0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, + 0x52, 0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x22, 0x8e, 0x01, 0x0a, 0x0c, 0x45, 0x78, + 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x04, 0x43, 0x6f, + 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, + 0x6f, 0x69, 0x6e, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x43, 0x6f, + 0x73, 0x74, 0x12, 0x26, 0x0a, 0x04, 0x47, 0x61, 0x69, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x12, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x49, 0x74, 0x65, 0x6d, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x47, 0x61, 0x69, 0x6e, 0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x68, + 0x61, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, + 0x53, 0x68, 0x61, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x22, 0x60, 0x0a, 0x08, 0x44, 0x72, + 0x61, 0x77, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x05, 0x52, 0x02, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x18, + 0x0a, 0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x07, 0x49, 0x74, 0x65, 0x6d, 0x4e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x22, 0xae, 0x03, 0x0a, + 0x12, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x12, 0x0a, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x53, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x48, + 0x65, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x48, 0x65, 0x61, 0x64, 0x12, + 0x10, 0x0a, 0x03, 0x53, 0x65, 0x78, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x53, 0x65, + 0x78, 0x12, 0x12, 0x0a, 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x04, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x04, 0x46, 0x6c, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x12, 0x10, 0x0a, 0x03, 0x56, 0x49, 0x50, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, + 0x56, 0x49, 0x50, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x09, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x52, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x4c, + 0x65, 0x76, 0x65, 0x6c, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x4c, 0x65, 0x76, 0x65, + 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x45, 0x78, 0x70, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, + 0x45, 0x78, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x53, 0x6b, 0x69, 0x6e, 0x49, 0x64, 0x18, 0x0c, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x06, 0x53, 0x6b, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x53, + 0x68, 0x61, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x0a, 0x53, 0x68, 0x61, 0x6b, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x42, + 0x61, 0x73, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x42, + 0x61, 0x73, 0x65, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x50, 0x6f, 0x77, 0x65, 0x72, + 0x4c, 0x69, 0x6e, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x50, 0x6f, 0x77, 0x65, + 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, + 0x6e, 0x65, 0x4d, 0x61, 0x78, 0x18, 0x10, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x50, 0x6f, 0x77, + 0x65, 0x72, 0x4c, 0x69, 0x6e, 0x65, 0x4d, 0x61, 0x78, 0x12, 0x22, 0x0a, 0x0c, 0x52, 0x65, 0x66, + 0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x18, 0x11, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x0c, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x22, 0x5f, 0x0a, + 0x13, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53, + 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x53, 0x75, + 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x53, 0x75, + 0x62, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x18, 0x03, 0x20, 0x03, 0x28, 0x05, 0x52, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x59, + 0x0a, 0x12, 0x43, 0x53, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, + 0x65, 0x72, 0x4f, 0x70, 0x12, 0x29, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, + 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x12, + 0x18, 0x0a, 0x07, 0x4f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, + 0x52, 0x07, 0x4f, 0x70, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x22, 0xd1, 0x01, 0x0a, 0x12, 0x53, 0x43, + 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, + 0x12, 0x34, 0x0a, 0x09, 0x4f, 0x70, 0x52, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x4f, + 0x70, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x4f, 0x70, 0x52, + 0x65, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x29, 0x0a, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x11, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, + 0x6e, 0x2e, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x06, 0x4f, 0x70, 0x43, 0x6f, 0x64, + 0x65, 0x12, 0x32, 0x0a, 0x08, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x45, + 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x45, 0x78, 0x63, + 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x26, 0x0a, 0x04, 0x44, 0x72, 0x61, 0x77, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x75, 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x44, + 0x72, 0x61, 0x77, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x44, 0x72, 0x61, 0x77, 0x2a, 0xad, 0x01, + 0x0a, 0x10, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x74, + 0x49, 0x44, 0x12, 0x18, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x50, 0x75, 0x73, + 0x68, 0x43, 0x6f, 0x69, 0x6e, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x1e, 0x0a, 0x19, + 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, + 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xa6, 0x2c, 0x12, 0x1f, 0x0a, 0x1a, + 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, 0x69, + 0x6e, 0x52, 0x6f, 0x6f, 0x6d, 0x53, 0x74, 0x61, 0x74, 0x65, 0x10, 0xa7, 0x2c, 0x12, 0x1e, 0x0a, + 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x43, 0x53, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, + 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x10, 0xa8, 0x2c, 0x12, 0x1e, 0x0a, + 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x53, 0x43, 0x50, 0x75, 0x73, 0x68, 0x43, 0x6f, + 0x69, 0x6e, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x4f, 0x70, 0x10, 0xa9, 0x2c, 0x2a, 0x6b, 0x0a, + 0x07, 0x4f, 0x70, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x50, 0x5f, 0x5a, + 0x65, 0x72, 0x6f, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x4f, 0x50, 0x5f, 0x42, 0x65, 0x74, 0x10, + 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x4f, 0x50, 0x5f, 0x47, 0x61, 0x69, 0x6e, 0x10, 0x02, 0x12, 0x0c, + 0x0a, 0x08, 0x4f, 0x50, 0x5f, 0x53, 0x68, 0x61, 0x6b, 0x65, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, + 0x4f, 0x50, 0x5f, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x10, 0x04, 0x12, 0x0f, 0x0a, 0x0b, + 0x4f, 0x50, 0x5f, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x10, 0x05, 0x12, 0x0b, 0x0a, + 0x07, 0x4f, 0x50, 0x5f, 0x44, 0x72, 0x61, 0x77, 0x10, 0x06, 0x2a, 0x30, 0x0a, 0x0c, 0x4f, 0x70, + 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, + 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a, + 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x10, 0x01, 0x42, 0x28, 0x5a, 0x26, + 0x6d, 0x6f, 0x6e, 0x67, 0x6f, 0x2e, 0x67, 0x61, 0x6d, 0x65, 0x73, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x67, 0x61, 0x6d, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x6f, 0x6c, 0x2f, 0x70, 0x75, + 0x73, 0x68, 0x63, 0x6f, 0x69, 0x6e, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_protocol_pushcoin_pushcoin_proto_rawDescOnce sync.Once + file_protocol_pushcoin_pushcoin_proto_rawDescData = file_protocol_pushcoin_pushcoin_proto_rawDesc +) + +func file_protocol_pushcoin_pushcoin_proto_rawDescGZIP() []byte { + file_protocol_pushcoin_pushcoin_proto_rawDescOnce.Do(func() { + file_protocol_pushcoin_pushcoin_proto_rawDescData = protoimpl.X.CompressGZIP(file_protocol_pushcoin_pushcoin_proto_rawDescData) + }) + return file_protocol_pushcoin_pushcoin_proto_rawDescData +} + +var file_protocol_pushcoin_pushcoin_proto_enumTypes = make([]protoimpl.EnumInfo, 3) +var file_protocol_pushcoin_pushcoin_proto_msgTypes = make([]protoimpl.MessageInfo, 8) +var file_protocol_pushcoin_pushcoin_proto_goTypes = []interface{}{ + (PushCoinPacketID)(0), // 0: pushcoin.PushCoinPacketID + (OpCodes)(0), // 1: pushcoin.OpCodes + (OpResultCode)(0), // 2: pushcoin.OpResultCode + (*SCPushCoinRoomInfo)(nil), // 3: pushcoin.SCPushCoinRoomInfo + (*ItemInfo)(nil), // 4: pushcoin.ItemInfo + (*ExchangeInfo)(nil), // 5: pushcoin.ExchangeInfo + (*DrawInfo)(nil), // 6: pushcoin.DrawInfo + (*PushCoinPlayerData)(nil), // 7: pushcoin.PushCoinPlayerData + (*SCPushCoinRoomState)(nil), // 8: pushcoin.SCPushCoinRoomState + (*CSPushCoinPlayerOp)(nil), // 9: pushcoin.CSPushCoinPlayerOp + (*SCPushCoinPlayerOp)(nil), // 10: pushcoin.SCPushCoinPlayerOp +} +var file_protocol_pushcoin_pushcoin_proto_depIdxs = []int32{ + 7, // 0: pushcoin.SCPushCoinRoomInfo.Players:type_name -> pushcoin.PushCoinPlayerData + 5, // 1: pushcoin.SCPushCoinRoomInfo.ExchangeList:type_name -> pushcoin.ExchangeInfo + 6, // 2: pushcoin.SCPushCoinRoomInfo.DrawList:type_name -> pushcoin.DrawInfo + 4, // 3: pushcoin.ExchangeInfo.Cost:type_name -> pushcoin.ItemInfo + 4, // 4: pushcoin.ExchangeInfo.Gain:type_name -> pushcoin.ItemInfo + 1, // 5: pushcoin.CSPushCoinPlayerOp.OpCode:type_name -> pushcoin.OpCodes + 2, // 6: pushcoin.SCPushCoinPlayerOp.OpRetCode:type_name -> pushcoin.OpResultCode + 1, // 7: pushcoin.SCPushCoinPlayerOp.OpCode:type_name -> pushcoin.OpCodes + 5, // 8: pushcoin.SCPushCoinPlayerOp.Exchange:type_name -> pushcoin.ExchangeInfo + 6, // 9: pushcoin.SCPushCoinPlayerOp.Draw:type_name -> pushcoin.DrawInfo + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name +} + +func init() { file_protocol_pushcoin_pushcoin_proto_init() } +func file_protocol_pushcoin_pushcoin_proto_init() { + if File_protocol_pushcoin_pushcoin_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_protocol_pushcoin_pushcoin_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCPushCoinRoomInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_pushcoin_pushcoin_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ItemInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_pushcoin_pushcoin_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ExchangeInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_pushcoin_pushcoin_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DrawInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_pushcoin_pushcoin_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PushCoinPlayerData); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_pushcoin_pushcoin_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCPushCoinRoomState); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_pushcoin_pushcoin_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CSPushCoinPlayerOp); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_protocol_pushcoin_pushcoin_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SCPushCoinPlayerOp); 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_protocol_pushcoin_pushcoin_proto_rawDesc, + NumEnums: 3, + NumMessages: 8, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_protocol_pushcoin_pushcoin_proto_goTypes, + DependencyIndexes: file_protocol_pushcoin_pushcoin_proto_depIdxs, + EnumInfos: file_protocol_pushcoin_pushcoin_proto_enumTypes, + MessageInfos: file_protocol_pushcoin_pushcoin_proto_msgTypes, + }.Build() + File_protocol_pushcoin_pushcoin_proto = out.File + file_protocol_pushcoin_pushcoin_proto_rawDesc = nil + file_protocol_pushcoin_pushcoin_proto_goTypes = nil + file_protocol_pushcoin_pushcoin_proto_depIdxs = nil +} diff --git a/protocol/pushcoin/pushcoin.proto b/protocol/pushcoin/pushcoin.proto new file mode 100644 index 0000000..0bb87bf --- /dev/null +++ b/protocol/pushcoin/pushcoin.proto @@ -0,0 +1,103 @@ +syntax = "proto3"; +package pushcoin; +option go_package = "mongo.games.com/game/protocol/pushcoin"; + +// 5670~5679 +enum PushCoinPacketID { + PACKET_PushCoin_ZERO = 0;// 弃用消息号 + PACKET_SCPushCoinRoomInfo = 5670; // 房间信息 + PACKET_SCPushCoinRoomState = 5671; // 房间状态 + PACKET_CSPushCoinPlayerOp = 5672; // 玩家操作 + PACKET_SCPushCoinPlayerOp = 5673; // 玩家操作返回 +} + +//房间信息 +//PACKET_SCPushCoinRoomInfo +message SCPushCoinRoomInfo { + int32 RoomId = 1; //房间id + int32 GameId = 2; //游戏id + int32 RoomMode = 3; //游戏模式 + repeated int32 Params = 4; //规则参数 + int32 State = 5; //房间当前状态 + int32 TimeOut = 6; //等待剩余时间 单位:秒 + repeated PushCoinPlayerData Players = 7; //房间内的玩家信息 + repeated ExchangeInfo ExchangeList = 8; //兑换信息 + repeated DrawInfo DrawList = 9; //抽奖信息 +} + +message ItemInfo{ + int32 ItemId = 1; //道具id + int32 ItemNum = 2; //道具数量 +} + +message ExchangeInfo{ + int32 Id = 1; //兑换id + repeated ItemInfo Cost = 2; //消耗道具 + repeated ItemInfo Gain = 3; //获得道具 + int32 ShakeTimes = 4; //获得震动次数 +} + +message DrawInfo{ + int32 Id = 1; //抽奖id + int32 ItemId = 2; //道具id + int32 ItemNum = 3; //道具数量 + int64 Coin = 4; //价值 +} + +message PushCoinPlayerData { + string Name = 1; //名字 + int32 SnId = 2; //账号 + int32 Head = 3; //头像 + int32 Sex = 4; //性别 + int64 Coin = 5; //金币 + int32 Flag = 6; //二进制标记 第一位:是否掉线(0:在线 1:掉线) 第二位:是否准备(0:未准备 1:已准备) + repeated string Params = 7; //其他数据 如:ip 等 + int32 VIP = 8; + int32 RoleId = 9; //使用中的角色id + int64 Level = 10; //玩家等级 + int64 Exp = 11; //玩家经验 + int32 SkinId = 12; //皮肤id + int32 ShakeTimes = 13; //可震动次数 + int64 BaseCoin = 14; //当前底分(单次投币金额) + int64 PowerLine = 15; // 当前能量值 + int64 PowerLineMax = 16; // 能量值上限 + int64 RefreshTimes = 17; // 刷新次数 +} + +//房间状态 +//PACKET_SCPushCoinRoomState +message SCPushCoinRoomState { + int32 State = 1; //房间当前状态 + int32 SubState = 2; //房间当前子状态 + repeated int32 Params = 3; //状态参数 +} + +//玩家操作 +//PACKET_CSPushCoinPlayerOp +message CSPushCoinPlayerOp { + OpCodes OpCode = 1; + repeated int64 OpParam = 2; +} + +enum OpCodes { + OP_Zero = 0; + OP_Bet = 1; // 下注 [下注金额] + OP_Gain = 2; // 得分 [得分金额] + OP_Shake = 3; // 震动 [消耗次数] + OP_Refresh = 4; // 刷新 [桌面金额] + OP_Exchange = 5; // 兑换 [兑换id] + OP_Draw = 6; // 抽奖 [抽奖id] +} + +enum OpResultCode { + OPRC_Success = 0; //成功 + OPRC_Error = 1; //失败 +} + +//PACKET_SCPushCoinPlayerOp +message SCPushCoinPlayerOp { + OpResultCode OpRetCode = 1; + OpCodes OpCode = 2; + ExchangeInfo Exchange = 3; // 兑换信息,加到背包 + DrawInfo Draw = 4; // 抽奖信息,掉落到桌面 +} \ No newline at end of file diff --git a/tools/benchmark/action_login.go b/tools/benchmark/action_login.go new file mode 100644 index 0000000..56cb89c --- /dev/null +++ b/tools/benchmark/action_login.go @@ -0,0 +1,95 @@ +package main + +import ( + "encoding/json" + "fmt" + "math/rand" + "mongo.games.com/goserver/core/timer" + "time" + + "mongo.games.com/goserver/core/logger" + "mongo.games.com/goserver/core/netlib" + + "mongo.games.com/game/model" + "mongo.games.com/game/proto" + loginproto "mongo.games.com/game/protocol/login" + playerproto "mongo.games.com/game/protocol/player" +) + +func init() { + // 心跳 + netlib.Register(int(loginproto.GatePacketID_PACKET_SC_PONG), loginproto.SCPong{}, SCPong) + // 登录 + netlib.Register(int(loginproto.LoginPacketID_PACKET_SC_LOGIN), loginproto.SCLogin{}, SCLogin) + // 玩家信息 + netlib.Register(int(playerproto.PlayerPacketID_PACKET_SC_PLAYERDATA), playerproto.SCPlayerData{}, SCPlayerData) +} + +func SCPong(s *netlib.Session, packetid int, data interface{}) error { + accountID := s.GetAttribute(SessionAttributeClientAccountId) + logger.Logger.Tracef("SCPong username:%v %v", accountID, data) + return nil +} + +func SCLogin(s *netlib.Session, packetid int, data interface{}) error { + logger.Logger.Trace("SCLogin ", data) + + msg, ok := data.(*loginproto.SCLogin) + if !ok { + return nil + } + + if msg.GetOpRetCode() != loginproto.OpResultCode_OPRC_Sucess { + accountID := s.GetAttribute(SessionAttributeClientAccountId) + logger.Logger.Error("登录失败 ", accountID) + s.Close() + return nil + } + + csPlayerData := &playerproto.CSPlayerData{ + AccId: msg.GetAccId(), + } + pp := &model.PlayerParams{ + Platform: 1, + Ip: fmt.Sprintf("%v.%v.%v.%v", 1+rand.Int31n(255), 1+rand.Int31n(255), 1+rand.Int31n(255), 1+rand.Int31n(255)), + City: "北京", + Logininmodel: "app", + } + d, err := json.Marshal(pp) + if err == nil { + csPlayerData.Params = proto.String(string(d)) + } + + s.Send(int(playerproto.PlayerPacketID_PACKET_CS_PLAYERDATA), csPlayerData) + logger.Logger.Info("登录成功 ", msg.GetAccId()) + return nil +} + +func SCPlayerData(s *netlib.Session, packetid int, data interface{}) error { + logger.Logger.Trace("SCPlayerData ", data) + msg, ok := data.(*playerproto.SCPlayerData) + if !ok { + return nil + } + + if msg.GetOpRetCode() != playerproto.OpResultCode_OPRC_Sucess { + accountID := s.GetAttribute(SessionAttributeClientAccountId) + logger.Logger.Errorf("获取玩家信息失败 %v", accountID) + s.Close() + return nil + } + + s.SetAttribute(SessionAttributeUser, msg) + + StartSessionPingTimer(s, timer.TimerActionWrapper(func(h timer.TimerHandle, ud interface{}) bool { + if !s.IsConned() { + StopSessionPingTimer(s) + return false + } + pack := &loginproto.CSPing{} + s.Send(int(loginproto.GatePacketID_PACKET_CS_PING), pack) + return true + }), nil, time.Second*time.Duration(60+rand.Int31n(100)), -1) + + return nil +} diff --git a/tools/benchmark/config.go b/tools/benchmark/config.go new file mode 100644 index 0000000..a90ad75 --- /dev/null +++ b/tools/benchmark/config.go @@ -0,0 +1,35 @@ +package main + +import ( + "mongo.games.com/goserver/core" + "mongo.games.com/goserver/core/logger" + "mongo.games.com/goserver/core/netlib" +) + +var Config = &Configuration{} + +type Configuration struct { + Count int // 机器人总数 + AppId string // appID + Connects netlib.SessionConfig // 网络连接配置 +} + +func (this *Configuration) Name() string { + return "benchmark" +} + +func (this *Configuration) Init() error { + logger.Logger.Tracef("%+v", *this) + if this.Count == 0 { + this.Count = 20 + } + return nil +} + +func (this *Configuration) Close() error { + return nil +} + +func init() { + core.RegistePackage(Config) +} diff --git a/tools/benchmark/config.yaml b/tools/benchmark/config.yaml new file mode 100644 index 0000000..b8d3d9c --- /dev/null +++ b/tools/benchmark/config.yaml @@ -0,0 +1,65 @@ +netlib: + SrvInfo: + Name: BenchmarkServer + Type: 9 + Id: 902 + AreaID: 1 + Banner: + - ================= + - benchmark server + - ================= + IoServices: [] +module: + Options: + QueueBacklog: 1024 + MaxDone: 1024 + Interval: 100 +executor: + Options: + QueueBacklog: 1024 + MaxDone: 1024 + Interval: 0 + Worker: + WorkerCnt: 8 + Options: + QueueBacklog: 1024 + MaxDone: 1024 + Interval: 0 +timer: + Options: + QueueBacklog: 1024 + MaxDone: 1024 + Interval: 100 +signal: + SupportSignal: true +benchmark: + Count: 100 + AppId: 5c56d1644966f078bfb90c71 + Connects: + Id: 402 + Type: 4 + AreaId: 1 + Name: ClientService + Ip: 127.0.0.1 + Port: 11001 + Protocol: tcp + Path: / + MaxDone: 200 + MaxPend: 200 + MaxPacket: 65535 + MaxConn: 2000 + RcvBuff: 4096 + SndBuff: 4096 + WriteTimeout: 3600 + ReadTimeout: 3600 + SoLinger: 10 + IsInnerLink: true + NoDelay: true + SupportFragment: true + AuthKey: www.jxjy.games.cn + IsClient: true + AllowMultiConn: true + FilterChain: + - session-filter-auth + HandlerChain: + - handler-gate-session diff --git a/tools/benchmark/connect.go b/tools/benchmark/connect.go new file mode 100644 index 0000000..a580173 --- /dev/null +++ b/tools/benchmark/connect.go @@ -0,0 +1,69 @@ +package main + +import ( + "time" + + "mongo.games.com/goserver/core/logger" + "mongo.games.com/goserver/core/module" + "mongo.games.com/goserver/core/netlib" +) + +const ( + // RobotSessionStartId 机器人session开始id + RobotSessionStartId = 100000000 +) + +var ( + BenchMarkModule = &BenchMark{} + WaitConnectSessions []*netlib.SessionConfig +) + +// NewSession 新建session +// id 连接id, 默认自动分配 +func NewSession(id ...int) { + cfg := Config.Connects + if len(id) > 0 && id[0] > 0 { + cfg.Id = id[0] + } else { + BenchMarkModule.idx++ + cfg.Id = BenchMarkModule.idx + } + cfg.Init() + logger.Logger.Info("waite connect session id=", cfg.Id) + WaitConnectSessions = append(WaitConnectSessions, &cfg) +} + +type BenchMark struct { + idx int +} + +func (m *BenchMark) ModuleName() string { + return "benchmark-module" +} + +func (m *BenchMark) Init() { + m.idx = RobotSessionStartId + for i := 0; i < Config.Count; i++ { + NewSession() + } +} + +// Update 机器开始连接游戏服务器 +func (m *BenchMark) Update() { + n := len(WaitConnectSessions) + if n > 0 { + config := WaitConnectSessions[n-1] + WaitConnectSessions = WaitConnectSessions[:n-1] + if err := netlib.Connect(config); err != nil { + logger.Logger.Error("netlib.Connect error", err) + } + } +} + +func (m *BenchMark) Shutdown() { + module.UnregisteModule(m) +} + +func init() { + module.RegisteModule(BenchMarkModule, time.Millisecond, 1) +} diff --git a/tools/benchmark/constants.go b/tools/benchmark/constants.go new file mode 100644 index 0000000..8a87971 --- /dev/null +++ b/tools/benchmark/constants.go @@ -0,0 +1,31 @@ +package main + +import ( + "mongo.games.com/goserver/core/netlib" + "mongo.games.com/goserver/core/timer" + "time" +) + +const ( + SessionAttributeClientAccountId int = iota // 账号 + SessionAttributeUser + SessionAttributePingTimer +) + +func StartSessionPingTimer(s *netlib.Session, act timer.TimerAction, ud interface{}, interval time.Duration, times int) bool { + StopSessionPingTimer(s) + if hTimer, ok := timer.StartTimer(act, ud, interval, times); ok { + s.SetAttribute(SessionAttributePingTimer, hTimer) + return true + } + return false +} + +func StopSessionPingTimer(s *netlib.Session) { + if h, ok := s.GetAttribute(SessionAttributePingTimer).(timer.TimerHandle); ok { + if h != timer.TimerHandle(0) { + timer.StopTimer(h) + s.RemoveAttribute(SessionAttributePingTimer) + } + } +} diff --git a/tools/benchmark/gatesessionhandler.go b/tools/benchmark/gatesessionhandler.go new file mode 100644 index 0000000..e6b06d7 --- /dev/null +++ b/tools/benchmark/gatesessionhandler.go @@ -0,0 +1,97 @@ +package main + +import ( + "crypto/md5" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "math/rand" + "mongo.games.com/game/common" + "mongo.games.com/game/model" + loginproto "mongo.games.com/game/protocol/login" + "mongo.games.com/goserver/core/logger" + "mongo.games.com/goserver/core/netlib" + "strconv" + "sync/atomic" + "time" +) + +/* + 添加到客户端管理器,管理器负责登录 + 当连接断开时,从管理器中移除,判断是否需要重连 +*/ + +const ( + GateSessionHandlerName = "handler-gate-session" +) + +type GateSessionHandler struct { + netlib.BasicSessionHandler +} + +func (g *GateSessionHandler) GetName() string { + return GateSessionHandlerName +} + +func (g *GateSessionHandler) GetInterestOps() uint { + return 1< + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/benchmark/main.go b/tools/benchmark/main.go new file mode 100644 index 0000000..b1fe17b --- /dev/null +++ b/tools/benchmark/main.go @@ -0,0 +1,25 @@ +package main + +import ( + _ "mongo.games.com/game" + + "mongo.games.com/goserver/core" + "mongo.games.com/goserver/core/module" +) + +func main() { + defer core.ClosePackages() + core.LoadPackages("config.yaml") + // core hook + core.RegisteHook(core.HOOK_BEFORE_START, func() error { + + return nil + }) + core.RegisteHook(core.HOOK_AFTER_STOP, func() error { + + return nil + }) + // module模块 + waiter := module.Start() + waiter.Wait("main()") +} diff --git a/worldsrv/welfmgr.go b/worldsrv/welfmgr.go index 7a331d9..ce183c9 100644 --- a/worldsrv/welfmgr.go +++ b/worldsrv/welfmgr.go @@ -5,6 +5,7 @@ import ( "math" "math/rand" "slices" + "sort" "time" "mongo.games.com/goserver/core/logger" @@ -2313,6 +2314,10 @@ func (this *WelfareMgr) SendRedPacketInfo(p *Player) *welfare.SCRedPacketInfo { } } + sort.Slice(pack.Info, func(i, j int) bool { + return pack.Info[i].StartTs < pack.Info[j].StartTs + }) + p.SendToClient(int(welfare.SPacketID_PACKET_SCRedPacketInfo), pack) return pack } @@ -2401,7 +2406,7 @@ func (this *WelfareMgr) GetRedPacket(p *Player, id int64) *welfare.SCRedPacketDr f := func() { // 概率抽奖 rate := 0 - n := rand.Int63n(100) + n := rand.Int63n(10000) for _, v := range cfg.GetRedList() { rate += int(v.GetRate()) if n < int64(rate) { diff --git a/xlsx/DB_GameFree.xlsx b/xlsx/DB_GameFree.xlsx index 965eeb4..f1f2c3e 100644 Binary files a/xlsx/DB_GameFree.xlsx and b/xlsx/DB_GameFree.xlsx differ diff --git a/xlsx/DB_GameRule.xlsx b/xlsx/DB_GameRule.xlsx index 1c38755..ad2e867 100644 Binary files a/xlsx/DB_GameRule.xlsx and b/xlsx/DB_GameRule.xlsx differ