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
7ad9404c
Commit
7ad9404c
authored
Mar 12, 2024
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix small
parent
ad1b5533
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
src/api/mycard/room.ts
src/api/mycard/room.ts
+10
-2
src/ui/Match/CustomRoomContent/index.tsx
src/ui/Match/CustomRoomContent/index.tsx
+1
-0
src/ui/Match/MatchModal/index.tsx
src/ui/Match/MatchModal/index.tsx
+5
-3
No files found.
src/api/mycard/room.ts
View file @
7ad9404c
...
...
@@ -2,6 +2,13 @@
import
{
Options
}
from
"
./options
"
;
enum
RoomAction
{
CreatePublic
=
1
,
CreatePrivate
=
2
,
JoinPublic
=
3
,
JoinPrivate
=
5
,
}
export
interface
Room
{
id
?:
string
;
title
?:
string
;
...
...
@@ -18,7 +25,8 @@ export function getJoinRoomPasswd(
_private
:
boolean
=
false
,
):
string
{
const
optionsBuffer
=
new
Uint8Array
(
6
);
optionsBuffer
[
1
]
=
(
_private
?
5
:
3
)
<<
4
;
optionsBuffer
[
1
]
=
(
_private
?
RoomAction
.
JoinPrivate
:
RoomAction
.
JoinPublic
)
<<
4
;
encryptBuffer
(
optionsBuffer
,
external_id
);
...
...
@@ -37,7 +45,7 @@ export function getCreateRoomPasswd(
// ref: https://docs.google.com/document/d/1rvrCGIONua2KeRaYNjKBLqyG9uybs9ZI-AmzZKNftOI/edit
const
optionsBuffer
=
new
Uint8Array
(
6
);
optionsBuffer
[
1
]
=
((
_private
?
2
:
1
)
<<
4
)
|
((
_private
?
RoomAction
.
CreatePrivate
:
RoomAction
.
CreatePublic
)
<<
4
)
|
(
options
.
duel_rule
<<
1
)
|
(
options
.
auto_death
?
0x1
:
0
);
...
...
src/ui/Match/CustomRoomContent/index.tsx
View file @
7ad9404c
...
...
@@ -23,6 +23,7 @@ const defaultProps: CustomRoomProps = {
export
const
mcCustomRoomStore
=
proxy
<
CustomRoomProps
>
(
defaultProps
);
// TODO: support public room
export
const
CustomRoomContent
:
React
.
FC
=
()
=>
{
const
{
message
}
=
App
.
useApp
();
const
user
=
useSnapshot
(
accountStore
).
user
;
...
...
src/ui/Match/MatchModal/index.tsx
View file @
7ad9404c
...
...
@@ -13,6 +13,9 @@ import styles from "./index.module.scss";
const
NeosConfig
=
useConfig
();
const
serverConfig
=
NeosConfig
.
servers
;
const
KOISHI_INDEX
=
0
;
const
PRERELEASE_INDEX
=
3
;
const
{
defaults
:
{
defaultPlayer
,
defaultPassword
},
automation
:
{
isAiMode
},
...
...
@@ -28,7 +31,6 @@ const defaultProps: Props = {
export
const
matchStore
=
proxy
<
Props
>
(
defaultProps
);
// TODO: support MC server
export
const
MatchModal
:
React
.
FC
=
({})
=>
{
const
{
message
}
=
App
.
useApp
();
const
{
open
}
=
useSnapshot
(
matchStore
);
...
...
@@ -102,11 +104,11 @@ export const MatchModal: React.FC = ({}) => {
value=
{
serverId
}
options=
{
[
{
value
:
0
,
value
:
KOISHI_INDEX
,
label
:
"
Koishi服
"
,
},
{
value
:
3
,
value
:
PRERELEASE_INDEX
,
label
:
"
超先行服
"
,
},
]
}
...
...
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