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
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
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
love_飞影
Neos
Commits
77e14b21
Commit
77e14b21
authored
Mar 12, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle join room
parent
c7d63765
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
4 deletions
+25
-4
src/ui/Match/CustomRoomContent/index.tsx
src/ui/Match/CustomRoomContent/index.tsx
+1
-1
src/ui/Match/index.tsx
src/ui/Match/index.tsx
+24
-3
No files found.
src/ui/Match/CustomRoomContent/index.tsx
View file @
77e14b21
...
...
@@ -189,7 +189,7 @@ export const CustomRoomContent: React.FC = () => {
value=
{
friendPrivateID
}
onChange=
{
onChangePrivateID
}
placeholder=
"在这输入你朋友的私密房间密码"
type=
"
number
"
type=
"
text
"
/>
</
div
>
);
...
...
src/ui/Match/index.tsx
View file @
77e14b21
...
...
@@ -46,7 +46,6 @@ export const Component: React.FC = () => {
const
[
deckName
,
setDeckName
]
=
useState
(
decks
.
at
(
0
)?.
deckName
??
""
);
const
user
=
accountStore
.
user
;
const
{
joined
}
=
useSnapshot
(
roomStore
);
const
{
options
,
friendPrivateID
}
=
mcCustomRoomStore
;
const
[
singleLoading
,
setSingleLoading
]
=
useState
(
false
);
// 单人模式的loading状态
const
[
athleticMatchLoading
,
setAthleticMatchLoading
]
=
useState
(
false
);
// 竞技匹配的loading状态
const
[
entertainMatchLoading
,
setEntertainMatchLoading
]
=
useState
(
false
);
// 娱乐匹配的loading状态
...
...
@@ -109,7 +108,7 @@ export const Component: React.FC = () => {
);
if
(
mcServer
)
{
const
passWd
=
getCreateRoomPasswd
(
options
,
mcCustomRoomStore
.
options
,
String
(
getPrivateRoomID
(
user
.
external_id
)),
user
.
external_id
,
true
,
...
...
@@ -123,7 +122,29 @@ export const Component: React.FC = () => {
}
};
// 加入MC自定义房间
const
onJoinMCRoom
=
()
=>
{};
const
onJoinMCRoom
=
async
()
=>
{
if
(
user
)
{
if
(
mcCustomRoomStore
.
friendPrivateID
!==
undefined
)
{
const
mcServer
=
serverList
.
find
(
(
server
)
=>
server
.
name
===
"
mycard-custom
"
,
);
if
(
mcServer
)
{
const
passWd
=
getJoinRoomPasswd
(
String
(
mcCustomRoomStore
.
friendPrivateID
),
user
.
external_id
,
true
,
);
await
connectSrvpro
({
ip
:
mcServer
.
ip
+
"
:
"
+
mcServer
.
port
,
player
:
user
.
username
,
passWd
,
});
}
}
else
{
message
.
error
(
"
请输入朋友的私密房间密码!
"
);
}
}
};
// MC观战
const
onMCWatch
=
()
=>
{
...
...
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