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
c183ae29
Commit
c183ae29
authored
Mar 23, 2023
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add select sum adapter
parent
82f06f20
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
98 additions
and
0 deletions
+98
-0
src/api/ocgcore/ocgAdapter/bufferIO.ts
src/api/ocgcore/ocgAdapter/bufferIO.ts
+12
-0
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+1
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+6
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectSum.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectSum.ts
+66
-0
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+6
-0
src/service/duel/selectSum.ts
src/service/duel/selectSum.ts
+7
-0
No files found.
src/api/ocgcore/ocgAdapter/bufferIO.ts
View file @
c183ae29
...
...
@@ -49,4 +49,16 @@ export class BufferReaderExt {
});
}
}
readCardShortLocation
():
ygopro
.
CardLocation
{
const
controler
=
this
.
inner
.
readUint8
();
const
location
=
this
.
inner
.
readUint8
();
const
sequence
=
this
.
inner
.
readUint8
();
return
new
ygopro
.
CardLocation
({
controler
,
location
:
numberToCardZone
(
location
),
sequence
,
});
}
}
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
c183ae29
...
...
@@ -51,3 +51,4 @@ export const MSG_WIN = 5;
export
const
MSG_WAITING
=
3
;
export
const
MSG_UPDATE_DATA
=
6
;
export
const
MSG_RELOAD_FIELD
=
162
;
export
const
MSG_SELECT_SUM
=
23
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
c183ae29
...
...
@@ -27,6 +27,7 @@ import MsgRecover from "./recover";
import
MsgWin
from
"
./win
"
;
import
MsgUpdateDataAdapter
from
"
./updateData
"
;
import
MsgReloadFieldAdapter
from
"
./reloadField
"
;
import
MsgSelectSum
from
"
./selectSum
"
;
import
PENETRATE
from
"
./penetrate
"
;
/*
...
...
@@ -160,6 +161,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
}
case
GAME_MSG
.
MSG_SELECT_SUM
:
{
gameMsg
.
select_sum
=
MsgSelectSum
(
gameData
);
break
;
}
default
:
{
gameMsg
.
unimplemented
=
new
ygopro
.
StocGameMessage
.
MsgUnimplemented
({
command
:
func
,
...
...
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/selectSum.ts
0 → 100644
View file @
c183ae29
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReaderExt
}
from
"
../../bufferIO
"
;
import
MsgSelectSum
=
ygopro
.
StocGameMessage
.
MsgSelectSum
;
/*
* Msg Select Sum
*
* @param -
*
* @usage -
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReaderExt
(
data
);
const
overflow
=
reader
.
inner
.
readUint8
();
const
player
=
reader
.
inner
.
readUint8
();
const
level
=
reader
.
inner
.
readInt32
();
const
min
=
reader
.
inner
.
readUint8
();
const
max
=
reader
.
inner
.
readUint8
();
const
msg
=
new
MsgSelectSum
({
overflow
,
player
,
level_sum
:
level
,
min
,
max
,
must_select_cards
:
[],
selectable_cards
:
[],
});
const
mustCount
=
reader
.
inner
.
readUint8
();
for
(
let
i
=
0
;
i
<
mustCount
;
i
++
)
{
const
code
=
reader
.
inner
.
readInt32
();
const
location
=
reader
.
readCardShortLocation
();
const
para
=
reader
.
inner
.
readInt32
();
msg
.
must_select_cards
.
push
(
new
MsgSelectSum
.
Info
({
code
,
location
,
level1
:
para
&
0xffff
,
level2
:
para
>>
16
,
response
:
i
,
})
);
}
const
selectAbleCount
=
reader
.
inner
.
readUint8
();
for
(
let
i
=
0
;
i
<
selectAbleCount
;
i
++
)
{
const
code
=
reader
.
inner
.
readInt32
();
const
location
=
reader
.
readCardShortLocation
();
const
para
=
reader
.
inner
.
readInt32
();
msg
.
selectable_cards
.
push
(
new
MsgSelectSum
.
Info
({
code
,
location
,
level1
:
para
&
0xffff
,
level2
:
para
>>
16
,
response
:
i
,
})
);
}
return
msg
;
};
src/service/duel/gameMsg.ts
View file @
c183ae29
...
...
@@ -24,6 +24,7 @@ import onMsgWait from "./wait";
import
onUnimplemented
from
"
./unimplemented
"
;
import
onMsgUpdateData
from
"
./updateData
"
;
import
onMsgReloadField
from
"
./reloadField
"
;
import
onMsgSelectSum
from
"
./selectSum
"
;
import
{
setWaiting
}
from
"
../../reducers/duel/mod
"
;
const
ActiveList
=
[
...
...
@@ -163,6 +164,11 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
select_sum
"
:
{
onMsgSelectSum
(
msg
.
select_sum
,
dispatch
);
break
;
}
case
"
unimplemented
"
:
{
onUnimplemented
(
msg
.
unimplemented
,
dispatch
);
...
...
src/service/duel/selectSum.ts
0 → 100644
View file @
c183ae29
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
import
MsgSelectSum
=
ygopro
.
StocGameMessage
.
MsgSelectSum
;
export
default
(
selectSum
:
MsgSelectSum
,
dispatch
:
AppDispatch
)
=>
{
console
.
log
(
selectSum
);
};
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