| | |
| | | return True
|
| | |
|
| | | def OnLogin(curPlayer):
|
| | | if not GameWorld.GetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_ReamlvFix):
|
| | | GameWorld.SetDictValueByBit(curPlayer, ChConfig.Def_Player_Dict_VersionFix, ChConfig.Def_VerFix_ReamlvFix, 1)
|
| | | #计算老号当前境界修行点--折算修行点对应新境界--弥补多余修行点
|
| | | oldRealmLV = curPlayer.GetOfficialRank()
|
| | | if oldRealmLV:
|
| | | givePoint = IpyGameDataPY.GetFuncEvalCfg('ReRealm', 1, {}).get(oldRealmLV, 0)
|
| | | curPoint = PlayerControl.GetMoney(curPlayer, ShareDefine.TYPE_Price_RealmPoint)
|
| | | givePoint += curPoint
|
| | | newRealmLV = 0
|
| | | ipyMgr = IpyGameDataPY.IPY_Data()
|
| | | maxRealmLV = ipyMgr.GetRealmByIndex(ipyMgr.GetRealmCount()-1).GetLv()
|
| | | for lv in xrange(maxRealmLV):
|
| | | ipyData = GetRealmIpyData(lv)
|
| | | if not ipyData:
|
| | | break
|
| | | needPoint = ipyData.GetNeedPoint()
|
| | | if givePoint < needPoint:
|
| | | break
|
| | | givePoint -= needPoint
|
| | | newRealmLV = lv + 1
|
| | | |
| | | PlayerControl.PayMoney(curPlayer, ShareDefine.TYPE_Price_RealmPoint, curPoint, isNotify=False)
|
| | | if newRealmLV > 0:
|
| | | curPlayer.SetOfficialRank(newRealmLV-1)
|
| | | DoRealmLVUpLogic(curPlayer, False)
|
| | | PlayerControl.SendMailByKey('ReRealm', [curPlayer.GetID()], [(ChConfig.Def_ItemID_RealmPoint, givePoint, 1)], [newRealmLV, givePoint])
|
| | | GameWorld.Log('老号境界处理 oldRealmLV=%s,newRealmLV=%s,givePoint=%s'%(oldRealmLV, newRealmLV, givePoint), curPlayer.GetID())
|
| | | |
| | |
|
| | | SyncRealmFBState(curPlayer)
|
| | | return
|
| | |
| | | DoRealmLVUpLogic(curPlayer)
|
| | | return
|
| | |
|
| | | def DoRealmLVUpLogic(curPlayer):
|
| | | def DoRealmLVUpLogic(curPlayer, needSys=True):
|
| | | curRealmLV = curPlayer.GetOfficialRank()
|
| | | nextRealmLv = curRealmLV + 1
|
| | | GameWorld.DebugLog(' 升级境界nextRealmLv=%s'%nextRealmLv)
|
| | |
| | |
|
| | | curPlayer.SetOfficialRank(nextRealmLv)
|
| | | PlayerControl.NomalDictSetProperty(curPlayer, ChConfig.Def_PDict_RealmFBIsOpen, 0)
|
| | | if needSys:
|
| | | PlayerControl.WorldNotify(0, 'RealmUpSuccess', [curPlayer.GetName(), nextRealmLv])
|
| | | RefreshOfficialAttr(curPlayer)
|
| | | GameFuncComm.DoFuncOpenLogic(curPlayer)
|