Merge remote-tracking branch 'origin/develop' into dev_slots
This commit is contained in:
commit
0550310342
|
@ -1,5 +1,4 @@
|
||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
xcopy ..\data\* .\data\ /s /e /y /exclude:..\shell\exclude.txt
|
xcopy ..\data\* .\data\ /s /e /y /exclude:..\shell\exclude.txt
|
||||||
|
|
||||||
|
@ -8,5 +7,4 @@ for /f %%i in (../shell/programs.txt) do (
|
||||||
go build -o ./%%i/%%i.exe ../%%i/
|
go build -o ./%%i/%%i.exe ../%%i/
|
||||||
)
|
)
|
||||||
|
|
||||||
endlocal
|
|
||||||
pause
|
pause
|
|
@ -1,5 +1,4 @@
|
||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
for /f "tokens=*" %%a in (../shell/programs.txt) do (
|
for /f "tokens=*" %%a in (../shell/programs.txt) do (
|
||||||
if exist "%%a\*.log" del /q "%%a\*.log"
|
if exist "%%a\*.log" del /q "%%a\*.log"
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
for /f %%i in (shell/programs.txt) do (
|
for /f %%i in (shell/programs.txt) do (
|
||||||
call shell/build_sub.bat %%i
|
call shell/build_sub.bat %%i
|
||||||
)
|
)
|
||||||
|
|
||||||
endlocal
|
|
||||||
|
|
||||||
echo "build complete!"
|
echo "build complete!"
|
|
@ -1,5 +1,4 @@
|
||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
for /f "tokens=*" %%a in (shell/programs.txt) do (
|
for /f "tokens=*" %%a in (shell/programs.txt) do (
|
||||||
if exist "%%a\*.log" del /q "%%a\*.log"
|
if exist "%%a\*.log" del /q "%%a\*.log"
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
@echo off
|
@echo off
|
||||||
setlocal enabledelayedexpansion
|
|
||||||
|
|
||||||
for /f %%i in (shell/programs.txt) do (
|
for /f %%i in (shell/programs.txt) do (
|
||||||
taskkill /F /IM %%i.exe
|
taskkill /F /IM %%i.exe
|
||||||
)
|
)
|
||||||
|
|
||||||
endlocal
|
|
||||||
|
|
||||||
echo "close complete!"
|
echo "close complete!"
|
|
@ -361,47 +361,6 @@ func (this *CSLoginHandler) Process(s *netlib.Session, packetid int, data interf
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type CSCustomServicePacketFactory struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
type CSCustomServiceHandler struct {
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *CSCustomServicePacketFactory) CreatePacket() interface{} {
|
|
||||||
pack := &login_proto.CSCustomService{}
|
|
||||||
return pack
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *CSCustomServiceHandler) Process(s *netlib.Session, packetid int, data interface{}, sid int64) error {
|
|
||||||
logger.Logger.Trace("CSCustomService Process recv ", data)
|
|
||||||
if _, ok := data.(*login_proto.CSCustomService); ok {
|
|
||||||
p := PlayerMgrSington.GetPlayer(sid)
|
|
||||||
if p == nil {
|
|
||||||
logger.Logger.Warn("CSCustomServiceHandler p == nil")
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
var Url string
|
|
||||||
var customType int32
|
|
||||||
flag := int32(0)
|
|
||||||
platform := PlatformMgrSingleton.GetPlatform(p.Platform)
|
|
||||||
if platform != nil {
|
|
||||||
Url = platform.ServiceUrl
|
|
||||||
customType = platform.CustomType
|
|
||||||
if platform.ServiceFlag {
|
|
||||||
flag = 1
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pack := &login_proto.SCCustomService{
|
|
||||||
Url: proto.String(Url),
|
|
||||||
OpenFlag: proto.Int32(flag),
|
|
||||||
CustomType: proto.Int32(customType),
|
|
||||||
}
|
|
||||||
p.SendToClient(int(login_proto.LoginPacketID_PACKET_SC_CUSTOMSERVICE), pack)
|
|
||||||
logger.Logger.Trace("SCCustomService:", pack)
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
type CSPlatFormPacketFactory struct {
|
type CSPlatFormPacketFactory struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -673,9 +632,6 @@ func init() {
|
||||||
//登录
|
//登录
|
||||||
common.RegisterHandler(int(login_proto.LoginPacketID_PACKET_CS_LOGIN), &CSLoginHandler{})
|
common.RegisterHandler(int(login_proto.LoginPacketID_PACKET_CS_LOGIN), &CSLoginHandler{})
|
||||||
netlib.RegisterFactory(int(login_proto.LoginPacketID_PACKET_CS_LOGIN), &CSLoginPacketFactory{})
|
netlib.RegisterFactory(int(login_proto.LoginPacketID_PACKET_CS_LOGIN), &CSLoginPacketFactory{})
|
||||||
//客服地址
|
|
||||||
common.RegisterHandler(int(login_proto.LoginPacketID_PACKET_CS_CUSTOMSERVICE), &CSCustomServiceHandler{})
|
|
||||||
netlib.RegisterFactory(int(login_proto.LoginPacketID_PACKET_CS_CUSTOMSERVICE), &CSCustomServicePacketFactory{})
|
|
||||||
//平台配置信息
|
//平台配置信息
|
||||||
common.RegisterHandler(int(login_proto.LoginPacketID_PACKET_CS_PLATFORMCFG), &CSPlatFormHandler{})
|
common.RegisterHandler(int(login_proto.LoginPacketID_PACKET_CS_PLATFORMCFG), &CSPlatFormHandler{})
|
||||||
netlib.RegisterFactory(int(login_proto.LoginPacketID_PACKET_CS_PLATFORMCFG), &CSPlatFormPacketFactory{})
|
netlib.RegisterFactory(int(login_proto.LoginPacketID_PACKET_CS_PLATFORMCFG), &CSPlatFormPacketFactory{})
|
||||||
|
|
|
@ -36,7 +36,7 @@ func (this *CSRoleInfoHandler) Process(s *netlib.Session, packetid int, data int
|
||||||
if platform == nil {
|
if platform == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
roleInfos := PetMgrSington.GetRoleInfos(p)
|
roleInfos := ModelMgrSingleton.GetRoleInfos(p)
|
||||||
pack := &pets.SCRoleInfo{
|
pack := &pets.SCRoleInfo{
|
||||||
Infos: roleInfos,
|
Infos: roleInfos,
|
||||||
}
|
}
|
||||||
|
@ -71,7 +71,7 @@ func (this *CSPetInfoHandler) Process(s *netlib.Session, packetid int, data inte
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
petInfos := PetMgrSington.GetPetInfos(p)
|
petInfos := ModelMgrSingleton.GetPetInfos(p)
|
||||||
pack := &pets.SCPetInfo{
|
pack := &pets.SCPetInfo{
|
||||||
Infos: petInfos,
|
Infos: petInfos,
|
||||||
}
|
}
|
||||||
|
@ -122,21 +122,21 @@ func (this *CSRisingStarHandler) Process(s *netlib.Session, packetid int, data i
|
||||||
}
|
}
|
||||||
if msg.RisingModId == 0 {
|
if msg.RisingModId == 0 {
|
||||||
logger.Logger.Warn("CSRisingStarHandler UseModId:", msg.RisingModId)
|
logger.Logger.Warn("CSRisingStarHandler UseModId:", msg.RisingModId)
|
||||||
SendInfoRole(pets.OpResultCode_OPRC_Error, PetMgrSington.GetRoleInfo(p, msg.RisingModId))
|
SendInfoRole(pets.OpResultCode_OPRC_Error, ModelMgrSingleton.GetRoleInfo(p, msg.RisingModId))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if msg.RisingType == 0 {
|
if msg.RisingType == 0 {
|
||||||
roleInfo := PetMgrSington.GetIntroductionByModId(msg.RisingModId)
|
roleInfo := ModelMgrSingleton.GetIntroductionByModId(msg.RisingModId)
|
||||||
if roleInfo == nil {
|
if roleInfo == nil {
|
||||||
SendInfoRole(pets.OpResultCode_OPRC_Error, PetMgrSington.GetRoleInfo(p, msg.RisingModId))
|
SendInfoRole(pets.OpResultCode_OPRC_Error, ModelMgrSingleton.GetRoleInfo(p, msg.RisingModId))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if roleInfo.MaxLevel == p.Roles.ModUnlock[msg.RisingModId] {
|
if roleInfo.MaxLevel == p.Roles.ModUnlock[msg.RisingModId] {
|
||||||
logger.Logger.Trace("人物已经达到最大等级")
|
logger.Logger.Trace("人物已经达到最大等级")
|
||||||
SendInfoRole(pets.OpResultCode_OPRC_Error, PetMgrSington.GetRoleInfo(p, msg.RisingModId))
|
SendInfoRole(pets.OpResultCode_OPRC_Error, ModelMgrSingleton.GetRoleInfo(p, msg.RisingModId))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
role := PetMgrSington.GetRoleInfo(p, msg.RisingModId)
|
role := ModelMgrSingleton.GetRoleInfo(p, msg.RisingModId)
|
||||||
if role != nil {
|
if role != nil {
|
||||||
if role.HaveAmount < role.Amount {
|
if role.HaveAmount < role.Amount {
|
||||||
logger.Logger.Trace("人物碎片道具数量不够", role.HaveAmount, role.Amount)
|
logger.Logger.Trace("人物碎片道具数量不够", role.HaveAmount, role.Amount)
|
||||||
|
@ -170,21 +170,21 @@ func (this *CSRisingStarHandler) Process(s *netlib.Session, packetid int, data i
|
||||||
FriendMgrSington.UpdateInfo(p.Platform, p.SnId)
|
FriendMgrSington.UpdateInfo(p.Platform, p.SnId)
|
||||||
p.dirty = true
|
p.dirty = true
|
||||||
//人物
|
//人物
|
||||||
SendInfoRole(pets.OpResultCode_OPRC_Sucess, PetMgrSington.GetRoleInfo(p, msg.RisingModId))
|
SendInfoRole(pets.OpResultCode_OPRC_Sucess, ModelMgrSingleton.GetRoleInfo(p, msg.RisingModId))
|
||||||
}
|
}
|
||||||
} else if msg.RisingType == 1 {
|
} else if msg.RisingType == 1 {
|
||||||
petInfo := PetMgrSington.GetIntroductionByModId(msg.RisingModId)
|
petInfo := ModelMgrSingleton.GetIntroductionByModId(msg.RisingModId)
|
||||||
if petInfo == nil {
|
if petInfo == nil {
|
||||||
SendInfoPet(pets.OpResultCode_OPRC_Error, PetMgrSington.GetPetInfo(p, msg.RisingModId))
|
SendInfoPet(pets.OpResultCode_OPRC_Error, ModelMgrSingleton.GetPetInfo(p, msg.RisingModId))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
if petInfo.MaxLevel == p.Pets.ModUnlock[msg.RisingModId] {
|
if petInfo.MaxLevel == p.Pets.ModUnlock[msg.RisingModId] {
|
||||||
logger.Logger.Trace("宠物已经达到最大等级")
|
logger.Logger.Trace("宠物已经达到最大等级")
|
||||||
SendInfoPet(pets.OpResultCode_OPRC_Error, PetMgrSington.GetPetInfo(p, msg.RisingModId))
|
SendInfoPet(pets.OpResultCode_OPRC_Error, ModelMgrSingleton.GetPetInfo(p, msg.RisingModId))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
pet := PetMgrSington.GetPetInfo(p, msg.RisingModId)
|
pet := ModelMgrSingleton.GetPetInfo(p, msg.RisingModId)
|
||||||
if pet != nil {
|
if pet != nil {
|
||||||
if pet.HaveAmount < pet.Amount {
|
if pet.HaveAmount < pet.Amount {
|
||||||
logger.Logger.Trace("宠物碎片道具数量不够", pet.HaveAmount, pet.Amount)
|
logger.Logger.Trace("宠物碎片道具数量不够", pet.HaveAmount, pet.Amount)
|
||||||
|
@ -216,7 +216,7 @@ func (this *CSRisingStarHandler) Process(s *netlib.Session, packetid int, data i
|
||||||
FriendMgrSington.UpdateInfo(p.Platform, p.SnId)
|
FriendMgrSington.UpdateInfo(p.Platform, p.SnId)
|
||||||
p.dirty = true
|
p.dirty = true
|
||||||
//宠物
|
//宠物
|
||||||
SendInfoPet(pets.OpResultCode_OPRC_Sucess, PetMgrSington.GetPetInfo(p, msg.RisingModId))
|
SendInfoPet(pets.OpResultCode_OPRC_Sucess, ModelMgrSingleton.GetPetInfo(p, msg.RisingModId))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -321,7 +321,7 @@ func (this *CSRolePetUnlockHandler) Process(s *netlib.Session, packetid int, dat
|
||||||
}
|
}
|
||||||
if msg.UseModType == 0 {
|
if msg.UseModType == 0 {
|
||||||
if _, ok1 := p.Roles.ModUnlock[msg.UseModId]; !ok1 {
|
if _, ok1 := p.Roles.ModUnlock[msg.UseModId]; !ok1 {
|
||||||
roleInfo := PetMgrSington.GetRoleInfo(p, msg.UseModId)
|
roleInfo := ModelMgrSingleton.GetRoleInfo(p, msg.UseModId)
|
||||||
if roleInfo != nil {
|
if roleInfo != nil {
|
||||||
item := BagMgrSingleton.GetItem(p.SnId, roleInfo.Fragment)
|
item := BagMgrSingleton.GetItem(p.SnId, roleInfo.Fragment)
|
||||||
if item != nil && item.ItemNum >= int64(roleInfo.Amount) {
|
if item != nil && item.ItemNum >= int64(roleInfo.Amount) {
|
||||||
|
@ -349,14 +349,14 @@ func (this *CSRolePetUnlockHandler) Process(s *netlib.Session, packetid int, dat
|
||||||
FriendMgrSington.UpdateInfo(p.Platform, p.SnId)
|
FriendMgrSington.UpdateInfo(p.Platform, p.SnId)
|
||||||
p.dirty = true
|
p.dirty = true
|
||||||
logger.Logger.Trace("解锁人物", msg.UseModId)
|
logger.Logger.Trace("解锁人物", msg.UseModId)
|
||||||
SendMsg(pets.OpResultCode_OPRC_Sucess, PetMgrSington.GetRoleInfo(p, msg.UseModId), nil)
|
SendMsg(pets.OpResultCode_OPRC_Sucess, ModelMgrSingleton.GetRoleInfo(p, msg.UseModId), nil)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if msg.UseModType == 1 {
|
} else if msg.UseModType == 1 {
|
||||||
if _, ok1 := p.Pets.ModUnlock[msg.UseModId]; !ok1 {
|
if _, ok1 := p.Pets.ModUnlock[msg.UseModId]; !ok1 {
|
||||||
petInfo := PetMgrSington.GetPetInfo(p, msg.UseModId)
|
petInfo := ModelMgrSingleton.GetPetInfo(p, msg.UseModId)
|
||||||
if petInfo != nil {
|
if petInfo != nil {
|
||||||
item := BagMgrSingleton.GetItem(p.SnId, petInfo.Fragment)
|
item := BagMgrSingleton.GetItem(p.SnId, petInfo.Fragment)
|
||||||
if item != nil && item.ItemNum >= int64(petInfo.Amount) {
|
if item != nil && item.ItemNum >= int64(petInfo.Amount) {
|
||||||
|
@ -384,7 +384,7 @@ func (this *CSRolePetUnlockHandler) Process(s *netlib.Session, packetid int, dat
|
||||||
FriendMgrSington.UpdateInfo(p.Platform, p.SnId)
|
FriendMgrSington.UpdateInfo(p.Platform, p.SnId)
|
||||||
p.dirty = true
|
p.dirty = true
|
||||||
logger.Logger.Trace("解锁宠物", msg.UseModId)
|
logger.Logger.Trace("解锁宠物", msg.UseModId)
|
||||||
SendMsg(pets.OpResultCode_OPRC_Sucess, nil, PetMgrSington.GetPetInfo(p, msg.UseModId))
|
SendMsg(pets.OpResultCode_OPRC_Sucess, nil, ModelMgrSingleton.GetPetInfo(p, msg.UseModId))
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -493,7 +493,7 @@ func CSSkinInfo(s *netlib.Session, packetid int, data interface{}, sid int64) er
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
pack := &pets.SCSkinInfo{
|
pack := &pets.SCSkinInfo{
|
||||||
Infos: PetMgrSington.GetSkinInfos(p),
|
Infos: ModelMgrSingleton.GetSkinInfos(p),
|
||||||
}
|
}
|
||||||
p.SendToClient(int(pets.PetsPacketID_PACKET_SC_SKIN_INFO), pack)
|
p.SendToClient(int(pets.PetsPacketID_PACKET_SC_SKIN_INFO), pack)
|
||||||
logger.Logger.Tracef("SCSkinInfo: %v", pack)
|
logger.Logger.Tracef("SCSkinInfo: %v", pack)
|
||||||
|
@ -530,7 +530,7 @@ func CSSkinUse(s *netlib.Session, packetid int, data interface{}, sid int64) err
|
||||||
}
|
}
|
||||||
|
|
||||||
// 已解锁的
|
// 已解锁的
|
||||||
info := PetMgrSington.GetSkinInfo(p, msg.GetId())
|
info := ModelMgrSingleton.GetSkinInfo(p, msg.GetId())
|
||||||
if !info.GetIsUnlock() {
|
if !info.GetIsUnlock() {
|
||||||
logger.Logger.Errorf("CSSkinUse unlock")
|
logger.Logger.Errorf("CSSkinUse unlock")
|
||||||
pack.RetCode = pets.OpResultCode_OPRC_Unlock
|
pack.RetCode = pets.OpResultCode_OPRC_Unlock
|
||||||
|
@ -567,7 +567,7 @@ func CSSkinUpgrade(s *netlib.Session, packetid int, data interface{}, sid int64)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 是否已经解锁
|
// 是否已经解锁
|
||||||
info := PetMgrSington.GetSkinInfo(p, msg.GetId())
|
info := ModelMgrSingleton.GetSkinInfo(p, msg.GetId())
|
||||||
if !info.GetIsUnlock() {
|
if !info.GetIsUnlock() {
|
||||||
logger.Logger.Errorf("CSSkinUpgrade not unlock")
|
logger.Logger.Errorf("CSSkinUpgrade not unlock")
|
||||||
send()
|
send()
|
||||||
|
@ -611,7 +611,7 @@ func CSSkinUpgrade(s *netlib.Session, packetid int, data interface{}, sid int64)
|
||||||
}
|
}
|
||||||
p.Skin.ModUnlock[msg.GetId()] = info.GetLevel() + 1
|
p.Skin.ModUnlock[msg.GetId()] = info.GetLevel() + 1
|
||||||
pack.RetCode = pets.OpResultCode_OPRC_Sucess
|
pack.RetCode = pets.OpResultCode_OPRC_Sucess
|
||||||
pack.Info = PetMgrSington.GetSkinInfo(p, msg.GetId())
|
pack.Info = ModelMgrSingleton.GetSkinInfo(p, msg.GetId())
|
||||||
send()
|
send()
|
||||||
|
|
||||||
// 任务加成变更
|
// 任务加成变更
|
||||||
|
@ -627,7 +627,7 @@ func SkinUnLock(p *Player, id int32) (*pets.SkinInfo, pets.OpResultCode) {
|
||||||
return nil, pets.OpResultCode_OPRC_Error
|
return nil, pets.OpResultCode_OPRC_Error
|
||||||
}
|
}
|
||||||
|
|
||||||
info := PetMgrSington.GetSkinInfo(p, id)
|
info := ModelMgrSingleton.GetSkinInfo(p, id)
|
||||||
if info.GetIsUnlock() {
|
if info.GetIsUnlock() {
|
||||||
return nil, pets.OpResultCode_OPRC_Error
|
return nil, pets.OpResultCode_OPRC_Error
|
||||||
}
|
}
|
||||||
|
@ -673,7 +673,7 @@ func SkinUnLock(p *Player, id int32) (*pets.SkinInfo, pets.OpResultCode) {
|
||||||
pack := &pets.SCSkinUnLock{
|
pack := &pets.SCSkinUnLock{
|
||||||
Id: id,
|
Id: id,
|
||||||
RetCode: pets.OpResultCode_OPRC_Sucess,
|
RetCode: pets.OpResultCode_OPRC_Sucess,
|
||||||
Info: PetMgrSington.GetSkinInfo(p, id),
|
Info: ModelMgrSingleton.GetSkinInfo(p, id),
|
||||||
}
|
}
|
||||||
p.SendToClient(int(pets.PetsPacketID_PACKET_SC_SKIN_UNLOCK), pack)
|
p.SendToClient(int(pets.PetsPacketID_PACKET_SC_SKIN_UNLOCK), pack)
|
||||||
logger.Logger.Tracef("SCSkinUnlock: %v", pack)
|
logger.Logger.Tracef("SCSkinUnlock: %v", pack)
|
||||||
|
|
|
@ -2229,7 +2229,7 @@ func CSQueryPlayer(s *netlib.Session, packetid int, data interface{}, sid int64)
|
||||||
Id: id,
|
Id: id,
|
||||||
Level: level,
|
Level: level,
|
||||||
}
|
}
|
||||||
roleData := PetMgrSington.GetIntroductionByModId(id)
|
roleData := ModelMgrSingleton.GetIntroductionByModId(id)
|
||||||
if roleData != nil {
|
if roleData != nil {
|
||||||
role.Name = roleData.Name
|
role.Name = roleData.Name
|
||||||
}
|
}
|
||||||
|
@ -2244,7 +2244,7 @@ func CSQueryPlayer(s *netlib.Session, packetid int, data interface{}, sid int64)
|
||||||
Id: id,
|
Id: id,
|
||||||
Level: level,
|
Level: level,
|
||||||
}
|
}
|
||||||
petData := PetMgrSington.GetIntroductionByModId(id)
|
petData := ModelMgrSingleton.GetIntroductionByModId(id)
|
||||||
if petData != nil {
|
if petData != nil {
|
||||||
pet.Name = petData.Name
|
pet.Name = petData.Name
|
||||||
}
|
}
|
||||||
|
|
|
@ -624,7 +624,6 @@ func (this *CSPMCmdHandler) Process(s *netlib.Session, packetid int, data interf
|
||||||
p.CoinPayTotal += int64(coin)
|
p.CoinPayTotal += int64(coin)
|
||||||
p.dirty = true
|
p.dirty = true
|
||||||
p.AddCoin(coin, 0, common.GainWay_ByPMCmd, p.GetName(), cmd)
|
p.AddCoin(coin, 0, common.GainWay_ByPMCmd, p.GetName(), cmd)
|
||||||
p.ReportSystemGiveEvent(int32(coin), common.GainWay_ByPMCmd, true)
|
|
||||||
p.SendDiffData()
|
p.SendDiffData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,113 +0,0 @@
|
||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"mongo.games.com/goserver/core/module"
|
|
||||||
)
|
|
||||||
|
|
||||||
const ACT_LOGGER = "actmgr"
|
|
||||||
|
|
||||||
var ActMgrSington = &ActMgr{
|
|
||||||
ConfigByPlateform: make(map[string]*ActGivePlateformConfig),
|
|
||||||
}
|
|
||||||
|
|
||||||
// config --------------------------------------------------------
|
|
||||||
type ActGiveConfig struct {
|
|
||||||
Tag int32 //赠与类型
|
|
||||||
IsStop int32 //是否阻止 1阻止 0放开
|
|
||||||
NeedFlow int32 //需要流水的倍数 0 不计算 其他计算
|
|
||||||
}
|
|
||||||
|
|
||||||
type ActGivePlateformConfig struct {
|
|
||||||
ActInfo map[string]*ActGiveConfig //奖励信息
|
|
||||||
findInfo map[int32]*ActGiveConfig //奖励信息
|
|
||||||
Platform string //平台
|
|
||||||
}
|
|
||||||
|
|
||||||
type ActMgr struct {
|
|
||||||
ConfigByPlateform map[string]*ActGivePlateformConfig
|
|
||||||
LastTicket int64
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ActMgr) AddGiveConfig(actComeConfig *ActGivePlateformConfig, plateFrom string) {
|
|
||||||
actComeConfig.findInfo = make(map[int32]*ActGiveConfig)
|
|
||||||
for _, v := range actComeConfig.ActInfo {
|
|
||||||
actComeConfig.findInfo[v.Tag] = v
|
|
||||||
}
|
|
||||||
this.ConfigByPlateform[plateFrom] = actComeConfig
|
|
||||||
|
|
||||||
this.OnConfigChanged(actComeConfig)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ActMgr) RemovePlateFormConfig(plateFrom string) {
|
|
||||||
_, ok := this.ConfigByPlateform[plateFrom]
|
|
||||||
if ok {
|
|
||||||
delete(this.ConfigByPlateform, plateFrom)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ActMgr) GetIsNeedGive(plateFrom string, tag int32) bool {
|
|
||||||
info := this.GetGiveConfig(plateFrom)
|
|
||||||
if info == nil {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
if v, ok := info.findInfo[tag]; ok {
|
|
||||||
if v.IsStop == 1 {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ActMgr) GetExchangeFlow(plateFrom string, tag int32) int32 {
|
|
||||||
info := this.GetGiveConfig(plateFrom)
|
|
||||||
if info == nil {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
if v, ok := info.findInfo[tag]; ok {
|
|
||||||
return v.NeedFlow
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ActMgr) GetGiveConfig(plateForm string) *ActGivePlateformConfig {
|
|
||||||
plateFormConfig, ok := this.ConfigByPlateform[plateForm]
|
|
||||||
if ok {
|
|
||||||
return plateFormConfig
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ActMgr) OnConfigChanged(actComeConfig *ActGivePlateformConfig) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// //////////////////////////////////////////////////////////////////
|
|
||||||
// / Module Implement [beg]
|
|
||||||
// //////////////////////////////////////////////////////////////////
|
|
||||||
func (this *ActMgr) ModuleName() string {
|
|
||||||
return "ActMgr"
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ActMgr) Init() {
|
|
||||||
this.LastTicket = time.Now().Unix()
|
|
||||||
|
|
||||||
if this.ConfigByPlateform == nil {
|
|
||||||
this.ConfigByPlateform = make(map[string]*ActGivePlateformConfig)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ActMgr) Update() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *ActMgr) Shutdown() {
|
|
||||||
module.UnregisteModule(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
module.RegisteModule(ActMgrSington, time.Minute, 0)
|
|
||||||
}
|
|
|
@ -79,7 +79,7 @@ func init() {
|
||||||
Num: param.ItemNum,
|
Num: param.ItemNum,
|
||||||
})
|
})
|
||||||
case common.ItemIDPetSkill:
|
case common.ItemIDPetSkill:
|
||||||
PetMgrSington.CheckShowRed(p)
|
ModelMgrSingleton.CheckShowRed(p)
|
||||||
|
|
||||||
case common.ItemIDPermit, common.ItemIDLong:
|
case common.ItemIDPermit, common.ItemIDLong:
|
||||||
var permitScore, long int64
|
var permitScore, long int64
|
||||||
|
@ -101,7 +101,7 @@ func init() {
|
||||||
|
|
||||||
switch itemData.GetType() {
|
switch itemData.GetType() {
|
||||||
case common.ItemTypeSkinChip:
|
case common.ItemTypeSkinChip:
|
||||||
PetMgrSington.CheckSkinRed(p)
|
ModelMgrSingleton.CheckSkinRed(p)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,6 +61,10 @@ func (m *CoinSceneMgr) GetCoinScenePool(plt string, id int32) *CoinScenePool {
|
||||||
return pool
|
return pool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// findCoinScenePool 查找指定平台和ID的场景池
|
||||||
|
// platform 平台ID
|
||||||
|
// id 场次ID
|
||||||
|
// 返回场景池map和对应的游戏场次配置
|
||||||
func (m *CoinSceneMgr) findCoinScenePool(platform string, id int32) (pools map[int32]*CoinScenePool, dbGameFree *server.DB_GameFree) {
|
func (m *CoinSceneMgr) findCoinScenePool(platform string, id int32) (pools map[int32]*CoinScenePool, dbGameFree *server.DB_GameFree) {
|
||||||
gf := PlatformMgrSingleton.GetGameFree(platform, id)
|
gf := PlatformMgrSingleton.GetGameFree(platform, id)
|
||||||
if gf == nil || gf.GetDbGameFree() == nil {
|
if gf == nil || gf.GetDbGameFree() == nil {
|
||||||
|
@ -76,9 +80,19 @@ func (m *CoinSceneMgr) findCoinScenePool(platform string, id int32) (pools map[i
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlayerEnter 玩家进入房间池
|
// PlayerEnter 玩家进入房间池
|
||||||
|
// 参数:
|
||||||
|
// - p: 玩家对象
|
||||||
|
// - id: 场次ID
|
||||||
|
// - roomId: 房间ID,为0时随机分配房间
|
||||||
|
// - exclude: 排除的房间ID列表
|
||||||
|
// - isChangeRoom: 是否为换房操作
|
||||||
|
//
|
||||||
|
// 返回值:
|
||||||
|
// - hallproto.OpResultCode: 操作结果代码
|
||||||
func (m *CoinSceneMgr) PlayerEnter(p *Player, id int32, roomId int32, exclude []int32, isChangeRoom bool) hallproto.OpResultCode {
|
func (m *CoinSceneMgr) PlayerEnter(p *Player, id int32, roomId int32, exclude []int32, isChangeRoom bool) hallproto.OpResultCode {
|
||||||
logger.Logger.Tracef("CoinSceneMgr PlayerEnter snid:%v id:%v roomid:%v exclude:%v", p.SnId, id, roomId, exclude)
|
logger.Logger.Tracef("CoinSceneMgr PlayerEnter snid:%v id:%v roomid:%v exclude:%v", p.SnId, id, roomId, exclude)
|
||||||
if p.isDelete { //删档用户不让进游戏
|
//删档用户不让进游戏
|
||||||
|
if p.isDelete {
|
||||||
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
}
|
}
|
||||||
// 玩家已经在房间里了
|
// 玩家已经在房间里了
|
||||||
|
@ -98,9 +112,19 @@ func (m *CoinSceneMgr) PlayerEnter(p *Player, id int32, roomId int32, exclude []
|
||||||
}
|
}
|
||||||
|
|
||||||
// AudienceEnter 观众进入房间
|
// AudienceEnter 观众进入房间
|
||||||
|
// 参数:
|
||||||
|
// - p: 玩家对象
|
||||||
|
// - id: 场次ID
|
||||||
|
// - roomId: 房间ID,为0时随机分配房间
|
||||||
|
// - exclude: 排除的房间ID列表
|
||||||
|
// - ischangeroom: 是否为换房操作
|
||||||
|
//
|
||||||
|
// 返回值:
|
||||||
|
// - hallproto.OpResultCode: 操作结果代码
|
||||||
func (m *CoinSceneMgr) AudienceEnter(p *Player, id int32, roomId int32, exclude []int32, ischangeroom bool) hallproto.OpResultCode {
|
func (m *CoinSceneMgr) AudienceEnter(p *Player, id int32, roomId int32, exclude []int32, ischangeroom bool) hallproto.OpResultCode {
|
||||||
logger.Logger.Tracef("CoinSceneMgr AudienceEnter snid:%v id:%v roomid:%v exclude:%v", p.SnId, id, roomId, exclude)
|
logger.Logger.Tracef("CoinSceneMgr AudienceEnter snid:%v id:%v roomid:%v exclude:%v", p.SnId, id, roomId, exclude)
|
||||||
if p.isDelete { //删档用户不让进游戏
|
//删档用户不让进游戏
|
||||||
|
if p.isDelete {
|
||||||
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
return hallproto.OpResultCode_OPRC_RoomHadClosed
|
||||||
}
|
}
|
||||||
if m.InCoinScene(p) {
|
if m.InCoinScene(p) {
|
||||||
|
@ -191,7 +215,7 @@ func (m *CoinSceneMgr) GetPlayerNums(p *Player, gameId, gameMode int32) []int32
|
||||||
return nums[:]
|
return nums[:]
|
||||||
}
|
}
|
||||||
|
|
||||||
// InCoinScene 是否在场次中
|
// InCoinScene 检查玩家是否在场次中
|
||||||
func (m *CoinSceneMgr) InCoinScene(p *Player) bool {
|
func (m *CoinSceneMgr) InCoinScene(p *Player) bool {
|
||||||
if p == nil {
|
if p == nil {
|
||||||
logger.Logger.Tracef("(m *CoinSceneMgr) InCoinScene p == nil")
|
logger.Logger.Tracef("(m *CoinSceneMgr) InCoinScene p == nil")
|
||||||
|
@ -230,18 +254,18 @@ func (m *CoinSceneMgr) PlayerTryLeave(p *Player, isAudience bool) hallproto.OpRe
|
||||||
return hallproto.OpResultCode_OPRC_OpYield
|
return hallproto.OpResultCode_OPRC_OpYield
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlayerInChanging 换房中
|
// PlayerInChanging 检查玩家是否正在换房中
|
||||||
func (m *CoinSceneMgr) PlayerInChanging(p *Player) bool {
|
func (m *CoinSceneMgr) PlayerInChanging(p *Player) bool {
|
||||||
_, exist := m.playerChanging[p.SnId]
|
_, exist := m.playerChanging[p.SnId]
|
||||||
return exist
|
return exist
|
||||||
}
|
}
|
||||||
|
|
||||||
// ClearPlayerChanging 换房结束
|
// ClearPlayerChanging 清除玩家换房状态
|
||||||
func (m *CoinSceneMgr) ClearPlayerChanging(p *Player) {
|
func (m *CoinSceneMgr) ClearPlayerChanging(p *Player) {
|
||||||
delete(m.playerChanging, p.SnId)
|
delete(m.playerChanging, p.SnId)
|
||||||
}
|
}
|
||||||
|
|
||||||
// PlayerTryChange 换房
|
// PlayerTryChange 玩家尝试换房
|
||||||
// id 场次id
|
// id 场次id
|
||||||
// excludeRoomId 排除的房间id
|
// excludeRoomId 排除的房间id
|
||||||
// isAudience 是否是观众
|
// isAudience 是否是观众
|
||||||
|
@ -258,6 +282,7 @@ func (m *CoinSceneMgr) PlayerTryChange(p *Player, id int32, excludeRoomId []int3
|
||||||
return m.PlayerEnter(p, id, 0, excludeRoomId, true)
|
return m.PlayerEnter(p, id, 0, excludeRoomId, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StartChangeCoinSceneTransact 开始换房事务
|
||||||
func (m *CoinSceneMgr) StartChangeCoinSceneTransact(p *Player, id int32, exclude []int32, isAudience bool) hallproto.OpResultCode {
|
func (m *CoinSceneMgr) StartChangeCoinSceneTransact(p *Player, id int32, exclude []int32, isAudience bool) hallproto.OpResultCode {
|
||||||
if p == nil || p.scene == nil {
|
if p == nil || p.scene == nil {
|
||||||
logger.Logger.Warnf("(m *CoinSceneMgr) StartChangeCoinSceneTransact p == nil || p.scene == nil snid:%v id:%v", p.SnId, id)
|
logger.Logger.Warnf("(m *CoinSceneMgr) StartChangeCoinSceneTransact p == nil || p.scene == nil snid:%v id:%v", p.SnId, id)
|
||||||
|
|
|
@ -182,6 +182,23 @@ func (csp *CoinScenePool) canEnter(p *Player) gamehallproto.OpResultCode {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 具体场次的入场规则
|
||||||
|
canEnterFunc := GetCoinSceneCanEnterFunc(int(dbGameFree.GetGameId()))
|
||||||
|
if canEnterFunc != nil {
|
||||||
|
ret := canEnterFunc(csp, p)
|
||||||
|
if ret != gamehallproto.OpResultCode_OPRC_Sucess {
|
||||||
|
return ret
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 通用入场检测
|
||||||
|
if dbGameFree.GetLimitCoin() != 0 && dbGameFree.GetLimitCoin() > p.Coin && !p.IsRob {
|
||||||
|
return gamehallproto.OpResultCode_OPRC_CoinNotEnough
|
||||||
|
}
|
||||||
|
if dbGameFree.GetMaxCoinLimit() != 0 && dbGameFree.GetMaxCoinLimit() < p.Coin && !p.IsRob {
|
||||||
|
return gamehallproto.OpResultCode_OPRC_CoinTooMore
|
||||||
|
}
|
||||||
|
|
||||||
return csp.policy.CanEnter(csp, p)
|
return csp.policy.CanEnter(csp, p)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,15 +241,14 @@ func (csp *CoinScenePool) playerEnter(p *Player, roomId int32, exclude []int32,
|
||||||
if s.IsFull() {
|
if s.IsFull() {
|
||||||
return gamehallproto.OpResultCode_OPRC_RoomIsFull
|
return gamehallproto.OpResultCode_OPRC_RoomIsFull
|
||||||
}
|
}
|
||||||
if sp, ok := s.sp.(*ScenePolicyData); ok {
|
if s.sp.CanEnter(s, p.SnId) == 0 {
|
||||||
if !s.starting || sp.EnterAfterStart {
|
|
||||||
scene = s
|
scene = s
|
||||||
} else {
|
} else {
|
||||||
logger.Logger.Warnf("(csp *CoinScenePool) PlayerEnter[!s.starting || sp.EnterAfterStart] snid:%v sceneid:%v starting:%v EnterAfterStart:%v", p.SnId, s.sceneId, s.starting, sp.EnterAfterStart)
|
logger.Logger.Warnf("(csp *CoinScenePool) PlayerEnter[!s.starting || sp.EnterAfterStart] snid:%v sceneid:%v starting:%v EnterAfterStart:%v",
|
||||||
|
p.SnId, s.sceneId, s.starting, s.sp.CanEnter(s, p.SnId))
|
||||||
return gamehallproto.OpResultCode_OPRC_Error
|
return gamehallproto.OpResultCode_OPRC_Error
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
logger.Logger.Warnf("(csp *CoinScenePool) PlayerEnter(robot:%v,roomid:%v, exclude:%v, isChangeRoom:%v) no found scene", p.SnId, roomId, exclude, isChangeRoom)
|
logger.Logger.Warnf("(csp *CoinScenePool) PlayerEnter(robot:%v,roomid:%v, exclude:%v, isChangeRoom:%v) no found scene", p.SnId, roomId, exclude, isChangeRoom)
|
||||||
return gamehallproto.OpResultCode_OPRC_Error
|
return gamehallproto.OpResultCode_OPRC_Error
|
||||||
|
|
|
@ -22,23 +22,6 @@ func (this *BaseCoinScenePool) New() interface{} {
|
||||||
|
|
||||||
// CanEnter 检查入场条件
|
// CanEnter 检查入场条件
|
||||||
func (this *BaseCoinScenePool) CanEnter(pool *CoinScenePool, p *Player) gamehall.OpResultCode {
|
func (this *BaseCoinScenePool) CanEnter(pool *CoinScenePool, p *Player) gamehall.OpResultCode {
|
||||||
// 具体场次的入场规则
|
|
||||||
canEnterFunc := GetCoinSceneCanEnterFunc(int(pool.dbGameFree.GetGameId()))
|
|
||||||
if canEnterFunc != nil {
|
|
||||||
ret := canEnterFunc(pool, p)
|
|
||||||
if ret != gamehall.OpResultCode_OPRC_Sucess {
|
|
||||||
return ret
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 通用入场检测
|
|
||||||
if pool.dbGameFree.GetLimitCoin() != 0 && pool.dbGameFree.GetLimitCoin() > p.Coin && !p.IsRob {
|
|
||||||
return gamehall.OpResultCode_OPRC_CoinNotEnough
|
|
||||||
}
|
|
||||||
if pool.dbGameFree.GetMaxCoinLimit() != 0 && int64(pool.dbGameFree.GetMaxCoinLimit()) < p.Coin && !p.IsRob {
|
|
||||||
return gamehall.OpResultCode_OPRC_CoinTooMore
|
|
||||||
}
|
|
||||||
|
|
||||||
return gamehall.OpResultCode_OPRC_Sucess
|
return gamehall.OpResultCode_OPRC_Sucess
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,11 +69,10 @@ func (this *BaseCoinScenePool) PlayerEnter(pool *CoinScenePool, p *Player, exclu
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// 牌局开始后禁止进入
|
// 牌局开始后禁止进入
|
||||||
if sp, ok := s.sp.(*ScenePolicyData); ok {
|
if s.sp.CanEnter(s, p.SnId) != 0 {
|
||||||
if s.starting && !sp.EnterAfterStart {
|
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
scenes[sceneId] = s
|
scenes[sceneId] = s
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,8 +55,6 @@ func init() {
|
||||||
etcd.Register(etcd.ETCDKEY_BLACKLIST_PREFIX, BlackInfoApi{}, handlerEvent)
|
etcd.Register(etcd.ETCDKEY_BLACKLIST_PREFIX, BlackInfoApi{}, handlerEvent)
|
||||||
// 代理
|
// 代理
|
||||||
etcd.Register(etcd.ETCDKEY_PROMOTER_PREFIX, PromoterConfig{}, handlerEvent)
|
etcd.Register(etcd.ETCDKEY_PROMOTER_PREFIX, PromoterConfig{}, handlerEvent)
|
||||||
// 赠送
|
|
||||||
etcd.Register(etcd.ETCDKEY_ACT_GIVE_PREFIX, ActGivePlateformConfig{}, handlerEvent)
|
|
||||||
// 7日签到
|
// 7日签到
|
||||||
etcd.Register(etcd.ETCDKEY_ACT_7SIGN, webapi.Welfare7SignDateList{}, platformConfigEvent)
|
etcd.Register(etcd.ETCDKEY_ACT_7SIGN, webapi.Welfare7SignDateList{}, platformConfigEvent)
|
||||||
// 转盘
|
// 转盘
|
||||||
|
@ -442,18 +440,6 @@ func handlerEvent(ctx context.Context, completeKey string, isInit bool, event *c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
case equalFunc(etcd.ETCDKEY_ACT_GIVE_PREFIX):
|
|
||||||
var config *ActGivePlateformConfig
|
|
||||||
if data != nil {
|
|
||||||
config = data.(*ActGivePlateformConfig)
|
|
||||||
}
|
|
||||||
if config == nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if isInit || event.Type == clientv3.EventTypePut {
|
|
||||||
ActMgrSington.AddGiveConfig(config, config.Platform)
|
|
||||||
}
|
|
||||||
|
|
||||||
case equalFunc(etcd.ETCDKEY_MatchAudience):
|
case equalFunc(etcd.ETCDKEY_MatchAudience):
|
||||||
switch event.Type {
|
switch event.Type {
|
||||||
case clientv3.EventTypePut:
|
case clientv3.EventTypePut:
|
||||||
|
|
|
@ -1,13 +1,9 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
"mongo.games.com/goserver/core/module"
|
|
||||||
|
|
||||||
"mongo.games.com/game/common"
|
"mongo.games.com/game/common"
|
||||||
"mongo.games.com/game/model"
|
"mongo.games.com/game/model"
|
||||||
hall_proto "mongo.games.com/game/protocol/gamehall"
|
"mongo.games.com/game/protocol/gamehall"
|
||||||
"mongo.games.com/game/protocol/pets"
|
"mongo.games.com/game/protocol/pets"
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
)
|
)
|
||||||
|
@ -17,13 +13,12 @@ const (
|
||||||
ItemConsume //消耗
|
ItemConsume //消耗
|
||||||
)
|
)
|
||||||
|
|
||||||
var PetMgrSington = &PetMgr{
|
var ModelMgrSingleton = &ModelMgr{}
|
||||||
//RPInfos: make(map[int32]*RoleAndPetInfo),
|
|
||||||
}
|
|
||||||
|
|
||||||
type PetMgr struct {
|
type ModelMgr struct {
|
||||||
//RPInfos map[int32]*RoleAndPetInfo
|
//RPInfos map[int32]*RoleAndPetInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
type RoleAndPetInfo struct {
|
type RoleAndPetInfo struct {
|
||||||
ModId int32 //模型id
|
ModId int32 //模型id
|
||||||
Name string //名字
|
Name string //名字
|
||||||
|
@ -32,12 +27,9 @@ type RoleAndPetInfo struct {
|
||||||
MaxLevel int32 //最大等级
|
MaxLevel int32 //最大等级
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PetMgr) ModuleName() string {
|
|
||||||
return "PetMgr"
|
|
||||||
}
|
|
||||||
|
|
||||||
// 人物
|
// 人物
|
||||||
func (this *PetMgr) GetRoleInfos(p *Player) []*pets.RoleInfo {
|
|
||||||
|
func (this *ModelMgr) GetRoleInfos(p *Player) []*pets.RoleInfo {
|
||||||
rolesInfo := srvdata.RolePetMgrSington.Roles
|
rolesInfo := srvdata.RolePetMgrSington.Roles
|
||||||
if rolesInfo != nil {
|
if rolesInfo != nil {
|
||||||
var newRoles = make([]*pets.RoleInfo, 0)
|
var newRoles = make([]*pets.RoleInfo, 0)
|
||||||
|
@ -89,7 +81,8 @@ func (this *PetMgr) GetRoleInfos(p *Player) []*pets.RoleInfo {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *PetMgr) GetRoleInfo(p *Player, modId int32) *pets.RoleInfo {
|
|
||||||
|
func (this *ModelMgr) GetRoleInfo(p *Player, modId int32) *pets.RoleInfo {
|
||||||
level := p.Roles.ModUnlock[modId]
|
level := p.Roles.ModUnlock[modId]
|
||||||
roleInfo := srvdata.RolePetMgrSington.GetRoleByRoleIdAndLevel(modId, level)
|
roleInfo := srvdata.RolePetMgrSington.GetRoleByRoleIdAndLevel(modId, level)
|
||||||
if roleInfo != nil {
|
if roleInfo != nil {
|
||||||
|
@ -130,9 +123,9 @@ func (this *PetMgr) GetRoleInfo(p *Player, modId int32) *pets.RoleInfo {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ////////////////////////////////////////////////////////////////////////
|
|
||||||
// 宠物
|
// 宠物
|
||||||
func (this *PetMgr) GetPetInfos(p *Player) []*pets.PetInfo {
|
|
||||||
|
func (this *ModelMgr) GetPetInfos(p *Player) []*pets.PetInfo {
|
||||||
petsInfo := srvdata.RolePetMgrSington.Pets
|
petsInfo := srvdata.RolePetMgrSington.Pets
|
||||||
if petsInfo != nil {
|
if petsInfo != nil {
|
||||||
var newPets = make([]*pets.PetInfo, 0)
|
var newPets = make([]*pets.PetInfo, 0)
|
||||||
|
@ -195,7 +188,8 @@ func (this *PetMgr) GetPetInfos(p *Player) []*pets.PetInfo {
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (this *PetMgr) GetPetInfo(p *Player, modId int32) *pets.PetInfo {
|
|
||||||
|
func (this *ModelMgr) GetPetInfo(p *Player, modId int32) *pets.PetInfo {
|
||||||
level := p.Pets.ModUnlock[modId]
|
level := p.Pets.ModUnlock[modId]
|
||||||
petInfo := srvdata.RolePetMgrSington.GetPetByPetIdAndLevel(modId, level)
|
petInfo := srvdata.RolePetMgrSington.GetPetByPetIdAndLevel(modId, level)
|
||||||
if petInfo != nil {
|
if petInfo != nil {
|
||||||
|
@ -247,7 +241,8 @@ func (this *PetMgr) GetPetInfo(p *Player, modId int32) *pets.PetInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 皮肤
|
// 皮肤
|
||||||
func (this *PetMgr) GetSkinInfos(p *Player) []*pets.SkinInfo {
|
|
||||||
|
func (this *ModelMgr) GetSkinInfos(p *Player) []*pets.SkinInfo {
|
||||||
var ret []*pets.SkinInfo
|
var ret []*pets.SkinInfo
|
||||||
for _, v := range PlatformMgrSingleton.GetConfig(p.Platform).SkinConfig.GetItems() {
|
for _, v := range PlatformMgrSingleton.GetConfig(p.Platform).SkinConfig.GetItems() {
|
||||||
ret = append(ret, this.GetSkinInfo(p, v.GetId()))
|
ret = append(ret, this.GetSkinInfo(p, v.GetId()))
|
||||||
|
@ -255,7 +250,7 @@ func (this *PetMgr) GetSkinInfos(p *Player) []*pets.SkinInfo {
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PetMgr) GetSkinInfo(p *Player, id int32) *pets.SkinInfo {
|
func (this *ModelMgr) GetSkinInfo(p *Player, id int32) *pets.SkinInfo {
|
||||||
cfg := PlatformMgrSingleton.GetSkinInfo(p.Platform, id)
|
cfg := PlatformMgrSingleton.GetSkinInfo(p.Platform, id)
|
||||||
if cfg == nil {
|
if cfg == nil {
|
||||||
return nil
|
return nil
|
||||||
|
@ -336,7 +331,8 @@ func (this *PetMgr) GetSkinInfo(p *Player, id int32) *pets.SkinInfo {
|
||||||
return ret
|
return ret
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *PetMgr) CheckSkinRed(p *Player) {
|
// CheckSkinRed 皮肤红点
|
||||||
|
func (this *ModelMgr) CheckSkinRed(p *Player) {
|
||||||
if p == nil || p.IsRob {
|
if p == nil || p.IsRob {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -356,12 +352,12 @@ func (this *PetMgr) CheckSkinRed(p *Player) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ok && len(info.GetCost()) > 0 {
|
if ok && len(info.GetCost()) > 0 {
|
||||||
p.SendShowRed(hall_proto.ShowRedCode_Skin, v.Id, 1)
|
p.SendShowRed(gamehall.ShowRedCode_Skin, v.Id, 1)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// vip等级解锁
|
// vip等级解锁
|
||||||
if info.GetUnLockType() == common.SkinGetVip && p.VIP >= info.GetNeedVip() {
|
if info.GetUnLockType() == common.SkinGetVip && p.VIP >= info.GetNeedVip() {
|
||||||
p.SendShowRed(hall_proto.ShowRedCode_Skin, v.Id, 1)
|
p.SendShowRed(gamehall.ShowRedCode_Skin, v.Id, 1)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -376,15 +372,16 @@ func (this *PetMgr) CheckSkinRed(p *Player) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ok && len(info.GetCost()) > 0 {
|
if ok && len(info.GetCost()) > 0 {
|
||||||
p.SendShowRed(hall_proto.ShowRedCode_Skin, v.Id, 1)
|
p.SendShowRed(gamehall.ShowRedCode_Skin, v.Id, 1)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 商品人物总加成 人物功能变动需要修改
|
// GetShopAward 角色加成
|
||||||
func (this *PetMgr) GetShopAward(shopInfo *model.ShopInfo, p *Player) (award, roleId int32) {
|
// 商品人物加成,角色id 人物功能变动需要修改
|
||||||
|
func (this *ModelMgr) GetShopAward(shopInfo *model.ShopInfo, p *Player) (award, roleId int32) {
|
||||||
if shopInfo.Ad > 0 && shopInfo.Type == ShopTypeCoin {
|
if shopInfo.Ad > 0 && shopInfo.Type == ShopTypeCoin {
|
||||||
id, add := srvdata.RolePetMgrSington.GetRoleAdd(p.PlayerData, common.RoleAddADV)
|
id, add := srvdata.RolePetMgrSington.GetRoleAdd(p.PlayerData, common.RoleAddADV)
|
||||||
award += add
|
award += add
|
||||||
|
@ -404,15 +401,18 @@ func (this *PetMgr) GetShopAward(shopInfo *model.ShopInfo, p *Player) (award, ro
|
||||||
return award, roleId
|
return award, roleId
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetAwardPetByWelf 宠物加成
|
||||||
// 宠物加成 宠物功能变动需要修改
|
// 宠物加成 宠物功能变动需要修改
|
||||||
func (this *PetMgr) GetAwardPetByWelf(p *Player) (award int64) {
|
func (this *ModelMgr) GetAwardPetByWelf(p *Player) (award int64) {
|
||||||
petChick := this.GetPetInfo(p, 1000001)
|
petChick := this.GetPetInfo(p, 1000001)
|
||||||
if petChick != nil && petChick.Level > 0 {
|
if petChick != nil && petChick.Level > 0 {
|
||||||
award = int64(petChick.Award)
|
award = int64(petChick.Award)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
func (this *PetMgr) GetIntroductionByModId(modId int32) *RoleAndPetInfo {
|
|
||||||
|
// GetIntroductionByModId 模型介绍
|
||||||
|
func (this *ModelMgr) GetIntroductionByModId(modId int32) *RoleAndPetInfo {
|
||||||
mod := srvdata.PBDB_Game_IntroductionMgr.GetData(modId)
|
mod := srvdata.PBDB_Game_IntroductionMgr.GetData(modId)
|
||||||
if mod == nil {
|
if mod == nil {
|
||||||
return &RoleAndPetInfo{}
|
return &RoleAndPetInfo{}
|
||||||
|
@ -425,7 +425,10 @@ func (this *PetMgr) GetIntroductionByModId(modId int32) *RoleAndPetInfo {
|
||||||
MaxLevel: mod.LevelMax,
|
MaxLevel: mod.LevelMax,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
func (this *PetMgr) CheckShowRed(p *Player) {
|
|
||||||
|
// CheckShowRed 检查红点
|
||||||
|
// 人物,宠物,宠物技能
|
||||||
|
func (this *ModelMgr) CheckShowRed(p *Player) {
|
||||||
if p == nil || p.IsRob {
|
if p == nil || p.IsRob {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -517,26 +520,9 @@ func (this *PetMgr) CheckShowRed(p *Player) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if roleRed {
|
if roleRed {
|
||||||
p.SendShowRed(hall_proto.ShowRedCode_Role, 0, 1)
|
p.SendShowRed(gamehall.ShowRedCode_Role, 0, 1)
|
||||||
}
|
}
|
||||||
if petRed {
|
if petRed {
|
||||||
p.SendShowRed(hall_proto.ShowRedCode_Pet, 0, 1)
|
p.SendShowRed(gamehall.ShowRedCode_Pet, 0, 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////
|
|
||||||
|
|
||||||
func (this *PetMgr) Init() {
|
|
||||||
|
|
||||||
}
|
|
||||||
func (this *PetMgr) Update() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *PetMgr) Shutdown() {
|
|
||||||
module.UnregisteModule(this)
|
|
||||||
}
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
module.RegisteModule(PetMgrSington, time.Second, 0)
|
|
||||||
}
|
|
||||||
|
|
|
@ -48,15 +48,12 @@ type ClubConfig struct {
|
||||||
GiveCoinRate []int64 //会长充值额外赠送比例
|
GiveCoinRate []int64 //会长充值额外赠送比例
|
||||||
}
|
}
|
||||||
type Platform struct {
|
type Platform struct {
|
||||||
Id int32 // 平台ID
|
Id int32 // 平台ID,数值
|
||||||
IdStr string // 字符id
|
IdStr string // 字符id,字符串
|
||||||
Name string // 平台名称
|
Name string // 平台名称
|
||||||
Isolated bool // 是否孤立(别的平台看不到)
|
Isolated bool // 是否孤立(别的平台看不到)
|
||||||
Disable bool // 是否禁用
|
Disable bool // 是否禁用
|
||||||
dirty bool //
|
|
||||||
ServiceUrl string //客服地址
|
|
||||||
BindOption int32 //绑定选项
|
BindOption int32 //绑定选项
|
||||||
ServiceFlag bool //客服标记 是否支持浏览器跳转 false否 true是
|
|
||||||
UpgradeAccountGiveCoin int32 //升级账号奖励金币
|
UpgradeAccountGiveCoin int32 //升级账号奖励金币
|
||||||
NewAccountGiveCoin int32 //新账号奖励金币
|
NewAccountGiveCoin int32 //新账号奖励金币
|
||||||
PerBankNoLimitAccount int32 //同一银行卡号绑定用户数量限制
|
PerBankNoLimitAccount int32 //同一银行卡号绑定用户数量限制
|
||||||
|
|
|
@ -124,9 +124,7 @@ func (pm *PlatformMgr) UpsertPlatform(name string, isolated, disable bool, id in
|
||||||
p.Id = id
|
p.Id = id
|
||||||
p.Name = name
|
p.Name = name
|
||||||
p.IdStr = pltId
|
p.IdStr = pltId
|
||||||
p.ServiceUrl = url
|
|
||||||
p.BindOption = bindOption
|
p.BindOption = bindOption
|
||||||
p.ServiceFlag = serviceFlag
|
|
||||||
p.CustomType = customType
|
p.CustomType = customType
|
||||||
p.UpgradeAccountGiveCoin = upgradeAccountGiveCoin
|
p.UpgradeAccountGiveCoin = upgradeAccountGiveCoin
|
||||||
p.NewAccountGiveCoin = newAccountGiveCoin
|
p.NewAccountGiveCoin = newAccountGiveCoin
|
||||||
|
|
|
@ -33,7 +33,6 @@ import (
|
||||||
playerproto "mongo.games.com/game/protocol/player"
|
playerproto "mongo.games.com/game/protocol/player"
|
||||||
"mongo.games.com/game/protocol/rankmatch"
|
"mongo.games.com/game/protocol/rankmatch"
|
||||||
serverproto "mongo.games.com/game/protocol/server"
|
serverproto "mongo.games.com/game/protocol/server"
|
||||||
shopproto "mongo.games.com/game/protocol/shop"
|
|
||||||
"mongo.games.com/game/srvdata"
|
"mongo.games.com/game/srvdata"
|
||||||
"mongo.games.com/game/worldsrv/internal"
|
"mongo.games.com/game/worldsrv/internal"
|
||||||
)
|
)
|
||||||
|
@ -443,9 +442,9 @@ func (this *Player) CheckShowRed() {
|
||||||
//商城红点
|
//商城红点
|
||||||
ShopMgrSington.ShopCheckShowRed(this)
|
ShopMgrSington.ShopCheckShowRed(this)
|
||||||
//数据依赖于背包数据 放入加载背包数据之后执行
|
//数据依赖于背包数据 放入加载背包数据之后执行
|
||||||
PetMgrSington.CheckShowRed(this)
|
ModelMgrSingleton.CheckShowRed(this)
|
||||||
// 皮肤红点
|
// 皮肤红点
|
||||||
PetMgrSington.CheckSkinRed(this)
|
ModelMgrSingleton.CheckSkinRed(this)
|
||||||
//福利红点
|
//福利红点
|
||||||
WelfareMgrSington.WelfareShowRed(this)
|
WelfareMgrSington.WelfareShowRed(this)
|
||||||
// 排行赛红点
|
// 排行赛红点
|
||||||
|
@ -1097,7 +1096,6 @@ func (this *Player) GetMessageAttach(id string) {
|
||||||
attachMsg, ok := data.(*model.Message)
|
attachMsg, ok := data.(*model.Message)
|
||||||
if ok && attachMsg != nil {
|
if ok && attachMsg != nil {
|
||||||
msg.AttachState = model.MSGATTACHSTATE_GOT
|
msg.AttachState = model.MSGATTACHSTATE_GOT
|
||||||
notifyClient := true
|
|
||||||
var remark string
|
var remark string
|
||||||
var gainWay int32 = common.GainWay_MessageAttach
|
var gainWay int32 = common.GainWay_MessageAttach
|
||||||
|
|
||||||
|
@ -1150,15 +1148,12 @@ func (this *Player) GetMessageAttach(id string) {
|
||||||
case model.MSGTYPE_GOLDCOMERANK:
|
case model.MSGTYPE_GOLDCOMERANK:
|
||||||
remark = "财神降临奖励"
|
remark = "财神降临奖励"
|
||||||
gainWay = common.GainWay_GoldCome
|
gainWay = common.GainWay_GoldCome
|
||||||
notifyClient = false
|
|
||||||
case model.MSGTYPE_RANDCOIN:
|
case model.MSGTYPE_RANDCOIN:
|
||||||
remark = "红包雨"
|
remark = "红包雨"
|
||||||
gainWay = common.GainWay_OnlineRandCoin
|
gainWay = common.GainWay_OnlineRandCoin
|
||||||
notifyClient = false
|
|
||||||
case model.MSGTYPE_REBATE:
|
case model.MSGTYPE_REBATE:
|
||||||
remark = "流水返利"
|
remark = "流水返利"
|
||||||
gainWay = common.GainWay_RebateTask
|
gainWay = common.GainWay_RebateTask
|
||||||
notifyClient = false
|
|
||||||
//邮件领取 添加日志
|
//邮件领取 添加日志
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
||||||
return model.InsertRebateLog(this.Platform, &model.Rebate{
|
return model.InsertRebateLog(this.Platform, &model.Rebate{
|
||||||
|
@ -1184,10 +1179,8 @@ func (this *Player) GetMessageAttach(id string) {
|
||||||
//dirtyCoin = msg.Coin
|
//dirtyCoin = msg.Coin
|
||||||
case model.MSGTYPE_MATCH_SIGNUPFEE:
|
case model.MSGTYPE_MATCH_SIGNUPFEE:
|
||||||
gainWay = common.GainWay_MatchBreakBack
|
gainWay = common.GainWay_MatchBreakBack
|
||||||
notifyClient = false
|
|
||||||
case model.MSGTYPE_MATCH_TICKETREWARD:
|
case model.MSGTYPE_MATCH_TICKETREWARD:
|
||||||
gainWay = common.GainWay_MatchSystemSupply
|
gainWay = common.GainWay_MatchSystemSupply
|
||||||
notifyClient = false
|
|
||||||
this.TicketTotal += msg.Ticket
|
this.TicketTotal += msg.Ticket
|
||||||
case model.MSGTYPE_MATCH_SHOPEXCHANGE:
|
case model.MSGTYPE_MATCH_SHOPEXCHANGE:
|
||||||
remark = "积分商城兑换"
|
remark = "积分商城兑换"
|
||||||
|
@ -1206,12 +1199,6 @@ func (this *Player) GetMessageAttach(id string) {
|
||||||
}
|
}
|
||||||
if msg.Coin > 0 {
|
if msg.Coin > 0 {
|
||||||
this.AddCoin(msg.Coin, 0, gainWay, msg.Id.Hex(), remark)
|
this.AddCoin(msg.Coin, 0, gainWay, msg.Id.Hex(), remark)
|
||||||
//俱乐部获取不算系统赠送
|
|
||||||
if msg.MType != model.MSGTYPE_ClubGet {
|
|
||||||
this.ReportSystemGiveEvent(int32(msg.Coin), gainWay, notifyClient) //邮件附件算是系统赠送
|
|
||||||
} else { //俱乐部获取算充值
|
|
||||||
this.AddCoinGiveLog(msg.Coin, 0, 0, gainWay, model.COINGIVETYPE_PAY, "club", "club")
|
|
||||||
}
|
|
||||||
this.AddPayCoinLog(msg.Coin, model.PayCoinLogType_Coin, "mail")
|
this.AddPayCoinLog(msg.Coin, model.PayCoinLogType_Coin, "mail")
|
||||||
if msg.Oper == 0 { //系统赠送
|
if msg.Oper == 0 { //系统赠送
|
||||||
if !this.IsRob {
|
if !this.IsRob {
|
||||||
|
@ -2953,97 +2940,6 @@ func (this *Player) ReportBindAlipayEvent() {
|
||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *Player) AddCoinGiveLog(payCoin, giveCoin int64, coinType, logType, recType int32, remark, oper string) {
|
|
||||||
plt := PlatformMgrSingleton.GetPlatform(this.Platform)
|
|
||||||
curVer := int32(0)
|
|
||||||
if plt != nil {
|
|
||||||
curVer = plt.ExchangeVer
|
|
||||||
}
|
|
||||||
|
|
||||||
log := model.NewCoinGiveLogEx(this.SnId, this.Name, payCoin, giveCoin, coinType, logType, this.PromoterTree,
|
|
||||||
recType, curVer, this.Platform, this.Channel, this.BeUnderAgentCode, remark, oper, this.PackageID, 0, 0)
|
|
||||||
if log != nil {
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
|
||||||
err := model.InsertGiveCoinLog(log)
|
|
||||||
if err == nil {
|
|
||||||
if this.LastExchangeOrder != "" && this.TotalConvertibleFlow > 0 {
|
|
||||||
err = model.UpdateGiveCoinLastFlow(log.Platform, this.LastExchangeOrder, this.TotalConvertibleFlow)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}), task.CompleteNotifyWrapper(func(ud interface{}, t task.Task) {
|
|
||||||
if ud == nil {
|
|
||||||
//清空流水,更新id
|
|
||||||
this.TotalConvertibleFlow = 0
|
|
||||||
this.LastExchangeOrder = log.LogId.Hex()
|
|
||||||
}
|
|
||||||
}), "UpdateGiveCoinLastFlow").StartByGroupFixExecutor(log.Platform, "UpdateGiveCoinLastFlow")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func ReportSystemGiveEvent(pd *model.PlayerData, amount, tag int32, notifyClient bool) {
|
|
||||||
//系统赠送
|
|
||||||
if !pd.IsRob {
|
|
||||||
//插入本地表
|
|
||||||
if amount > 0 {
|
|
||||||
if ActMgrSington.GetIsNeedGive(pd.Platform, tag) {
|
|
||||||
plt := PlatformMgrSingleton.GetPlatform(pd.Platform)
|
|
||||||
curVer := int32(0)
|
|
||||||
if plt != nil {
|
|
||||||
curVer = plt.ExchangeVer
|
|
||||||
}
|
|
||||||
|
|
||||||
log := model.NewCoinGiveLogEx(pd.SnId, pd.Name, 0, int64(amount), 0, tag, pd.PromoterTree,
|
|
||||||
model.COINGIVETYPE_SYSTEM, curVer, pd.Platform, pd.Channel, pd.BeUnderAgentCode, "",
|
|
||||||
"system", pd.PackageID, 0, 0)
|
|
||||||
if log != nil {
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
|
||||||
err := model.InsertGiveCoinLog(log)
|
|
||||||
if err == nil {
|
|
||||||
if pd.LastExchangeOrder != "" && pd.TotalConvertibleFlow > 0 {
|
|
||||||
err = model.UpdateGiveCoinLastFlow(log.Platform, pd.LastExchangeOrder, pd.TotalConvertibleFlow)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return err
|
|
||||||
}), task.CompleteNotifyWrapper(func(ud interface{}, t task.Task) {
|
|
||||||
if ud == nil {
|
|
||||||
//清空流水,更新id
|
|
||||||
pd.TotalConvertibleFlow = 0
|
|
||||||
pd.LastExchangeOrder = log.LogId.Hex()
|
|
||||||
player := PlayerMgrSington.GetPlayerBySnId(pd.SnId)
|
|
||||||
if player == nil {
|
|
||||||
//需要回写数据库
|
|
||||||
task.New(nil, task.CallableWrapper(func(o *basic.Object) interface{} {
|
|
||||||
model.UpdatePlayerExchageFlowAndOrder(pd.Platform, pd.SnId, 0, pd.LastExchangeOrder)
|
|
||||||
return nil
|
|
||||||
}), nil, "UpdatePlayerExchageFlowAndOrder").StartByGroupFixExecutor(log.Platform, pd.AccountId)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}), "UpdateGiveCoinLastFlow").StartByGroupFixExecutor(log.Platform, "UpdateGiveCoinLastFlow")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if notifyClient {
|
|
||||||
player := PlayerMgrSington.GetPlayerBySnId(pd.SnId)
|
|
||||||
if player != nil {
|
|
||||||
//通知客户端
|
|
||||||
sendPack := &shopproto.SCNotifyGiveCoinInfo{
|
|
||||||
GiveCoin: proto.Int64(int64(amount)),
|
|
||||||
GiveTag: proto.Int32(tag),
|
|
||||||
}
|
|
||||||
|
|
||||||
proto.SetDefaults(sendPack)
|
|
||||||
player.SendToClient(int(shopproto.SPacketID_SHOP_SC_GIVECOIN_INFO), sendPack)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (this *Player) ReportSystemGiveEvent(amount, tag int32, notifyClient bool) {
|
|
||||||
ReportSystemGiveEvent(this.PlayerData, amount, tag, notifyClient)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 破产事件
|
// 破产事件
|
||||||
func (this *Player) ReportBankRuptcy(gameid, gamemode, gamefreeid int32) {
|
func (this *Player) ReportBankRuptcy(gameid, gamemode, gamefreeid int32) {
|
||||||
//if !this.IsRob {
|
//if !this.IsRob {
|
||||||
|
@ -3695,7 +3591,7 @@ func (this *Player) GetVIPLevel() int32 {
|
||||||
//玩家VIP升级
|
//玩家VIP升级
|
||||||
this.SCVIPInfo()
|
this.SCVIPInfo()
|
||||||
if b {
|
if b {
|
||||||
PetMgrSington.CheckSkinRed(this)
|
ModelMgrSingleton.CheckSkinRed(this)
|
||||||
}
|
}
|
||||||
return this.VIP
|
return this.VIP
|
||||||
}
|
}
|
||||||
|
|
|
@ -888,6 +888,7 @@ func (this *Scene) IsPreCreateScene() bool {
|
||||||
return this.dbGameFree.GetCreateRoomNum() > 0
|
return this.dbGameFree.GetCreateRoomNum() > 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo 删除
|
||||||
func (this *Scene) TryForceDeleteMatchInfo() {
|
func (this *Scene) TryForceDeleteMatchInfo() {
|
||||||
if !this.IsMatchScene() {
|
if !this.IsMatchScene() {
|
||||||
return
|
return
|
||||||
|
|
|
@ -223,7 +223,7 @@ func (this *ShopMgr) GetShopInfo(shopId int32, p *Player) *model.ShopInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
award, roleId := PetMgrSington.GetShopAward(shopInfo, p)
|
award, roleId := ModelMgrSingleton.GetShopAward(shopInfo, p)
|
||||||
firstBuy := false
|
firstBuy := false
|
||||||
if shopInfo.FirstSwitch {
|
if shopInfo.FirstSwitch {
|
||||||
firstBuy = !slices.Contains(p.ShopID, int(shopInfo.Id))
|
firstBuy = !slices.Contains(p.ShopID, int(shopInfo.Id))
|
||||||
|
@ -312,7 +312,7 @@ func (this *ShopMgr) GetShopInfos(p *Player, nowLocation int) []*shop.ShopInfo {
|
||||||
ItemNum: i2.ItemNum,
|
ItemNum: i2.ItemNum,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
award, roleId := PetMgrSington.GetShopAward(shopInfo, p)
|
award, roleId := ModelMgrSingleton.GetShopAward(shopInfo, p)
|
||||||
firstBuy := false
|
firstBuy := false
|
||||||
if shopInfo.FirstSwitch {
|
if shopInfo.FirstSwitch {
|
||||||
firstBuy = !slices.Contains(p.ShopID, int(shopInfo.Id))
|
firstBuy = !slices.Contains(p.ShopID, int(shopInfo.Id))
|
||||||
|
@ -384,7 +384,7 @@ func (this *ShopMgr) GetShopInfos(p *Player, nowLocation int) []*shop.ShopInfo {
|
||||||
ItemNum: i2.ItemNum,
|
ItemNum: i2.ItemNum,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
award, roleId := PetMgrSington.GetShopAward(shopInfo, p)
|
award, roleId := ModelMgrSingleton.GetShopAward(shopInfo, p)
|
||||||
firstBuy := false
|
firstBuy := false
|
||||||
if shopInfo.FirstSwitch {
|
if shopInfo.FirstSwitch {
|
||||||
firstBuy = !slices.Contains(p.ShopID, int(shopInfo.Id))
|
firstBuy = !slices.Contains(p.ShopID, int(shopInfo.Id))
|
||||||
|
@ -649,7 +649,7 @@ func (this *ShopMgr) GetAmountFinal(p *Player, shopId, vipShopId int32) int64 {
|
||||||
switch shopInfo.Type {
|
switch shopInfo.Type {
|
||||||
case ShopTypeCoin:
|
case ShopTypeCoin:
|
||||||
var addCoin int64
|
var addCoin int64
|
||||||
award, _ := PetMgrSington.GetShopAward(shopInfo, p)
|
award, _ := ModelMgrSingleton.GetShopAward(shopInfo, p)
|
||||||
if award > 0 {
|
if award > 0 {
|
||||||
addCoin = int64(float64(addTotal) * float64(award) / 100.0)
|
addCoin = int64(float64(addTotal) * float64(award) / 100.0)
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -67,13 +67,13 @@ func (this *WelfareMgr) GetReliefFund(p *Player, isVideo bool) {
|
||||||
var add int64
|
var add int64
|
||||||
coin := int64(sdata.Get) // 增加金币
|
coin := int64(sdata.Get) // 增加金币
|
||||||
p.WelfData.ReliefFundTimes += 1
|
p.WelfData.ReliefFundTimes += 1
|
||||||
award := PetMgrSington.GetAwardPetByWelf(p)
|
award := ModelMgrSingleton.GetAwardPetByWelf(p)
|
||||||
if award > 0 {
|
if award > 0 {
|
||||||
if isVideo { // 双倍领取,蝶女视频加成
|
if isVideo { // 双倍领取,蝶女视频加成
|
||||||
gainWay = common.GainWay_ReliefFund2
|
gainWay = common.GainWay_ReliefFund2
|
||||||
rate = 2
|
rate = 2
|
||||||
add = int64(float64(coin*award*2) / 100.0)
|
add = int64(float64(coin*award*2) / 100.0)
|
||||||
roleGirl := PetMgrSington.GetRoleInfo(p, 2000001)
|
roleGirl := ModelMgrSingleton.GetRoleInfo(p, 2000001)
|
||||||
if roleGirl != nil && roleGirl.Level > 0 {
|
if roleGirl != nil && roleGirl.Level > 0 {
|
||||||
//蝶女加成
|
//蝶女加成
|
||||||
add += int64(float64(coin*int64(roleGirl.Award)*2) / 100.0)
|
add += int64(float64(coin*int64(roleGirl.Award)*2) / 100.0)
|
||||||
|
@ -491,7 +491,7 @@ func (this *WelfareMgr) GetTurnplteVideo(p *Player) {
|
||||||
for _, d := range drawdates {
|
for _, d := range drawdates {
|
||||||
coin := d.Grade * 2
|
coin := d.Grade * 2
|
||||||
if d.Type == 1 { // 蝶女金币加成
|
if d.Type == 1 { // 蝶女金币加成
|
||||||
roleGirl := PetMgrSington.GetRoleInfo(p, 2000001)
|
roleGirl := ModelMgrSingleton.GetRoleInfo(p, 2000001)
|
||||||
if roleGirl != nil && roleGirl.Level > 0 {
|
if roleGirl != nil && roleGirl.Level > 0 {
|
||||||
coin = int32(float64(coin) * float64(100+roleGirl.Award) / 100.0)
|
coin = int32(float64(coin) * float64(100+roleGirl.Award) / 100.0)
|
||||||
}
|
}
|
||||||
|
@ -545,7 +545,7 @@ func DrawWelfareDate(dates []*webapi_proto.WelfareDate, p *Player, gainWay int32
|
||||||
coin := int64(v.Grade)
|
coin := int64(v.Grade)
|
||||||
add := int64(0)
|
add := int64(0)
|
||||||
if isVideo {
|
if isVideo {
|
||||||
roleGirl := PetMgrSington.GetRoleInfo(p, 2000001)
|
roleGirl := ModelMgrSingleton.GetRoleInfo(p, 2000001)
|
||||||
if roleGirl != nil && roleGirl.Level > 0 /*|| !role.IsUsing*/ {
|
if roleGirl != nil && roleGirl.Level > 0 /*|| !role.IsUsing*/ {
|
||||||
//蝶女加成
|
//蝶女加成
|
||||||
add = int64(float64(coin) * float64(roleGirl.Award) * 2 / 100.0)
|
add = int64(float64(coin) * float64(roleGirl.Award) * 2 / 100.0)
|
||||||
|
|
Loading…
Reference in New Issue