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
e08981e6
Commit
e08981e6
authored
Dec 03, 2022
by
Chunchi Che
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add MsgHint
parent
ade51646
Pipeline
#18342
passed with stages
in 3 minutes
Changes
8
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
4118 additions
and
3278 deletions
+4118
-3278
neos-protobuf
neos-protobuf
+1
-1
src/api/ocgcore/idl/ocgcore.ts
src/api/ocgcore/idl/ocgcore.ts
+3994
-3277
src/api/ocgcore/ocgAdapter/bufferIO.ts
src/api/ocgcore/ocgAdapter/bufferIO.ts
+8
-0
src/api/ocgcore/ocgAdapter/protoDecl.ts
src/api/ocgcore/ocgAdapter/protoDecl.ts
+1
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/hint.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/hint.ts
+90
-0
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
+6
-0
src/service/duel/gameMsg.ts
src/service/duel/gameMsg.ts
+8
-0
src/service/duel/hint.ts
src/service/duel/hint.ts
+10
-0
No files found.
neos-protobuf
@
b1387888
Subproject commit
dcf16e3665ad64a5882b6d84996f642952d38fcc
Subproject commit
b1387888e6e895e186f5dde1ff986f11305a3b84
src/api/ocgcore/idl/ocgcore.ts
View file @
e08981e6
This diff is collapsed.
Click to expand it.
src/api/ocgcore/ocgAdapter/bufferIO.ts
View file @
e08981e6
...
...
@@ -2,6 +2,7 @@ const OFFSET_UINT8 = 1;
const
OFFSET_INT8
=
1
;
const
OFFSET_UINT16
=
2
;
const
OFFSET_UINT32
=
4
;
const
OFFSET_INT32
=
4
;
export
class
BufferReader
{
dataView
:
DataView
;
...
...
@@ -41,4 +42,11 @@ export class BufferReader {
return
ret
;
}
readInt32
():
number
{
const
ret
=
this
.
dataView
.
getInt32
(
this
.
offset
,
this
.
littleEndian
);
this
.
offset
+=
OFFSET_INT32
;
return
ret
;
}
}
src/api/ocgcore/ocgAdapter/protoDecl.ts
View file @
e08981e6
...
...
@@ -27,3 +27,4 @@ export const MSG_START = 4;
export
const
MSG_DRAW
=
90
;
export
const
MSG_NEW_TURN
=
40
;
export
const
MSG_NEW_PHASE
=
41
;
export
const
MSG_HINT
=
2
;
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/hint.ts
0 → 100644
View file @
e08981e6
import
{
ygopro
}
from
"
../../../idl/ocgcore
"
;
import
{
BufferReader
}
from
"
../../bufferIO
"
;
const
LITTLE_ENDIAN
=
true
;
/*
* Msg Hint
*
* @param hintType: char - 提示的类型
* @param hintPlayer: char - 提示的玩家
* @param hintData: int32 - 提示的数据
*
* @usage - 显示提示信息
* */
export
default
(
data
:
Uint8Array
)
=>
{
const
reader
=
new
BufferReader
(
data
,
LITTLE_ENDIAN
);
const
hintCommand
=
reader
.
readUint8
();
const
hintPlayer
=
reader
.
readUint8
();
const
hintData
=
reader
.
readInt32
();
let
hintType
=
ygopro
.
StocGameMessage
.
MsgHint
.
HintType
.
UNKNOWN
;
switch
(
hintCommand
)
{
case
0x01
:
{
// TODO
break
;
}
case
0x02
:
{
// TODO
break
;
}
case
0x03
:
{
hintType
=
ygopro
.
StocGameMessage
.
MsgHint
.
HintType
.
SELECT_LOCATION
;
break
;
}
case
0x04
:
{
hintType
=
ygopro
.
StocGameMessage
.
MsgHint
.
HintType
.
SELECT_EFFECT
;
break
;
}
case
0x05
:
{
// TODO
break
;
}
case
0x06
:
{
hintType
=
ygopro
.
StocGameMessage
.
MsgHint
.
HintType
.
SELECT_RACE
;
break
;
}
case
0x07
:
{
hintType
=
ygopro
.
StocGameMessage
.
MsgHint
.
HintType
.
SELECT_ATTRIBUTE
;
break
;
}
case
0x08
:
{
// TODO
break
;
}
case
0x09
:
{
hintType
=
ygopro
.
StocGameMessage
.
MsgHint
.
HintType
.
SELECT_NUMBER
;
break
;
}
case
0x0a
:
{
// TODO
break
;
}
case
0x0b
:
{
hintType
=
ygopro
.
StocGameMessage
.
MsgHint
.
HintType
.
SELECT_REGION
;
break
;
}
default
:
{
break
;
}
}
return
new
ygopro
.
StocGameMessage
.
MsgHint
({
hint_type
:
hintType
,
player
:
hintPlayer
,
hint_data
:
hintData
,
});
};
src/api/ocgcore/ocgAdapter/stoc/stocGameMsg/mod.ts
View file @
e08981e6
...
...
@@ -10,6 +10,7 @@ import MsgStartAdapter from "./start";
import
MsgDrawAdapter
from
"
./draw
"
;
import
MsgNewTurnAdapter
from
"
./newTurn
"
;
import
MsgNewPhaseAdapter
from
"
./newPhase
"
;
import
MsgHintAdapter
from
"
./hint
"
;
/*
* STOC GameMsg
...
...
@@ -55,6 +56,11 @@ export default class GameMsgAdapter implements StocAdapter {
break
;
}
case
GAME_MSG
.
MSG_HINT
:
{
gameMsg
.
hint
=
MsgHintAdapter
(
gameData
);
break
;
}
default
:
{
console
.
log
(
"
Unhandled GameMessage function=
"
,
func
);
...
...
src/service/duel/gameMsg.ts
View file @
e08981e6
...
...
@@ -4,6 +4,7 @@ import onMsgStart from "./start";
import
onMsgDraw
from
"
./draw
"
;
import
onMsgNewTurn
from
"
./newTurn
"
;
import
onMsgNewPhase
from
"
./newPhase
"
;
import
onMsgHint
from
"
./hint
"
;
export
default
function
handleGameMsg
(
pb
:
ygopro
.
YgoStocMsg
)
{
const
dispatch
=
store
.
dispatch
;
...
...
@@ -38,6 +39,13 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break
;
}
case
"
hint
"
:
{
const
hint
=
msg
.
hint
;
onMsgHint
(
hint
,
dispatch
);
break
;
}
default
:
{
console
.
log
(
"
Unhandled GameMsg=
"
+
msg
.
gameMsg
);
...
...
src/service/duel/hint.ts
0 → 100644
View file @
e08981e6
import
{
ygopro
}
from
"
../../api/ocgcore/idl/ocgcore
"
;
import
{
AppDispatch
}
from
"
../../store
"
;
export
default
(
hint
:
ygopro
.
StocGameMessage
.
MsgHint
,
dispatch
:
AppDispatch
)
=>
{
// TODO
console
.
log
(
hint
);
};
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