Merge branch 'develop' into sdk

This commit is contained in:
hahwu 2025-07-17 15:08:28 +08:00
commit 099d7793f0
2 changed files with 10 additions and 2 deletions

View File

@ -197,7 +197,7 @@ func (ad *GameLogic) NewAccountInsertDataToDB() bool {
playerInfo.PackUnlockCount = 5 playerInfo.PackUnlockCount = 5
playerInfo.EnergyBuyCount = 0 playerInfo.EnergyBuyCount = 0
playerInfo.UserName = ad.Db_AccountInfo.UserName playerInfo.UserName = ad.Db_AccountInfo.UserName
playerInfo.LoginTime = 0 playerInfo.LoginTime = (int32)(time.Now().Unix())
playerInfo.LogoutTime = 0 playerInfo.LogoutTime = 0
playerInfo.Todayolinetime = 0 playerInfo.Todayolinetime = 0
playerInfo.Rolecreatetime = (int32)(time.Now().Unix()) playerInfo.Rolecreatetime = (int32)(time.Now().Unix())

View File

@ -101,11 +101,13 @@ func AdminPlayerInfo(args []interface{}) error {
req := &msg.ReqAdminInfo{} req := &msg.ReqAdminInfo{}
proto.Unmarshal(buf, req) proto.Unmarshal(buf, req)
player := G_GameLogicPtr.GetPlayer(req.Uid) player := G_GameLogicPtr.GetPlayer(req.Uid)
online := true
if player == nil { if player == nil {
player = new(Player) player = new(Player)
player.M_DwUin = req.Uid player.M_DwUin = req.Uid
player.InitPlayerOnly() player.InitPlayerOnly()
player.ZeroUpdate(nil) player.ZeroUpdate(nil)
online = false
} }
res := make(map[string]interface{}) res := make(map[string]interface{})
res["Name"] = player.PlayMod.getBaseMod().NickName res["Name"] = player.PlayMod.getBaseMod().NickName
@ -118,10 +120,16 @@ func AdminPlayerInfo(args []interface{}) error {
res["Energy"] = player.GetPlayerBaseMod().GetEnergy() res["Energy"] = player.GetPlayerBaseMod().GetEnergy()
res["Diamond"] = player.GetPlayerBaseMod().GetDiamond() res["Diamond"] = player.GetPlayerBaseMod().GetDiamond()
res["Mac"] = player.GetPlayerBaseMod().GetName() res["Mac"] = player.GetPlayerBaseMod().GetName()
res["Login"] = player.GetPlayerBaseMod().Data.LoginTime res["Login"] = player.PlayMod.getBaseMod().LoginTime
res["Cumulative"] = player.PlayMod.getBaseMod().Cumulative res["Cumulative"] = player.PlayMod.getBaseMod().Cumulative
res["RegisterTime"] = player.GetPlayerBaseMod().GetRegisterTime()
res["TodayCumulative"] = player.PlayMod.getBaseMod().TodayCumulative res["TodayCumulative"] = player.PlayMod.getBaseMod().TodayCumulative
if online {
res["Cumulative"] = int64(player.PlayMod.getBaseMod().Cumulative) + GoUtil.Now() - int64(player.PlayMod.getBaseMod().LoginTime)
res["TodayCumulative"] = int64(player.PlayMod.getBaseMod().TodayCumulative) + GoUtil.Now() - int64(player.PlayMod.getBaseMod().LoginTime)
}
res["Bonus"] = player.PlayMod.getLimitedTimeEventMod().Progress res["Bonus"] = player.PlayMod.getLimitedTimeEventMod().Progress
res["Code"] = player.PlayMod.getBaseMod().AddCode
OrderMap := make(map[int]interface{}) OrderMap := make(map[int]interface{})
Index := 0 Index := 0
for k, v := range player.PlayMod.getOrderMod().OrderList { for k, v := range player.PlayMod.getOrderMod().OrderList {