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
BBeretta
Neos
Commits
6682e09b
Commit
6682e09b
authored
Mar 11, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
udpate CustomRoomContent
parent
380b34be
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
5 deletions
+90
-5
src/api/mycard/room.ts
src/api/mycard/room.ts
+11
-2
src/ui/Match/CustomRoomContent/index.module.scss
src/ui/Match/CustomRoomContent/index.module.scss
+41
-0
src/ui/Match/CustomRoomContent/index.tsx
src/ui/Match/CustomRoomContent/index.tsx
+38
-3
No files found.
src/api/mycard/room.ts
View file @
6682e09b
...
...
@@ -12,9 +12,13 @@ export interface Room {
// 通过房间ID和external_id加密得出房间密码
//
// 用于加入MC服房间
export
function
getJoinRoomPasswd
(
roomID
:
string
,
external_id
:
number
):
string
{
export
function
getJoinRoomPasswd
(
roomID
:
string
,
external_id
:
number
,
_private
:
boolean
=
false
,
):
string
{
const
optionsBuffer
=
new
Uint8Array
(
6
);
optionsBuffer
[
1
]
=
3
<<
4
;
optionsBuffer
[
1
]
=
(
_private
?
5
:
3
)
<<
4
;
encryptBuffer
(
optionsBuffer
,
external_id
);
...
...
@@ -70,6 +74,11 @@ function encryptBuffer(buffer: Uint8Array, external_id: number) {
}
}
// 获取私密房间ID
export
function
getPrivateRoomID
(
external_id
:
number
):
number
{
return
external_id
^
0x54321
;
}
/* 一些辅助函数 */
function
readUInt16LE
(
buffer
:
Uint8Array
,
offset
:
number
):
number
{
...
...
src/ui/Match/CustomRoomContent/index.module.scss
View file @
6682e09b
...
...
@@ -3,9 +3,50 @@
flex-direction
:
column
;
font
:
var
(
--
theme-font
);
font-size
:
1rem
;
gap
:
0
.5rem
;
margin-bottom
:
1rem
;
p
{
font-size
:
1
.2rem
;
}
.clipboard
{
display
:
flex
;
flex-direction
:
row
;
.title
{
margin-right
:
3
.5rem
;
}
.input
{
width
:
50%
;
}
}
.digit-option
{
display
:
flex
;
justify-content
:
space-between
;
.input
{
width
:
60%
;
}
}
.select-option
{
display
:
flex
;
flex-direction
:
row
;
}
.check
{
font-size
:
1rem
;
}
}
.footer
{
text-align
:
right
;
gap
:
1rem
;
.btn
{
margin-right
:
0
.5rem
;
}
}
src/ui/Match/CustomRoomContent/index.tsx
View file @
6682e09b
import
{
Button
}
from
"
antd
"
;
import
{
CopyOutlined
,
KeyOutlined
}
from
"
@ant-design/icons
"
;
import
{
Button
,
Checkbox
,
Input
}
from
"
antd
"
;
import
React
from
"
react
"
;
import
{
Select
}
from
"
@/ui/Shared
"
;
import
styles
from
"
./index.module.scss
"
;
export
const
CustomRoomContent
:
React
.
FC
=
()
=>
{
return
(
<
div
className=
{
styles
.
container
}
>
<
p
>
创建/加入私密房间
</
p
>
<
div
className=
{
styles
.
clipboard
}
>
<
div
className=
{
styles
.
title
}
>
房间密码
<
KeyOutlined
/>
</
div
>
<
Input
className=
{
styles
.
input
}
type=
"text"
/>
<
Button
icon=
{
<
CopyOutlined
/>
}
/>
</
div
>
<
div
className=
{
styles
[
"
digit-option
"
]
}
>
<
div
className=
{
styles
.
title
}
>
初始LP
</
div
>
<
Input
className=
{
styles
.
input
}
type=
"text"
/>
</
div
>
<
div
className=
{
styles
[
"
digit-option
"
]
}
>
<
div
className=
{
styles
.
title
}
>
初始手牌数
</
div
>
<
Input
className=
{
styles
.
input
}
type=
"text"
/>
</
div
>
<
div
className=
{
styles
[
"
digit-option
"
]
}
>
<
div
className=
{
styles
.
title
}
>
每回合抽卡
</
div
>
<
Input
className=
{
styles
.
input
}
type=
"text"
/>
</
div
>
<
div
className=
{
styles
[
"
select-option
"
]
}
>
<
Select
title=
"卡片允许"
/>
</
div
>
<
div
className=
{
styles
[
"
select-option
"
]
}
>
<
Select
title=
"决斗模式"
/>
</
div
>
<
div
className=
{
styles
[
"
select-option
"
]
}
>
<
Select
title=
"决斗规则"
/>
</
div
>
<
Checkbox
className=
{
styles
.
check
}
>
不检查卡组
</
Checkbox
>
<
Checkbox
className=
{
styles
.
check
}
>
不切洗卡组
</
Checkbox
>
<
Checkbox
className=
{
styles
.
check
}
>
40分自动加时
</
Checkbox
>
</
div
>
);
};
...
...
@@ -14,8 +49,8 @@ export const CustomRoomContent: React.FC = () => {
export
const
CustomRoomFooter
:
React
.
FC
=
()
=>
{
return
(
<
div
className=
{
styles
.
footer
}
>
<
Button
>
创建私密房间
</
Button
>
<
Button
>
加入私密房间
</
Button
>
<
Button
className=
{
styles
.
btn
}
>
创建私密房间
</
Button
>
<
Button
className=
{
styles
.
btn
}
>
加入私密房间
</
Button
>
</
div
>
);
};
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