| | |
| | | DWORD MapID; //场景地图ID
|
| | | WORD LVLimitMin; //最低等级限制, 0为不限制
|
| | | WORD LVLimitMax; //最高等级限制, 0为不限制
|
| | | BYTE JobRankLimit; //所需职业阶
|
| | | DWORD TicketID; //门票ID
|
| | | list TicketCostCnt; //门票消耗数信息
|
| | | WORD TicketPrice; //门票单价(不能用钱抵的配0)
|
| | |
| | |
|
| | | elif packType == IPY_GameServer.CDBPlayerRefresh_Job:
|
| | | curPlayer.SetJob(packValue)
|
| | | elif packType == IPY_GameServer.CDBPlayerRefresh_ExAttr1:
|
| | | PlayerControl.SetJobRank(curPlayer, packValue)
|
| | |
|
| | | # elif packType == IPY_GameServer.CDBPlayerRefresh_CurrentPlayerType:
|
| | | # #这里应该通知组队那边刷新
|
| | |
| | |
|
| | | #------------------------------------------------------------------------------
|
| | |
|
| | | ## 职业阶数
|
| | | def GetJobRank(curPlayer): return curPlayer.GetExAttr1()
|
| | | def SetJobRank(curPlayer, jobRank): return curPlayer.SetExAttr1(jobRank)
|
| | |
|
| | | ##VIP到期时间
|
| | | def GetVIPExpireTime(curPlayer): return curPlayer.GetExAttr9()
|
| | | def SetVIPExpireTime(curPlayer, expireTime): return curPlayer.SetExAttr9(expireTime)
|
| | |
| | | sendPack.PlayerID = curPlayer.GetPlayerID()
|
| | | sendPack.RealmLV = curPlayer.GetOfficialRank()
|
| | | sendPack.Job = curPlayer.GetJob()
|
| | | sendPack.JobRank = PlayerControl.GetJobRank(curPlayer)
|
| | | sendPack.AtkAdd = atkAdd/100
|
| | | NetPackCommon.SendFakePack(notifyPlayer, sendPack)
|
| | | return
|
| | |
| | | GameWorld.DebugLog(" 生成新仙盟红包 红包额度不能低于红包个数!outputNum=%s,redCnt=%s" % (outputNum, packetCnt))
|
| | | return
|
| | | job = curPlayer.GetJob()
|
| | | jobRank = PlayerControl.GetJobRank(curPlayer)
|
| | | jobRank = 0
|
| | | playerName = curPlayer.GetName()
|
| | | __SaveNewRedRecord(family, playerID, playerName, job, jobRank, getType, moneyType, outputNum, packetCnt, state, wishStr, data=data)
|
| | | return
|
| | |
| | | def __SaveNewRedRecord(family, ownerid, playerName, job, jobRank, getType, moneyType, outputNum, packetCnt,state=State_NoSend, wishStr='', sysCreateTime=None, data=0):
|
| | | global g_allRecordDict
|
| | | global g_redPackCountDict
|
| | | job = job + jobRank * 10 #个位是job 十位百位是jobrank
|
| | | recordType = ShareDefine.Def_UniversalGameRecType_FamilyRedPacketAllRecord
|
| | | universalRecMgr = GameWorld.GetUniversalRecMgr()
|
| | | recordList = universalRecMgr.GetTypeList(recordType)
|
| | |
| | |
|
| | | playerID= curPlayer.GetPlayerID()
|
| | | job = curPlayer.GetJob()
|
| | | jobRank = PlayerControl.GetJobRank(curPlayer)
|
| | | job = jobRank * 10 + job
|
| | | playerName = curPlayer.GetName()
|
| | |
|
| | |
|
| | |
| | | invitePack.NameLen = len(invitePack.Name)
|
| | | invitePack.LV = curPlayer.GetLV()
|
| | | invitePack.Job = curPlayer.GetJob()
|
| | | invitePack.JobLevel = PlayerControl.GetJobRank(curPlayer)
|
| | | invitePack.RealmLV = curPlayer.GetOfficialRank()
|
| | | invitePack.TagMapID = tagMapID
|
| | | invitePack.TagMapEx = tagMapEx
|
| | |
| | | requestPack.NameLen = len(requestPack.Name)
|
| | | requestPack.LV = curPlayer.GetLV()
|
| | | requestPack.Job = curPlayer.GetJob()
|
| | | requestPack.JobLevel = PlayerControl.GetJobRank(curPlayer)
|
| | | requestPack.RealmLV = curPlayer.GetOfficialRank()
|
| | | NetPackCommon.SendFakePack(tagPlayer, requestPack)
|
| | |
|
| | |
| | | nearbyPlayer.NameLen = len(nearbyPlayer.Name)
|
| | | nearbyPlayer.LV = player.GetLV()
|
| | | nearbyPlayer.Job = player.GetJob()
|
| | | nearbyPlayer.JobLevel = PlayerControl.GetJobRank(player)
|
| | | nearbyPlayer.RealmLV = player.GetOfficialRank()
|
| | | nearbyPlayerInfo.PlayerList.append(nearbyPlayer)
|
| | |
|
| | |
| | | sceneTeam.NameLen = len(sceneTeam.PlayerName)
|
| | | sceneTeam.LV = leader.GetLV()
|
| | | sceneTeam.Job = leader.GetJob()
|
| | | sceneTeam.JobLevel = PlayerControl.GetJobRank(leader)
|
| | | sceneTeam.RealmLV = leader.GetOfficialRank()
|
| | | sceneTeam.MemberCount = team.GetTeamPlayerCount()
|
| | | sceneTeam.TagMapID = team.GetTagMapID()
|
| | |
| | | tagMapTeam.NameLen = len(tagMapTeam.PlayerName)
|
| | | tagMapTeam.LV = leader.GetLV()
|
| | | tagMapTeam.Job = leader.GetJob()
|
| | | tagMapTeam.JobLevel = PlayerControl.GetJobRank(leader)
|
| | | tagMapTeam.RealmLV = leader.GetOfficialRank()
|
| | | tagMapTeam.MemberCount = team.GetTeamPlayerCount()
|
| | | tagMapTeam.ReqMinLV = team.GetReqMinLV()
|
| | |
| | | ["TeamEnterCDMe", "TeamEnterCDAll"], "SingleEnterCD"],
|
| | | ShareDefine.EntFBAskRet_LVLimit:[["TeamMatchingLVMe", "TeamMatchingLVAll"],
|
| | | ["TeamEnterLVMe", "TeamEnterLVAll"], "FbLV"],
|
| | | ShareDefine.EntFBAskRet_JobRankLimit:[["TeamMatchingJobMe", "TeamMatchingJobAll"], |
| | | ["TeamEnterJobMe", "TeamEnterJobAll"], "SingleEnterJob"],
|
| | | ShareDefine.EntFBAskRet_NoTicket:[["TeamMatchingTicketMe", "TeamMatchingTicketAll"],
|
| | | ["TeamEnterTicketMe", "TeamEnterTicketAll"], "GeRen_chenxin_157069"],
|
| | | ShareDefine.EntFBAskRet_Dead:[["TeamMatchingDeadMe", "TeamMatchingDeadAll"],
|
| | |
| | | PlayerControl.NotifyCode(curPlayer, "FbLV", [mapID])
|
| | | return ShareDefine.EntFBAskRet_LVLimit
|
| | |
|
| | | #职业阶判断
|
| | | jobRankLimit = fbLineIpyData.GetJobRankLimit()
|
| | | if jobRankLimit and PlayerControl.GetJobRank(curPlayer) < jobRankLimit:
|
| | | GameWorld.Log("玩家职业阶级不足, 无法进入副本!mapID=%s,lineID=%s,jobRank=%s < jobRankLimit=%s" |
| | | % (mapID, lineID, PlayerControl.GetJobRank(curPlayer), jobRankLimit), playerID)
|
| | | if isNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "SingleEnterJob", [mapID])
|
| | | return ShareDefine.EntFBAskRet_JobRankLimit
|
| | | |
| | | #门票判断
|
| | | if not GetFBEnterTicket(curPlayer, mapID, lineID, fbLineIpyData, reqEnterCnt, isTeamAsk)[0]:
|
| | | if isNotify:
|
| | |
| | | ("DWORD", "MapID", 0),
|
| | | ("WORD", "LVLimitMin", 0),
|
| | | ("WORD", "LVLimitMax", 0),
|
| | | ("BYTE", "JobRankLimit", 0),
|
| | | ("DWORD", "TicketID", 0),
|
| | | ("list", "TicketCostCnt", 0),
|
| | | ("WORD", "TicketPrice", 0),
|
| | |
| | | self.MapID = 0
|
| | | self.LVLimitMin = 0
|
| | | self.LVLimitMax = 0
|
| | | self.JobRankLimit = 0
|
| | | self.TicketID = 0
|
| | | self.TicketCostCnt = []
|
| | | self.TicketPrice = 0
|
| | |
| | | def GetMapID(self): return self.MapID # 场景地图ID
|
| | | def GetLVLimitMin(self): return self.LVLimitMin # 最低等级限制, 0为不限制
|
| | | def GetLVLimitMax(self): return self.LVLimitMax # 最高等级限制, 0为不限制
|
| | | def GetJobRankLimit(self): return self.JobRankLimit # 所需职业阶
|
| | | def GetTicketID(self): return self.TicketID # 门票ID
|
| | | def GetTicketCostCnt(self): return self.TicketCostCnt # 门票消耗数信息
|
| | | def GetTicketPrice(self): return self.TicketPrice # 门票单价(不能用钱抵的配0)
|
| | |
| | | # return
|
| | |
|
| | | #职业限制
|
| | | if not ItemCommon.JobUseable(curPlayer, curItem):
|
| | | if not ItemCommon.CheckJob(curPlayer, curItem):
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_31379")
|
| | | return
|
| | |
|
| | |
| | | # return False
|
| | |
|
| | | #职业检查
|
| | | if not ItemCommon.JobUseable(curPlayer, curItem):
|
| | | if not ItemCommon.CheckJob(curPlayer, curItem):
|
| | | if needNotify:
|
| | | PlayerControl.NotifyCode(curPlayer, "GeRen_lhs_31379")
|
| | |
|
| | |
| | | return
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #此函数验证当前职业阶可用(向下兼容),同CheckJob区分使用
|
| | | def JobUseable(curPlayer, curItem):
|
| | | '''判断物品是否职业可用
|
| | | 物品表中职业限制规则: 0为通用;非0百位代表职业,十位和个位为职业阶数, 职业阶向下兼容,高阶可使用低阶物品
|
| | | '''
|
| | | itemJobLimit = curItem.GetJobLimit()
|
| | | if not itemJobLimit:
|
| | | return True
|
| | | |
| | | # 取消限制的物品
|
| | | if curItem.GetUserAttr(ShareDefine.Def_IudetCancelUseLimit) == 1:
|
| | | return CheckJob(curPlayer, curItem)
|
| | | |
| | | if curPlayer.GetJob() == itemJobLimit / 100 and PlayerControl.GetJobRank(curPlayer) >= itemJobLimit % 100:
|
| | | return True
|
| | | return False
|
| | |
|
| | | #此函数验证当前职业系可用,同JobUseable区分使用
|
| | | #此函数验证当前职业系可用
|
| | | def CheckJob(curPlayer, curItem):
|
| | | '''判断物品是否职业系可用
|
| | | 物品表中职业限制规则: 0为通用;非0百位代表职业,十位和个位为职业阶数, 职业阶向下兼容,高阶可使用低阶物品
|
| | | 物品表中职业限制规则: 0为通用;非0百位代表职业
|
| | | '''
|
| | | itemJobLimit = curItem.GetJobLimit()
|
| | | if not itemJobLimit:
|
| | | return True
|
| | | if curPlayer.GetJob() == itemJobLimit / 100:
|
| | | if curPlayer.GetJob() == itemJobLimit:
|
| | | return True
|
| | |
|
| | | return False
|
| | |
| | | #@return 返回值无意义
|
| | | #@remarks 玩家登陆游戏初始化
|
| | | def InitLoginPlayer(curPlayer, tick):
|
| | | #初始化职业阶数,默认1
|
| | | if PlayerControl.GetJobRank(curPlayer) == 0:
|
| | | PlayerControl.SetJobRank(curPlayer, 1)
|
| | | |
| | | ##初始化交易列表
|
| | | if curPlayer.GetTradeList().GetTradeItemCount() == 0:
|
| | | curPlayer.GetTradeList().SetTradeListCount(ChConfig.Def_PlayerTradeMaxItemCount)
|
| | |
| | | return curPlayer.GetOperateInfo()
|
| | | return platform
|
| | |
|
| | | def GetBillboardJob(curPlayer): return curPlayer.GetJob() + PlayerControl.GetJobRank(curPlayer) * 10 #个位是job 十位百位是jobrank
|
| | | def GetBillboardJob(curPlayer): return curPlayer.GetJob()
|
| | |
|
| | | def UpdatePlayerBillboardOnLeaveServer(curPlayer, isAll=False):
|
| | | ##下线更新玩家排行榜
|
| | |
| | | curPlayer.SendPropertyRefresh(ShareDefine.CDBPlayerRefresh_ForbidenTalk, value, False)
|
| | | return
|
| | |
|
| | |
|
| | | ## 职业阶数
|
| | | def GetJobRank(curPlayer): return curPlayer.GetExAttr1()
|
| | | def SetJobRank(curPlayer, jobRank): |
| | | curPlayer.SendGameServerRefreshState(IPY_GameWorld.CDBPlayerRefresh_ExAttr1, jobRank)
|
| | | return curPlayer.SetExAttr1(jobRank)
|
| | |
|
| | | ## 队伍相关审核开关状态, joinReqCheck-入队申请是否需要审核; inviteCheck-组队邀请是否需要审核;
|
| | | def SetTeamCheckStateEx(curPlayer, joinReqCheck, inviteCheck): return SetTeamCheckState(curPlayer, joinReqCheck * 10 + inviteCheck)
|
| | | def SetTeamCheckState(curPlayer, checkState): return curPlayer.SetExAttr2(checkState, False, True)
|
| | |
| | | curPlayerPropDict["LV"] = curPlayer.GetLV()
|
| | | curPlayerPropDict["RealmLV"] = curPlayer.GetOfficialRank()
|
| | | curPlayerPropDict["Job"] = curPlayer.GetJob()
|
| | | curPlayerPropDict["JobRank"] = PlayerControl.GetJobRank(curPlayer)
|
| | | curPlayerPropDict["VIPLV"] = curPlayer.GetVIPLv()
|
| | | curPlayerPropDict["Name"] = curPlayer.GetPlayerName()
|
| | | curPlayerPropDict["FamilyID"] = curPlayer.GetFamilyID()
|
| | |
| | | itemDict = {}
|
| | | itemDict["ItemIndex"] = curEquip.GetItemPlaceIndex()
|
| | | itemDict["ItemID"] = curEquip.GetItemTypeID()
|
| | | itemDict["IsBind"] = int(curEquip.GetIsBind())
|
| | | itemDict["IsSuite"] = int(curEquip.GetIsSuite())
|
| | | itemDict["IsAuctionItem"] = int(ItemControler.GetIsAuctionItem(curEquip))
|
| | | #itemDict["IsSuite"] = int(curEquip.GetIsSuite())
|
| | | userData = curEquip.GetUserData()
|
| | | if userData and userData != "{}":
|
| | | itemDict["UserData"] = userData
|