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
aafb9b87
Commit
aafb9b87
authored
Aug 17, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle side service
parent
4669c900
Pipeline
#23179
passed with stages
in 11 minutes and 16 seconds
Changes
9
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
263 additions
and
5 deletions
+263
-5
neos-protobuf
neos-protobuf
+1
-1
src/api/ocgcore/idl/ocgcore.ts
src/api/ocgcore/idl/ocgcore.ts
+198
-4
src/api/ocgcore/ocgAdapter/adapter.ts
src/api/ocgcore/ocgAdapter/adapter.ts
+12
-0
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+2
-0
src/api/ocgcore/ocgAdapter/stoc/stocChangeSide.ts
src/api/ocgcore/ocgAdapter/stoc/stocChangeSide.ts
+16
-0
src/api/ocgcore/ocgAdapter/stoc/stocWaitingSide.ts
src/api/ocgcore/ocgAdapter/stoc/stocWaitingSide.ts
+16
-0
src/service/onSocketMessage.ts
src/service/onSocketMessage.ts
+10
-0
src/service/side/changeSide.ts
src/service/side/changeSide.ts
+4
-0
src/service/side/waitingSide.ts
src/service/side/waitingSide.ts
+4
-0
No files found.
neos-protobuf
@
a02a8caa
Subproject commit
12f48aa7901f81f4b356b968bc7a8281a1a2d848
Subproject commit
a02a8caa38767bb06e1a9d5be97773af5a0fc4b2
src/api/ocgcore/idl/ocgcore.ts
View file @
aafb9b87
...
@@ -978,7 +978,7 @@ export namespace ygopro {
...
@@ -978,7 +978,7 @@ export namespace ygopro {
}
}
}
}
export
class
YgoStocMsg
extends
pb_1
.
Message
{
export
class
YgoStocMsg
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
]];
#
one_of_decls
:
number
[][]
=
[[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
]];
constructor
(
data
?:
any
[]
|
({}
&
(({
constructor
(
data
?:
any
[]
|
({}
&
(({
stoc_join_game
?:
StocJoinGame
;
stoc_join_game
?:
StocJoinGame
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -994,6 +994,8 @@ export namespace ygopro {
...
@@ -994,6 +994,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
StocChat
;
stoc_chat
?:
StocChat
;
...
@@ -1009,6 +1011,8 @@ export namespace ygopro {
...
@@ -1009,6 +1011,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1024,6 +1028,8 @@ export namespace ygopro {
...
@@ -1024,6 +1028,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1039,6 +1045,8 @@ export namespace ygopro {
...
@@ -1039,6 +1045,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1054,6 +1062,8 @@ export namespace ygopro {
...
@@ -1054,6 +1062,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1069,6 +1079,8 @@ export namespace ygopro {
...
@@ -1069,6 +1079,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1084,6 +1096,8 @@ export namespace ygopro {
...
@@ -1084,6 +1096,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1099,6 +1113,8 @@ export namespace ygopro {
...
@@ -1099,6 +1113,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1114,6 +1130,8 @@ export namespace ygopro {
...
@@ -1114,6 +1130,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1129,6 +1147,8 @@ export namespace ygopro {
...
@@ -1129,6 +1147,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1144,6 +1164,8 @@ export namespace ygopro {
...
@@ -1144,6 +1164,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1159,6 +1181,8 @@ export namespace ygopro {
...
@@ -1159,6 +1181,8 @@ export namespace ygopro {
stoc_game_msg
?:
StocGameMessage
;
stoc_game_msg
?:
StocGameMessage
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1174,6 +1198,8 @@ export namespace ygopro {
...
@@ -1174,6 +1198,8 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
StocTimeLimit
;
stoc_time_limit
?:
StocTimeLimit
;
stoc_error_msg
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
}
|
{
stoc_join_game
?:
never
;
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_chat
?:
never
;
...
@@ -1189,6 +1215,42 @@ export namespace ygopro {
...
@@ -1189,6 +1215,42 @@ export namespace ygopro {
stoc_game_msg
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
StocErrorMsg
;
stoc_error_msg
?:
StocErrorMsg
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
never
;
}
|
{
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_hs_player_enter
?:
never
;
stoc_type_change
?:
never
;
stoc_hs_player_change
?:
never
;
stoc_hs_watch_change
?:
never
;
stoc_select_hand
?:
never
;
stoc_hand_result
?:
never
;
stoc_select_tp
?:
never
;
stoc_deck_count
?:
never
;
stoc_duel_start
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
StocChangeSide
;
stoc_waiting_side
?:
never
;
}
|
{
stoc_join_game
?:
never
;
stoc_chat
?:
never
;
stoc_hs_player_enter
?:
never
;
stoc_type_change
?:
never
;
stoc_hs_player_change
?:
never
;
stoc_hs_watch_change
?:
never
;
stoc_select_hand
?:
never
;
stoc_hand_result
?:
never
;
stoc_select_tp
?:
never
;
stoc_deck_count
?:
never
;
stoc_duel_start
?:
never
;
stoc_game_msg
?:
never
;
stoc_time_limit
?:
never
;
stoc_error_msg
?:
never
;
stoc_change_side
?:
never
;
stoc_waiting_side
?:
StocWaitingSide
;
}))))
{
}))))
{
super
();
super
();
pb_1
.
Message
.
initialize
(
this
,
Array
.
isArray
(
data
)
?
data
:
[],
0
,
-
1
,
[],
this
.
#
one_of_decls
);
pb_1
.
Message
.
initialize
(
this
,
Array
.
isArray
(
data
)
?
data
:
[],
0
,
-
1
,
[],
this
.
#
one_of_decls
);
...
@@ -1235,6 +1297,12 @@ export namespace ygopro {
...
@@ -1235,6 +1297,12 @@ export namespace ygopro {
if
(
"
stoc_error_msg
"
in
data
&&
data
.
stoc_error_msg
!=
undefined
)
{
if
(
"
stoc_error_msg
"
in
data
&&
data
.
stoc_error_msg
!=
undefined
)
{
this
.
stoc_error_msg
=
data
.
stoc_error_msg
;
this
.
stoc_error_msg
=
data
.
stoc_error_msg
;
}
}
if
(
"
stoc_change_side
"
in
data
&&
data
.
stoc_change_side
!=
undefined
)
{
this
.
stoc_change_side
=
data
.
stoc_change_side
;
}
if
(
"
stoc_waiting_side
"
in
data
&&
data
.
stoc_waiting_side
!=
undefined
)
{
this
.
stoc_waiting_side
=
data
.
stoc_waiting_side
;
}
}
}
}
}
get
stoc_join_game
()
{
get
stoc_join_game
()
{
...
@@ -1363,9 +1431,27 @@ export namespace ygopro {
...
@@ -1363,9 +1431,27 @@ export namespace ygopro {
get
has_stoc_error_msg
()
{
get
has_stoc_error_msg
()
{
return
pb_1
.
Message
.
getField
(
this
,
14
)
!=
null
;
return
pb_1
.
Message
.
getField
(
this
,
14
)
!=
null
;
}
}
get
stoc_change_side
()
{
return
pb_1
.
Message
.
getWrapperField
(
this
,
StocChangeSide
,
15
)
as
StocChangeSide
;
}
set
stoc_change_side
(
value
:
StocChangeSide
)
{
pb_1
.
Message
.
setOneofWrapperField
(
this
,
15
,
this
.
#
one_of_decls
[
0
],
value
);
}
get
has_stoc_change_side
()
{
return
pb_1
.
Message
.
getField
(
this
,
15
)
!=
null
;
}
get
stoc_waiting_side
()
{
return
pb_1
.
Message
.
getWrapperField
(
this
,
StocWaitingSide
,
16
)
as
StocWaitingSide
;
}
set
stoc_waiting_side
(
value
:
StocWaitingSide
)
{
pb_1
.
Message
.
setOneofWrapperField
(
this
,
16
,
this
.
#
one_of_decls
[
0
],
value
);
}
get
has_stoc_waiting_side
()
{
return
pb_1
.
Message
.
getField
(
this
,
16
)
!=
null
;
}
get
msg
()
{
get
msg
()
{
const
cases
:
{
const
cases
:
{
[
index
:
number
]:
"
none
"
|
"
stoc_join_game
"
|
"
stoc_chat
"
|
"
stoc_hs_player_enter
"
|
"
stoc_type_change
"
|
"
stoc_hs_player_change
"
|
"
stoc_hs_watch_change
"
|
"
stoc_select_hand
"
|
"
stoc_hand_result
"
|
"
stoc_select_tp
"
|
"
stoc_deck_count
"
|
"
stoc_duel_start
"
|
"
stoc_game_msg
"
|
"
stoc_time_limit
"
|
"
stoc_error_msg
"
;
[
index
:
number
]:
"
none
"
|
"
stoc_join_game
"
|
"
stoc_chat
"
|
"
stoc_hs_player_enter
"
|
"
stoc_type_change
"
|
"
stoc_hs_player_change
"
|
"
stoc_hs_watch_change
"
|
"
stoc_select_hand
"
|
"
stoc_hand_result
"
|
"
stoc_select_tp
"
|
"
stoc_deck_count
"
|
"
stoc_duel_start
"
|
"
stoc_game_msg
"
|
"
stoc_time_limit
"
|
"
stoc_error_msg
"
|
"
stoc_change_side
"
|
"
stoc_waiting_side
"
;
}
=
{
}
=
{
0
:
"
none
"
,
0
:
"
none
"
,
1
:
"
stoc_join_game
"
,
1
:
"
stoc_join_game
"
,
...
@@ -1381,9 +1467,11 @@ export namespace ygopro {
...
@@ -1381,9 +1467,11 @@ export namespace ygopro {
11
:
"
stoc_duel_start
"
,
11
:
"
stoc_duel_start
"
,
12
:
"
stoc_game_msg
"
,
12
:
"
stoc_game_msg
"
,
13
:
"
stoc_time_limit
"
,
13
:
"
stoc_time_limit
"
,
14
:
"
stoc_error_msg
"
14
:
"
stoc_error_msg
"
,
15
:
"
stoc_change_side
"
,
16
:
"
stoc_waiting_side
"
};
};
return
cases
[
pb_1
.
Message
.
computeOneofCase
(
this
,
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
])];
return
cases
[
pb_1
.
Message
.
computeOneofCase
(
this
,
[
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
])];
}
}
static
fromObject
(
data
:
{
static
fromObject
(
data
:
{
stoc_join_game
?:
ReturnType
<
typeof
StocJoinGame
.
prototype
.
toObject
>
;
stoc_join_game
?:
ReturnType
<
typeof
StocJoinGame
.
prototype
.
toObject
>
;
...
@@ -1400,6 +1488,8 @@ export namespace ygopro {
...
@@ -1400,6 +1488,8 @@ export namespace ygopro {
stoc_game_msg
?:
ReturnType
<
typeof
StocGameMessage
.
prototype
.
toObject
>
;
stoc_game_msg
?:
ReturnType
<
typeof
StocGameMessage
.
prototype
.
toObject
>
;
stoc_time_limit
?:
ReturnType
<
typeof
StocTimeLimit
.
prototype
.
toObject
>
;
stoc_time_limit
?:
ReturnType
<
typeof
StocTimeLimit
.
prototype
.
toObject
>
;
stoc_error_msg
?:
ReturnType
<
typeof
StocErrorMsg
.
prototype
.
toObject
>
;
stoc_error_msg
?:
ReturnType
<
typeof
StocErrorMsg
.
prototype
.
toObject
>
;
stoc_change_side
?:
ReturnType
<
typeof
StocChangeSide
.
prototype
.
toObject
>
;
stoc_waiting_side
?:
ReturnType
<
typeof
StocWaitingSide
.
prototype
.
toObject
>
;
}):
YgoStocMsg
{
}):
YgoStocMsg
{
const
message
=
new
YgoStocMsg
({});
const
message
=
new
YgoStocMsg
({});
if
(
data
.
stoc_join_game
!=
null
)
{
if
(
data
.
stoc_join_game
!=
null
)
{
...
@@ -1444,6 +1534,12 @@ export namespace ygopro {
...
@@ -1444,6 +1534,12 @@ export namespace ygopro {
if
(
data
.
stoc_error_msg
!=
null
)
{
if
(
data
.
stoc_error_msg
!=
null
)
{
message
.
stoc_error_msg
=
StocErrorMsg
.
fromObject
(
data
.
stoc_error_msg
);
message
.
stoc_error_msg
=
StocErrorMsg
.
fromObject
(
data
.
stoc_error_msg
);
}
}
if
(
data
.
stoc_change_side
!=
null
)
{
message
.
stoc_change_side
=
StocChangeSide
.
fromObject
(
data
.
stoc_change_side
);
}
if
(
data
.
stoc_waiting_side
!=
null
)
{
message
.
stoc_waiting_side
=
StocWaitingSide
.
fromObject
(
data
.
stoc_waiting_side
);
}
return
message
;
return
message
;
}
}
toObject
()
{
toObject
()
{
...
@@ -1462,6 +1558,8 @@ export namespace ygopro {
...
@@ -1462,6 +1558,8 @@ export namespace ygopro {
stoc_game_msg
?:
ReturnType
<
typeof
StocGameMessage
.
prototype
.
toObject
>
;
stoc_game_msg
?:
ReturnType
<
typeof
StocGameMessage
.
prototype
.
toObject
>
;
stoc_time_limit
?:
ReturnType
<
typeof
StocTimeLimit
.
prototype
.
toObject
>
;
stoc_time_limit
?:
ReturnType
<
typeof
StocTimeLimit
.
prototype
.
toObject
>
;
stoc_error_msg
?:
ReturnType
<
typeof
StocErrorMsg
.
prototype
.
toObject
>
;
stoc_error_msg
?:
ReturnType
<
typeof
StocErrorMsg
.
prototype
.
toObject
>
;
stoc_change_side
?:
ReturnType
<
typeof
StocChangeSide
.
prototype
.
toObject
>
;
stoc_waiting_side
?:
ReturnType
<
typeof
StocWaitingSide
.
prototype
.
toObject
>
;
}
=
{};
}
=
{};
if
(
this
.
stoc_join_game
!=
null
)
{
if
(
this
.
stoc_join_game
!=
null
)
{
data
.
stoc_join_game
=
this
.
stoc_join_game
.
toObject
();
data
.
stoc_join_game
=
this
.
stoc_join_game
.
toObject
();
...
@@ -1505,6 +1603,12 @@ export namespace ygopro {
...
@@ -1505,6 +1603,12 @@ export namespace ygopro {
if
(
this
.
stoc_error_msg
!=
null
)
{
if
(
this
.
stoc_error_msg
!=
null
)
{
data
.
stoc_error_msg
=
this
.
stoc_error_msg
.
toObject
();
data
.
stoc_error_msg
=
this
.
stoc_error_msg
.
toObject
();
}
}
if
(
this
.
stoc_change_side
!=
null
)
{
data
.
stoc_change_side
=
this
.
stoc_change_side
.
toObject
();
}
if
(
this
.
stoc_waiting_side
!=
null
)
{
data
.
stoc_waiting_side
=
this
.
stoc_waiting_side
.
toObject
();
}
return
data
;
return
data
;
}
}
serialize
():
Uint8Array
;
serialize
():
Uint8Array
;
...
@@ -1539,6 +1643,10 @@ export namespace ygopro {
...
@@ -1539,6 +1643,10 @@ export namespace ygopro {
writer
.
writeMessage
(
13
,
this
.
stoc_time_limit
,
()
=>
this
.
stoc_time_limit
.
serialize
(
writer
));
writer
.
writeMessage
(
13
,
this
.
stoc_time_limit
,
()
=>
this
.
stoc_time_limit
.
serialize
(
writer
));
if
(
this
.
has_stoc_error_msg
)
if
(
this
.
has_stoc_error_msg
)
writer
.
writeMessage
(
14
,
this
.
stoc_error_msg
,
()
=>
this
.
stoc_error_msg
.
serialize
(
writer
));
writer
.
writeMessage
(
14
,
this
.
stoc_error_msg
,
()
=>
this
.
stoc_error_msg
.
serialize
(
writer
));
if
(
this
.
has_stoc_change_side
)
writer
.
writeMessage
(
15
,
this
.
stoc_change_side
,
()
=>
this
.
stoc_change_side
.
serialize
(
writer
));
if
(
this
.
has_stoc_waiting_side
)
writer
.
writeMessage
(
16
,
this
.
stoc_waiting_side
,
()
=>
this
.
stoc_waiting_side
.
serialize
(
writer
));
if
(
!
w
)
if
(
!
w
)
return
writer
.
getResultBuffer
();
return
writer
.
getResultBuffer
();
}
}
...
@@ -1590,6 +1698,12 @@ export namespace ygopro {
...
@@ -1590,6 +1698,12 @@ export namespace ygopro {
case
14
:
case
14
:
reader
.
readMessage
(
message
.
stoc_error_msg
,
()
=>
message
.
stoc_error_msg
=
StocErrorMsg
.
deserialize
(
reader
));
reader
.
readMessage
(
message
.
stoc_error_msg
,
()
=>
message
.
stoc_error_msg
=
StocErrorMsg
.
deserialize
(
reader
));
break
;
break
;
case
15
:
reader
.
readMessage
(
message
.
stoc_change_side
,
()
=>
message
.
stoc_change_side
=
StocChangeSide
.
deserialize
(
reader
));
break
;
case
16
:
reader
.
readMessage
(
message
.
stoc_waiting_side
,
()
=>
message
.
stoc_waiting_side
=
StocWaitingSide
.
deserialize
(
reader
));
break
;
default
:
reader
.
skipField
();
default
:
reader
.
skipField
();
}
}
}
}
...
@@ -4719,6 +4833,86 @@ export namespace ygopro {
...
@@ -4719,6 +4833,86 @@ export namespace ygopro {
return
StocDeckCount
.
deserialize
(
bytes
);
return
StocDeckCount
.
deserialize
(
bytes
);
}
}
}
}
export
class
StocChangeSide
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[];
constructor
(
data
?:
any
[]
|
{})
{
super
();
pb_1
.
Message
.
initialize
(
this
,
Array
.
isArray
(
data
)
?
data
:
[],
0
,
-
1
,
[],
this
.
#
one_of_decls
);
if
(
!
Array
.
isArray
(
data
)
&&
typeof
data
==
"
object
"
)
{
}
}
static
fromObject
(
data
:
{}):
StocChangeSide
{
const
message
=
new
StocChangeSide
({});
return
message
;
}
toObject
()
{
const
data
:
{}
=
{};
return
data
;
}
serialize
():
Uint8Array
;
serialize
(
w
:
pb_1
.
BinaryWriter
):
void
;
serialize
(
w
?:
pb_1
.
BinaryWriter
):
Uint8Array
|
void
{
const
writer
=
w
||
new
pb_1
.
BinaryWriter
();
if
(
!
w
)
return
writer
.
getResultBuffer
();
}
static
deserialize
(
bytes
:
Uint8Array
|
pb_1
.
BinaryReader
):
StocChangeSide
{
const
reader
=
bytes
instanceof
pb_1
.
BinaryReader
?
bytes
:
new
pb_1
.
BinaryReader
(
bytes
),
message
=
new
StocChangeSide
();
while
(
reader
.
nextField
())
{
if
(
reader
.
isEndGroup
())
break
;
switch
(
reader
.
getFieldNumber
())
{
default
:
reader
.
skipField
();
}
}
return
message
;
}
serializeBinary
():
Uint8Array
{
return
this
.
serialize
();
}
static
deserializeBinary
(
bytes
:
Uint8Array
):
StocChangeSide
{
return
StocChangeSide
.
deserialize
(
bytes
);
}
}
export
class
StocWaitingSide
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[];
constructor
(
data
?:
any
[]
|
{})
{
super
();
pb_1
.
Message
.
initialize
(
this
,
Array
.
isArray
(
data
)
?
data
:
[],
0
,
-
1
,
[],
this
.
#
one_of_decls
);
if
(
!
Array
.
isArray
(
data
)
&&
typeof
data
==
"
object
"
)
{
}
}
static
fromObject
(
data
:
{}):
StocWaitingSide
{
const
message
=
new
StocWaitingSide
({});
return
message
;
}
toObject
()
{
const
data
:
{}
=
{};
return
data
;
}
serialize
():
Uint8Array
;
serialize
(
w
:
pb_1
.
BinaryWriter
):
void
;
serialize
(
w
?:
pb_1
.
BinaryWriter
):
Uint8Array
|
void
{
const
writer
=
w
||
new
pb_1
.
BinaryWriter
();
if
(
!
w
)
return
writer
.
getResultBuffer
();
}
static
deserialize
(
bytes
:
Uint8Array
|
pb_1
.
BinaryReader
):
StocWaitingSide
{
const
reader
=
bytes
instanceof
pb_1
.
BinaryReader
?
bytes
:
new
pb_1
.
BinaryReader
(
bytes
),
message
=
new
StocWaitingSide
();
while
(
reader
.
nextField
())
{
if
(
reader
.
isEndGroup
())
break
;
switch
(
reader
.
getFieldNumber
())
{
default
:
reader
.
skipField
();
}
}
return
message
;
}
serializeBinary
():
Uint8Array
{
return
this
.
serialize
();
}
static
deserializeBinary
(
bytes
:
Uint8Array
):
StocWaitingSide
{
return
StocWaitingSide
.
deserialize
(
bytes
);
}
}
export
class
StocDuelStart
extends
pb_1
.
Message
{
export
class
StocDuelStart
extends
pb_1
.
Message
{
#
one_of_decls
:
number
[][]
=
[];
#
one_of_decls
:
number
[][]
=
[];
constructor
(
data
?:
any
[]
|
{})
{
constructor
(
data
?:
any
[]
|
{})
{
...
...
src/api/ocgcore/ocgAdapter/adapter.ts
View file @
aafb9b87
import
{
ygopro
}
from
"
../idl/ocgcore
"
;
import
{
ygopro
}
from
"
../idl/ocgcore
"
;
import
{
YgoProPacket
}
from
"
./packet
"
;
import
{
YgoProPacket
}
from
"
./packet
"
;
import
{
import
{
STOC_CHANGE_SIDE
,
STOC_CHAT
,
STOC_CHAT
,
STOC_DECK_COUNT
,
STOC_DECK_COUNT
,
STOC_DUEL_START
,
STOC_DUEL_START
,
...
@@ -15,7 +16,9 @@ import {
...
@@ -15,7 +16,9 @@ import {
STOC_SELECT_TP
,
STOC_SELECT_TP
,
STOC_TIME_LIMIT
,
STOC_TIME_LIMIT
,
STOC_TYPE_CHANGE
,
STOC_TYPE_CHANGE
,
STOC_WAITING_SIDE
,
}
from
"
./protoDecl
"
;
}
from
"
./protoDecl
"
;
import
StocChangeSide
from
"
./stoc/stocChangeSide
"
;
import
StocChat
from
"
./stoc/stocChat
"
;
import
StocChat
from
"
./stoc/stocChat
"
;
import
StocDeckCount
from
"
./stoc/stocDeckCount
"
;
import
StocDeckCount
from
"
./stoc/stocDeckCount
"
;
import
StocDuelStart
from
"
./stoc/stocDuelStart
"
;
import
StocDuelStart
from
"
./stoc/stocDuelStart
"
;
...
@@ -30,6 +33,7 @@ import StocSelectHand from "./stoc/stocSelectHand";
...
@@ -30,6 +33,7 @@ import StocSelectHand from "./stoc/stocSelectHand";
import
StocSelectTp
from
"
./stoc/stocSelectTp
"
;
import
StocSelectTp
from
"
./stoc/stocSelectTp
"
;
import
StocTimeLimit
from
"
./stoc/stocTimeLimit
"
;
import
StocTimeLimit
from
"
./stoc/stocTimeLimit
"
;
import
StocTypeChange
from
"
./stoc/stocTypeChange
"
;
import
StocTypeChange
from
"
./stoc/stocTypeChange
"
;
import
StocWaitingSide
from
"
./stoc/stocWaitingSide
"
;
/*
/*
* 将[`ygoProPacket`]对象转换成[`ygopro.YgoStocMsg`]对象
* 将[`ygoProPacket`]对象转换成[`ygopro.YgoStocMsg`]对象
...
@@ -97,6 +101,14 @@ export function adaptStoc(packet: YgoProPacket): ygopro.YgoStocMsg {
...
@@ -97,6 +101,14 @@ export function adaptStoc(packet: YgoProPacket): ygopro.YgoStocMsg {
pb
=
new
StocErrorMsg
(
packet
).
upcast
();
pb
=
new
StocErrorMsg
(
packet
).
upcast
();
break
;
break
;
}
}
case
STOC_CHANGE_SIDE
:
{
pb
=
new
StocChangeSide
(
packet
).
upcast
();
break
;
}
case
STOC_WAITING_SIDE
:
{
pb
=
new
StocWaitingSide
(
packet
).
upcast
();
break
;
}
default
:
{
default
:
{
break
;
break
;
}
}
...
...
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
aafb9b87
...
@@ -31,6 +31,8 @@ export const STOC_DUEL_START = 21;
...
@@ -31,6 +31,8 @@ export const STOC_DUEL_START = 21;
export
const
STOC_GAME_MSG
=
1
;
export
const
STOC_GAME_MSG
=
1
;
export
const
STOC_TIME_LIMIT
=
24
;
export
const
STOC_TIME_LIMIT
=
24
;
export
const
STOC_ERROR_MSG
=
2
;
export
const
STOC_ERROR_MSG
=
2
;
export
const
STOC_CHANGE_SIDE
=
7
;
export
const
STOC_WAITING_SIDE
=
8
;
export
const
MSG_START
=
4
;
export
const
MSG_START
=
4
;
export
const
MSG_DRAW
=
90
;
export
const
MSG_DRAW
=
90
;
...
...
src/api/ocgcore/ocgAdapter/stoc/stocChangeSide.ts
0 → 100644
View file @
aafb9b87
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
export
default
class
ChangeSide
implements
StocAdapter
{
packet
:
YgoProPacket
;
constructor
(
packet
:
YgoProPacket
)
{
this
.
packet
=
packet
;
}
upcast
():
ygopro
.
YgoStocMsg
{
return
new
ygopro
.
YgoStocMsg
({
stoc_change_side
:
new
ygopro
.
StocChangeSide
({}),
});
}
}
src/api/ocgcore/ocgAdapter/stoc/stocWaitingSide.ts
0 → 100644
View file @
aafb9b87
import
{
ygopro
}
from
"
../../idl/ocgcore
"
;
import
{
StocAdapter
,
YgoProPacket
}
from
"
../packet
"
;
export
default
class
WaitingSide
implements
StocAdapter
{
packet
:
YgoProPacket
;
constructor
(
packet
:
YgoProPacket
)
{
this
.
packet
=
packet
;
}
upcast
():
ygopro
.
YgoStocMsg
{
return
new
ygopro
.
YgoStocMsg
({
stoc_waiting_side
:
new
ygopro
.
StocWaitingSide
({}),
});
}
}
src/service/onSocketMessage.ts
View file @
aafb9b87
...
@@ -20,6 +20,8 @@ import handleHsPlayerEnter from "./room/hsPlayerEnter";
...
@@ -20,6 +20,8 @@ import handleHsPlayerEnter from "./room/hsPlayerEnter";
import
handleHsWatchChange
from
"
./room/hsWatchChange
"
;
import
handleHsWatchChange
from
"
./room/hsWatchChange
"
;
import
handleJoinGame
from
"
./room/joinGame
"
;
import
handleJoinGame
from
"
./room/joinGame
"
;
import
handleTypeChange
from
"
./room/typeChange
"
;
import
handleTypeChange
from
"
./room/typeChange
"
;
import
{
handleChangeSide
}
from
"
./side/changeSide
"
;
import
{
handleWaitingSide
}
from
"
./side/waitingSide
"
;
/*
/*
* 先将从长连接中读取到的二进制数据通过Adapter转成protobuf结构体,
* 先将从长连接中读取到的二进制数据通过Adapter转成protobuf结构体,
...
@@ -93,6 +95,14 @@ export default async function handleSocketMessage(e: MessageEvent) {
...
@@ -93,6 +95,14 @@ export default async function handleSocketMessage(e: MessageEvent) {
await
handleErrorMsg
(
pb
.
stoc_error_msg
);
await
handleErrorMsg
(
pb
.
stoc_error_msg
);
break
;
break
;
}
}
case
"
stoc_change_side
"
:
{
handleChangeSide
(
pb
.
stoc_change_side
);
break
;
}
case
"
stoc_waiting_side
"
:
{
handleWaitingSide
(
pb
.
stoc_waiting_side
);
break
;
}
default
:
{
default
:
{
console
.
log
(
packet
);
console
.
log
(
packet
);
...
...
src/service/side/changeSide.ts
0 → 100644
View file @
aafb9b87
import
{
ygopro
}
from
"
@/api
"
;
export
function
handleChangeSide
(
_
:
ygopro
.
StocChangeSide
)
{
console
.
log
(
"
on StocChangeSide
"
);
}
src/service/side/waitingSide.ts
0 → 100644
View file @
aafb9b87
import
{
ygopro
}
from
"
@/api
"
;
export
function
handleWaitingSide
(
_
:
ygopro
.
StocWaitingSide
)
{
console
.
log
(
"
on StocWaitingSide
"
);
}
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