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
49652094
Commit
49652094
authored
Mar 25, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handle MSG_ADD_COUNTER and MSG_REMOVE_COUNTER
parent
a815c8b9
Pipeline
#20929
passed with stages
in 18 minutes and 4 seconds
Changes
6
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
75 additions
and
0 deletions
+75
-0
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+2
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/addCounter.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/addCounter.ts
+24
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+12
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/removeCounter.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/removeCounter.ts
+24
-0
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+6
-0
src/service/duel/updateCounter.ts
src/service/duel/updateCounter.ts
+7
-0
No files found.
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
49652094
...
...
@@ -52,3 +52,5 @@ export const MSG_WAITING = 3;
export
const
MSG_UPDATE_DATA
=
6
;
export
const
MSG_RELOAD_FIELD
=
162
;
export
const
MSG_SELECT_SUM
=
23
;
export
const
MSG_ADD_COUNTER
=
101
;
export
const
MSG_REMOVE_COUNTER
=
102
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/addCounter.ts
0 → 100644
View file @
49652094
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReaderExt
}
from
"
../../bufferIO
"
;
import
MsgUpdateCounter
=
ygopro
.
StocGameMessage
.
MsgUpdateCounter
;
/*
* Msg Add Counter
* @param - TODO
*
* @usage - TODO
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReaderExt
(
data
);
const
counterType
=
reader
.
inner
.
readUint16
();
const
location
=
reader
.
readCardShortLocation
();
const
count
=
reader
.
inner
.
readUint16
();
return
new
MsgUpdateCounter
({
counter_type
:
counterType
,
location
,
action_type
:
MsgUpdateCounter
.
ActionType
.
ADD
,
count
,
});
};
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
49652094
...
...
@@ -28,6 +28,8 @@ import MsgWin from "./win";
import
MsgUpdateDataAdapter
from
"
./updateData
"
;
import
MsgReloadFieldAdapter
from
"
./reloadField
"
;
import
MsgSelectSum
from
"
./selectSum
"
;
import
MsgAddCounter
from
"
./addCounter
"
;
import
MsgRemoveCounter
from
"
./removeCounter
"
;
import
PENETRATE
from
"
./penetrate
"
;
/*
...
...
@@ -166,6 +168,16 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
}
case
GAME_MSG
.
MSG_ADD_COUNTER
:
{
gameMsg
.
update_counter
=
MsgAddCounter
(
gameData
);
break
;
}
case
GAME_MSG
.
MSG_REMOVE_COUNTER
:
{
gameMsg
.
update_counter
=
MsgRemoveCounter
(
gameData
);
break
;
}
default
:
{
gameMsg
.
unimplemented
=
new
ygopro
.
StocGameMessage
.
MsgUnimplemented
({
command
:
func
,
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/removeCounter.ts
0 → 100644
View file @
49652094
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReaderExt
}
from
"
../../bufferIO
"
;
import
MsgUpdateCounter
=
ygopro
.
StocGameMessage
.
MsgUpdateCounter
;
/*
* Msg Remove Counter
* @param - TODO
*
* @usage - TODO
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReaderExt
(
data
);
const
counterType
=
reader
.
inner
.
readUint16
();
const
location
=
reader
.
readCardShortLocation
();
const
count
=
reader
.
inner
.
readUint16
();
return
new
MsgUpdateCounter
({
counter_type
:
counterType
,
location
,
action_type
:
MsgUpdateCounter
.
ActionType
.
REMOVE
,
count
,
});
};
src/service/duel/gameMsg.ts
View file @
49652094
...
...
@@ -26,6 +26,7 @@ import onMsgUpdateData from "./updateData";
import
onMsgReloadField
from
"
./reloadField
"
;
import
onMsgSelectSum
from
"
./selectSum
"
;
import
onMsgSelectTribute
from
"
./selectTribute
"
;
import
onMsgUpdateCounter
from
"
./updateCounter
"
;
import
{
setWaiting
}
from
"
../../reducers/duel/mod
"
;
const
ActiveList
=
[
...
...
@@ -175,6 +176,11 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
update_counter
"
:
{
onMsgUpdateCounter
(
msg
.
update_counter
,
dispatch
);
break
;
}
case
"
unimplemented
"
:
{
onUnimplemented
(
msg
.
unimplemented
,
dispatch
);
...
...
src/service/duel/updateCounter.ts
0 → 100644
View file @
49652094
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
MsgUpdateCounter
=
ygopro
.
StocGameMessage
.
MsgUpdateCounter
;
export
default
(
updateCounter
:
MsgUpdateCounter
,
dispatch
:
AppDispatch
)
=>
{
console
.
log
(
updateCounter
);
};
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