Add team user points
This commit is contained in:
parent
50e0dde7de
commit
b3c1dceec9
@ -720,9 +720,14 @@ class ChuniBase:
|
|||||||
team_id = 65535
|
team_id = 65535
|
||||||
team_name = self.game_cfg.team.team_name
|
team_name = self.game_cfg.team.team_name
|
||||||
team_rank = 0
|
team_rank = 0
|
||||||
|
team_user_point = 0
|
||||||
|
|
||||||
# Get user profile
|
# Get user profile
|
||||||
profile = await self.data.profile.get_profile_data(data["userId"], self.version)
|
profile = await self.data.profile.get_profile_data(data["userId"], self.version)
|
||||||
|
|
||||||
|
if profile is None:
|
||||||
|
return {"userId": data["userId"], "teamId": 0}
|
||||||
|
|
||||||
if profile and profile["teamId"]:
|
if profile and profile["teamId"]:
|
||||||
# Get team by id
|
# Get team by id
|
||||||
team = await self.data.profile.get_team_by_id(profile["teamId"])
|
team = await self.data.profile.get_team_by_id(profile["teamId"])
|
||||||
@ -731,7 +736,12 @@ class ChuniBase:
|
|||||||
team_id = team["id"]
|
team_id = team["id"]
|
||||||
team_name = team["teamName"]
|
team_name = team["teamName"]
|
||||||
team_rank = await self.data.profile.get_team_rank(team["id"])
|
team_rank = await self.data.profile.get_team_rank(team["id"])
|
||||||
|
team_point = team["teamPoint"]
|
||||||
|
if team["userTeamPoint"] is not None and team["userTeamPoint"] is not "":
|
||||||
|
user_team_point_data = json.loads(team["userTeamPoint"])
|
||||||
|
for user_point_data in user_team_point_data:
|
||||||
|
if user_point_data["user"] == data["userId"]:
|
||||||
|
team_user_point = int(user_point_data["userPoint"])
|
||||||
# Don't return anything if no team name has been defined for defaults and there is no team set for the player
|
# Don't return anything if no team name has been defined for defaults and there is no team set for the player
|
||||||
if not profile["teamId"] and team_name == "":
|
if not profile["teamId"] and team_name == "":
|
||||||
return {"userId": data["userId"], "teamId": 0}
|
return {"userId": data["userId"], "teamId": 0}
|
||||||
@ -741,11 +751,12 @@ class ChuniBase:
|
|||||||
"teamId": team_id,
|
"teamId": team_id,
|
||||||
"teamRank": team_rank,
|
"teamRank": team_rank,
|
||||||
"teamName": team_name,
|
"teamName": team_name,
|
||||||
|
"assaultTimeRate": 1, # TODO: Figure out assaultTime, which might be team point boost?
|
||||||
"userTeamPoint": {
|
"userTeamPoint": {
|
||||||
"userId": data["userId"],
|
"userId": data["userId"],
|
||||||
"teamId": team_id,
|
"teamId": team_id,
|
||||||
"orderId": 1,
|
"orderId": 0,
|
||||||
"teamPoint": 1,
|
"teamPoint": team_user_point,
|
||||||
"aggrDate": data["playDate"],
|
"aggrDate": data["playDate"],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user