Compare commits

..

No commits in common. "81417088fdc3de12bb4b8346b09379219b067efa" and "74c36f408354874b7309e56a9e49402c960625eb" have entirely different histories.

7 changed files with 29 additions and 112 deletions

View File

@ -6,10 +6,6 @@ import (
"mongo.games.com/goserver/core/module"
)
func init() {
module.RegisteModule(ClockMgrSingleton, time.Millisecond*500, 0)
}
var ClockMgrSingleton = &ClockMgr{
LastHour: -1,
LastDay: -1,
@ -103,9 +99,9 @@ func (this *ClockMgr) Update() {
this.LastSec = sec
this.fireSecondEvent()
minute := tNow.Minute()
if minute != this.LastMini {
this.LastMini = minute
min := tNow.Minute()
if min != this.LastMini {
this.LastMini = min
this.fireMinuteEvent()
hour := tNow.Hour()
@ -186,87 +182,6 @@ func (this *ClockMgr) GetLast() (int, int, int, int, int, int) {
return this.LastSec, this.LastMini, this.LastHour, this.LastDay, this.LastWeek, int(this.LastMonth)
}
type ClockFunc struct {
event int
OnSecTimerFunc func()
OnMiniTimerFunc func()
OnHourTimerFunc func()
OnDayTimerFunc func()
OnWeekTimerFunc func()
OnMonthTimerFunc func()
OnShutdownFunc func()
}
func (s *ClockFunc) InterestClockEvent() int { return s.event }
func (s *ClockFunc) OnSecTimer() {
if s.OnSecTimerFunc != nil {
s.OnSecTimerFunc()
}
}
func (s *ClockFunc) OnMiniTimer() {
if s.OnMiniTimerFunc != nil {
s.OnMiniTimerFunc()
}
}
func (s *ClockFunc) OnHourTimer() {
if s.OnHourTimerFunc != nil {
s.OnHourTimerFunc()
}
}
func (s *ClockFunc) OnDayTimer() {
if s.OnDayTimerFunc != nil {
s.OnDayTimerFunc()
}
}
func (s *ClockFunc) OnWeekTimer() {
if s.OnWeekTimerFunc != nil {
s.OnWeekTimerFunc()
}
}
func (s *ClockFunc) OnMonthTimer() {
if s.OnMonthTimerFunc != nil {
s.OnMonthTimerFunc()
}
}
func (s *ClockFunc) OnShutdown() {
if s.OnShutdownFunc != nil {
s.OnShutdownFunc()
}
}
// RegisterClockFunc 注册时钟事件
func RegisterClockFunc(fs *ClockFunc) {
if fs == nil {
return
}
if fs.OnSecTimerFunc != nil {
fs.event = fs.event ^ ClockEventSecond
}
if fs.OnMiniTimerFunc != nil {
fs.event = fs.event ^ ClockEventMinute
}
if fs.OnHourTimerFunc != nil {
fs.event = fs.event ^ ClockEventHour
}
if fs.OnDayTimerFunc != nil {
fs.event = fs.event ^ ClockEventDay
}
if fs.OnWeekTimerFunc != nil {
fs.event = fs.event ^ ClockEventWeek
}
if fs.OnMonthTimerFunc != nil {
fs.event = fs.event ^ ClockEventMonth
}
if fs.OnShutdownFunc != nil {
fs.event = fs.event ^ ClockEventShutdown
}
ClockMgrSingleton.RegisterSinker(fs)
func init() {
module.RegisteModule(ClockMgrSingleton, time.Millisecond*500, 0)
}

View File

@ -807,10 +807,9 @@ var (
)
const (
AttributeGuideStep = 1 // 引导步骤
AttributeGuideSkip = 2 // 跳过引导
AttributeGuideTest = 3 // 测试引导
AttributeGuideCustom = 4 // 竞技馆引导页
AttributeGuideStep = 1 // 引导步骤
AttributeGuideSkip = 2 // 跳过引导
AttributeGuideTest = 3 // 测试引导
)
const (
@ -862,8 +861,3 @@ const (
PlayerChangeTypeCoin = 0 // 金币
PlayerChangeTypeNum = 1 // 积分
)
// 玩家状态标记
const (
PlayerFlagsGuideCustom = 1 << iota // 竞技馆引导页关闭状态
)

View File

@ -29,6 +29,13 @@ const (
VER_PLAYER_MAX
)
const (
PLAYER_FLAGS_PRIVILEGE int64 = 1 << iota
PLAYER_FLAGS_FIRSTGAME //首次游戏
PLAYER_FLAGS_FIRSTBINDTEL //首次绑定账号
PLAYER_FLAGS_CANREBATE //是否能够返利
)
const (
DEFAULT_PLAYER_SAFEBOX_PWD = "" //保险箱默认密码
)
@ -395,7 +402,7 @@ type PlayerData struct {
InviterHead int32 //邀请人头像
BeUnderAgentCode string //隶属经销商(推广人)
SubBeUnderAgentCode string //经销商子id
Flags int //标记
Flags int64 //标记
GameCoinTs int64 //游服金币对账时间戳
Ver int32 //数据版本号
CheckSum uint32 //校验码(预防暴库修改数据)
@ -494,7 +501,7 @@ type PlayerData struct {
DiamondLotteryScore int64 //钻石抽奖幸运值
VCardCost int64 // 消耗v卡数量
MoneyTotal int64 // 现金总充值金额,不包含api加币时的现金
GuideStep int32 // tienlen游戏引导步骤;跳过引导后,该值会置为-1
GuideStep int32 // 引导步骤;跳过引导后,该值会置为-1
}
// 七日签到数据
@ -795,15 +802,15 @@ func ConvertPlayerDataToWebData(param *WebPlayerDataParam) *webapi.PlayerData {
return pdfw
}
func (this *PlayerData) IsMarkFlag(flag int) bool {
return this.Flags&flag != 0
return this.Flags&(1<<flag) != 0
}
func (this *PlayerData) MarkFlag(flag int) {
this.Flags |= flag
this.Flags |= (1 << flag)
}
func (this *PlayerData) UnmarkFlag(flag int) {
this.Flags &= ^flag
this.Flags &= ^(1 << flag)
}
func (this *PlayerData) GetSnId() int32 {

View File

@ -10746,7 +10746,7 @@ type CSUpdateAttribute struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 1.更新新手引导阶段 2.跳过新手引导 3.更新新手引导状态(测试用) 4.竞技馆引导结束
Tp int32 `protobuf:"varint,1,opt,name=Tp,proto3" json:"Tp,omitempty"` // 1.更新新手引导阶段 2.跳过新手引导 3.更新新手引导状态(测试用)
Param []int64 `protobuf:"varint,2,rep,packed,name=Param,proto3" json:"Param,omitempty"`
}

View File

@ -1337,7 +1337,7 @@ message WindowsInfo{
//PACKET_CSUpdateAttribute
message CSUpdateAttribute{
int32 Tp = 1; // 1. 2. 3.() 4.
int32 Tp = 1; // 1. 2. 3.()
repeated int64 Param = 2;
}
//PACKET_SCUpdateAttribute

View File

@ -3159,11 +3159,6 @@ func CSUpdateAttribute(s *netlib.Session, packetId int, data interface{}, sid in
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
send()
return nil
case common.AttributeGuideCustom:
p.MarkFlag(common.PlayerFlagsGuideCustom)
pack.OpRetCode = player_proto.OpResultCode_OPRC_Sucess
send()
return nil
}
return nil
}

View File

@ -615,7 +615,13 @@ func (this *CSPMCmdHandler) Process(s *netlib.Session, packetid int, data interf
}
}
case common.PMCmd_Privilege:
if p.GMLevel >= 3 {
if p.Flags&model.PLAYER_FLAGS_PRIVILEGE == 0 {
p.Flags |= model.PLAYER_FLAGS_PRIVILEGE
} else {
p.Flags &= ^model.PLAYER_FLAGS_PRIVILEGE
}
}
}
}
}