feat(login): 重构登录逻辑并迁移每日重置功能到 Personself 方法
将原本在 Controller.Login 中处理的每日重置逻辑(如电池、任务等)迁移到 service.Info.Personself 方法中,并移除对 gtime.Now().Time 的旧引用。同时更新了 相关的时间判断函数 IsToday,使其支持 *gtime.Time 类型。 此外,清理无用导入包,优化日志打印方式,并修复部分结构体字段定义与使用问题。
This commit is contained in:
@@ -28,6 +28,7 @@ func (e *Effect8) DamageFloor(t *info.DamageZone) bool {
|
||||
if t.Type == info.DamageType.Red {
|
||||
t.Damage = alpacadecimal.NewFromInt(utils.Min(t.Damage.IntPart(),
|
||||
int64(e.Ctx().Opp.CurrentPet.Info.Hp)-1))
|
||||
e.max = t.Damage
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ func (f *FightC) handleTimeout(ourID, oppID uint32, actions map[uint32]action.Ba
|
||||
if _, exists := actions[pid]; exists {
|
||||
continue
|
||||
}
|
||||
cool.Loger.Debug(context.Background(), "玩家%d 超时\n", pid)
|
||||
cool.Loger.Debug(context.Background(), "玩家超时", pid)
|
||||
|
||||
f.Reason = info.BattleOverReason.PlayerOVerTime
|
||||
f.closefight = true
|
||||
|
||||
@@ -163,6 +163,7 @@ func init() {
|
||||
PetItemRegistry.RegisterExact(300024, func(itemid uint32, onpet *model.PetInfo) bool {
|
||||
|
||||
onpet.Downgrade(1)
|
||||
onpet.NextLvExp = 0
|
||||
onpet.Update_EXP()
|
||||
onpet.Ev = [6]uint32{}
|
||||
onpet.Dv = uint32(grand.Intn(32))
|
||||
|
||||
@@ -211,7 +211,8 @@ func (h *ClientData) OnEvent(v []byte) {
|
||||
return
|
||||
}
|
||||
}
|
||||
cool.Loger.Debug(context.TODO(), "接收数据", header.UserID, header.CMD)
|
||||
fmt.Println("接收数据", header.UserID, header.CMD)
|
||||
// cool.Loger.Debug(context.TODO(), "接收数据", header.UserID, header.CMD)
|
||||
h.Recv(header)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user