Merge branch 'develop' of git.pogorockgames.com:mango-games/server/game into develop
This commit is contained in:
commit
8935f29b22
|
@ -6,6 +6,10 @@ import (
|
||||||
"mongo.games.com/goserver/core/module"
|
"mongo.games.com/goserver/core/module"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
|
时钟
|
||||||
|
*/
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
module.RegisteModule(ClockMgrSingleton, time.Millisecond*500, 0)
|
module.RegisteModule(ClockMgrSingleton, time.Millisecond*500, 0)
|
||||||
}
|
}
|
||||||
|
@ -247,25 +251,25 @@ func RegisterClockFunc(fs *ClockFunc) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if fs.OnSecTimerFunc != nil {
|
if fs.OnSecTimerFunc != nil {
|
||||||
fs.event = fs.event ^ ClockEventSecond
|
fs.event = fs.event | ClockEventSecond
|
||||||
}
|
}
|
||||||
if fs.OnMiniTimerFunc != nil {
|
if fs.OnMiniTimerFunc != nil {
|
||||||
fs.event = fs.event ^ ClockEventMinute
|
fs.event = fs.event | ClockEventMinute
|
||||||
}
|
}
|
||||||
if fs.OnHourTimerFunc != nil {
|
if fs.OnHourTimerFunc != nil {
|
||||||
fs.event = fs.event ^ ClockEventHour
|
fs.event = fs.event | ClockEventHour
|
||||||
}
|
}
|
||||||
if fs.OnDayTimerFunc != nil {
|
if fs.OnDayTimerFunc != nil {
|
||||||
fs.event = fs.event ^ ClockEventDay
|
fs.event = fs.event | ClockEventDay
|
||||||
}
|
}
|
||||||
if fs.OnWeekTimerFunc != nil {
|
if fs.OnWeekTimerFunc != nil {
|
||||||
fs.event = fs.event ^ ClockEventWeek
|
fs.event = fs.event | ClockEventWeek
|
||||||
}
|
}
|
||||||
if fs.OnMonthTimerFunc != nil {
|
if fs.OnMonthTimerFunc != nil {
|
||||||
fs.event = fs.event ^ ClockEventMonth
|
fs.event = fs.event | ClockEventMonth
|
||||||
}
|
}
|
||||||
if fs.OnShutdownFunc != nil {
|
if fs.OnShutdownFunc != nil {
|
||||||
fs.event = fs.event ^ ClockEventShutdown
|
fs.event = fs.event | ClockEventShutdown
|
||||||
}
|
}
|
||||||
|
|
||||||
ClockMgrSingleton.RegisterSinker(fs)
|
ClockMgrSingleton.RegisterSinker(fs)
|
||||||
|
|
|
@ -6,7 +6,6 @@ import (
|
||||||
protocol_game "mongo.games.com/game/protocol/server"
|
protocol_game "mongo.games.com/game/protocol/server"
|
||||||
"mongo.games.com/goserver/core/logger"
|
"mongo.games.com/goserver/core/logger"
|
||||||
"mongo.games.com/goserver/core/netlib"
|
"mongo.games.com/goserver/core/netlib"
|
||||||
"mongo.games.com/goserver/srvlib"
|
|
||||||
"mongo.games.com/goserver/srvlib/protocol"
|
"mongo.games.com/goserver/srvlib/protocol"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -45,11 +44,11 @@ func createMulticastPacket(packetid int, data interface{}, sis ...*protocol.MCSe
|
||||||
return pack, nil
|
return pack, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendToGate(sid int64, packetid int, rawpack interface{}, s *netlib.Session) bool {
|
func SendToGate(sid int64, packetId int, pack interface{}, s *netlib.Session) bool {
|
||||||
if s == nil || rawpack == nil || sid == 0 {
|
if s == nil || pack == nil || sid == 0 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
pack, err := createMulticastPacket(packetid, rawpack,
|
pack, err := createMulticastPacket(packetId, pack,
|
||||||
&protocol.MCSessionUnion{
|
&protocol.MCSessionUnion{
|
||||||
Mccs: &protocol.MCClientSession{
|
Mccs: &protocol.MCClientSession{
|
||||||
SId: proto.Int64(sid)}})
|
SId: proto.Int64(sid)}})
|
||||||
|
@ -63,25 +62,17 @@ func SendToGate(sid int64, packetid int, rawpack interface{}, s *netlib.Session)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func SendToActThrSrv(packetid int, rawpack interface{}) bool {
|
// TransmitToServer 转发消息到指定服务器
|
||||||
if rawpack == nil {
|
// sid: 客户端连接标识
|
||||||
return false
|
// packetId: 消息id
|
||||||
}
|
// pack: 消息内容
|
||||||
|
// s: 接收消息的服务器连接
|
||||||
replaySess := srvlib.ServerSessionMgrSington.GetSession(GetSelfAreaId(), ActThrServerType, ActThrServerID)
|
func TransmitToServer(sid int64, packetId int, pack interface{}, s *netlib.Session) bool {
|
||||||
if replaySess != nil {
|
if d, err := netlib.MarshalPacket(packetId, pack); err == nil {
|
||||||
return replaySess.Send(int(packetid), rawpack)
|
|
||||||
}
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
func TransmitToServer(sid int64, packetid int, rawpack interface{}, s *netlib.Session) bool {
|
|
||||||
if d, err := netlib.MarshalPacket(packetid, rawpack); err == nil {
|
|
||||||
pack := &protocol_game.SSTransmit{
|
pack := &protocol_game.SSTransmit{
|
||||||
PacketData: d,
|
PacketData: d,
|
||||||
SessionId: sid,
|
SessionId: sid,
|
||||||
}
|
}
|
||||||
proto.SetDefaults(pack)
|
|
||||||
return s.Send(int(protocol_game.TransmitPacketID_PACKET_SS_PACKET_TRANSMIT), pack, true)
|
return s.Send(int(protocol_game.TransmitPacketID_PACKET_SS_PACKET_TRANSMIT), pack, true)
|
||||||
} else {
|
} else {
|
||||||
logger.Logger.Warn("TransmitToServer err:", err)
|
logger.Logger.Warn("TransmitToServer err:", err)
|
||||||
|
|
|
@ -1968,7 +1968,7 @@ func (this *TienLenSceneData) TrySmallGameBilled() {
|
||||||
score = losePlayerCoin
|
score = losePlayerCoin
|
||||||
}
|
}
|
||||||
//判断宠物技能生不生效
|
//判断宠物技能生不生效
|
||||||
if losePlayer.PetUseSkill() {
|
if losePlayer.PetUseSkill() && !this.IsCustom() && !this.IsMatchScene() {
|
||||||
score = 0
|
score = 0
|
||||||
//通知客户端宠物技能生效 炸弹不扣分
|
//通知客户端宠物技能生效 炸弹不扣分
|
||||||
pack := &tienlen.SCTienLenPetSkillRes{}
|
pack := &tienlen.SCTienLenPetSkillRes{}
|
||||||
|
|
|
@ -3161,25 +3161,6 @@ func (this *Player) AddCoinPayTotal(coin int64) {
|
||||||
this.CoinPayTotal += coin
|
this.CoinPayTotal += coin
|
||||||
}
|
}
|
||||||
|
|
||||||
// 当用户充值
|
|
||||||
func OnPlayerPay(pd *model.PlayerData, coin int64) {
|
|
||||||
if pd == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
buf, err := pd.GetPlayerDataEncoder()
|
|
||||||
if err == nil {
|
|
||||||
pack := &serverproto.WTPlayerPay{
|
|
||||||
AddCoin: proto.Int64(coin),
|
|
||||||
PlayerData: buf.Bytes(),
|
|
||||||
}
|
|
||||||
proto.SetDefaults(pack)
|
|
||||||
common.SendToActThrSrv(int(serverproto.SSPacketID_PACKET_WT_PLAYERPAY), pack)
|
|
||||||
}
|
|
||||||
|
|
||||||
//ActFPayMgrSington.OnPlayerPay(pd.SnId, pd.Platform, coin)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *Player) SendPlatformCanUsePromoterBind() {
|
func (this *Player) SendPlatformCanUsePromoterBind() {
|
||||||
state := int32(0)
|
state := int32(0)
|
||||||
plt := PlatformMgrSingleton.GetPlatform(this.Platform)
|
plt := PlatformMgrSingleton.GetPlatform(this.Platform)
|
||||||
|
|
Loading…
Reference in New Issue