From 5977e64909c6a89db801e2c02be2353fdc8f6517 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期二, 21 八月 2018 21:45:35 +0800
Subject: [PATCH] fix:读表路径改成服务器表路径
---
Tool/Robot/DataReader/MapEventPointReader.py | 42 +++++++++++++++++++-----------------------
Tool/Robot/DataReader/ChinMapReader.py | 8 +++++++-
2 files changed, 26 insertions(+), 24 deletions(-)
diff --git a/Tool/Robot/DataReader/ChinMapReader.py b/Tool/Robot/DataReader/ChinMapReader.py
index 5e35e3e..fb270de 100644
--- a/Tool/Robot/DataReader/ChinMapReader.py
+++ b/Tool/Robot/DataReader/ChinMapReader.py
@@ -12,6 +12,9 @@
#---------------------------------------------------------------------
import CommFunc
import logging
+import ConfigurationReader.ConfigIniReader
+
+
# 1. 构建表
@@ -84,9 +87,12 @@
def ReadChinMapData( PyBaseRoot):
global __gChinMapDataReader
+ config = ConfigurationReader.ConfigIniReader.GetConfig()
+ ServerDBConfigPath = config.GetServerDBConfigPath() #数据库路径
+
if not __gChinMapDataReader:
__gChinMapDataReader = ChinMapDataMgr()
- __gChinMapDataReader.InitTable(PyBaseRoot + "Data\\tagChinMap.txt")
+ __gChinMapDataReader.InitTable(ServerDBConfigPath + r"\SysDB\tagChinMap.txt")
def GetChinMapData():
global __gChinMapDataReader
diff --git a/Tool/Robot/DataReader/MapEventPointReader.py b/Tool/Robot/DataReader/MapEventPointReader.py
index db0a990..2468abb 100644
--- a/Tool/Robot/DataReader/MapEventPointReader.py
+++ b/Tool/Robot/DataReader/MapEventPointReader.py
@@ -12,34 +12,28 @@
#---------------------------------------------------------------------
import CommFunc
import logging
-# 1. 构建表
+import ConfigurationReader.ConfigIniReader
+
+
+
+# 1. 构建表
class MapEventPoint():
def __init__(self):
- #int int int int int int int int string string string
- self.Key = 0
self.MapID = 0
self.NPCID = 0
- self.IsShowInfo = 0
- self.Colour = 0
self.LowLV = 0
self.HighestLV = 0
self.Defense = 0
- self.Drop1 = ""
- self.Drop2 = ""
- self.EXP = ""
- self.count = 12
def ReadFromList(self, curList):
-
- self.MapID = CommFunc.ToIntDef(curList[1])
- self.NPCID = CommFunc.ToIntDef(curList[2])
-
- self.LowLV = CommFunc.ToIntDef(curList[6])
- self.HighestLV = CommFunc.ToIntDef(curList[7])
- self.Defense = CommFunc.ToIntDef(curList[8])
+ self.MapID = CommFunc.ToIntDef(curList[0])
+ self.NPCID = CommFunc.ToIntDef(curList[1])
+ self.LowLV = CommFunc.ToIntDef(curList[2])
+ self.HighestLV = CommFunc.ToIntDef(curList[3])
+ self.Defense = CommFunc.ToIntDef(curList[4])
return
@@ -67,8 +61,8 @@
linenum = 0
for line in lines:
linenum += 1
- # 1.字段类型 2.字段名 3.字段备注
- if linenum <= 3:
+ # 字段名
+ if linenum <= 1:
continue
classObj = MapEventPoint()
lineList = line.split('\t')
@@ -88,8 +82,8 @@
linenum = 0
for line in lines:
linenum += 1
- # 1.字段类型 2.字段名 3.字段备注
- if linenum <= 3:
+ # .字段名
+ if linenum <= 1:
continue
classObj = NPCPoint()
lineList = line.strip().split('\t')
@@ -126,7 +120,7 @@
# 已记录
continue
myPoint = point
- print myPoint.LowLV
+ #print myPoint.LowLV
if not myPoint:
if not pointList:
@@ -184,11 +178,13 @@
__gMapEventPointReader = None
def ReadMapEventPoint( PyBaseRoot):
+ config = ConfigurationReader.ConfigIniReader.GetConfig()
+ ServerDBConfigPath = config.GetServerDBConfigPath() #数据库路径
global __gMapEventPointReader
if not __gMapEventPointReader:
__gMapEventPointReader = MapEventPointMgr()
- __gMapEventPointReader.InitTable(PyBaseRoot + "Data\\MapEventPoint.txt")
- __gMapEventPointReader.InitPointType(PyBaseRoot + "Data\\MonsterRefreshPoint.txt")
+ __gMapEventPointReader.InitTable(ServerDBConfigPath + r"\PySysDB\tagMapEventPoint.txt")
+ __gMapEventPointReader.InitPointType(ServerDBConfigPath + r"\PySysDB\tagMonsterRefreshPoint.txt")
def GetMapEventPoint():
global __gMapEventPointReader
--
Gitblit v1.8.0