From 32c4493813924e3f13485c803cd9b27a558927fd Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期五, 28 六月 2019 10:35:34 +0800
Subject: [PATCH] 7595 【前端】【主干】同步仙宝奇缘后台优化 - 添加客户端版本号

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py   |    4 
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameObj.py   |   17 ---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_Account.py   |  248 +++++++++++++++++++++++++++++++++++++++++++++++++
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameWorld.py |    2 
 Tool/数据库/ChangeAccount/Collections/DataServerPlayerData.py                           |   17 +++
 5 files changed, 267 insertions(+), 21 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
index 5842119..a9f3245 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/EventReport.py
@@ -576,7 +576,9 @@
 def WriteEvent_login(curPlayer):
     if curPlayer.GetIP() == "127.0.0.1":
         return
-    EventReport(ShareDefine.Def_UserAction_Login, "Job=%s&SessionID=%s"%(curPlayer.GetJob(), GameWorld.GetSessionID(curPlayer)), curPlayer)
+    EventReport(ShareDefine.Def_UserAction_Login, "Job=%s&SessionID=%s&Version=%s"%(
+                                curPlayer.GetJob(), GameWorld.GetSessionID(curPlayer),
+                                curPlayer.GetAccountData().GetLastLoginTime()), curPlayer)
 
     return
 
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_Account.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_Account.py
new file mode 100644
index 0000000..1d4ea9d
--- /dev/null
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_Account.py
@@ -0,0 +1,248 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 2.0.4
+#
+# Do not make changes to this file unless you know what you are doing--modify
+# the SWIG interface file instead.
+
+
+
+from sys import version_info
+if version_info >= (2,6,0):
+    def swig_import_helper():
+        from os.path import dirname
+        import imp
+        fp = None
+        try:
+            fp, pathname, description = imp.find_module('_IPY_Account', [dirname(__file__)])
+        except ImportError:
+            import _IPY_Account
+            return _IPY_Account
+        if fp is not None:
+            try:
+                _mod = imp.load_module('_IPY_Account', fp, pathname, description)
+            finally:
+                fp.close()
+            return _mod
+    _IPY_Account = swig_import_helper()
+    del swig_import_helper
+else:
+    import _IPY_Account
+del version_info
+try:
+    _swig_property = property
+except NameError:
+    pass # Python < 2.2 doesn't have 'property'.
+def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
+    if (name == "thisown"): return self.this.own(value)
+    if (name == "this"):
+        if type(value).__name__ == 'SwigPyObject':
+            self.__dict__[name] = value
+            return
+    method = class_type.__swig_setmethods__.get(name,None)
+    if method: return method(self,value)
+    if (not static):
+        self.__dict__[name] = value
+    else:
+        raise AttributeError("You cannot add attributes to %s" % self)
+
+def _swig_setattr(self,class_type,name,value):
+    return _swig_setattr_nondynamic(self,class_type,name,value,0)
+
+def _swig_getattr(self,class_type,name):
+    if (name == "thisown"): return self.this.own()
+    method = class_type.__swig_getmethods__.get(name,None)
+    if method: return method(self)
+    raise AttributeError(name)
+
+def _swig_repr(self):
+    try: strthis = "proxy of " + self.this.__repr__()
+    except: strthis = ""
+    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
+
+try:
+    _object = object
+    _newclass = 1
+except AttributeError:
+    class _object : pass
+    _newclass = 0
+
+
+class SwigPyIterator(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _IPY_Account.delete_SwigPyIterator
+    __del__ = lambda self : None;
+    def value(self): return _IPY_Account.SwigPyIterator_value(self)
+    def incr(self, n = 1): return _IPY_Account.SwigPyIterator_incr(self, n)
+    def decr(self, n = 1): return _IPY_Account.SwigPyIterator_decr(self, n)
+    def distance(self, *args): return _IPY_Account.SwigPyIterator_distance(self, *args)
+    def equal(self, *args): return _IPY_Account.SwigPyIterator_equal(self, *args)
+    def copy(self): return _IPY_Account.SwigPyIterator_copy(self)
+    def next(self): return _IPY_Account.SwigPyIterator_next(self)
+    def __next__(self): return _IPY_Account.SwigPyIterator___next__(self)
+    def previous(self): return _IPY_Account.SwigPyIterator_previous(self)
+    def advance(self, *args): return _IPY_Account.SwigPyIterator_advance(self, *args)
+    def __eq__(self, *args): return _IPY_Account.SwigPyIterator___eq__(self, *args)
+    def __ne__(self, *args): return _IPY_Account.SwigPyIterator___ne__(self, *args)
+    def __iadd__(self, *args): return _IPY_Account.SwigPyIterator___iadd__(self, *args)
+    def __isub__(self, *args): return _IPY_Account.SwigPyIterator___isub__(self, *args)
+    def __add__(self, *args): return _IPY_Account.SwigPyIterator___add__(self, *args)
+    def __sub__(self, *args): return _IPY_Account.SwigPyIterator___sub__(self, *args)
+    def __iter__(self): return self
+SwigPyIterator_swigregister = _IPY_Account.SwigPyIterator_swigregister
+SwigPyIterator_swigregister(SwigPyIterator)
+
+class IntVector(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, IntVector, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, IntVector, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _IPY_Account.IntVector_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _IPY_Account.IntVector___nonzero__(self)
+    def __bool__(self): return _IPY_Account.IntVector___bool__(self)
+    def __len__(self): return _IPY_Account.IntVector___len__(self)
+    def pop(self): return _IPY_Account.IntVector_pop(self)
+    def __getslice__(self, *args): return _IPY_Account.IntVector___getslice__(self, *args)
+    def __setslice__(self, *args): return _IPY_Account.IntVector___setslice__(self, *args)
+    def __delslice__(self, *args): return _IPY_Account.IntVector___delslice__(self, *args)
+    def __delitem__(self, *args): return _IPY_Account.IntVector___delitem__(self, *args)
+    def __getitem__(self, *args): return _IPY_Account.IntVector___getitem__(self, *args)
+    def __setitem__(self, *args): return _IPY_Account.IntVector___setitem__(self, *args)
+    def append(self, *args): return _IPY_Account.IntVector_append(self, *args)
+    def empty(self): return _IPY_Account.IntVector_empty(self)
+    def size(self): return _IPY_Account.IntVector_size(self)
+    def clear(self): return _IPY_Account.IntVector_clear(self)
+    def swap(self, *args): return _IPY_Account.IntVector_swap(self, *args)
+    def get_allocator(self): return _IPY_Account.IntVector_get_allocator(self)
+    def begin(self): return _IPY_Account.IntVector_begin(self)
+    def end(self): return _IPY_Account.IntVector_end(self)
+    def rbegin(self): return _IPY_Account.IntVector_rbegin(self)
+    def rend(self): return _IPY_Account.IntVector_rend(self)
+    def pop_back(self): return _IPY_Account.IntVector_pop_back(self)
+    def erase(self, *args): return _IPY_Account.IntVector_erase(self, *args)
+    def __init__(self, *args): 
+        this = _IPY_Account.new_IntVector(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def push_back(self, *args): return _IPY_Account.IntVector_push_back(self, *args)
+    def front(self): return _IPY_Account.IntVector_front(self)
+    def back(self): return _IPY_Account.IntVector_back(self)
+    def assign(self, *args): return _IPY_Account.IntVector_assign(self, *args)
+    def resize(self, *args): return _IPY_Account.IntVector_resize(self, *args)
+    def insert(self, *args): return _IPY_Account.IntVector_insert(self, *args)
+    def reserve(self, *args): return _IPY_Account.IntVector_reserve(self, *args)
+    def capacity(self): return _IPY_Account.IntVector_capacity(self)
+    __swig_destroy__ = _IPY_Account.delete_IntVector
+    __del__ = lambda self : None;
+IntVector_swigregister = _IPY_Account.IntVector_swigregister
+IntVector_swigregister(IntVector)
+
+class DoubleVector(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, DoubleVector, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, DoubleVector, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _IPY_Account.DoubleVector_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _IPY_Account.DoubleVector___nonzero__(self)
+    def __bool__(self): return _IPY_Account.DoubleVector___bool__(self)
+    def __len__(self): return _IPY_Account.DoubleVector___len__(self)
+    def pop(self): return _IPY_Account.DoubleVector_pop(self)
+    def __getslice__(self, *args): return _IPY_Account.DoubleVector___getslice__(self, *args)
+    def __setslice__(self, *args): return _IPY_Account.DoubleVector___setslice__(self, *args)
+    def __delslice__(self, *args): return _IPY_Account.DoubleVector___delslice__(self, *args)
+    def __delitem__(self, *args): return _IPY_Account.DoubleVector___delitem__(self, *args)
+    def __getitem__(self, *args): return _IPY_Account.DoubleVector___getitem__(self, *args)
+    def __setitem__(self, *args): return _IPY_Account.DoubleVector___setitem__(self, *args)
+    def append(self, *args): return _IPY_Account.DoubleVector_append(self, *args)
+    def empty(self): return _IPY_Account.DoubleVector_empty(self)
+    def size(self): return _IPY_Account.DoubleVector_size(self)
+    def clear(self): return _IPY_Account.DoubleVector_clear(self)
+    def swap(self, *args): return _IPY_Account.DoubleVector_swap(self, *args)
+    def get_allocator(self): return _IPY_Account.DoubleVector_get_allocator(self)
+    def begin(self): return _IPY_Account.DoubleVector_begin(self)
+    def end(self): return _IPY_Account.DoubleVector_end(self)
+    def rbegin(self): return _IPY_Account.DoubleVector_rbegin(self)
+    def rend(self): return _IPY_Account.DoubleVector_rend(self)
+    def pop_back(self): return _IPY_Account.DoubleVector_pop_back(self)
+    def erase(self, *args): return _IPY_Account.DoubleVector_erase(self, *args)
+    def __init__(self, *args): 
+        this = _IPY_Account.new_DoubleVector(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def push_back(self, *args): return _IPY_Account.DoubleVector_push_back(self, *args)
+    def front(self): return _IPY_Account.DoubleVector_front(self)
+    def back(self): return _IPY_Account.DoubleVector_back(self)
+    def assign(self, *args): return _IPY_Account.DoubleVector_assign(self, *args)
+    def resize(self, *args): return _IPY_Account.DoubleVector_resize(self, *args)
+    def insert(self, *args): return _IPY_Account.DoubleVector_insert(self, *args)
+    def reserve(self, *args): return _IPY_Account.DoubleVector_reserve(self, *args)
+    def capacity(self): return _IPY_Account.DoubleVector_capacity(self)
+    __swig_destroy__ = _IPY_Account.delete_DoubleVector
+    __del__ = lambda self : None;
+DoubleVector_swigregister = _IPY_Account.DoubleVector_swigregister
+DoubleVector_swigregister(DoubleVector)
+
+class PairInt(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, PairInt, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, PairInt, name)
+    __repr__ = _swig_repr
+    def __init__(self, *args): 
+        this = _IPY_Account.new_PairInt(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_setmethods__["first"] = _IPY_Account.PairInt_first_set
+    __swig_getmethods__["first"] = _IPY_Account.PairInt_first_get
+    if _newclass:first = _swig_property(_IPY_Account.PairInt_first_get, _IPY_Account.PairInt_first_set)
+    __swig_setmethods__["second"] = _IPY_Account.PairInt_second_set
+    __swig_getmethods__["second"] = _IPY_Account.PairInt_second_get
+    if _newclass:second = _swig_property(_IPY_Account.PairInt_second_get, _IPY_Account.PairInt_second_set)
+    def __len__(self): return 2
+    def __repr__(self): return str((self.first, self.second))
+    def __getitem__(self, index): 
+      if not (index % 2): 
+        return self.first
+      else:
+        return self.second
+    def __setitem__(self, index, val):
+      if not (index % 2): 
+        self.first = val
+      else:
+        self.second = val
+    __swig_destroy__ = _IPY_Account.delete_PairInt
+    __del__ = lambda self : None;
+PairInt_swigregister = _IPY_Account.PairInt_swigregister
+PairInt_swigregister(PairInt)
+
+import IPY_PlayerDefine
+import IPY_ServerDefine
+class IPY_Account(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, IPY_Account, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, IPY_Account, name)
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
+    __repr__ = _swig_repr
+    def GetOperator(self): return _IPY_Account.IPY_Account_GetOperator(self)
+    def GetAreaID(self): return _IPY_Account.IPY_Account_GetAreaID(self)
+    def GetGeTuiClientID(self): return _IPY_Account.IPY_Account_GetGeTuiClientID(self)
+    def GetDeviceFlag(self): return _IPY_Account.IPY_Account_GetDeviceFlag(self)
+    def GetLastLoginTime(self): return _IPY_Account.IPY_Account_GetLastLoginTime(self)
+    def GetClientVersion(self): return _IPY_Account.IPY_Account_GetClientVersion(self)
+    __swig_destroy__ = _IPY_Account.delete_IPY_Account
+    __del__ = lambda self : None;
+IPY_Account_swigregister = _IPY_Account.IPY_Account_swigregister
+IPY_Account_swigregister(IPY_Account)
+
+# This file is compatible with both classic and new-style classes.
+
+
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameObj.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameObj.py
index f7fa723..5a2e429 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameObj.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameObj.py
@@ -910,23 +910,6 @@
 IPY_Friend_swigregister = _IPY_GameObj.IPY_Friend_swigregister
 IPY_Friend_swigregister(IPY_Friend)
 
-class IPY_Account(_object):
-    __swig_setmethods__ = {}
-    __setattr__ = lambda self, name, value: _swig_setattr(self, IPY_Account, name, value)
-    __swig_getmethods__ = {}
-    __getattr__ = lambda self, name: _swig_getattr(self, IPY_Account, name)
-    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
-    __repr__ = _swig_repr
-    def GetOperator(self): return _IPY_GameObj.IPY_Account_GetOperator(self)
-    def GetAreaID(self): return _IPY_GameObj.IPY_Account_GetAreaID(self)
-    def GetGeTuiClientID(self): return _IPY_GameObj.IPY_Account_GetGeTuiClientID(self)
-    def GetDeviceFlag(self): return _IPY_GameObj.IPY_Account_GetDeviceFlag(self)
-    def GetLastLoginTime(self): return _IPY_GameObj.IPY_Account_GetLastLoginTime(self)
-    __swig_destroy__ = _IPY_GameObj.delete_IPY_Account
-    __del__ = lambda self : None;
-IPY_Account_swigregister = _IPY_GameObj.IPY_Account_swigregister
-IPY_Account_swigregister(IPY_Account)
-
 class IPY_Player(IPY_GameObj):
     __swig_setmethods__ = {}
     for _s in [IPY_GameObj]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{}))
diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameWorld.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameWorld.py
index 32cfd9b..52bd17f 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameWorld.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/IPY_GameWorld.py
@@ -24,4 +24,4 @@
 from IPY_Pet import *
 from IPY_GameMap import *
 from IPY_MissionDelete import *
-
+from IPY_Account import *
diff --git "a/Tool/\346\225\260\346\215\256\345\272\223/ChangeAccount/Collections/DataServerPlayerData.py" "b/Tool/\346\225\260\346\215\256\345\272\223/ChangeAccount/Collections/DataServerPlayerData.py"
index de6b77e..fe20c6a 100644
--- "a/Tool/\346\225\260\346\215\256\345\272\223/ChangeAccount/Collections/DataServerPlayerData.py"
+++ "b/Tool/\346\225\260\346\215\256\345\272\223/ChangeAccount/Collections/DataServerPlayerData.py"
@@ -1178,7 +1178,6 @@
 
 
 #----------------------------------------------------------------------
-#------------------------------------------------------
 #玩家账户信息#tagDSAccount
 class tagDSAccount(Structure):
     _pack_ = 1
@@ -1211,6 +1210,7 @@
         ('TokenExpire', ctypes.c_char * 20),
         ('Phone', ctypes.c_ubyte),
         ('DeviceFlag', ctypes.c_char * 33),
+        ('ClientVersion', ctypes.c_char * 25),
         ('ADOResult', ctypes.c_ulong),
         ('SID', ctypes.c_int),    #用于校验
         ('VerNO', ctypes.c_ulong)   #用于SID校验时比较版本号
@@ -1261,6 +1261,7 @@
         self.TokenExpire, pos = CommFunc.ReadString(buf, pos, 20)
         self.Phone, pos = CommFunc.ReadBYTE(buf, pos)
         self.DeviceFlag, pos = CommFunc.ReadString(buf, pos, 33)
+        self.ClientVersion, pos = CommFunc.ReadString(buf, pos, 25)
         return self.getLength()
 
 
@@ -1307,6 +1308,7 @@
         rec[u'TokenExpire'] = fix_incomingText(self.TokenExpire)
         rec[u'Phone'] = self.Phone
         rec[u'DeviceFlag'] = fix_incomingText(self.DeviceFlag)
+        rec[u'ClientVersion'] = fix_incomingText(self.ClientVersion)
         rec[u'SID'] = self.SID
         rec[u'VerNO'] = self.VerNO
         return rec
@@ -1341,6 +1343,7 @@
         self.TokenExpire = fix_outgoingText(rec.get(u'TokenExpire', u''))
         self.Phone = rec.get(u'Phone', 0)
         self.DeviceFlag = fix_outgoingText(rec.get(u'DeviceFlag', u''))
+        self.ClientVersion = fix_outgoingText(rec.get(u'ClientVersion', u''))
         self.SID = rec['SID']
         self.VerNO = rec.get(u'VerNO', 0)
 
@@ -1590,6 +1593,7 @@
             TokenExpire = %s,
             Phone = %s,
             DeviceFlag = %s,
+            ClientVersion = %s,
             ADOResult = %s,
             SID = %s,
             VerNO = %s,
@@ -1622,6 +1626,7 @@
                 self.TokenExpire,
                 self.Phone,
                 self.DeviceFlag,
+                self.ClientVersion,
                 self.ADOResult,
                 self.SID,
                 self.VerNO
@@ -1629,7 +1634,7 @@
         return output
 
     def dumpString(self):
-        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
+        output = '''%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s\t%1s'''%(
                 self.ACCID,
                 self.Psw,
                 self.PswLV2,
@@ -1658,6 +1663,7 @@
                 self.TokenExpire,
                 self.Phone,
                 self.DeviceFlag,
+                self.ClientVersion,
             )
         return output
 
@@ -1728,6 +1734,13 @@
         else:
             self.DeviceFlag = Str[:33]
             
+    def SetClientVersion(self,Str):
+        if len(Str)<=25:
+            self.ClientVersion = Str
+        else:
+            self.ClientVersion = Str[:25]
+            
+
 #------------------------------------------------------
 #人物物品#tagRoleItem
 class tagRoleItem(Structure):

--
Gitblit v1.8.0