Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-proxy
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
MyCard
ygopro-proxy
Commits
7056b601
Commit
7056b601
authored
Oct 07, 2022
by
Chunchi Che
Committed by
GitHub
Oct 07, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14 from DarkNeos/dev
Dev
parents
a72dc603
40d7c419
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
362 additions
and
155 deletions
+362
-155
DarkNeos/transform.go
DarkNeos/transform.go
+52
-2
DarkNeos/ygopropb/ocgcore.pb.go
DarkNeos/ygopropb/ocgcore.pb.go
+309
-152
neos-protobuf
neos-protobuf
+1
-1
No files found.
DarkNeos/transform.go
View file @
7056b601
...
...
@@ -25,6 +25,7 @@ const (
CtosProtoPlayerInfo
=
16
CtosProtoJoinGame
=
18
CtosHsReady
=
34
CtosHsStart
=
37
StocJoinGame
=
18
StocTypeChange
=
19
...
...
@@ -114,6 +115,8 @@ func Transform(src []byte, tranformType int, ctx *util.Context) ([]byte, error)
packet
=
(
*
pCtosUpdateDeck
)(
message
.
GetCtosUpdateDeck
())
.
Pb2Packet
()
case
*
(
ygopropb
.
YgoCtosMsg_CtosHsReady
)
:
packet
=
(
*
pCtosHsReady
)(
message
.
GetCtosHsReady
())
.
Pb2Packet
()
case
*
(
ygopropb
.
YgoCtosMsg_CtosHsStart
)
:
packet
=
(
*
pCtosHsStart
)(
message
.
GetCtosHsStart
())
.
Packet2Pb
()
default
:
return
nil
,
errors
.
New
(
COMPONENT
+
"Unhandled YgoCtosMsg type"
)
}
...
...
@@ -228,6 +231,17 @@ func (_ *pCtosHsReady) Pb2Packet() YgoPacket {
}
}
type
pCtosHsStart
ygopropb
.
CtosHsStart
// empty message
func
(
_
*
pCtosHsStart
)
Packet2Pb
()
YgoPacket
{
return
YgoPacket
{
PacketLen
:
1
,
Proto
:
CtosHsStart
,
Exdata
:
make
([]
byte
,
0
),
}
}
// +++++ Server To Client +++++
type
server2Client
interface
{
...
...
@@ -299,7 +313,7 @@ type pStocHsPlayerEnter struct{}
func
(
_
pStocHsPlayerEnter
)
Packet2Pb
(
pkt
YgoPacket
)
ygopropb
.
YgoStocMsg
{
name_max
:=
util
.
UTF16_BUFFER_MAX_LEN
*
2
name
:=
util
.
Utf16BufferToStr
(
pkt
.
Exdata
[
:
name_max
])
pos
:=
pkt
.
Exdata
[
name_max
]
pos
:=
pkt
.
Exdata
[
name_max
]
&
0x3
// todo: make sure
msg
:=
ygopropb
.
YgoStocMsg_StocHsPlayerEnter
{
StocHsPlayerEnter
:
&
ygopropb
.
StocHsPlayerEnter
{
...
...
@@ -316,9 +330,45 @@ func (_ pStocHsPlayerEnter) Packet2Pb(pkt YgoPacket) ygopropb.YgoStocMsg {
type
pStocTypeChage
struct
{}
func
(
_
pStocTypeChage
)
Packet2Pb
(
pkt
YgoPacket
)
ygopropb
.
YgoStocMsg
{
type_
:=
pkt
.
Exdata
[
0
]
isHost
:=
((
type_
>>
4
)
&
0xf
)
!=
0
var
selfType
ygopropb
.
StocTypeChange_SelfType
switch
type_
&
0xf
{
case
0
:
{
selfType
=
ygopropb
.
StocTypeChange_PLAYER1
}
case
1
:
{
selfType
=
ygopropb
.
StocTypeChange_PLAYER2
}
case
2
:
{
selfType
=
ygopropb
.
StocTypeChange_PLAYER3
}
case
3
:
{
selfType
=
ygopropb
.
StocTypeChange_PLAYER4
}
case
4
:
{
selfType
=
ygopropb
.
StocTypeChange_PLAYER5
}
case
5
:
{
selfType
=
ygopropb
.
StocTypeChange_PLAYER6
}
default
:
{
selfType
=
ygopropb
.
StocTypeChange_UNKNOWN
}
}
msg
:=
ygopropb
.
YgoStocMsg_StocTypeChange
{
StocTypeChange
:
&
ygopropb
.
StocTypeChange
{
Type
:
int32
(
pkt
.
Exdata
[
0
]),
SelfType
:
selfType
,
IsHost
:
isHost
,
},
}
...
...
DarkNeos/ygopropb/ocgcore.pb.go
View file @
7056b601
This diff is collapsed.
Click to expand it.
neos-protobuf
@
ed6ff3b1
Subproject commit
7b87e8a035a016c44d551f85c1ce0a719b507b8f
Subproject commit
ed6ff3b15aaa74e35feb40d33aa518b52a275402
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