Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
N
Neos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
Neos
Commits
cf9fd846
Commit
cf9fd846
authored
Nov 20, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feat/athletics' into 'main'
enable athletics match See merge request
mycard/Neos!333
parents
5eb16f3d
0b0587df
Pipeline
#24104
passed with stages
in 14 minutes and 37 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
12 deletions
+25
-12
src/api/mycard/match.ts
src/api/mycard/match.ts
+1
-1
src/ui/Match/index.tsx
src/ui/Match/index.tsx
+24
-11
No files found.
src/api/mycard/match.ts
View file @
cf9fd846
...
...
@@ -9,7 +9,7 @@ export interface MatchInfo {
export
async
function
match
(
username
:
string
,
extraId
:
number
,
arena
:
string
=
"
entertain
"
,
arena
:
"
athletic
"
|
"
entertain
"
=
"
entertain
"
,
):
Promise
<
MatchInfo
|
undefined
>
{
const
headers
=
{
Authorization
:
"
Basic
"
+
customBase64Encode
(
username
+
"
:
"
+
extraId
),
...
...
src/ui/Match/index.tsx
View file @
cf9fd846
...
...
@@ -36,20 +36,20 @@ export const Component: React.FC = () => {
const
user
=
accountStore
.
user
;
const
{
joined
}
=
useSnapshot
(
roomStore
);
const
[
singleLoading
,
setSingleLoading
]
=
useState
(
false
);
// 单人模式的loading状态
const
[
matchLoading
,
setMatchLoading
]
=
useState
(
false
);
// 匹配模式的loading状态
const
[
athleticMatchLoading
,
setAthleticMatchLoading
]
=
useState
(
false
);
// 竞技匹配的loading状态
const
[
entertainMatchLoading
,
setEntertainMatchLoading
]
=
useState
(
false
);
// 娱乐匹配的loading状态
const
[
watchLoading
,
setWatchLoading
]
=
useState
(
false
);
// 观战模式的loading状态
const
navigate
=
useNavigate
();
// 竞技匹配
const
onCompetitiveMatch
=
()
=>
message
.
error
(
"
暂未开放,敬请期待
"
);
// 娱乐匹配
const
onEntertainMatch
=
async
()
=>
{
// 匹配
const
onMatch
=
async
(
arena
:
"
athletic
"
|
"
entertain
"
)
=>
{
if
(
!
user
)
{
message
.
error
(
"
请先登录萌卡账号
"
);
}
else
{
setMatchLoading
(
true
);
const
matchInfo
=
await
match
(
user
.
username
,
user
.
external_id
);
arena
===
"
athletic
"
?
setAthleticMatchLoading
(
true
)
:
setEntertainMatchLoading
(
true
);
const
matchInfo
=
await
match
(
user
.
username
,
user
.
external_id
,
arena
);
if
(
matchInfo
)
{
await
connectSrvpro
({
...
...
@@ -63,6 +63,12 @@ export const Component: React.FC = () => {
}
};
// 竞技匹配
const
onCompetitiveMatch
=
async
()
=>
await
onMatch
(
"
athletic
"
);
// 娱乐匹配
const
onEntertainMatch
=
async
()
=>
await
onMatch
(
"
entertain
"
);
// MC观战
const
onMCWatch
=
()
=>
{
if
(
!
user
)
{
...
...
@@ -121,7 +127,8 @@ export const Component: React.FC = () => {
useEffect
(()
=>
{
if
(
joined
)
{
setSingleLoading
(
false
);
setMatchLoading
(
false
);
setAthleticMatchLoading
(
false
);
setEntertainMatchLoading
(
false
);
setWatchLoading
(
false
);
navigate
(
`/waitroom`
);
}
...
...
@@ -165,14 +172,20 @@ export const Component: React.FC = () => {
<
Mode
title=
"MC竞技匹配"
desc=
"与MyCard天梯其他数万名玩家激战,力争最强。每月最后一天22点结算,公布排名并获取奖励。"
icon=
{
<
IconFont
type=
"icon-battle"
size=
{
32
}
/>
}
icon=
{
athleticMatchLoading
?
(
<
LoadingOutlined
/>
)
:
(
<
IconFont
type=
"icon-battle"
size=
{
32
}
/>
)
}
onClick=
{
onCompetitiveMatch
}
/>
<
Mode
title=
"MC娱乐匹配"
desc=
"暂且搁置胜负,享受决斗的乐趣。过去一周竞技匹配使用数最多的20个卡组将被禁用。"
icon=
{
m
atchLoading
?
(
entertainM
atchLoading
?
(
<
LoadingOutlined
/>
)
:
(
<
IconFont
type=
"icon-coffee"
size=
{
28
}
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment