Casper 3 months ago
parent
commit
447e474d3e

+ 6 - 3
sri-server-bg03/lib/Connection_e1.py

@@ -292,12 +292,14 @@ class SRIConnection(asyncio.Protocol):
         # --- check ---
         user = mdb.get_one('UserInfo', {'username': object.account})
         name = ''
+        uuid = ''
         if not user:
             ret = False
         elif not check_password_hash(user['password'], object.password):
             ret = False
         else:
             name = user.get('name')
+            uuid = str(user.get('_id'))
             ret = True
 
         # --- update ---
@@ -308,6 +310,7 @@ class SRIConnection(asyncio.Protocol):
                 'uid': 3,  # 对应数据库里的ego的id
                 'name': object.account,  # 对应数据库里
                 'egotype': 1,  # 舱端类型
+                'user_uuid': uuid,  # 用户id
             }
 
         # --- send 4000
@@ -315,7 +318,7 @@ class SRIConnection(asyncio.Protocol):
         object.ret = ret  # 返回结果
         object.uid = self.connection_id
         object.name = name  # 人员名称
-        object.user_uuid = str(user.get('_id'))  # 人员唯一标识
+        object.user_uuid = uuid  # 人员唯一标识
         re_command_id = protobuf.SC_Sign  # 4000
         re_body_length = object.ByteSize()
         re_head_data = struct.pack(self.head_sequence, re_command_id, re_body_length)
@@ -580,7 +583,7 @@ class SRIConnection(asyncio.Protocol):
 
     def message2014(self, body_data):
 
-        # --- 解析消息体
+        # --- 解析消息体 2014
         """
         message CSState
         {
@@ -623,7 +626,7 @@ class SRIConnection(asyncio.Protocol):
                 Leave.egotype: int32
                 """
                 o3 = protobuf.UserActivityInfo()
-                o3.user_uuid = 'SSGGSSEEFFHHWWSS'  # 用户uuid
+                o3.user_uuid = self.client_info.get('user_uuid')  # 用户uuid
                 o3.cockpit_id = self.connection_id  # 舱端id
                 o3.vehicle_id = o1.uid  # 车端id
                 re_command_id = protobuf.S2V_SendUserInfo  # 6011

+ 0 - 1
sri-server-bg03/xprotobuf/protocol.proto

@@ -441,7 +441,6 @@ message CSState
 {
     UserState state=1;
     int32 uid=2;
-    string user_uuid=3;
 };
 
 message UserActivityInfo

File diff suppressed because it is too large
+ 0 - 0
sri-server-bg03/xprotobuf/protocol_pb2.py


Some files were not shown because too many files changed in this diff