竞技馆中奖广播
This commit is contained in:
parent
0a67496d50
commit
d8a6246f93
|
@ -877,3 +877,7 @@ const (
|
||||||
LotteryStateRun = 2 // 抽奖进行中
|
LotteryStateRun = 2 // 抽奖进行中
|
||||||
LotteryStateNoStart = 3 // 抽奖未开始
|
LotteryStateNoStart = 3 // 抽奖未开始
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
NoticeTypeCustomAward = 1 + iota // 房卡场获奖通知
|
||||||
|
)
|
||||||
|
|
|
@ -16,6 +16,7 @@ import (
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
"mongo.games.com/game/mq"
|
"mongo.games.com/game/mq"
|
||||||
"mongo.games.com/game/proto"
|
"mongo.games.com/game/proto"
|
||||||
|
"mongo.games.com/game/protocol/server"
|
||||||
"mongo.games.com/game/protocol/tienlen"
|
"mongo.games.com/game/protocol/tienlen"
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
)
|
)
|
||||||
|
@ -2634,6 +2635,7 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
p := base.PlayerMgrSington.GetPlayerBySnId(packBilled.List[0].SnId)
|
p := base.PlayerMgrSington.GetPlayerBySnId(packBilled.List[0].SnId)
|
||||||
if p != nil {
|
if p != nil {
|
||||||
var items []*model.Item
|
var items []*model.Item
|
||||||
|
var noticeItems []*server.Item
|
||||||
for _, v := range packBilled.List[0].Award {
|
for _, v := range packBilled.List[0].Award {
|
||||||
itemData := srvdata.GameItemMgr.Get(p.Platform, v.GetId())
|
itemData := srvdata.GameItemMgr.Get(p.Platform, v.GetId())
|
||||||
if itemData != nil {
|
if itemData != nil {
|
||||||
|
@ -2641,6 +2643,10 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
ItemId: v.GetId(),
|
ItemId: v.GetId(),
|
||||||
ItemNum: v.GetNum(),
|
ItemNum: v.GetNum(),
|
||||||
})
|
})
|
||||||
|
noticeItems = append(noticeItems, &server.Item{
|
||||||
|
Id: v.GetId(),
|
||||||
|
Num: v.GetNum(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
p.AddItems(&model.AddItemParam{
|
p.AddItems(&model.AddItemParam{
|
||||||
|
@ -2667,6 +2673,16 @@ func (this *SceneBilledStateTienLen) OnEnter(s *base.Scene) {
|
||||||
mq.Write(award, mq.DBCustomLogAward)
|
mq.Write(award, mq.DBCustomLogAward)
|
||||||
mq.Write(award, mq.WorldCustomAward)
|
mq.Write(award, mq.WorldCustomAward)
|
||||||
sceneEx.PlayerAward[p.SnId] = &items
|
sceneEx.PlayerAward[p.SnId] = &items
|
||||||
|
notice := &server.GWNewNotice{
|
||||||
|
Platform: p.Platform,
|
||||||
|
Tp: common.NoticeTypeCustomAward,
|
||||||
|
RoomId: sceneEx.SceneId,
|
||||||
|
SnId: p.GetSnId(),
|
||||||
|
Name: p.GetName(),
|
||||||
|
RoleId: p.Roles.ModId,
|
||||||
|
Items: noticeItems,
|
||||||
|
}
|
||||||
|
sceneEx.SendToWorld(int(server.SSPacketID_PACKET_GW_NEWNOTICE), notice)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -21,6 +21,21 @@ enum MSGPacketID {
|
||||||
PACKET_SC_GETMESSAGEATTACH = 2437;
|
PACKET_SC_GETMESSAGEATTACH = 2437;
|
||||||
PACKET_SC_NOTICE = 2438;
|
PACKET_SC_NOTICE = 2438;
|
||||||
PACKET_CS_MESSAGELIST = 2439;
|
PACKET_CS_MESSAGELIST = 2439;
|
||||||
|
PACKET_Notice = 2440; // 通知跑马灯
|
||||||
|
}
|
||||||
|
|
||||||
|
message Item {
|
||||||
|
int32 Id = 1;
|
||||||
|
int64 Num = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
// PACKET_Notice
|
||||||
|
message Notice {
|
||||||
|
int32 Tp = 1; // 1:竞技馆中奖通知
|
||||||
|
int32 SnId = 2;
|
||||||
|
string Name = 3;
|
||||||
|
int32 RoleId = 4;
|
||||||
|
repeated Item Items = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message NoticeParam{
|
message NoticeParam{
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -544,15 +544,13 @@ message WGHundredOp{
|
||||||
|
|
||||||
//系统广播
|
//系统广播
|
||||||
message GWNewNotice{
|
message GWNewNotice{
|
||||||
string ch = 1;
|
string Platform = 1; // 平台
|
||||||
string content = 2;
|
int32 Tp = 2; //类型 1房卡场获奖通知
|
||||||
int64 start = 3;
|
int32 RoomId = 3; //房间id
|
||||||
int64 interval = 4;
|
int32 SnId = 4; //玩家id
|
||||||
int64 count = 5;
|
string Name = 5; //玩家名字
|
||||||
int64 msgtype = 6;
|
int32 RoleId = 6; //角色id
|
||||||
string platform = 7;
|
repeated Item Items = 7; //道具
|
||||||
int32 priority = 8;
|
|
||||||
bool isrob = 9;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message PlayerStatics{
|
message PlayerStatics{
|
||||||
|
|
|
@ -1425,6 +1425,9 @@ func CSGetPrivateRoomListHandler(s *netlib.Session, packetId int, data interface
|
||||||
State: v.SceneState,
|
State: v.SceneState,
|
||||||
Players: players,
|
Players: players,
|
||||||
}
|
}
|
||||||
|
if v.creator == 0 {
|
||||||
|
d.IsSystem = true
|
||||||
|
}
|
||||||
pack.Datas = append(pack.Datas, d)
|
pack.Datas = append(pack.Datas, d)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,6 +14,7 @@ import (
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
"mongo.games.com/game/mq"
|
"mongo.games.com/game/mq"
|
||||||
loginproto "mongo.games.com/game/protocol/login"
|
loginproto "mongo.games.com/game/protocol/login"
|
||||||
|
"mongo.games.com/game/protocol/message"
|
||||||
playerproto "mongo.games.com/game/protocol/player"
|
playerproto "mongo.games.com/game/protocol/player"
|
||||||
serverproto "mongo.games.com/game/protocol/server"
|
serverproto "mongo.games.com/game/protocol/server"
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
|
@ -317,19 +318,41 @@ func init() {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
// 游戏服务器的系统广播
|
// 游戏服务器的系统广播
|
||||||
// 捕鱼
|
netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.PacketFactoryWrapper(func() interface{} {
|
||||||
//netlib.RegisterFactory(int(serverproto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.PacketFactoryWrapper(func() interface{} {
|
return &serverproto.GWNewNotice{}
|
||||||
// return &serverproto.GWNewNotice{}
|
}))
|
||||||
//}))
|
netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.HandlerWrapper(func(s *netlib.Session, packetID int, pack interface{}) error {
|
||||||
//netlib.RegisterHandler(int(serverproto.SSPacketID_PACKET_GW_NEWNOTICE), netlib.HandlerWrapper(func(s *netlib.Session,
|
logger.Logger.Tracef("receive SSPacketID_PACKET_GW_NEWNOTICE GWNewNotice:%v", pack)
|
||||||
// packetid int, pack interface{}) error {
|
msg, ok := pack.(*serverproto.GWNewNotice)
|
||||||
// logger.Logger.Trace("receive GWNewNotice:", pack)
|
if !ok {
|
||||||
// if msg, ok := pack.(*serverproto.GWNewNotice); ok {
|
return nil
|
||||||
// //立即发送改为定期发送,控制下广播包的频度
|
}
|
||||||
// //HorseRaceLampMgrSingleton.PushGameHorseRaceLamp(msg.GetCh(), msg.GetPlatform(), msg.GetContent(), int32(msg.GetMsgtype()), msg.GetIsrob(), msg.GetPriority())
|
|
||||||
// }
|
switch msg.GetTp() {
|
||||||
// return nil
|
case common.NoticeTypeCustomAward:
|
||||||
//}))
|
var items []*message.Item
|
||||||
|
for _, v := range msg.GetItems() {
|
||||||
|
items = append(items, &message.Item{
|
||||||
|
Id: v.GetId(),
|
||||||
|
Num: v.GetNum(),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
notice := &message.Notice{
|
||||||
|
Tp: msg.GetTp(),
|
||||||
|
SnId: msg.GetSnId(),
|
||||||
|
Name: msg.GetName(),
|
||||||
|
RoleId: msg.GetRoleId(),
|
||||||
|
Items: items,
|
||||||
|
}
|
||||||
|
PlayerMgrSington.BroadcastMessageToPlatform(msg.GetPlatform(), int(message.MSGPacketID_PACKET_Notice), notice)
|
||||||
|
logger.Logger.Tracef("broadcast custom award notice:%v", notice)
|
||||||
|
|
||||||
|
default:
|
||||||
|
logger.Logger.Errorf("not type GWNewNotice:%v", pack)
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}))
|
||||||
|
|
||||||
// 强制离开房间
|
// 强制离开房间
|
||||||
// 返回房间失败
|
// 返回房间失败
|
||||||
|
|
Loading…
Reference in New Issue