#!/usr/bin/python
|
# -*- coding: GBK -*-
|
#
|
# @todo:
|
#
|
# @author: Alee
|
# @date 2018-1-3 ÏÂÎç05:54:40
|
# @version 1.0
|
#
|
# @note:
|
#
|
#---------------------------------------------------------------------
|
# ¼òҪ˵Ã÷ µÇ¼£¬µÇ³ö´¦Àí°ü
|
# ÏêϸÃèÊö None
|
|
import base64
|
from AI.AIBase import *
|
import logging
|
import os
|
from ConfigurationReader import ConfigIniReader
|
from DataReader import MapEventPointReader, ChinMapReader
|
from Protocol.PacketsSend import tagCClientVersion
|
from Protocol.PacketsSend import tagCRoleLoginAsk
|
from Protocol.PacketsSend import tagCInitMapOK
|
from Protocol.PacketsSend import tagCNPCAnswer #08 02 ʼþ»ØÓ¦·¢°ü
|
from Protocol.PacketsSend import tagCCancelEvent #08 0A ½áÊøÊ¼þ#tagCCancelEvent
|
from Protocol.PacketsSend import tagCPlayerLogin, tagCWorldTransfer, tagCLeaveTeam, tagCPlayerLogOut, tagCExitFB
|
|
from Robot.PlayerData import PlayerData
|
from Protocol.PacketsSendPY import tagCMLoginState, tagCMSightZoom, tagCMTJGnpc, tagCGAutoMatchTeam, tagCGCreateTeam, tagCMWorldTick
|
from Protocol.PacketsSendPY import tagCMTJGDead
|
from Robot import DataDefine
|
import random
|
import CommFunc
|
|
VER = "2012-08-30 16:30"
|
|
|
#ĬÈϵÚÒ»ÕŵØÍ¼
|
Def_First_MapID = 10010
|
##Íæ¼ÒÓÎÏ·Õ˺Ÿñʽ: ƽ̨Õ˺Å@ƽ̨Ãû@sÇø·þID, ƽ̨Õ˺ſÉÄÜ´ø@£¬ÈçÓÊÏäyhlz123@qq.com@173on_lan@s519
|
Def_AccID_Split_Sign = "@"
|
## µÇ¼£¬µÇ³ö´¦Àí°ü
|
#
|
# ¼Ì³ÐAIBase
|
class AILoginout(AIBase):
|
|
## ËùÓÐAI±ØÐë²ÉÓÃÕâÖй̶¨µÄ³õʼ»¯ÔÐÍ£¬ÒÔ±ãAIMgr×Ô¶¯¼ÓÔØ
|
# @param None : None
|
# @return bool
|
# @remarks ´ËAI²»ÐèÒªÖÜÆÚÐÔ±»µ÷Óã¬ËùÒÔÉèÖÃΪ²»ÆôÓÃTimer
|
def __init__(self, robot):
|
#´ËAI²»ÐèÒªÖÜÆÚÐÔ±»µ÷Óã¬ËùÒÔÉèÖÃΪ²»ÆôÓÃTimer
|
AIBase.__init__(self, robot, 0, False, False)
|
self.SetActive(True)
|
self.MapID = 0
|
|
self.RandMapYet = False # ÊÇ·ñÒÑËæ»úÏß·
|
|
|
## ÏòAIMgr×¢²áÏûÏ¢»Øµ÷º¯Êý
|
# @param None : None
|
# @return bool
|
# @remarks
|
def _RegisterPacket(self, aiMgr):
|
aiMgr.RegNetMsg(0x0101, self.OnServerPrepared, False)
|
aiMgr.RegNetMsg(0x0115, self.OnAskClientVersion, False)
|
aiMgr.RegNetMsg(0x0107, self.OnShowLoginFrm, True)
|
aiMgr.RegNetMsg(0x0109, self.OnServerPrepareOK, False)
|
aiMgr.RegNetMsg(0x0103, self.OnNeedCreateRole, False)
|
aiMgr.RegNetMsg(0x0102, self.OnCDBPlayer, True)
|
aiMgr.RegNetMsg(0x0401, self.OnPlayerMapInit, True)
|
aiMgr.RegNetMsg(0x0403, self.OnPlayerLoginLoadOK, False)
|
aiMgr.RegNetMsg(0x0104, self.OnServerDisconnect, True)
|
aiMgr.RegNetMsg(0x0418, self.OnAttr, True)
|
aiMgr.RegNetMsg(0xA709, self.OnAttrList, True)
|
#aiMgr.RegNetMsg(0x0114, self.OnAttrList, True) Ïß·
|
aiMgr.RegNetMsg(0x0906, self.LeaveTeam, True)
|
aiMgr.RegNetMsg(0x0609, self.PlayerDie, True)
|
aiMgr.RegNetMsg(0xB902, self.TeamRefresh, True)
|
aiMgr.RegNetMsg(0x0820, self.MissionDict, True)
|
|
|
def PlayerDie(self, pack):
|
# ÍÑ»ú¹ÒºóÐø´¦ÀíÓÉ·þÎñÆ÷¾ö¶¨£¬ÕâÀïÖ»ÊÇÌṩ´¥·¢Ê±»ú
|
#self.TJGLeave(0)
|
|
sendPack = tagCMTJGDead()
|
self.robot.SendMapServerPYPack(sendPack)
|
return
|
|
# À뿪¶ÓÎé
|
def LeaveTeam(self, pack):
|
if pack.PlayerID != self.robot.GetPlayerInfo().GetPlayerID():
|
if self.robot.GetPlayerInfo().GetTeamMemberLV() == 2:
|
# ×éÔ±Í˳ö ¶Ó³¤¼ÌÐøÕÒÈË×é¶Ó
|
self.JoinTeam()
|
return
|
self.robot.GetPlayerInfo().SetTeamID(0)
|
self.robot.GetPlayerInfo().SetTeamMemberLV(0)
|
self.JoinTeam()
|
return
|
|
# ¶ÓÎéË¢ÐÂ
|
def TeamRefresh(self, pack):
|
logging.debug("TeamRefresh----%s"%self.robot.GetPlayerInfo().GetPlayerID())
|
self.robot.GetPlayerInfo().SetTeamID(pack.TeamID)
|
for member in pack.MemberList:
|
if member.PlayerID == self.robot.GetPlayerInfo().GetPlayerID():
|
self.robot.GetPlayerInfo().SetTeamMemberLV(member.MemberLV)
|
break
|
return
|
|
#A709 ÊôÐÔÕûºÏ°ü
|
def OnAttrList(self, pack):
|
if pack.ObjID != self.robot.GetPlayerInfo().GetPlayerID():
|
return
|
|
if pack.ObjType != 1:
|
return
|
|
for i in xrange(pack.Count):
|
lpack = pack.RefreshType[i]
|
self.CalcAttr(lpack)
|
|
return
|
|
#0418
|
def OnAttr(self, pack):
|
if pack.ObjID != self.robot.GetPlayerInfo().GetPlayerID():
|
return
|
|
if pack.ObjType != 1:
|
return
|
|
self.CalcAttr(pack)
|
return
|
|
def CalcAttr(self, pack):
|
if pack.RefreshType == DataDefine.CDBPlayerRefresh_LV:
|
self.robot.GetPlayerInfo().SetPlayerLV(pack.Value)
|
if self.robot.GetIsLoginOK():
|
self.RefreshPoint()
|
|
elif pack.RefreshType == DataDefine.CDBPlayerRefresh_DEF:
|
self.robot.GetPlayerInfo().SetDefense(pack.Value)
|
elif pack.RefreshType == DataDefine.CDBPlayerRefresh_Gold:
|
self.robot.GetPlayerInfo().SetGold(pack.Value)
|
elif pack.RefreshType == DataDefine.CDBPlayerRefresh_TeamID:
|
self.robot.GetPlayerInfo().SetTeamID(pack.Value)
|
if pack.Value == 0:
|
self.robot.GetPlayerInfo().SetTeamMemberLV(0)
|
elif pack.RefreshType == DataDefine.CDBPlayerRefresh_HappyPoint:
|
self.robot.GetPlayerInfo().SetTJGTime(pack.Value)
|
|
if self.robot.GetIsLoginOK():
|
# Í˳ö¶ÓÎ飬ÀëÏß -- Ö»ÓÐÕýÔڵǼ³É¹¦²Å¿ÉÒÔ£¬²»È»»áÔì³ÉÑ»·ÉÏÏÂÏß
|
self.TJGLeave(pack.Value)
|
elif pack.RefreshType == DataDefine.CDBPlayerRefresh_Tick:
|
self.robot.GetPlayerInfo().SetWorldTick(pack.Value)
|
elif pack.RefreshType == DataDefine.CDBPlayerRefresh_FBID:
|
self.robot.GetPlayerInfo().SetFBID(pack.Value)
|
|
def TJGLeave(self, tjgTime):
|
|
if tjgTime != 0:
|
return
|
sendPack = tagCLeaveTeam()
|
self.robot.Send(sendPack)
|
|
sendPack = tagCPlayerLogOut()
|
self.robot.Send(sendPack)
|
|
self.robot.SetIsLoginOK(False)
|
#from Robot import RobotMgr
|
#RobotMgr.GetRobotMgr().DisconnectServer(self.robot)
|
|
def MissionDict(self, pack):
|
|
# ½âËøµØÍ¼£¬¼¼ÄÜ
|
if self.robot.GetPlayerInfo().GetMaxMapID() != 0:
|
return
|
|
if pack.MissionID != 1:
|
return
|
|
if pack.DictKey != "OpenMap":
|
return
|
|
maxfbID = pack.DictValue
|
maxMapID = ChinMapReader.GetChinMapData().FindMaxMapID(self.robot.GetPlayerInfo().GetPlayerLV(), maxfbID)
|
|
self.robot.GetPlayerInfo().SetMaxMapID(maxMapID)
|
return
|
|
## ºÍ·þÎñÆ÷¶Ï¿ª
|
# @param None : None
|
# @return bool
|
# @remarks
|
def OnServerDisconnect(self, packOnServerDisconnect):
|
logging.info("RobotCheckTT serverdisconnect, %s reason:%s " % (self.robot.GetPlayerInfo().GetAccID(), packOnServerDisconnect.Reason))
|
self.robot.SetIsLoginOK(False)
|
self.robot.SetLastDisconnectReason(packOnServerDisconnect.Reason)
|
from Robot import RobotMgr
|
RobotMgr.GetRobotMgr().DisconnectServer(self.robot)
|
return
|
|
|
## ·þÎñÆ÷×¼±¸Íê³É
|
# @param None : None
|
# @return bool
|
# @remarks
|
def OnServerPrepared(self, packOnServerPrepared):
|
#=======================================================================
|
# loginPack = tagCPlayerLogin()
|
# loginPack.AccID =
|
# logging.debug(str(loginPack.AccID))
|
# loginPack.Password = base64.standard_b64encode()
|
# loginPack.Version = ConfigIniReader.GetConfig().GetVersionNo()
|
# logging.info("RobotCheckTT peer:0x%08X OnServerPrepared %s,%s,%d"% \
|
# (self.robot.GetPeerValue(), loginPack.AccID, loginPack.Password, loginPack.Version))
|
#=======================================================================
|
# Êý¾Ý¿âÈ¡³öΪunicodeÐèҪתstr
|
if self.IsTokenLogOn():
|
return
|
|
#self.robot.Send(loginPack)
|
return
|
|
|
## ÊÇ·ñTokenµÇ½
|
# @param None : None
|
# @return bool
|
# @remarks
|
def IsTokenLogOn(self):
|
#·¢°üTokenµÇ½
|
|
#===============================================================================
|
# class tagCPlayerLogin(Structure):
|
# Head = tagHead()
|
# IDType = 0 #(BYTE IDType)//Õ˺ÅÀàÐÍ.0:ÆÕͨÕ˺Å;1:FreeSDK;
|
# AccID = "" #(char AccID[65])// ÉçȺÕ˺ŵij¤¶ÈÊÇ30
|
# Password = "" #(char Password[33])//size = Len£¬¿É·¢token
|
# Version = 0 #(DWORD Version)
|
# LineNO = 0 #(BYTE LineNO)
|
# MAC = "" #(char MAC[18])//MACµØÖ·
|
# AppID = 0 #(DWORD AppID)//Ó¦ÓñàÂë, ½ÓFreeSDK
|
# AccountID = 0 #(DWORD AccountID)//Óû§IDÓëÕ˺Ų»Í¬£¬½ÓFreeSDK
|
# TokenExpire = "" #(char TokenExpire[20])//ʱ¼ä´Á£¬ºÁÃë¼¶£¬½ÓFreeSDK
|
# Phone = 0 #(BYTE Phone)//ÊÇ·ñ°ó¶¨ÊÖ»ú
|
# ServerID = 0 #(DWORD ServerID)//·þÎñÆ÷ID
|
# data = None
|
#===============================================================================
|
|
|
|
#=======================================================================
|
# cAccessLogin = tagCAccessLogin()
|
# cAccessLogin.AccessToken = self.robot.GetRobotConfig()[0]
|
# cAccessLogin.MAC = self.robot.GetRobotConfig()[2]
|
# cAccessLogin.Version = ConfigIniReader.GetConfig().GetVersionNo()
|
#=======================================================================
|
strList = self.robot.GetRobotConfig()[1].split(Def_AccID_Split_Sign)
|
accID = self.GetPlatformAccID(self.robot.GetRobotConfig()[1])
|
spID = strList[-2]
|
sid = strList[-1]
|
cAccessLogin = tagCPlayerLogin()
|
cAccessLogin.IDType = 1
|
cAccessLogin.AccID = accID
|
cAccessLogin.Password = "1"*32
|
cAccessLogin.Version = ConfigIniReader.GetConfig().GetVersionNo()
|
cAccessLogin.LineNO = 255
|
cAccessLogin.MAC = self.robot.GetRobotConfig()[2]
|
cAccessLogin.AppID = self.robot.GetRobotConfig()[4]
|
cAccessLogin.ServerID = int(sid[1:])
|
cAccessLogin.Adult = self.robot.GetRobotConfig()[3]
|
cAccessLogin.ExtraLen = len(spID)
|
cAccessLogin.Extra = spID
|
|
self.robot.Send(cAccessLogin)
|
#print "New Player Login ---------- ", self.robot.GetRobotConfig()[1]
|
return True
|
|
##»ñȡƽ̨Õ˺Å
|
def GetPlatformAccID(self, gameAccID):
|
infoList = gameAccID.split(Def_AccID_Split_Sign)
|
paInfoList = infoList[:-2]
|
platformAccID = Def_AccID_Split_Sign.join(paInfoList)
|
return platformAccID
|
|
## ÇëÇó°æ±¾
|
# @param None : None
|
# @return bool
|
# @remarks
|
def OnAskClientVersion(self, packOnAskClientVersion):
|
ClientVersionPack = tagCClientVersion()
|
ClientVersionPack.Version = ConfigIniReader.GetConfig().GetClientVersion()
|
ClientVersionPack.VersionLen = len(ClientVersionPack.Version)
|
logging.debug("RobotCheckTT peer:0x%08X OnAskClientVersion %s,%d"% \
|
(self.robot.GetPeerValue(), ClientVersionPack.Version, ClientVersionPack.VersionLen))
|
self.robot.Send(ClientVersionPack)
|
return
|
|
|
## 怫
|
# @param None : None
|
# @return bool
|
# @remarks
|
def OnShowLoginFrm(self, packOnShowLoginFrm):
|
if packOnShowLoginFrm.Type == 1:
|
#ÐèÒª´´½¨½ÇÉ«
|
pack = tagCRoleLoginAsk()
|
pack.Type = 1
|
logging.debug("RobotCheckTT peer:0x%08X OnShowLoginFrm 1"%(self.robot.GetPeerValue()))
|
self.robot.Send(pack)
|
return
|
if packOnShowLoginFrm.Type == 2:
|
#Ñ¡Ôñ½ÇÉ«
|
pack = tagCRoleLoginAsk()
|
pack.Type = 2
|
logging.debug("RobotCheckTT peer:0x%08X OnShowLoginFrm 2"%(self.robot.GetPeerValue()))
|
self.robot.Send(pack)
|
return
|
return
|
|
|
## µØÍ¼×¼±¸Íê³É
|
# @param None : None
|
# @return bool
|
# @remarks
|
def OnServerPrepareOK(self, packOnServerPrepareOK):
|
# 1.ÍÑ»ú¹Ò״̬ 2.¶ÁÈ¡µØÍ¼³É¹¦ 3.ÊÓÒ°Ëõ·Å
|
|
#֪ͨGameServer×Ô¼º¶ÁÈ¡µØÍ¼³É¹¦
|
pack = tagCInitMapOK()
|
pack.MapID = self.MapID
|
self.robot.Send(pack)
|
|
loginState = tagCMLoginState()
|
loginState.State = 1 # // 0Õý³£µÇ¼£¬1ÍÑ»úµÇ¼£¬2ÍÑ»úµÇ¼ËÀÍö
|
self.robot.SendMapServerPYPack(loginState)
|
|
#ÉèÖýøÈëÍæ¼ÒÊý¾Ý
|
self.robot.GetPlayerInfo().SetRoundNpcDict({})
|
logging.debug("RobotCheckTT peer:0x%08X OnServerPrepareOK"%(self.robot.GetPeerValue()))
|
|
|
## ´´½¨Ö÷½Ç
|
# @param None : None
|
# @return bool
|
# @remarks
|
def OnNeedCreateRole(self, packOnNeedCreateRole):
|
#ÐèÒª´´½¨Íæ¼Ò, ʲôҲ²»×ö
|
logging.debug("RobotCheckTT peer:0x%08X OnNeedCreateRole"%(self.robot.GetPeerValue()))
|
return
|
|
|
## Ö÷½Ç³õʼ»¯
|
# @param None : None
|
# @return bool
|
# @remarks
|
def OnCDBPlayer(self, packOnCDBPlayer):
|
self.MapID = packOnCDBPlayer.MapID
|
#=======================================================================
|
# logging.info("RobotCheckTT peer:0x%08X Player%sLogin, ID:%d, AccID:%s " \
|
# "HP:%d MP:%d, MapID:%d Pos:(%d,%d)"%(\
|
# self.robot.GetPeerValue(), packOnCDBPlayer.PlayerName,
|
# packOnCDBPlayer.PlayerID, packOnCDBPlayer.AccID, packOnCDBPlayer.HP,
|
# packOnCDBPlayer.MP, packOnCDBPlayer.MapID,
|
# packOnCDBPlayer.PosX, packOnCDBPlayer.PosY))
|
#=======================================================================
|
self.robot.SetPlayerInfo(PlayerData(packOnCDBPlayer.AccID, \
|
packOnCDBPlayer.PlayerID, packOnCDBPlayer.PlayerName, \
|
packOnCDBPlayer.MapID, packOnCDBPlayer.PosX, packOnCDBPlayer.PosY, {}, packOnCDBPlayer.Job))
|
|
self.robot.GetPlayerInfo().SetPlayerLV(packOnCDBPlayer.LV)
|
self.robot.GetPlayerInfo().SetGold(packOnCDBPlayer.Gold)
|
self.robot.GetPlayerInfo().SetLineID(packOnCDBPlayer.LineID)
|
self.robot.GetPlayerInfo().SetTJGTime(packOnCDBPlayer.HappyPoint)
|
self.robot.GetPlayerInfo().SetFBID(packOnCDBPlayer.FBID)
|
|
self.robot.GetPlayerInfo().SetJob(packOnCDBPlayer.Job)
|
self.robot.GetPlayerInfo().SetPlayerID(packOnCDBPlayer.PlayerID)
|
|
## 04 01 ÈËÎïËùÔڵij¡¾°³õʼ»¯#tagPlayerMapInit
|
# @param None : None
|
# @return bool
|
# @remarks
|
def OnPlayerMapInit(self, packOnPlayerMapInit):
|
logging.debug("RobotCheckTT peer:0x%08X ÈËÎïËùÔڵij¡¾°³õʼ»¯"%(self.robot.GetPeerValue()))
|
self.MapID = packOnPlayerMapInit.MapID
|
self.robot.GetPlayerInfo().SetMapID(self.MapID)
|
self.robot.GetPlayerInfo().SetPosX(packOnPlayerMapInit.PosX)
|
self.robot.GetPlayerInfo().SetPosY(packOnPlayerMapInit.PosY)
|
return
|
|
|
## 04 03 Íæ¼ÒµÇ¼Êý¾Ý·¢ËÍÍê±ÏOK#tagPlayerLoginLoadOK
|
# @param None : None
|
# @return bool
|
# @remarks
|
def OnPlayerLoginLoadOK(self, packOnPlayerLoginLoadOK):
|
logging.debug("RobotCheckTT peer:0x%08X tagPlayerLoginLoadOK"%(self.robot.GetPeerValue()))
|
self.robot.SetIsLoginOK(True)
|
self.robot.ClearDisconnectReason()
|
|
sendPack = tagCMWorldTick()
|
self.robot.SendMapServerPYPack(sendPack)
|
|
# // ÊÓÒ°Ëõ·Å£¬ÓÃÓÚÍÑ»ú¹Ò²»³¬¹ý×î´óÊÓÒ°£¬¿ÕÏÐ״̬Ϊ0£¬±»Íæ¼Ò¹¥»÷»Ö¸´ÊÓÒ°
|
sightPack = tagCMSightZoom()
|
sightPack.Sight = 0
|
self.robot.SendMapServerPYPack(sightPack)
|
|
mapData = ChinMapReader.GetChinMapData().FindMapByID(self.robot.GetPlayerInfo().GetMapID())
|
|
if self.robot.GetPlayerInfo().GetTJGTime() == 0:
|
# Í˳ö¶ÓÎ飬ÀëÏߣ»±ØÐëÔÚÕýʽµÇ¼ºóÀëÏߣ¬²»È»»áµ¼Ö·´¸´µÇ¼
|
self.TJGLeave(0)
|
return
|
|
if mapData and mapData.MapFBType != 0:
|
|
sendPack = tagCExitFB()
|
self.robot.Send(sendPack)
|
return
|
|
# ÇëÇóÏß·
|
#self.SendEventAnswer()
|
self.RefreshPoint()
|
|
|
|
# ÖØÉè¹Ò»úµã
|
def RefreshPoint(self):
|
MapEventPointReader.GetMapEventPoint().FindNPC(self.robot)
|
point = self.robot.GetPlayerInfo().GetTJGPoint()
|
if not point:
|
return
|
|
mapID, (posX, posY), npcID = point
|
if posX == 0 and posY == 0:
|
logging.info("¹Ò»úµã±í´íÎ󣡣¡£¡ npcID = %s"%npcID)
|
return
|
|
## ÅжÏÊÇ·ñÒѵ½´ïÄ¿±êµã£¬±ÜÃâÇл»²»Í¬Ïß·ËÀÑ»·
|
if self.robot.GetPlayerInfo().GetMapID() == mapID and \
|
CommFunc.GetDist(posX, posY, self.robot.GetPlayerInfo().GetPosX(), self.robot.GetPlayerInfo().GetPosY()) < 10:
|
# Òѵ½Ä¿±êµã
|
pass
|
else:
|
|
if self.RandMapYet:
|
# Éý¼¶ºóͬһÏß·Çл»µØµã
|
lineNO = self.robot.GetPlayerInfo().GetFBID() #ÒÑÔÚ±¾µØÍ¼ ²»ÔÙÇÐÏß
|
else:
|
lineNO = random.randint(0, 9) # 0 Ϊ·þÎñ¶Ë´¦Àí£¬ ÆäËûÊýֵΪ¾ßÌåÏß·
|
self.RandMapYet = True
|
|
# Ôݲ»×öÏß·ÇëÇ󣬿ÉÈ«¾Ö´¦Àí, tagPyGetLineState()
|
# 1.´«ËͰü£¬2.ÉèÖùһúNPC 3.×é¶Ó
|
|
sendPack = tagCWorldTransfer()
|
sendPack.Type = 1
|
sendPack.MapID = mapID
|
sendPack.PosX = posX + random.randint(0, 4)
|
sendPack.PosY = posY + random.randint(0, 4)
|
sendPack.ExtField1 = lineNO
|
self.robot.Send(sendPack)
|
|
self.robot.GetPlayerInfo().SetPosX(sendPack.PosX)
|
self.robot.GetPlayerInfo().SetPosY(sendPack.PosY)
|
|
sendPack = tagCMTJGnpc()
|
sendPack.NPCID = npcID
|
self.robot.SendMapServerPYPack(sendPack)
|
|
|
if mapID != self.robot.GetPlayerInfo().GetMapID():
|
logging.debug("µØÍ¼Çл»¹Ò»ú----%s-%s"%(mapID,self.robot.GetPlayerInfo().GetMapID()))
|
return
|
|
self.JoinTeam()
|
return
|
|
|
def JoinTeam(self):
|
if self.robot.GetPlayerInfo().GetTeamID() != 0:
|
return
|
if not self.robot.GetIsLoginOK():
|
return
|
|
logging.debug("×é¶ÓÉêÇë----%s"%self.robot.GetPlayerInfo().GetPlayerID())
|
sendPack = tagCGAutoMatchTeam()
|
self.robot.SendGameServerPYPack(sendPack)
|
|
sendPack = tagCGCreateTeam()
|
sendPack.TagMapID = 0
|
sendPack.TagMapEx = 0
|
sendPack.ReqMinLV = 1
|
sendPack.ReqMaxLV = 0
|
self.robot.SendGameServerPYPack(sendPack)
|
|
## ·¢Ê¼þ»ØÓ¦°ü
|
# @param None : None
|
# @return bool
|
# @remarks
|
def SendEventAnswer(self):
|
NPCAnswer = tagCNPCAnswer()
|
NPCAnswer.Clear()
|
|
NPCAnswer.AnswerLen = 2
|
NPCAnswer.Answer = 'OK'
|
|
self.robot.Send(NPCAnswer)
|
|
|
## ·¢Í˳öʼþ
|
# @param None : None
|
# @return bool
|
# @remarks
|
def SendExitEventAnswer(self):
|
ExitEvent = tagCCancelEvent()
|
ExitEvent.Clear()
|
|
ExitEvent.Type = 0
|
|
self.robot.Send(ExitEvent)
|
|
"""
|
ʵÏÖ¸÷ÖÖÏûÏ¢»Øµ÷º¯Êý£¬
|
1. Ïò·þÎñ¶Ë·¢°ü¿ÉʹÓÃÀàËÆ
|
onlineR = tagCOnlineReturn()
|
self.robot.Send( onlineR )
|
|
2.Èç¹ûÐèÒªÏòRobot±£´æÊý¾Ý£¬ÔòÊÂÏÈÈ·ÈÏÕâЩÊý¾ÝÊÇ·ñÖ»ÊÇAIÔËÐÐÏà¹Ø£¬
|
¶øÓëʹÓÃRobotµÄÆäËûÀàµÄʵÀýÎÞ¹Ø
|
Èç¹ûÊÇÕâÖÖÇé¿ö£¬Çë²»Òª±£´æµ½Robot£¬¶øÓ¦¸ÃÔÚ¶ÔÓ¦µÄAIµÄ×ÓÀàÄÚ±£´æÊý¾Ý
|
|
3.Èç¹ûÐèÒªÖÜÆÚÐԻص÷£¬ÔòÔÚ__init__ʱÉèÖÃTimer£¬ÌáÊ¾ÖØÔØ_Processº¯Êý
|
"""
|
|
|
|