Skip to content

Commit a5b69f8

Browse files
committed
feature: tournament chat
1 parent 63cd1a8 commit a5b69f8

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

src/chat/chat.service.ts

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,53 @@ export class ChatService {
7171
return;
7272
}
7373

74+
break;
75+
case ChatLobbyType.Tournament:
76+
const { tournaments } = await this.hasuraService.query(
77+
{
78+
tournaments: {
79+
__args: {
80+
where: {
81+
id: {
82+
_eq: id,
83+
},
84+
_or: [
85+
{
86+
is_organizer: {
87+
_eq: true,
88+
},
89+
},
90+
{
91+
teams: {
92+
_or: [
93+
{
94+
owner_steam_id: {
95+
_eq: client.user.steam_id,
96+
},
97+
},
98+
{
99+
roster: {
100+
player_steam_id: {
101+
_eq: client.user.steam_id,
102+
},
103+
},
104+
},
105+
],
106+
},
107+
},
108+
],
109+
},
110+
},
111+
id: true,
112+
},
113+
},
114+
client.user.steam_id,
115+
);
116+
117+
if (tournaments.length === 0) {
118+
return;
119+
}
120+
74121
break;
75122
default:
76123
this.logger.warn(`Unknown lobby type: ${type}`);

src/chat/enums/ChatLobbyTypes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export enum ChatLobbyType {
22
Match = "match",
33
Team = "team",
44
MatchMaking = "matchmaking",
5+
Tournament = "tournament",
56
}

0 commit comments

Comments
 (0)