16 卡牌服务端(删除部分无用代码GY_GM_xxx.py)
| | |
| | | #GM操作字符
|
| | | Def_GM_Oper_ForbidAcc = 'GMOperForbidAcc' #GM操作符:踢出玩家
|
| | | #---------------------------------------------------------------------
|
| | | #GM活动ID(10倍)
|
| | | Def_GY_GM_GameID_MapGiveExp_Ten = 3000005
|
| | | Def_GY_GM_GameID_MapGiveExp_Fifty = 3000006
|
| | |
|
| | | #------------
|
| | | # 非c++定义的账号状态,py用的账号锁定,禁言,按位判断
|
| | |
| | | TYPE_Time_Format_YmdHMS = "%Y%m%d%H%M%S"
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | #无限封存时间(10年)
|
| | | Def_GMPower_MaxTime = 60*24*365*10
|
| | | #GM权限表
|
| | |
|
| | | # GM命令 超级GM(1级) A级GM(2级) B级GM(3级) C级GM(4级) D级GM(5级)
|
| | | Def_GMPower_Disc = { |
| | | 'GY_GM_PlayerDetailByID' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #角色查询 |
| | | 'GY_GM_MoveToPlayerByID' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #传送到玩家身边
|
| | | 'GY_GM_PullPlayerByID' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #把玩家拉到身边
|
| | | 'GY_GM_ViewBroadcast' : { 1 : True , 2 : True , 3 : True , 4 : False, 5 : False} , #查询公告
|
| | | 'GY_GM_ForbidFight' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : False} , #禁止战斗
|
| | | 'GY_GM_KickPlayer' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #踢玩家下线
|
| | | 'GY_GM_CloseAccID' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : False} , #帐号封存
|
| | | 'GY_GM_SetNoSight' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #设置隐身
|
| | | 'GY_GM_CancelNoSight' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #取消隐身
|
| | | 'GY_GM_ForbidTalk' : { 1 : True , 2 : True , 3 : True , 4 : False, 5 : False} , #禁止说话
|
| | | 'GY_GM_ChangeGMLV' : { 1 : True , 2 : False, 3 : False, 4 : False, 5 : False} , #更改权限
|
| | | 'GY_GM_SetExpRate' : { 1 : True , 2 : True , 3 : True , 4 : False, 5 : False} , #经验倍率
|
| | | 'GY_GM_StartGame' : { 1 : True , 2 : True , 3 : True , 4 : False, 5 : False} , #开启活动
|
| | | 'GY_GM_ViewGame' : { 1 : True , 2 : True , 3 : True , 4 : False, 5 : False} , #查询活动
|
| | | 'GY_GM_FindPlayerByID' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #查询玩家
|
| | | 'GY_GM_FindPlayerByName' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #查询玩家
|
| | | 'GY_GM_GivePlayerExp' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #给经验
|
| | | 'GY_GM_Broadcast' : { 1 : True , 2 : True , 3 : True , 4 : False, 5 : False} , #发布公告
|
| | | 'GY_GM_ViewWordExpRate' : { 1 : True , 2 : True , 3 : True , 4 : False, 5 : False} , #查看服务器经验倍率
|
| | | 'GY_GM_MapGiveExp' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #设置指定地图经验倍率
|
| | | 'GY_GM_Offline_FindPlayer': { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #脱机工具-查找玩家
|
| | | 'GY_GM_Offline_ViewItem' : { 1 : True , 2 : True , 3 : True , 4 : False, 5 : False} , #脱机工具-查看物品
|
| | | 'GY_GM_Offline_ViewAttribute' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #脱机工具-查看玩家属性
|
| | | 'GY_GM_Offline_ViewSkill': { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #脱机工具-查看玩家技能
|
| | | 'GY_GM_Offline_ViewTitle': { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #脱机工具-查看玩家称号
|
| | | 'GY_GM_Offline_ViewMoney': { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #脱机工具-查看玩家货币
|
| | | 'GY_GM_Offline_ViewGMOper': { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #脱机工具-查看玩家GM操作
|
| | | 'GY_GM_CloseBroadcast' : { 1 : True , 2 : True , 3 : True , 4 : False, 5 : False} , #脱机工具-消除公告
|
| | | 'GY_GM_Offline_UnBind' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #脱机工具-解封玩家
|
| | | 'GY_GM_Offline_ViewUnBind' : { 1 : True , 2 : True , 3 : True , 4 : True , 5 : True } , #脱机工具-查询玩家
|
| | | }
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | | #请求类型(需要和GameServer中的一致)
|
| | | Def_QueryType_Count = 56
|
| | | (
|
| | |
| | | #内部测试人员,不限制
|
| | | return True
|
| | |
|
| | | GMLVPowerDict = ReadChConfig.GetEvalChConfig("GMLVPower")
|
| | | if curPlayer_GMLV in GMLVPowerDict:
|
| | | powerList = GMLVPowerDict[curPlayer_GMLV]
|
| | | if not powerList or callFunName in powerList:
|
| | | return True
|
| | | |
| | | #验证权限
|
| | | if callFunName in ChConfig.Def_GMPower_Disc:
|
| | | gmPowerList = ChConfig.Def_GMPower_Disc[callFunName]
|
| | | |
| | | if curPlayer_GMLV not in gmPowerList:
|
| | | #GM等级异常
|
| | | GameWorld.Log("###使用GM命令 = %s,GM等级 = %s异常"%(callFunName , curPlayer_GMLV) , curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | if not gmPowerList[curPlayer_GMLV]:
|
| | | GameWorld.Log("###使用GM命令 = %s,权限 = %s不足"%(callFunName , curPlayer_GMLV) , curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | #内部测试用GM命令
|
| | | else:
|
| | | GameWorld.Log("###非内部人员, 使用调试GM命令 = %s,权限 = %s不足"%(callFunName , curPlayer_GMLV) , curPlayer.GetPlayerID())
|
| | | return
|
| | | |
| | | return True
|
| | |
|
| | | #---------------------------------------------------------------------
|
| | |
| | | # return
|
| | | #===============================================================================
|
| | | return
|
| | | #---------------------------------------------------------------------
|
| | | ##GM开关活动, 地图服务器给经验
|
| | | # @param curPlayer 玩家实例
|
| | | # @param tick 时间戳
|
| | | # @return 返回值无意义
|
| | | # @remarks GM开关活动, 地图服务器给经验
|
| | | def ProcessMapGiveExp(curPlayer, tick):
|
| | | gameWorld = GameWorld.GetGameWorld()
|
| | | #经验倍率
|
| | | exp_Multiple = 0
|
| | | if gameWorld.IsEventActive(ChConfig.Def_GY_GM_GameID_MapGiveExp_Ten):
|
| | | exp_Multiple = 10
|
| | | elif gameWorld.IsEventActive(ChConfig.Def_GY_GM_GameID_MapGiveExp_Fifty):
|
| | | exp_Multiple = 50
|
| | | else:
|
| | | #无活动
|
| | | return
|
| | | |
| | | mapExpTick = curPlayer.GetTickByType(ChConfig.TYPE_Player_Tick_GiveMapExp)
|
| | | |
| | | if mapExpTick == 0:
|
| | | #第一次设定当前时间
|
| | | curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_GiveMapExp, tick)
|
| | | return
|
| | | |
| | | if tick - mapExpTick < ChConfig.TYPE_Player_Tick_Time[ChConfig.TYPE_Player_Tick_GiveMapExp]:
|
| | | #没有到刷新间隔
|
| | | return
|
| | | |
| | | curPlayer.SetTickByType(ChConfig.TYPE_Player_Tick_GiveMapExp, tick) |
| | | |
| | | reExp = 0
|
| | | |
| | | playerControl = PlayerControl.PlayerControl(curPlayer)
|
| | | #玩家经验增加 参考经验 * 经验倍率
|
| | | playerControl.AddExp(reExp * exp_Multiple)
|
| | | |
| | | return
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | | ##清空玩家连续击杀数量
|
| | | # @param curPlayer 玩家实例
|
| | | # @param tick 时间戳
|