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
a887c624
Commit
a887c624
authored
Dec 14, 2023
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update class SingleMode
parent
ccdba4e7
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
55 deletions
+43
-55
gframe/single_mode.cpp
gframe/single_mode.cpp
+39
-55
gframe/single_mode.h
gframe/single_mode.h
+4
-0
No files found.
gframe/single_mode.cpp
View file @
a887c624
...
...
@@ -99,7 +99,7 @@ int SingleMode::SinglePlayThread() {
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
dField
);
mainGame
->
gMutex
.
unlock
();
std
::
vector
<
char
>
engineBuffer
;
engineBuffer
.
resize
(
MESSAGE_BUFFER_SIZE
);
engineBuffer
.
resize
(
SIZE_MESSAGE_BUFFER
);
is_closing
=
false
;
is_continuing
=
true
;
int
len
=
get_message
(
pduel
,
(
byte
*
)
engineBuffer
.
data
());
...
...
@@ -774,40 +774,36 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
}
return
is_continuing
;
}
void
SingleMode
::
ReloadLocation
(
int
player
,
int
location
,
int
flag
,
std
::
vector
<
unsigned
char
>&
queryBuffer
)
{
query_field_card
(
pduel
,
player
,
location
,
flag
,
queryBuffer
.
data
(),
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
player
),
location
,
(
char
*
)
queryBuffer
.
data
());
}
void
SingleMode
::
RefreshLocation
(
int
player
,
int
location
,
int
flag
)
{
std
::
vector
<
unsigned
char
>
queryBuffer
;
queryBuffer
.
reserve
(
SIZE_QUERY_BUFFER
);
ReloadLocation
(
player
,
location
,
flag
,
queryBuffer
);
}
void
SingleMode
::
SinglePlayRefresh
(
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
/*int len = */
query_field_card
(
pduel
,
0
,
LOCATION_MZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_MZONE
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_MZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_MZONE
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
0
,
LOCATION_SZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_SZONE
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_SZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_SZONE
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
0
,
LOCATION_HAND
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_HAND
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_HAND
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_HAND
,
(
char
*
)
queryBuffer
);
std
::
vector
<
unsigned
char
>
queryBuffer
;
queryBuffer
.
reserve
(
SIZE_QUERY_BUFFER
);
ReloadLocation
(
0
,
LOCATION_MZONE
,
flag
,
queryBuffer
);
ReloadLocation
(
1
,
LOCATION_MZONE
,
flag
,
queryBuffer
);
ReloadLocation
(
0
,
LOCATION_SZONE
,
flag
,
queryBuffer
);
ReloadLocation
(
1
,
LOCATION_SZONE
,
flag
,
queryBuffer
);
ReloadLocation
(
0
,
LOCATION_HAND
,
flag
,
queryBuffer
);
ReloadLocation
(
1
,
LOCATION_HAND
,
flag
,
queryBuffer
);
}
void
SingleMode
::
SinglePlayRefreshHand
(
int
player
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
/*int len = */
query_field_card
(
pduel
,
player
,
LOCATION_HAND
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
player
),
LOCATION_HAND
,
(
char
*
)
queryBuffer
);
RefreshLocation
(
player
,
LOCATION_HAND
,
flag
);
}
void
SingleMode
::
SinglePlayRefreshGrave
(
int
player
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
/*int len = */
query_field_card
(
pduel
,
player
,
LOCATION_GRAVE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
player
),
LOCATION_GRAVE
,
(
char
*
)
queryBuffer
);
RefreshLocation
(
player
,
LOCATION_GRAVE
,
flag
);
}
void
SingleMode
::
SinglePlayRefreshDeck
(
int
player
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
/*int len = */
query_field_card
(
pduel
,
player
,
LOCATION_DECK
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
player
),
LOCATION_DECK
,
(
char
*
)
queryBuffer
);
RefreshLocation
(
player
,
LOCATION_DECK
,
flag
);
}
void
SingleMode
::
SinglePlayRefreshExtra
(
int
player
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
/*int len = */
query_field_card
(
pduel
,
player
,
LOCATION_EXTRA
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
player
),
LOCATION_EXTRA
,
(
char
*
)
queryBuffer
);
RefreshLocation
(
player
,
LOCATION_EXTRA
,
flag
);
}
void
SingleMode
::
SinglePlayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
)
{
unsigned
char
queryBuffer
[
0x2000
];
...
...
@@ -815,36 +811,24 @@ void SingleMode::SinglePlayRefreshSingle(int player, int location, int sequence,
mainGame
->
dField
.
UpdateCard
(
mainGame
->
LocalPlayer
(
player
),
location
,
sequence
,
(
char
*
)
queryBuffer
);
}
void
SingleMode
::
SinglePlayReload
()
{
unsigned
char
queryBuffer
[
0x2000
];
std
::
vector
<
byte
>
queryBuffer
;
queryBuffer
.
reserve
(
SIZE_QUERY_BUFFER
);
unsigned
int
flag
=
0xffdfff
;
/*int len = */
query_field_card
(
pduel
,
0
,
LOCATION_MZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_MZONE
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_MZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_MZONE
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
0
,
LOCATION_SZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_SZONE
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_SZONE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_SZONE
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
0
,
LOCATION_HAND
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_HAND
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_HAND
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_HAND
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
0
,
LOCATION_DECK
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_DECK
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_DECK
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_DECK
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
0
,
LOCATION_EXTRA
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_EXTRA
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_EXTRA
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_EXTRA
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
0
,
LOCATION_GRAVE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_GRAVE
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_GRAVE
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_GRAVE
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
0
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
0
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
ReloadLocation
(
0
,
LOCATION_MZONE
,
flag
,
queryBuffer
);
ReloadLocation
(
1
,
LOCATION_MZONE
,
flag
,
queryBuffer
);
ReloadLocation
(
0
,
LOCATION_SZONE
,
flag
,
queryBuffer
);
ReloadLocation
(
1
,
LOCATION_SZONE
,
flag
,
queryBuffer
);
ReloadLocation
(
0
,
LOCATION_HAND
,
flag
,
queryBuffer
);
ReloadLocation
(
1
,
LOCATION_HAND
,
flag
,
queryBuffer
);
ReloadLocation
(
0
,
LOCATION_DECK
,
flag
,
queryBuffer
);
ReloadLocation
(
1
,
LOCATION_DECK
,
flag
,
queryBuffer
);
ReloadLocation
(
0
,
LOCATION_EXTRA
,
flag
,
queryBuffer
);
ReloadLocation
(
1
,
LOCATION_EXTRA
,
flag
,
queryBuffer
);
ReloadLocation
(
0
,
LOCATION_GRAVE
,
flag
,
queryBuffer
);
ReloadLocation
(
1
,
LOCATION_GRAVE
,
flag
,
queryBuffer
);
ReloadLocation
(
0
,
LOCATION_REMOVED
,
flag
,
queryBuffer
);
ReloadLocation
(
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
);
}
int
SingleMode
::
MessageHandler
(
intptr_t
fduel
,
int
type
)
{
if
(
!
enable_log
)
...
...
gframe/single_mode.h
View file @
a887c624
#ifndef SINGLE_MODE_H
#define SINGLE_MODE_H
#include <stdint.h>
#include <vector>
#include "replay.h"
namespace
ygo
{
...
...
@@ -18,6 +20,8 @@ public:
static
int
SinglePlayThread
();
static
bool
SinglePlayAnalyze
(
char
*
msg
,
unsigned
int
len
);
inline
static
void
ReloadLocation
(
int
player
,
int
location
,
int
flag
,
std
::
vector
<
unsigned
char
>&
queryBuffer
);
inline
static
void
RefreshLocation
(
int
player
,
int
location
,
int
flag
);
static
void
SinglePlayRefresh
(
int
flag
=
0xf81fff
);
static
void
SinglePlayRefreshHand
(
int
player
,
int
flag
=
0x781fff
);
static
void
SinglePlayRefreshGrave
(
int
player
,
int
flag
=
0x181fff
);
...
...
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