Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
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
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
Commits
1ff39351
Commit
1ff39351
authored
Oct 19, 2024
by
Chen Bill
Committed by
GitHub
Oct 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DuelMode change: fix the declaration of Analyze (#2609)
parent
cc9497b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
56 deletions
+55
-56
gframe/network.h
gframe/network.h
+19
-20
gframe/single_duel.h
gframe/single_duel.h
+18
-18
gframe/tag_duel.h
gframe/tag_duel.h
+18
-18
No files found.
gframe/network.h
View file @
1ff39351
...
@@ -208,26 +208,25 @@ inline unsigned int GetPosition(unsigned char* qbuf, int offset) {
...
@@ -208,26 +208,25 @@ inline unsigned int GetPosition(unsigned char* qbuf, int offset) {
class
DuelMode
{
class
DuelMode
{
public:
public:
virtual
~
DuelMode
()
{}
DuelMode
()
=
default
;
virtual
void
Chat
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
{}
virtual
~
DuelMode
()
=
default
;
virtual
void
JoinGame
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
bool
is_creater
)
{}
virtual
void
Chat
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
=
0
;
virtual
void
LeaveGame
(
DuelPlayer
*
dp
)
{}
virtual
void
JoinGame
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
bool
is_creater
)
=
0
;
virtual
void
ToDuelist
(
DuelPlayer
*
dp
)
{}
virtual
void
LeaveGame
(
DuelPlayer
*
dp
)
=
0
;
virtual
void
ToObserver
(
DuelPlayer
*
dp
)
{}
virtual
void
ToDuelist
(
DuelPlayer
*
dp
)
=
0
;
virtual
void
PlayerReady
(
DuelPlayer
*
dp
,
bool
is_ready
)
{}
virtual
void
ToObserver
(
DuelPlayer
*
dp
)
=
0
;
virtual
void
PlayerKick
(
DuelPlayer
*
dp
,
unsigned
char
pos
)
{}
virtual
void
PlayerReady
(
DuelPlayer
*
dp
,
bool
is_ready
)
=
0
;
virtual
void
UpdateDeck
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
{}
virtual
void
PlayerKick
(
DuelPlayer
*
dp
,
unsigned
char
pos
)
=
0
;
virtual
void
StartDuel
(
DuelPlayer
*
dp
)
{}
virtual
void
UpdateDeck
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
=
0
;
virtual
void
HandResult
(
DuelPlayer
*
dp
,
unsigned
char
res
)
{}
virtual
void
StartDuel
(
DuelPlayer
*
dp
)
=
0
;
virtual
void
TPResult
(
DuelPlayer
*
dp
,
unsigned
char
tp
)
{}
virtual
void
HandResult
(
DuelPlayer
*
dp
,
unsigned
char
res
)
=
0
;
virtual
void
Process
()
{}
virtual
void
TPResult
(
DuelPlayer
*
dp
,
unsigned
char
tp
)
=
0
;
virtual
int
Analyze
(
char
*
msgbuffer
,
unsigned
int
len
)
{
virtual
void
Process
()
=
0
;
return
0
;
virtual
int
Analyze
(
unsigned
char
*
msgbuffer
,
unsigned
int
len
)
=
0
;
}
virtual
void
Surrender
(
DuelPlayer
*
dp
)
=
0
;
virtual
void
Surrender
(
DuelPlayer
*
dp
)
{}
virtual
void
GetResponse
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
unsigned
int
len
)
=
0
;
virtual
void
GetResponse
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
unsigned
int
len
)
{}
virtual
void
TimeConfirm
(
DuelPlayer
*
dp
)
=
0
;
virtual
void
TimeConfirm
(
DuelPlayer
*
dp
)
{}
virtual
void
EndDuel
()
=
0
;
virtual
void
EndDuel
()
{}
public:
public:
event
*
etimer
{
nullptr
};
event
*
etimer
{
nullptr
};
...
...
gframe/single_duel.h
View file @
1ff39351
...
@@ -10,24 +10,24 @@ namespace ygo {
...
@@ -10,24 +10,24 @@ namespace ygo {
class
SingleDuel
:
public
DuelMode
{
class
SingleDuel
:
public
DuelMode
{
public:
public:
SingleDuel
(
bool
is_match
);
SingleDuel
(
bool
is_match
);
virtual
~
SingleDuel
()
;
~
SingleDuel
()
override
;
v
irtual
void
Chat
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
;
v
oid
Chat
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
override
;
v
irtual
void
JoinGame
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
bool
is_creater
)
;
v
oid
JoinGame
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
bool
is_creater
)
override
;
v
irtual
void
LeaveGame
(
DuelPlayer
*
dp
)
;
v
oid
LeaveGame
(
DuelPlayer
*
dp
)
override
;
v
irtual
void
ToDuelist
(
DuelPlayer
*
dp
)
;
v
oid
ToDuelist
(
DuelPlayer
*
dp
)
override
;
v
irtual
void
ToObserver
(
DuelPlayer
*
dp
)
;
v
oid
ToObserver
(
DuelPlayer
*
dp
)
override
;
v
irtual
void
PlayerReady
(
DuelPlayer
*
dp
,
bool
ready
)
;
v
oid
PlayerReady
(
DuelPlayer
*
dp
,
bool
ready
)
override
;
v
irtual
void
PlayerKick
(
DuelPlayer
*
dp
,
unsigned
char
pos
)
;
v
oid
PlayerKick
(
DuelPlayer
*
dp
,
unsigned
char
pos
)
override
;
v
irtual
void
UpdateDeck
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
;
v
oid
UpdateDeck
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
override
;
v
irtual
void
StartDuel
(
DuelPlayer
*
dp
)
;
v
oid
StartDuel
(
DuelPlayer
*
dp
)
override
;
v
irtual
void
HandResult
(
DuelPlayer
*
dp
,
unsigned
char
res
)
;
v
oid
HandResult
(
DuelPlayer
*
dp
,
unsigned
char
res
)
override
;
v
irtual
void
TPResult
(
DuelPlayer
*
dp
,
unsigned
char
tp
)
;
v
oid
TPResult
(
DuelPlayer
*
dp
,
unsigned
char
tp
)
override
;
v
irtual
void
Process
()
;
v
oid
Process
()
override
;
v
irtual
void
Surrender
(
DuelPlayer
*
dp
)
;
v
oid
Surrender
(
DuelPlayer
*
dp
)
override
;
virtual
int
Analyze
(
unsigned
char
*
msgbuffer
,
unsigned
int
len
)
;
int
Analyze
(
unsigned
char
*
msgbuffer
,
unsigned
int
len
)
override
;
v
irtual
void
GetResponse
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
unsigned
int
len
)
;
v
oid
GetResponse
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
unsigned
int
len
)
override
;
v
irtual
void
TimeConfirm
(
DuelPlayer
*
dp
)
;
v
oid
TimeConfirm
(
DuelPlayer
*
dp
)
override
;
v
irtual
void
EndDuel
()
;
v
oid
EndDuel
()
override
;
void
DuelEndProc
();
void
DuelEndProc
();
void
WaitforResponse
(
int
playerid
);
void
WaitforResponse
(
int
playerid
);
...
...
gframe/tag_duel.h
View file @
1ff39351
...
@@ -10,24 +10,24 @@ namespace ygo {
...
@@ -10,24 +10,24 @@ namespace ygo {
class
TagDuel
:
public
DuelMode
{
class
TagDuel
:
public
DuelMode
{
public:
public:
TagDuel
();
TagDuel
();
virtual
~
TagDuel
()
;
~
TagDuel
()
override
;
v
irtual
void
Chat
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
;
v
oid
Chat
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
override
;
v
irtual
void
JoinGame
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
bool
is_creater
)
;
v
oid
JoinGame
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
bool
is_creater
)
override
;
v
irtual
void
LeaveGame
(
DuelPlayer
*
dp
)
;
v
oid
LeaveGame
(
DuelPlayer
*
dp
)
override
;
v
irtual
void
ToDuelist
(
DuelPlayer
*
dp
)
;
v
oid
ToDuelist
(
DuelPlayer
*
dp
)
override
;
v
irtual
void
ToObserver
(
DuelPlayer
*
dp
)
;
v
oid
ToObserver
(
DuelPlayer
*
dp
)
override
;
v
irtual
void
PlayerReady
(
DuelPlayer
*
dp
,
bool
ready
)
;
v
oid
PlayerReady
(
DuelPlayer
*
dp
,
bool
ready
)
override
;
v
irtual
void
PlayerKick
(
DuelPlayer
*
dp
,
unsigned
char
pos
)
;
v
oid
PlayerKick
(
DuelPlayer
*
dp
,
unsigned
char
pos
)
override
;
v
irtual
void
UpdateDeck
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
;
v
oid
UpdateDeck
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
int
len
)
override
;
v
irtual
void
StartDuel
(
DuelPlayer
*
dp
)
;
v
oid
StartDuel
(
DuelPlayer
*
dp
)
override
;
v
irtual
void
HandResult
(
DuelPlayer
*
dp
,
unsigned
char
res
)
;
v
oid
HandResult
(
DuelPlayer
*
dp
,
unsigned
char
res
)
override
;
v
irtual
void
TPResult
(
DuelPlayer
*
dp
,
unsigned
char
tp
)
;
v
oid
TPResult
(
DuelPlayer
*
dp
,
unsigned
char
tp
)
override
;
v
irtual
void
Process
()
;
v
oid
Process
()
override
;
v
irtual
void
Surrender
(
DuelPlayer
*
dp
)
;
v
oid
Surrender
(
DuelPlayer
*
dp
)
override
;
virtual
int
Analyze
(
unsigned
char
*
msgbuffer
,
unsigned
int
len
)
;
int
Analyze
(
unsigned
char
*
msgbuffer
,
unsigned
int
len
)
override
;
v
irtual
void
GetResponse
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
unsigned
int
len
)
;
v
oid
GetResponse
(
DuelPlayer
*
dp
,
unsigned
char
*
pdata
,
unsigned
int
len
)
override
;
v
irtual
void
TimeConfirm
(
DuelPlayer
*
dp
)
;
v
oid
TimeConfirm
(
DuelPlayer
*
dp
)
override
;
v
irtual
void
EndDuel
()
;
v
oid
EndDuel
()
override
;
void
DuelEndProc
();
void
DuelEndProc
();
void
WaitforResponse
(
int
playerid
);
void
WaitforResponse
(
int
playerid
);
...
...
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