| | |
| | | import ChItem
|
| | | import PlayerTJG
|
| | | import EventShell
|
| | | import PyGameData
|
| | | import PlayerLove
|
| | | import math
|
| | | #---------------------------------------------------------------------
|
| | |
|
| | |
|
| | |
| | | content = sendPack.GetContent()
|
| | |
|
| | | #通用判断
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick):
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick, talkType=IPY_GameWorld.tcArea):
|
| | | return
|
| | |
|
| | | #通用设置
|
| | |
| | | content = sendPack.GetContent()
|
| | |
|
| | | #通用检测
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick, checkSameMsg = False):
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick, checkSameMsg = False, talkType=IPY_GameWorld.tcWorld):
|
| | | return
|
| | |
|
| | | #通用设置
|
| | |
| | | content = sendPack.GetContent()
|
| | |
|
| | | #通用检测
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick, checkSameMsg = False):
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick, checkSameMsg = False, talkType=IPY_GameWorld.tcCountry):
|
| | | return
|
| | |
|
| | | #通用设置
|
| | |
| | | #玩家聊天内容
|
| | | content = sendPack.GetContent()
|
| | |
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick):
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick, talkType=IPY_GameWorld.tcFamily):
|
| | | return
|
| | | |
| | | #通用设置
|
| | | SetTalkTime(curPlayer, content, IPY_GameWorld.tcFamily, tick)
|
| | |
|
| | | extras = GetTalkExtraValue(curPlayer)
|
| | | curPlayer.ChatFamily(content, 0, extras)
|
| | |
| | | #玩家聊天内容
|
| | | content = sendPack.GetContent()
|
| | |
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick):
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick, talkType=IPY_GameWorld.tcTeam):
|
| | | return
|
| | |
|
| | | #通用设置
|
| | |
| | | #玩家聊天内容
|
| | | content = sendPack.GetContent()
|
| | |
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick):
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick, talkType=IPY_GameWorld.tcPrivate):
|
| | | return
|
| | |
|
| | | #通用设置
|
| | |
| | | extras = GetTalkExtraValue(curPlayer)
|
| | | curPlayer.ChatMiByID(sendPack.GetTalkType(), sendPack.GetPlayerID(), content, 0, extras)
|
| | | return
|
| | |
|
| | | def TalkPrivateByID(curPlayer, tagPlayerID, content):
|
| | | #私聊 0为默认 1为1对1聊天
|
| | | talkType = 1
|
| | | extras = GetTalkExtraValue(curPlayer)
|
| | | curPlayer.ChatMiByID(talkType, tagPlayerID, content, 0, extras)
|
| | | return
|
| | |
|
| | |
|
| | |
|
| | | ## 私聊频道(封包参数)
|
| | |
| | | #玩家聊天内容
|
| | | content = sendPack.GetContent()
|
| | |
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick):
|
| | | if not __CheckTalk(curPlayer, content, sendPack.GetLen(), tick, talkType=IPY_GameWorld.tcPrivate):
|
| | | return
|
| | |
|
| | | #通用设置
|
| | |
| | | # @param checkSameMsg 是否检查相同信息
|
| | | # @return True or False
|
| | | # @remarks 函数详细说明.
|
| | | def __CheckTalk(curPlayer, content, length, tick, checkGMForbidenTalk = True, checkSameMsg = True):
|
| | | def __CheckTalk(curPlayer, content, length, tick, checkGMForbidenTalk = True, checkSameMsg = True, talkType=None):
|
| | | if checkGMForbidenTalk and GetGMToolForbidTalk(curPlayer):
|
| | | #GeRen_chenxin_921745 对不起,您已被GM禁言,发送信息失败
|
| | | #PlayerControl.NotifyCode(curPlayer, "GeRen_chenxin_921745")
|
| | |
| | | #PlayerControl.NotifyCode(curPlayer, "CanootTalk02")
|
| | | return False
|
| | |
|
| | | #频道各自间隔时间
|
| | | if talkType != None:
|
| | | talkCDDict = IpyGameDataPY.GetFuncEvalCfg("TalkCD", 1, {})
|
| | | if str(talkType) in talkCDDict:
|
| | | cdTicks = talkCDDict[str(talkType)] * 1000
|
| | | lastTalkTick = curPlayer.GetTalkTick(talkType)
|
| | | remainTick = cdTicks - (tick - lastTalkTick)
|
| | | if remainTick > 0:
|
| | | PlayerControl.NotifyCode(curPlayer, "CanootTalk01", [int(math.ceil(remainTick/1000.0))])
|
| | | return False
|
| | | |
| | | #聊天信息太长
|
| | | if length > ChConfig.Def_PlayerTalkMaxCount :
|
| | | PlayerControl.NotifyCode(curPlayer, "CanootTalk13")
|
| | |
| | | #设置当前聊天内容为玩家本次聊天内容
|
| | | #curPlayer.SetLastChatContent(content)
|
| | | #设置当前频道时间
|
| | | #curPlayer.SetTalkTick(type, tick)
|
| | | curPlayer.SetTalkTick(type, tick)
|
| | | return
|
| | |
|
| | | ## 信件2B封包
|
| | |
| | | vipLv = objTalk.GetVIPLv() # 玩家vip等级
|
| | | GMLevel = objTalk.GetGMLevel()
|
| | | job = objTalk.GetJob()
|
| | | playerID = objTalk.GetID()
|
| | |
|
| | | extraValueStr = ""
|
| | | # vip等级
|
| | |
| | | extraValueStr += GetTalkExtraValueStar(ShareDefine.Def_TalkExtraValue_Bit_ServerGroupID) % PlayerControl.GetPlayerServerGroupID(objTalk)
|
| | | # 等级
|
| | | extraValueStr += GetTalkExtraValueStar(ShareDefine.Def_TalkExtraValue_Bit_LV) % objTalk.GetLV()
|
| | | # 伴侣信息
|
| | | coupleName = PlayerControl.GetCoupleName(objTalk)
|
| | | coupleJob = PlayerControl.GetCoupleJob(objTalk)
|
| | | bridePriceMaxID = PlayerControl.GetBridePriceMaxID(objTalk)
|
| | | extraValueStr = "%s|%s|%s|%s" % (extraValueStr, coupleName, coupleJob, bridePriceMaxID)
|
| | | return extraValueStr
|
| | |
|
| | |
|
| | |
| | | # @param tick
|
| | | # @return
|
| | | def OnPyTalk(index, clientData, tick):
|
| | | return
|
| | | curPlayer = GameWorld.GetPlayerManager().GetPlayerByIndex(index)
|
| | |
|
| | | #GameWorld.DebugLog("OnPyTalk, Name:%s" % curPlayer.GetPlayerName())
|