mirror of
https://github.com/studio-neptune/yuuki.git
synced 2024-11-10 17:14:06 +08:00
v6.5.0-alpha_RC2
This commit is contained in:
parent
9f286fe7b0
commit
5f2dc7f41a
2 changed files with 23 additions and 13 deletions
34
libs/data.py
34
libs/data.py
|
@ -139,18 +139,28 @@ class Yuuki_Data:
|
|||
else:
|
||||
assert "Unknown DataType"
|
||||
return self.Data[Type][Query]
|
||||
elif type(Query) == list and len(Query) == 2:
|
||||
if Query[0] not in self.Data[Type]:
|
||||
if Type in self.initType:
|
||||
self.Data[Type][Query[0]] = self.initType[Type]
|
||||
else:
|
||||
assert "Unknown DataType"
|
||||
if Query[1] not in self.Data[Type][Query[0]]:
|
||||
if Type in self.initType:
|
||||
self.Data[Type][Query[0]][Query[1]] = self.initType[Query[0]]
|
||||
else:
|
||||
assert "Unknown DataType"
|
||||
return self.Data[Type][Query[0]][Query[1]]
|
||||
elif type(Query) == list:
|
||||
if len(Query) >= 2:
|
||||
if Query[0] not in self.Data[Type]:
|
||||
if Type in self.initType:
|
||||
self.Data[Type][Query[0]] = self.initType[Type]
|
||||
else:
|
||||
assert "Unknown DataType"
|
||||
if Query[1] not in self.Data[Type][Query[0]]:
|
||||
if Type in self.initType:
|
||||
self.Data[Type][Query[0]][Query[1]] = self.initType[Query[0]]
|
||||
else:
|
||||
assert "Unknown DataType"
|
||||
if len(Query) == 2:
|
||||
return self.Data[Type][Query[0]][Query[1]]
|
||||
if len(Query) >= 3:
|
||||
if Query[2] not in self.Data[Type][Query[0]][Query[1]]:
|
||||
if Type in self.initType:
|
||||
self.Data[Type][Query[0]][Query[1]][Query[2]] = self.initType[Query[0]]
|
||||
else:
|
||||
assert "Unknown DataType"
|
||||
if len(Query) == 3:
|
||||
return self.Data[Type][Query[0]][Query[1]][Query[2]]
|
||||
else:
|
||||
assert "Error Query"
|
||||
else:
|
||||
|
|
|
@ -173,7 +173,7 @@ class Yuuki:
|
|||
return Accounts[count]
|
||||
|
||||
def getGroupTicket(self, GroupID, userId):
|
||||
GroupTicket = self.data.getData("Group", [GroupID, "GroupTicket"])
|
||||
GroupTicket = self.data.getData("Group", [GroupID, "GroupTicket", userId])
|
||||
if GroupTicket == "":
|
||||
GroupTicket = self.getClientByMid(userId).reissueGroupTicket(GroupID)
|
||||
self.data.updateData(self.data.getData("Group", [GroupID, "GroupTicket"]), userId, GroupTicket)
|
||||
|
|
Loading…
Reference in a new issue