diff --git a/common/broadcasthandler.go b/common/broadcasthandler.go new file mode 100644 index 0000000..0922359 --- /dev/null +++ b/common/broadcasthandler.go @@ -0,0 +1,45 @@ +package common + +import ( + rawproto "google.golang.org/protobuf/proto" + "mongo.games.com/game/proto" + "mongo.games.com/goserver/core/logger" + "mongo.games.com/goserver/core/netlib" + "mongo.games.com/goserver/srvlib" + "mongo.games.com/goserver/srvlib/protocol" +) + +func RegisterBoardCastHandler() { + netlib.Register(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), &protocol.SSPacketBroadcast{}, BroadcastHandler) +} + +func BroadcastHandler(s *netlib.Session, packetId int, data interface{}) error { + if bp, ok := data.(*protocol.SSPacketBroadcast); ok { + pd := bp.GetData() + sp := bp.GetSessParam() + if bcss := sp.GetBcss(); bcss != nil { + srvlib.ServerSessionMgrSington.Broadcast(int(bp.GetPacketId()), pd, int(bcss.GetSArea()), int(bcss.GetSType())) + } + } + return nil +} + +func CreateBroadcastPacket(sp *protocol.BCSessionUnion, packetId int, data interface{}) (rawproto.Message, error) { + pack := &protocol.SSPacketBroadcast{ + SessParam: sp, + PacketId: proto.Int(packetId), + } + + if byteData, ok := data.([]byte); ok { + pack.Data = byteData + } else { + byteData, err := netlib.MarshalPacket(packetId, data) + if err == nil { + pack.Data = byteData + } else { + logger.Logger.Warnf("CreateBroadcastPacket err:%v", err) + return nil, err + } + } + return pack, nil +} diff --git a/common/multicasthandler.go b/common/multicasthandler.go new file mode 100644 index 0000000..0a60453 --- /dev/null +++ b/common/multicasthandler.go @@ -0,0 +1,50 @@ +package common + +import ( + rawproto "google.golang.org/protobuf/proto" + "mongo.games.com/game/proto" + "mongo.games.com/goserver/core/logger" + "mongo.games.com/goserver/core/netlib" + "mongo.games.com/goserver/srvlib" + "mongo.games.com/goserver/srvlib/protocol" +) + +func RegisterMulticastHandler() { + netlib.Register(int(protocol.SrvlibPacketID_PACKET_SS_MULTICAST), &protocol.SSPacketMulticast{}, MulticastHandler) +} + +func MulticastHandler(s *netlib.Session, packetId int, data interface{}) error { + if mp, ok := data.(*protocol.SSPacketMulticast); ok { + pd := mp.GetData() + sis := mp.GetSessions() + for _, si := range sis { + ss := si.GetMcss() + if ss != nil { + ns := srvlib.ServerSessionMgrSington.GetSession(int(ss.GetSArea()), int(ss.GetSType()), int(ss.GetSId())) + if ns != nil { + ns.Send(int(mp.GetPacketId()), pd /*, s.GetSessionConfig().IsInnerLink*/) + } + } + } + } + return nil +} + +func CreateMulticastPacket(packetId int, data interface{}, sis ...*protocol.MCSessionUnion) (rawproto.Message, error) { + pack := &protocol.SSPacketMulticast{ + Sessions: sis, + PacketId: proto.Int(packetId), + } + if byteData, ok := data.([]byte); ok { + pack.Data = byteData + } else { + byteData, err := netlib.MarshalPacket(packetId, data) + if err == nil { + pack.Data = byteData + } else { + logger.Logger.Errorf("CreateMulticastPacket err:%v", err) + return nil, err + } + } + return pack, nil +} diff --git a/data/DB_PropExchange.dat b/data/DB_PropExchange.dat index 9d60e50..d669dda 100644 Binary files a/data/DB_PropExchange.dat and b/data/DB_PropExchange.dat differ diff --git a/data/DB_Skin.dat b/data/DB_Skin.dat index 4d3cb46..3803399 100644 Binary files a/data/DB_Skin.dat and b/data/DB_Skin.dat differ diff --git a/data/DB_Skin.json b/data/DB_Skin.json index 3a5ce1b..6109313 100644 --- a/data/DB_Skin.json +++ b/data/DB_Skin.json @@ -45,9 +45,9 @@ "SkinPic": "icon_300003", "SkinName": "活力-粉", "SkinType": "mg_02", - "UnlockType": 3, + "UnlockType": 2, "UnlockItem": { - "5": 0 + "310003": 20 }, "SkinSkillName": "活力满满", "SkinSkillIcon": "SkillIcon-30003", @@ -66,9 +66,9 @@ "SkinPic": "icon_300004", "SkinName": "活力-青", "SkinType": "mg_03", - "UnlockType": 3, + "UnlockType": 2, "UnlockItem": { - "2": 0 + "310004": 20 }, "SkinSkillName": "金币满满", "SkinSkillIcon": "SkillIcon-30004", diff --git a/data/DB_Task.dat b/data/DB_Task.dat index 95a4c56..31cd7aa 100644 Binary files a/data/DB_Task.dat and b/data/DB_Task.dat differ diff --git a/data/DB_VIP.dat b/data/DB_VIP.dat index f541d80..bc0b4f0 100644 Binary files a/data/DB_VIP.dat and b/data/DB_VIP.dat differ diff --git a/data/DB_VIP.json b/data/DB_VIP.json index 2d2a23e..136ccb2 100644 --- a/data/DB_VIP.json +++ b/data/DB_VIP.json @@ -30,6 +30,7 @@ "更多VIP功能正待开发" ], "Privilege9": [ + 0, 0, 0 ], @@ -70,6 +71,7 @@ ], "MatchFreeTimes": 1, "Privilege9": [ + 0, 0, 0 ], @@ -110,6 +112,8 @@ ], "MatchFreeTimes": 2, "Privilege9": [ + 0, + 0, 0, 0 ], @@ -150,6 +154,7 @@ ], "MatchFreeTimes": 3, "Privilege9": [ + 0, 0, 0 ], @@ -190,6 +195,7 @@ ], "MatchFreeTimes": 4, "Privilege9": [ + 0, 0, 0 ], @@ -230,6 +236,8 @@ ], "MatchFreeTimes": 5, "Privilege9": [ + 0, + 0, 0, 0 ], @@ -270,6 +278,7 @@ ], "MatchFreeTimes": 6, "Privilege9": [ + 0, 0, 0 ], @@ -310,6 +319,7 @@ ], "MatchFreeTimes": 7, "Privilege9": [ + 0, 0, 0 ], @@ -350,6 +360,7 @@ ], "MatchFreeTimes": 8, "Privilege9": [ + 0, 0, 0 ], @@ -390,6 +401,7 @@ ], "MatchFreeTimes": 9, "Privilege9": [ + 0, 0, 0 ], @@ -430,6 +442,7 @@ ], "MatchFreeTimes": 10, "Privilege9": [ + 0, 0, 0 ], @@ -470,6 +483,7 @@ ], "MatchFreeTimes": 11, "Privilege9": [ + 0, 0, 0 ], @@ -510,6 +524,7 @@ ], "MatchFreeTimes": 12, "Privilege9": [ + 0, 0, 0 ], @@ -550,6 +565,7 @@ ], "MatchFreeTimes": 13, "Privilege9": [ + 0, 0, 0 ], @@ -590,6 +606,7 @@ ], "MatchFreeTimes": 14, "Privilege9": [ + 0, 0, 0 ], @@ -630,6 +647,7 @@ ], "MatchFreeTimes": 15, "Privilege9": [ + 0, 0, 0 ], @@ -670,6 +688,7 @@ ], "MatchFreeTimes": 16, "Privilege9": [ + 0, 0, 0 ], diff --git a/data/DB_VIPShow.dat b/data/DB_VIPShow.dat index 71c1e91..56e777a 100644 --- a/data/DB_VIPShow.dat +++ b/data/DB_VIPShow.dat @@ -1,3 +1,3 @@ - - \ No newline at end of file + + \ No newline at end of file diff --git a/data/DB_VIPShow.json b/data/DB_VIPShow.json index 79d6cdb..acb89e4 100644 --- a/data/DB_VIPShow.json +++ b/data/DB_VIPShow.json @@ -2,11 +2,11 @@ "Arr": [ { "Id": 1, - "SkinId": 300003 + "SkinId": 300004 }, { "Id": 2, - "SkinId": 300004, + "SkinId": 300003, "VIPLevel": 3 } ] diff --git a/gamesrv/action/action_server.go b/gamesrv/action/action_server.go index 42afa23..10b4483 100644 --- a/gamesrv/action/action_server.go +++ b/gamesrv/action/action_server.go @@ -576,6 +576,7 @@ func init() { return nil })) + common.RegisterMulticastHandler() //玩家离开 netlib.Register(int(server.SSPacketID_PACKET_WG_PlayerLEAVE), server.WGPlayerLeave{}, HandleWGPlayerLeave) //同步记牌器过期时间 diff --git a/gamesrv/base/broadcasthandler.go b/gamesrv/base/broadcasthandler.go deleted file mode 100644 index afebcee..0000000 --- a/gamesrv/base/broadcasthandler.go +++ /dev/null @@ -1,61 +0,0 @@ -package base - -import ( - rawproto "google.golang.org/protobuf/proto" - "mongo.games.com/game/proto" - "mongo.games.com/goserver/core/logger" - "mongo.games.com/goserver/core/netlib" - "mongo.games.com/goserver/srvlib" - "mongo.games.com/goserver/srvlib/protocol" -) - -var ( - BroadcastMaker = &BroadcastPacketFactory{} -) - -type BroadcastPacketFactory struct { -} - -type BroadcastHandler struct { -} - -func init() { - netlib.RegisterHandler(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), &BroadcastHandler{}) - netlib.RegisterFactory(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), BroadcastMaker) -} - -func (this *BroadcastPacketFactory) CreatePacket() interface{} { - pack := &protocol.SSPacketBroadcast{} - return pack -} - -func (this *BroadcastPacketFactory) CreateBroadcastPacket(sp *protocol.BCSessionUnion, packetid int, data interface{}) (rawproto.Message, error) { - pack := &protocol.SSPacketBroadcast{ - SessParam: sp, - PacketId: proto.Int(packetid), - } - if byteData, ok := data.([]byte); ok { - pack.Data = byteData - } else { - byteData, err := netlib.MarshalPacket(packetid, data) - if err == nil { - pack.Data = byteData - } else { - logger.Logger.Warn("BroadcastPacketFactory.CreateBroadcastPacket err:", err) - return nil, err - } - } - proto.SetDefaults(pack) - return pack, nil -} - -func (this *BroadcastHandler) Process(s *netlib.Session, packetid int, data interface{}) error { - if bp, ok := data.(*protocol.SSPacketBroadcast); ok { - pd := bp.GetData() - sp := bp.GetSessParam() - if bcss := sp.GetBcss(); bcss != nil { - srvlib.ServerSessionMgrSington.Broadcast(int(bp.GetPacketId()), pd, int(bcss.GetSArea()), int(bcss.GetSType())) - } - } - return nil -} diff --git a/gamesrv/base/multicasthandler.go b/gamesrv/base/multicasthandler.go deleted file mode 100644 index 6a670d7..0000000 --- a/gamesrv/base/multicasthandler.go +++ /dev/null @@ -1,67 +0,0 @@ -package base - -import ( - rawproto "google.golang.org/protobuf/proto" - "mongo.games.com/game/proto" - "mongo.games.com/goserver/core/logger" - "mongo.games.com/goserver/core/netlib" - "mongo.games.com/goserver/srvlib" - "mongo.games.com/goserver/srvlib/protocol" -) - -var ( - MulticastMaker = &MulticastPacketFactory{} -) - -type MulticastPacketFactory struct { -} - -type MulticastHandler struct { -} - -func init() { - netlib.RegisterHandler(int(protocol.SrvlibPacketID_PACKET_SS_MULTICAST), &MulticastHandler{}) - netlib.RegisterFactory(int(protocol.SrvlibPacketID_PACKET_SS_MULTICAST), MulticastMaker) -} - -func (this *MulticastPacketFactory) CreatePacket() interface{} { - pack := &protocol.SSPacketMulticast{} - return pack -} - -func (this *MulticastPacketFactory) CreateMulticastPacket(packetid int, data interface{}, sis ...*protocol.MCSessionUnion) (rawproto.Message, error) { - pack := &protocol.SSPacketMulticast{ - Sessions: sis, - PacketId: proto.Int(packetid), - } - if byteData, ok := data.([]byte); ok { - pack.Data = byteData - } else { - byteData, err := netlib.MarshalPacket(packetid, data) - if err == nil { - pack.Data = byteData - } else { - logger.Logger.Info("MulticastPacketFactory.CreateMulticastPacket err:", err) - return nil, err - } - } - proto.SetDefaults(pack) - return pack, nil -} - -func (this *MulticastHandler) Process(s *netlib.Session, packetid int, data interface{}) error { - if mp, ok := data.(*protocol.SSPacketMulticast); ok { - pd := mp.GetData() - sis := mp.GetSessions() - for _, si := range sis { - ss := si.GetMcss() - if ss != nil { - ns := srvlib.ServerSessionMgrSington.GetSession(int(ss.GetSArea()), int(ss.GetSType()), int(ss.GetSId())) - if ns != nil { - ns.Send(int(mp.GetPacketId()), pd /*, s.GetSessionConfig().IsInnerLink*/) - } - } - } - } - return nil -} diff --git a/gamesrv/base/playermgr.go b/gamesrv/base/playermgr.go index 5a4db1e..88144ae 100644 --- a/gamesrv/base/playermgr.go +++ b/gamesrv/base/playermgr.go @@ -158,7 +158,7 @@ func (this *PlayerMgr) BroadcastMessage(packetid int, rawpack interface{}) bool sc := &protocol.BCSessionUnion{ Bccs: &protocol.BCClientSession{}, } - pack, err := BroadcastMaker.CreateBroadcastPacket(sc, packetid, rawpack) + pack, err := common.CreateBroadcastPacket(sc, packetid, rawpack) if err == nil && pack != nil { srvlib.ServerSessionMgrSington.Broadcast(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), pack, common.GetSelfAreaId(), srvlib.GateServerType) return true diff --git a/gamesrv/base/scene.go b/gamesrv/base/scene.go index f638b54..9d4bd8c 100644 --- a/gamesrv/base/scene.go +++ b/gamesrv/base/scene.go @@ -893,7 +893,7 @@ func (this *Scene) Broadcast(packetid int, msg rawproto.Message, excludeSid int6 } for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packetid, msg, v...) + pack, err := common.CreateMulticastPacket(packetid, msg, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvlibproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) @@ -917,7 +917,7 @@ func (this *Scene) RobotBroadcast(packetid int, msg rawproto.Message) { } for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packetid, msg, v...) + pack, err := common.CreateMulticastPacket(packetid, msg, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvlibproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) @@ -941,7 +941,7 @@ func (this *Scene) BroadcastToAudience(packetid int, msg rawproto.Message) { } for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packetid, msg, v...) + pack, err := common.CreateMulticastPacket(packetid, msg, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvlibproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) diff --git a/gamesrv/base/scene_mgr.go b/gamesrv/base/scene_mgr.go index c241b03..1b5b320 100644 --- a/gamesrv/base/scene_mgr.go +++ b/gamesrv/base/scene_mgr.go @@ -195,7 +195,7 @@ func (this *SceneMgr) JackPotSync(platform string, gameIds ...int32) { for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - cPack, err := MulticastMaker.CreateMulticastPacket(int(gamehall.HundredScenePacketID_PACKET_SC_GAMEJACKPOT), pack, v...) + cPack, err := common.CreateMulticastPacket(int(gamehall.HundredScenePacketID_PACKET_SC_GAMEJACKPOT), pack, v...) if err == nil { proto.SetDefaults(cPack) gateSess.Send(int(srvlibproto.SrvlibPacketID_PACKET_SS_MULTICAST), cPack) diff --git a/gamesrv/fishing/scenedata_fishing.go b/gamesrv/fishing/scenedata_fishing.go index d3a6914..c0ffaff 100644 --- a/gamesrv/fishing/scenedata_fishing.go +++ b/gamesrv/fishing/scenedata_fishing.go @@ -1458,7 +1458,7 @@ func (this *FishingSceneData) BroadCastMessage(packetid int, msg proto.Message, if gateSess == nil || len(v) == 0 { continue } - pack, err := base.MulticastMaker.CreateMulticastPacket(packetid, msg, v...) + pack, err := common.CreateMulticastPacket(packetid, msg, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvlibproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) diff --git a/gatesrv/broadcasthandler.go b/gatesrv/broadcasthandler.go index 1fb80a0..319bfec 100644 --- a/gatesrv/broadcasthandler.go +++ b/gatesrv/broadcasthandler.go @@ -1,56 +1,16 @@ package main import ( - rawproto "google.golang.org/protobuf/proto" - "mongo.games.com/game/proto" - "mongo.games.com/goserver/core/logger" "mongo.games.com/goserver/core/netlib" "mongo.games.com/goserver/srvlib" "mongo.games.com/goserver/srvlib/protocol" ) -var ( - BroadcastMaker = &BroadcastPacketFactory{} -) - -type BroadcastPacketFactory struct { -} - -type BroadcastHandler struct { -} - func init() { - // 给所有玩家或某个类型的所有服务发消息 - netlib.RegisterHandler(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), &BroadcastHandler{}) - netlib.RegisterFactory(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), BroadcastMaker) + netlib.Register(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), &protocol.SSPacketBroadcast{}, BroadcastHandler) } -func (this *BroadcastPacketFactory) CreatePacket() interface{} { - pack := &protocol.SSPacketBroadcast{} - return pack -} - -func (this *BroadcastPacketFactory) CreateBroadcastPacket(sp *protocol.BCSessionUnion, packetid int, data interface{}) (rawproto.Message, error) { - pack := &protocol.SSPacketBroadcast{ - SessParam: sp, - PacketId: proto.Int(packetid), - } - if byteData, ok := data.([]byte); ok { - pack.Data = byteData - } else { - byteData, err := netlib.MarshalPacket(packetid, data) - if err == nil { - pack.Data = byteData - } else { - logger.Logger.Warn("BroadcastPacketFactory.CreateBroadcastPacket err:", err) - return nil, err - } - } - proto.SetDefaults(pack) - return pack, nil -} - -func (this *BroadcastHandler) Process(s *netlib.Session, packetid int, data interface{}) error { +func BroadcastHandler(s *netlib.Session, packetid int, data interface{}) error { if bp, ok := data.(*protocol.SSPacketBroadcast); ok { pd := bp.GetData() sp := bp.GetSessParam() diff --git a/gatesrv/multicasthandler.go b/gatesrv/multicasthandler.go index ce0f29e..cfcde44 100644 --- a/gatesrv/multicasthandler.go +++ b/gatesrv/multicasthandler.go @@ -1,61 +1,21 @@ package main import ( - rawproto "google.golang.org/protobuf/proto" - "mongo.games.com/game/proto" - "mongo.games.com/goserver/core/logger" "mongo.games.com/goserver/core/netlib" "mongo.games.com/goserver/srvlib" "mongo.games.com/goserver/srvlib/protocol" ) -var ( - MulticastMaker = &MulticastPacketFactory{} -) - -type MulticastPacketFactory struct { -} - -type MulticastHandler struct { -} - func init() { - // 给某些玩家和某些服务发消息 - netlib.RegisterHandler(int(protocol.SrvlibPacketID_PACKET_SS_MULTICAST), &MulticastHandler{}) - netlib.RegisterFactory(int(protocol.SrvlibPacketID_PACKET_SS_MULTICAST), MulticastMaker) + netlib.Register(int(protocol.SrvlibPacketID_PACKET_SS_MULTICAST), &protocol.SSPacketMulticast{}, MulticastHandler) } -func (this *MulticastPacketFactory) CreatePacket() interface{} { - pack := &protocol.SSPacketMulticast{} - return pack -} - -func (this *MulticastPacketFactory) CreateMulticastPacket(packetid int, data interface{}, sis ...*protocol.MCSessionUnion) (rawproto.Message, error) { - pack := &protocol.SSPacketMulticast{ - Sessions: sis, - PacketId: proto.Int(packetid), - } - if byteData, ok := data.([]byte); ok { - pack.Data = byteData - } else { - byteData, err := netlib.MarshalPacket(packetid, data) - if err == nil { - pack.Data = byteData - } else { - logger.Logger.Info("MulticastPacketFactory.CreateMulticastPacket err:", err) - return nil, err - } - } - proto.SetDefaults(pack) - return pack, nil -} - -func (this *MulticastHandler) Process(s *netlib.Session, packetid int, data interface{}) error { +func MulticastHandler(s *netlib.Session, packetid int, data interface{}) error { if mp, ok := data.(*protocol.SSPacketMulticast); ok { pd := mp.GetData() sis := mp.GetSessions() for _, si := range sis { - ns := this.getSession(si) + ns := getSession(si) if ns != nil { ns.Send(int(mp.GetPacketId()), pd /*, s.GetSessionConfig().IsInnerLink*/) } @@ -64,7 +24,7 @@ func (this *MulticastHandler) Process(s *netlib.Session, packetid int, data inte return nil } -func (this *MulticastHandler) getSession(su *protocol.MCSessionUnion) *netlib.Session { +func getSession(su *protocol.MCSessionUnion) *netlib.Session { cs := su.GetMccs() if cs != nil { return srvlib.ClientSessionMgrSington.GetSession(cs.GetSId()) diff --git a/mgrsrv/api/broadcasthandler.go b/mgrsrv/api/broadcasthandler.go index a42c07c..803adee 100644 --- a/mgrsrv/api/broadcasthandler.go +++ b/mgrsrv/api/broadcasthandler.go @@ -1,61 +1,9 @@ package api import ( - rawproto "google.golang.org/protobuf/proto" - "mongo.games.com/game/proto" - "mongo.games.com/goserver/core/logger" - "mongo.games.com/goserver/core/netlib" - "mongo.games.com/goserver/srvlib" - "mongo.games.com/goserver/srvlib/protocol" + "mongo.games.com/game/common" ) -var ( - BroadcastMaker = &BroadcastPacketFactory{} -) - -type BroadcastPacketFactory struct { -} - -type BroadcastHandler struct { -} - func init() { - netlib.RegisterHandler(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), &BroadcastHandler{}) - netlib.RegisterFactory(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), BroadcastMaker) -} - -func (this *BroadcastPacketFactory) CreatePacket() interface{} { - pack := &protocol.SSPacketBroadcast{} - return pack -} - -func (this *BroadcastPacketFactory) CreateBroadcastPacket(sp *protocol.BCSessionUnion, packetid int, data interface{}) (rawproto.Message, error) { - pack := &protocol.SSPacketBroadcast{ - SessParam: sp, - PacketId: proto.Int(packetid), - } - if byteData, ok := data.([]byte); ok { - pack.Data = byteData - } else { - byteData, err := netlib.MarshalPacket(packetid, data) - if err == nil { - pack.Data = byteData - } else { - logger.Logger.Warn("BroadcastPacketFactory.CreateBroadcastPacket err:", err) - return nil, err - } - } - proto.SetDefaults(pack) - return pack, nil -} - -func (this *BroadcastHandler) Process(s *netlib.Session, packetid int, data interface{}) error { - if bp, ok := data.(*protocol.SSPacketBroadcast); ok { - pd := bp.GetData() - sp := bp.GetSessParam() - if bcss := sp.GetBcss(); bcss != nil { - srvlib.ServerSessionMgrSington.Broadcast(int(bp.GetPacketId()), pd, int(bcss.GetSArea()), int(bcss.GetSType())) - } - } - return nil + common.RegisterBoardCastHandler() } diff --git a/mgrsrv/api/webapi_srctrl.go b/mgrsrv/api/webapi_srctrl.go index e2b06a6..9d9b932 100644 --- a/mgrsrv/api/webapi_srctrl.go +++ b/mgrsrv/api/webapi_srctrl.go @@ -229,7 +229,7 @@ func SrvCtrlNotice(rw http.ResponseWriter, data []byte) { sc := &protocol.BCSessionUnion{ Bccs: &protocol.BCClientSession{}, } - broadcast, err := BroadcastMaker.CreateBroadcastPacket(sc, int(msg_proto.MSGPacketID_PACKET_SC_NOTICE), noticePacket) + broadcast, err := common.CreateBroadcastPacket(sc, int(msg_proto.MSGPacketID_PACKET_SC_NOTICE), noticePacket) if err != nil || broadcast == nil { pack.Tag = webapi.TagCode_FAILED pack.Msg = "send notice failed(inner error)" diff --git a/protocol/tournament/tournament.pb.go b/protocol/tournament/tournament.pb.go index 1b84ad3..a808964 100644 --- a/protocol/tournament/tournament.pb.go +++ b/protocol/tournament/tournament.pb.go @@ -1866,6 +1866,7 @@ type MatchInfo struct { TotalRound int32 `protobuf:"varint,5,opt,name=TotalRound,proto3" json:"TotalRound,omitempty"` // 总轮数 RemainNum int32 `protobuf:"varint,6,opt,name=RemainNum,proto3" json:"RemainNum,omitempty"` // 剩余人数 Players []*MatchPlayer `protobuf:"bytes,7,rep,name=Players,proto3" json:"Players,omitempty"` // 玩家列表 + Icon string `protobuf:"bytes,8,opt,name=Icon,proto3" json:"Icon,omitempty"` // 比赛图标 } func (x *MatchInfo) Reset() { @@ -1949,6 +1950,13 @@ func (x *MatchInfo) GetPlayers() []*MatchPlayer { return nil } +func (x *MatchInfo) GetIcon() string { + if x != nil { + return x.Icon + } + return "" +} + type SCTMMatchList struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -2414,7 +2422,7 @@ var file_tournament_proto_rawDesc = []byte{ 0x55, 0x73, 0x65, 0x53, 0x6b, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x52, 0x61, 0x6e, 0x6b, 0x12, 0x14, 0x0a, 0x05, 0x53, 0x63, 0x6f, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x53, 0x63, - 0x6f, 0x72, 0x65, 0x22, 0xe0, 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, + 0x6f, 0x72, 0x65, 0x22, 0xf4, 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, @@ -2428,84 +2436,86 @@ var file_tournament_proto_rawDesc = []byte{ 0x4e, 0x75, 0x6d, 0x12, 0x31, 0x0a, 0x07, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x07, 0x50, - 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x22, 0x64, 0x0a, 0x0d, 0x53, 0x43, 0x54, 0x4d, 0x4d, 0x61, - 0x74, 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6d, 0x65, - 0x6e, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x04, 0x4c, 0x69, - 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, - 0x54, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x22, 0x2c, 0x0a, 0x0a, - 0x43, 0x53, 0x52, 0x6f, 0x6f, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x22, 0xc6, 0x01, 0x0a, 0x09, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x52, 0x6f, 0x6f, 0x6d, - 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, - 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x49, 0x6e, - 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, - 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x52, 0x6f, - 0x75, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x52, 0x6f, 0x75, 0x6e, 0x64, - 0x12, 0x1e, 0x0a, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x6f, 0x75, 0x6e, 0x64, - 0x12, 0x31, 0x0a, 0x07, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4d, - 0x61, 0x74, 0x63, 0x68, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x07, 0x50, 0x6c, 0x61, 0x79, - 0x65, 0x72, 0x73, 0x22, 0x57, 0x0a, 0x0a, 0x53, 0x43, 0x52, 0x6f, 0x6f, 0x6d, 0x4c, 0x69, 0x73, - 0x74, 0x12, 0x29, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x74, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x61, 0x74, - 0x63, 0x68, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, - 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, 0x0a, 0x02, - 0x54, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x2a, 0xc7, 0x04, 0x0a, - 0x0c, 0x54, 0x4f, 0x55, 0x52, 0x4e, 0x41, 0x4d, 0x45, 0x4e, 0x54, 0x49, 0x44, 0x12, 0x12, 0x0a, - 0x0e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x5a, 0x45, 0x52, 0x4f, 0x10, - 0x00, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, - 0x53, 0x54, 0x4d, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xb4, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, - 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x54, 0x4d, 0x49, 0x6e, 0x66, 0x6f, - 0x73, 0x10, 0xb5, 0x15, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, - 0x4d, 0x5f, 0x43, 0x53, 0x54, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xb6, - 0x15, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, - 0x43, 0x54, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xb7, 0x15, 0x12, 0x19, - 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, 0x53, 0x53, 0x69, - 0x67, 0x6e, 0x52, 0x61, 0x63, 0x65, 0x10, 0xb8, 0x15, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, - 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x61, 0x63, - 0x65, 0x10, 0xb9, 0x15, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, - 0x4d, 0x5f, 0x53, 0x43, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x69, 0x67, 0x6e, 0x4e, 0x75, 0x6d, 0x10, - 0xba, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, - 0x53, 0x43, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, - 0xbb, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, - 0x53, 0x43, 0x54, 0x4d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x10, 0xbc, 0x15, 0x12, 0x1d, 0x0a, 0x18, + 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x49, 0x63, 0x6f, 0x6e, 0x18, 0x08, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x49, 0x63, 0x6f, 0x6e, 0x22, 0x64, 0x0a, 0x0d, 0x53, 0x43, + 0x54, 0x4d, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x4c, + 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x75, 0x72, + 0x6e, 0x61, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, + 0x22, 0x2c, 0x0a, 0x0a, 0x43, 0x53, 0x52, 0x6f, 0x6f, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0e, + 0x0a, 0x02, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, 0x12, 0x0e, + 0x0a, 0x02, 0x54, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, 0x22, 0xc6, + 0x01, 0x0a, 0x09, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x6f, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, + 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x52, 0x6f, + 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x49, 0x64, 0x12, 0x1e, + 0x0a, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0a, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x64, 0x12, 0x14, + 0x0a, 0x05, 0x52, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x52, + 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, 0x6f, 0x75, + 0x6e, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x54, 0x6f, 0x74, 0x61, 0x6c, 0x52, + 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x31, 0x0a, 0x07, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x18, + 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x74, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6d, 0x65, + 0x6e, 0x74, 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x52, 0x07, + 0x50, 0x6c, 0x61, 0x79, 0x65, 0x72, 0x73, 0x22, 0x57, 0x0a, 0x0a, 0x53, 0x43, 0x52, 0x6f, 0x6f, + 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x74, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x6e, 0x74, + 0x2e, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x52, 0x6f, 0x6f, 0x6d, 0x52, 0x04, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x49, 0x64, + 0x12, 0x0e, 0x0a, 0x02, 0x54, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x54, 0x70, + 0x2a, 0xc7, 0x04, 0x0a, 0x0c, 0x54, 0x4f, 0x55, 0x52, 0x4e, 0x41, 0x4d, 0x45, 0x4e, 0x54, 0x49, + 0x44, 0x12, 0x12, 0x0a, 0x0e, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x5a, + 0x45, 0x52, 0x4f, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x12, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, + 0x54, 0x4d, 0x5f, 0x43, 0x53, 0x54, 0x4d, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xb4, 0x15, 0x12, 0x18, + 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x54, 0x4d, + 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x10, 0xb5, 0x15, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, + 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, 0x53, 0x54, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, + 0x73, 0x74, 0x10, 0xb6, 0x15, 0x12, 0x1b, 0x0a, 0x16, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, + 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x54, 0x4d, 0x52, 0x61, 0x6e, 0x6b, 0x4c, 0x69, 0x73, 0x74, 0x10, + 0xb7, 0x15, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, + 0x43, 0x53, 0x53, 0x69, 0x67, 0x6e, 0x52, 0x61, 0x63, 0x65, 0x10, 0xb8, 0x15, 0x12, 0x19, 0x0a, + 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x53, 0x69, 0x67, + 0x6e, 0x52, 0x61, 0x63, 0x65, 0x10, 0xb9, 0x15, 0x12, 0x1c, 0x0a, 0x17, 0x50, 0x41, 0x43, 0x4b, + 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x53, 0x79, 0x6e, 0x63, 0x53, 0x69, 0x67, 0x6e, + 0x4e, 0x75, 0x6d, 0x10, 0xba, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, + 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x50, 0x72, 0x6f, 0x6d, 0x6f, 0x74, 0x69, 0x6f, 0x6e, 0x49, + 0x6e, 0x66, 0x6f, 0x10, 0xbb, 0x15, 0x12, 0x18, 0x0a, 0x13, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, + 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x54, 0x4d, 0x53, 0x74, 0x61, 0x72, 0x74, 0x10, 0xbc, 0x15, + 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, 0x53, + 0x54, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xbf, 0x15, 0x12, + 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x54, + 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xc0, 0x15, 0x12, 0x1d, + 0x0a, 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, 0x53, 0x54, 0x4d, + 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x10, 0xc1, 0x15, 0x12, 0x1d, 0x0a, + 0x18, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x54, 0x4d, 0x53, + 0x65, 0x61, 0x73, 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x10, 0xc2, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, 0x53, 0x54, 0x4d, 0x53, 0x65, - 0x61, 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xbf, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, - 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x54, 0x4d, 0x53, 0x65, 0x61, - 0x73, 0x6f, 0x6e, 0x49, 0x6e, 0x66, 0x6f, 0x10, 0xc0, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, - 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, 0x53, 0x54, 0x4d, 0x53, 0x65, 0x61, 0x73, - 0x6f, 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x10, 0xc1, 0x15, 0x12, 0x1d, 0x0a, 0x18, 0x50, 0x41, 0x43, - 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x54, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, - 0x6e, 0x52, 0x61, 0x6e, 0x6b, 0x10, 0xc2, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, - 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, 0x53, 0x54, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0xc3, 0x15, 0x12, 0x1e, 0x0a, 0x19, 0x50, 0x41, 0x43, 0x4b, - 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x54, 0x4d, 0x53, 0x65, 0x61, 0x73, 0x6f, 0x6e, - 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0xc4, 0x15, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, - 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, 0x53, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x69, 0x73, - 0x74, 0x10, 0xc5, 0x15, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, - 0x4d, 0x5f, 0x53, 0x43, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xc6, 0x15, - 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, 0x53, - 0x52, 0x6f, 0x6f, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xc7, 0x15, 0x12, 0x19, 0x0a, 0x14, 0x50, - 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x52, 0x6f, 0x6f, 0x6d, 0x4c, - 0x69, 0x73, 0x74, 0x10, 0xc8, 0x15, 0x2a, 0xa2, 0x01, 0x0a, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x52, - 0x61, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, - 0x53, 0x75, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, 0x43, - 0x5f, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x4f, 0x50, 0x52, - 0x43, 0x5f, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, 0x50, 0x52, - 0x43, 0x5f, 0x4e, 0x6f, 0x49, 0x74, 0x65, 0x6d, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x4f, 0x50, - 0x52, 0x43, 0x5f, 0x54, 0x69, 0x6d, 0x65, 0x10, 0x04, 0x12, 0x0d, 0x0a, 0x09, 0x4f, 0x50, 0x52, - 0x43, 0x5f, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, 0x43, - 0x5f, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x10, 0x06, 0x12, 0x0d, 0x0a, 0x09, 0x4f, 0x50, - 0x52, 0x43, 0x5f, 0x46, 0x72, 0x65, 0x65, 0x10, 0x07, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x50, 0x52, - 0x43, 0x5f, 0x4e, 0x6f, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0x08, 0x42, 0x2a, 0x5a, 0x28, 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, 0x74, 0x6f, 0x75, - 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x73, 0x6f, 0x6e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0xc3, 0x15, 0x12, 0x1e, 0x0a, 0x19, + 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x54, 0x4d, 0x53, 0x65, + 0x61, 0x73, 0x6f, 0x6e, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0xc4, 0x15, 0x12, 0x1a, 0x0a, 0x15, + 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x43, 0x53, 0x4d, 0x61, 0x74, 0x63, + 0x68, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xc5, 0x15, 0x12, 0x1a, 0x0a, 0x15, 0x50, 0x41, 0x43, 0x4b, + 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x4d, 0x61, 0x74, 0x63, 0x68, 0x4c, 0x69, 0x73, + 0x74, 0x10, 0xc6, 0x15, 0x12, 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, + 0x4d, 0x5f, 0x43, 0x53, 0x52, 0x6f, 0x6f, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xc7, 0x15, 0x12, + 0x19, 0x0a, 0x14, 0x50, 0x41, 0x43, 0x4b, 0x45, 0x54, 0x5f, 0x54, 0x4d, 0x5f, 0x53, 0x43, 0x52, + 0x6f, 0x6f, 0x6d, 0x4c, 0x69, 0x73, 0x74, 0x10, 0xc8, 0x15, 0x2a, 0xa2, 0x01, 0x0a, 0x0c, 0x53, + 0x69, 0x67, 0x6e, 0x52, 0x61, 0x63, 0x65, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x0f, 0x0a, 0x0b, 0x4f, + 0x50, 0x52, 0x43, 0x5f, 0x53, 0x75, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, + 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x10, 0x01, 0x12, 0x0e, 0x0a, + 0x0a, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, + 0x0b, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x4e, 0x6f, 0x49, 0x74, 0x65, 0x6d, 0x10, 0x03, 0x12, 0x0d, + 0x0a, 0x09, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x54, 0x69, 0x6d, 0x65, 0x10, 0x04, 0x12, 0x0d, 0x0a, + 0x09, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x43, 0x6f, 0x69, 0x6e, 0x10, 0x05, 0x12, 0x10, 0x0a, 0x0c, + 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x44, 0x69, 0x61, 0x6d, 0x6f, 0x6e, 0x64, 0x10, 0x06, 0x12, 0x0d, + 0x0a, 0x09, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x46, 0x72, 0x65, 0x65, 0x10, 0x07, 0x12, 0x10, 0x0a, + 0x0c, 0x4f, 0x50, 0x52, 0x43, 0x5f, 0x4e, 0x6f, 0x41, 0x77, 0x61, 0x72, 0x64, 0x10, 0x08, 0x42, + 0x2a, 0x5a, 0x28, 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, 0x74, 0x6f, 0x75, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x6e, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/protocol/tournament/tournament.proto b/protocol/tournament/tournament.proto index 7c4086e..08ed170 100644 --- a/protocol/tournament/tournament.proto +++ b/protocol/tournament/tournament.proto @@ -218,6 +218,7 @@ message MatchInfo{ int32 TotalRound = 5; // 总轮数 int32 RemainNum = 6; // 剩余人数 repeated MatchPlayer Players = 7; // 玩家列表 + string Icon = 8; // 比赛图标 } message SCTMMatchList{ diff --git a/public b/public index 07c189d..fc20f70 160000 --- a/public +++ b/public @@ -1 +1 @@ -Subproject commit 07c189d652b84910258fa33eb3214d39c53edec4 +Subproject commit fc20f707697bffbac116ad93e1c94cc530fd0cf3 diff --git a/worldsrv/action_server.go b/worldsrv/action_server.go index 6dc0a87..28e1e1a 100644 --- a/worldsrv/action_server.go +++ b/worldsrv/action_server.go @@ -789,6 +789,9 @@ func (this *CSAccountInvalidHandler) Process(s *netlib.Session, packetid int, da } func init() { + common.RegisterBoardCastHandler() + common.RegisterMulticastHandler() + common.RegisterHandler(int(playerproto.PlayerPacketID_PACKET_CS_PMCMD), &CSPMCmdHandler{}) netlib.RegisterFactory(int(playerproto.PlayerPacketID_PACKET_CS_PMCMD), &CSPMCmdPacketFactory{}) diff --git a/worldsrv/action_tournament.go b/worldsrv/action_tournament.go index f55d5d7..bcebbf6 100644 --- a/worldsrv/action_tournament.go +++ b/worldsrv/action_tournament.go @@ -123,10 +123,11 @@ func CSMatchList(s *netlib.Session, packetId int, data interface{}, sid int64) e d := &tournament.MatchInfo{ MatchId: int64(v.TMId), InstanceId: v.SortId, - Name: v.gmd.MatchName, + Name: v.gmd.GetMatchName(), Round: round, TotalRound: v.GetTotalRound(), RemainNum: TournamentMgr.GetRemainNum(v.SortId), + Icon: v.gmd.GetTitleURL(), } for _, v := range TournamentMgr.GetRemainPlayer(v.SortId) { var name, headUrl string diff --git a/worldsrv/broadcasthandler.go b/worldsrv/broadcasthandler.go deleted file mode 100644 index 38650cd..0000000 --- a/worldsrv/broadcasthandler.go +++ /dev/null @@ -1,62 +0,0 @@ -package main - -import ( - rawproto "google.golang.org/protobuf/proto" - "mongo.games.com/game/proto" - "mongo.games.com/goserver/core/logger" - "mongo.games.com/goserver/core/netlib" - "mongo.games.com/goserver/srvlib" - "mongo.games.com/goserver/srvlib/protocol" -) - -var ( - BroadcastMaker = &BroadcastPacketFactory{} -) - -type BroadcastPacketFactory struct { -} - -type BroadcastHandler struct { -} - -func init() { - netlib.RegisterHandler(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), &BroadcastHandler{}) - netlib.RegisterFactory(int(protocol.SrvlibPacketID_PACKET_SS_BROADCAST), BroadcastMaker) -} - -func (this *BroadcastPacketFactory) CreatePacket() interface{} { - pack := &protocol.SSPacketBroadcast{} - return pack -} - -func (this *BroadcastPacketFactory) CreateBroadcastPacket(sp *protocol.BCSessionUnion, packetid int, data interface{}) (rawproto.Message, error) { - pack := &protocol.SSPacketBroadcast{ - SessParam: sp, - PacketId: proto.Int(packetid), - } - - if byteData, ok := data.([]byte); ok { - pack.Data = byteData - } else { - byteData, err := netlib.MarshalPacket(packetid, data) - if err == nil { - pack.Data = byteData - } else { - logger.Logger.Warn("BroadcastPacketFactory.CreateBroadcastPacket err:", err) - return nil, err - } - } - proto.SetDefaults(pack) - return pack, nil -} - -func (this *BroadcastHandler) Process(s *netlib.Session, packetid int, data interface{}) error { - if bp, ok := data.(*protocol.SSPacketBroadcast); ok { - pd := bp.GetData() - sp := bp.GetSessParam() - if bcss := sp.GetBcss(); bcss != nil { - srvlib.ServerSessionMgrSington.Broadcast(int(bp.GetPacketId()), pd, int(bcss.GetSArea()), int(bcss.GetSType())) - } - } - return nil -} diff --git a/worldsrv/gamestate.go b/worldsrv/gamestate.go index 2eff9a8..f315cec 100644 --- a/worldsrv/gamestate.go +++ b/worldsrv/gamestate.go @@ -75,7 +75,7 @@ func (gsm *GameStateManager) BrodcastGameState(gameId int32, platform string, pa } for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packid, pack, v...) + pack, err := common.CreateMulticastPacket(packid, pack, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) diff --git a/worldsrv/multicasthandler.go b/worldsrv/multicasthandler.go deleted file mode 100644 index 2a94ceb..0000000 --- a/worldsrv/multicasthandler.go +++ /dev/null @@ -1,67 +0,0 @@ -package main - -import ( - rawproto "google.golang.org/protobuf/proto" - "mongo.games.com/game/proto" - "mongo.games.com/goserver/core/logger" - "mongo.games.com/goserver/core/netlib" - "mongo.games.com/goserver/srvlib" - "mongo.games.com/goserver/srvlib/protocol" -) - -var ( - MulticastMaker = &MulticastPacketFactory{} -) - -type MulticastPacketFactory struct { -} - -type MulticastHandler struct { -} - -func init() { - netlib.RegisterHandler(int(protocol.SrvlibPacketID_PACKET_SS_MULTICAST), &MulticastHandler{}) - netlib.RegisterFactory(int(protocol.SrvlibPacketID_PACKET_SS_MULTICAST), MulticastMaker) -} - -func (this *MulticastPacketFactory) CreatePacket() interface{} { - pack := &protocol.SSPacketMulticast{} - return pack -} - -func (this *MulticastPacketFactory) CreateMulticastPacket(packetid int, data interface{}, sis ...*protocol.MCSessionUnion) (rawproto.Message, error) { - pack := &protocol.SSPacketMulticast{ - Sessions: sis, - PacketId: proto.Int(packetid), - } - if byteData, ok := data.([]byte); ok { - pack.Data = byteData - } else { - byteData, err := netlib.MarshalPacket(packetid, data) - if err == nil { - pack.Data = byteData - } else { - logger.Logger.Info("MulticastPacketFactory.CreateMulticastPacket err:", err) - return nil, err - } - } - proto.SetDefaults(pack) - return pack, nil -} - -func (this *MulticastHandler) Process(s *netlib.Session, packetid int, data interface{}) error { - if mp, ok := data.(*protocol.SSPacketMulticast); ok { - pd := mp.GetData() - sis := mp.GetSessions() - for _, si := range sis { - ss := si.GetMcss() - if ss != nil { - ns := srvlib.ServerSessionMgrSington.GetSession(int(ss.GetSArea()), int(ss.GetSType()), int(ss.GetSId())) - if ns != nil { - ns.Send(int(mp.GetPacketId()), pd /*, s.GetSessionConfig().IsInnerLink*/) - } - } - } - } - return nil -} diff --git a/worldsrv/platformmgr.go b/worldsrv/platformmgr.go index 1fff5f4..7014aa7 100644 --- a/worldsrv/platformmgr.go +++ b/worldsrv/platformmgr.go @@ -10,6 +10,7 @@ import ( "mongo.games.com/goserver/core/utils" srvlibproto "mongo.games.com/goserver/srvlib/protocol" + "mongo.games.com/game/common" "mongo.games.com/game/model" "mongo.games.com/game/proto" hallproto "mongo.games.com/game/protocol/gamehall" @@ -302,7 +303,7 @@ func (pm *PlatformMgr) Broadcast(packetid int, packet interface{}, players map[i } for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packetid, packet, v...) + pack, err := common.CreateMulticastPacket(packetid, packet, v...) if err == nil { gateSess.Send(int(srvlibproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) } diff --git a/worldsrv/playermgr.go b/worldsrv/playermgr.go index 55d4c08..7d76256 100644 --- a/worldsrv/playermgr.go +++ b/worldsrv/playermgr.go @@ -2,7 +2,6 @@ package main import ( "math/rand" - "mongo.games.com/game/worldsrv/internal" "time" "mongo.games.com/goserver/core/basic" @@ -16,7 +15,8 @@ import ( "mongo.games.com/game/common" "mongo.games.com/game/model" "mongo.games.com/game/proto" - server_proto "mongo.games.com/game/protocol/server" + serverproto "mongo.games.com/game/protocol/server" + "mongo.games.com/game/worldsrv/internal" ) var PlayerMgrSington = &PlayerMgr{ @@ -292,7 +292,7 @@ func (this *PlayerMgr) BroadcastMessage(packetid int, rawpack interface{}) bool sc := &srvproto.BCSessionUnion{ Bccs: &srvproto.BCClientSession{}, } - pack, err := BroadcastMaker.CreateBroadcastPacket(sc, packetid, rawpack) + pack, err := common.CreateBroadcastPacket(sc, packetid, rawpack) if err == nil && pack != nil { srvlib.ServerSessionMgrSington.Broadcast(int(srvproto.SrvlibPacketID_PACKET_SS_BROADCAST), pack, common.GetSelfAreaId(), srvlib.GateServerType) return true @@ -318,7 +318,7 @@ func (this *PlayerMgr) BroadcastMessageToPlatform(platform string, packetid int, } for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packetid, rawpack, v...) + pack, err := common.CreateMulticastPacket(packetid, rawpack, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) @@ -345,7 +345,7 @@ func (this *PlayerMgr) BroadcastMessageToPlatformByFunc(platform string, packeti } for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packetid, rawpack, v...) + pack, err := common.CreateMulticastPacket(packetid, rawpack, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) @@ -378,7 +378,7 @@ func (this *PlayerMgr) BroadcastMessageToPlatformWithHall(platform string, snid } for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packetid, rawpack, v...) + pack, err := common.CreateMulticastPacket(packetid, rawpack, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) @@ -391,7 +391,7 @@ func (this *PlayerMgr) BroadcastMessageToPlatformWithHall(platform string, snid // BroadcastMessageToGroup 发送群组消息 func (this *PlayerMgr) BroadcastMessageToGroup(packetid int, rawpack interface{}, tags []string) bool { - pack := &server_proto.SSCustomTagMulticast{ + pack := &serverproto.SSCustomTagMulticast{ Tags: tags, } if byteData, ok := rawpack.([]byte); ok { @@ -405,7 +405,7 @@ func (this *PlayerMgr) BroadcastMessageToGroup(packetid int, rawpack interface{} return false } } - srvlib.ServerSessionMgrSington.Broadcast(int(server_proto.SSPacketID_PACKET_SS_CUSTOMTAG_MULTICAST), pack, common.GetSelfAreaId(), srvlib.GateServerType) + srvlib.ServerSessionMgrSington.Broadcast(int(serverproto.SSPacketID_PACKET_SS_CUSTOMTAG_MULTICAST), pack, common.GetSelfAreaId(), srvlib.GateServerType) return true } @@ -426,7 +426,7 @@ func (this *PlayerMgr) BroadcastMessageToTarget(platform string, target []int32, } for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packetid, rawpack, v...) + pack, err := common.CreateMulticastPacket(packetid, rawpack, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) diff --git a/worldsrv/scene.go b/worldsrv/scene.go index d885720..407af35 100644 --- a/worldsrv/scene.go +++ b/worldsrv/scene.go @@ -1159,7 +1159,7 @@ func (this *Scene) Broadcast(packetid int, msg rawproto.Message, excludeSid int6 for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packetid, msg, v...) + pack, err := common.CreateMulticastPacket(packetid, msg, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvlibproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) diff --git a/worldsrv/tmmatch.go b/worldsrv/tmmatch.go index 05398c0..482162c 100644 --- a/worldsrv/tmmatch.go +++ b/worldsrv/tmmatch.go @@ -107,7 +107,7 @@ func (tm *TmMatch) BroadcastMessage(packetId int, rawPack interface{}) { } for gateSess, v := range mgs { if gateSess != nil && len(v) != 0 { - pack, err := MulticastMaker.CreateMulticastPacket(packetId, rawPack, v...) + pack, err := common.CreateMulticastPacket(packetId, rawPack, v...) if err == nil { proto.SetDefaults(pack) gateSess.Send(int(srvproto.SrvlibPacketID_PACKET_SS_MULTICAST), pack) diff --git a/worldsrv/tournament.go b/worldsrv/tournament.go index cbb198c..02bf60e 100644 --- a/worldsrv/tournament.go +++ b/worldsrv/tournament.go @@ -220,6 +220,21 @@ func (this *Tournament) GetRemainPlayer(sortId int64) []*MatchPlayerInfo { robotPlayer := func(n int) { for _, v := range tm.robotGrades[n] { + if v.copySnid == 0 { + for _, vv := range tm.TmPlayer { + p := PlayerMgrSington.GetPlayerBySnId(vv.SnId) + if p != nil { + ret = append(ret, &MatchPlayerInfo{ + SnId: vv.SnId, + RoleId: p.GetRoleId(), + SkinId: p.Skin.ModId, + Grade: v.grade, + }) + } + break + } + continue + } ret = append(ret, &MatchPlayerInfo{ SnId: v.copySnid, RoleId: v.copyRoleId, diff --git a/xlsx/DB_Skin.xlsx b/xlsx/DB_Skin.xlsx index bf74d4c..c9e7169 100644 Binary files a/xlsx/DB_Skin.xlsx and b/xlsx/DB_Skin.xlsx differ diff --git a/xlsx/DB_VIP.xlsx b/xlsx/DB_VIP.xlsx index 0060af6..a1f8201 100644 Binary files a/xlsx/DB_VIP.xlsx and b/xlsx/DB_VIP.xlsx differ diff --git a/xlsx/DB_VIPShow.xlsx b/xlsx/DB_VIPShow.xlsx index 96e9c67..4d007c0 100644 Binary files a/xlsx/DB_VIPShow.xlsx and b/xlsx/DB_VIPShow.xlsx differ