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
b4387a80
Commit
b4387a80
authored
May 13, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'server-develop' into server
parents
b29b0807
7640f72b
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
773 additions
and
743 deletions
+773
-743
gframe/bufferio.h
gframe/bufferio.h
+7
-8
gframe/client_card.cpp
gframe/client_card.cpp
+8
-8
gframe/client_field.cpp
gframe/client_field.cpp
+5
-5
gframe/data_manager.cpp
gframe/data_manager.cpp
+5
-5
gframe/data_manager.h
gframe/data_manager.h
+5
-3
gframe/deck_con.h
gframe/deck_con.h
+37
-37
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+1
-1
gframe/deck_manager.h
gframe/deck_manager.h
+1
-1
gframe/duelclient.cpp
gframe/duelclient.cpp
+375
-362
gframe/event_handler.cpp
gframe/event_handler.cpp
+1
-0
gframe/game.cpp
gframe/game.cpp
+15
-13
gframe/game.h
gframe/game.h
+3
-2
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+62
-59
gframe/single_duel.cpp
gframe/single_duel.cpp
+85
-85
gframe/single_mode.cpp
gframe/single_mode.cpp
+63
-62
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+90
-90
premake5.lua
premake5.lua
+2
-2
strings.conf
strings.conf
+8
-0
No files found.
gframe/bufferio.h
View file @
b4387a80
#ifndef BUFFERIO_H
#define BUFFERIO_H
#ifdef _MSC_VER
#pragma warning(disable: 4244)
#endif
class
BufferIO
{
public:
...
...
@@ -53,7 +50,7 @@ public:
inline
static
int
CopyWStr
(
T1
*
src
,
T2
*
pstr
,
int
bufsize
)
{
int
l
=
0
;
while
(
src
[
l
]
&&
l
<
bufsize
-
1
)
{
pstr
[
l
]
=
src
[
l
];
pstr
[
l
]
=
(
T2
)
src
[
l
];
l
++
;
}
pstr
[
l
]
=
0
;
...
...
@@ -63,7 +60,7 @@ public:
inline
static
int
CopyWStrRef
(
T1
*
src
,
T2
*&
pstr
,
int
bufsize
)
{
int
l
=
0
;
while
(
src
[
l
]
&&
l
<
bufsize
-
1
)
{
pstr
[
l
]
=
src
[
l
];
pstr
[
l
]
=
(
T2
)
src
[
l
];
l
++
;
}
pstr
+=
l
;
...
...
@@ -75,7 +72,7 @@ public:
char
*
pstr
=
str
;
while
(
*
wsrc
!=
0
)
{
if
(
*
wsrc
<
0x80
)
{
*
str
=
*
wsrc
;
*
str
=
(
char
)
*
wsrc
;
++
str
;
}
else
if
(
*
wsrc
<
0x800
)
{
str
[
0
]
=
((
*
wsrc
>>
6
)
&
0x1f
)
|
0xc0
;
...
...
@@ -141,12 +138,14 @@ public:
return
wp
-
wstr
;
}
static
int
GetVal
(
const
wchar_t
*
pstr
)
{
int
ret
=
0
;
unsigned
int
ret
=
0
;
while
(
*
pstr
>=
L'0'
&&
*
pstr
<=
L'9'
)
{
ret
=
ret
*
10
+
(
*
pstr
-
L'0'
);
pstr
++
;
}
return
ret
;
if
(
*
pstr
==
0
)
return
(
int
)
ret
;
return
0
;
}
};
...
...
gframe/client_card.cpp
View file @
b4387a80
...
...
@@ -113,10 +113,10 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
if
(
flag
&
QUERY_REASON_CARD
)
buf
+=
4
;
if
(
flag
&
QUERY_EQUIP_CARD
)
{
int
c
=
BufferIO
::
ReadInt8
(
buf
);
int
l
=
BufferIO
::
Read
Int8
(
buf
);
int
s
=
BufferIO
::
ReadInt8
(
buf
);
BufferIO
::
ReadInt8
(
buf
);
int
c
=
BufferIO
::
Read
U
Int8
(
buf
);
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
buf
);
int
s
=
BufferIO
::
Read
U
Int8
(
buf
);
BufferIO
::
Read
U
Int8
(
buf
);
ClientCard
*
ecard
=
mainGame
->
dField
.
GetCard
(
mainGame
->
LocalPlayer
(
c
),
l
,
s
);
if
(
ecard
)
{
equipTarget
=
ecard
;
...
...
@@ -126,10 +126,10 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
if
(
flag
&
QUERY_TARGET_CARD
)
{
int
count
=
BufferIO
::
ReadInt32
(
buf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
c
=
BufferIO
::
ReadInt8
(
buf
);
int
l
=
BufferIO
::
Read
Int8
(
buf
);
int
s
=
BufferIO
::
ReadInt8
(
buf
);
BufferIO
::
ReadInt8
(
buf
);
int
c
=
BufferIO
::
Read
U
Int8
(
buf
);
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
buf
);
int
s
=
BufferIO
::
Read
U
Int8
(
buf
);
BufferIO
::
Read
U
Int8
(
buf
);
ClientCard
*
tcard
=
mainGame
->
dField
.
GetCard
(
mainGame
->
LocalPlayer
(
c
),
l
,
s
);
if
(
tcard
)
{
cardTarget
.
insert
(
tcard
);
...
...
gframe/client_field.cpp
View file @
b4387a80
...
...
@@ -197,7 +197,7 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
case
LOCATION_DECK
:
{
if
(
sequence
!=
0
||
deck
[
controler
].
size
()
==
0
)
{
deck
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
deck
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
deck
[
controler
].
size
()
-
1
)
;
}
else
{
deck
[
controler
].
push_back
(
0
);
for
(
int
i
=
deck
[
controler
].
size
()
-
1
;
i
>
0
;
--
i
)
{
...
...
@@ -212,7 +212,7 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
}
case
LOCATION_HAND
:
{
hand
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
hand
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
hand
[
controler
].
size
()
-
1
)
;
break
;
}
case
LOCATION_MZONE
:
{
...
...
@@ -225,18 +225,18 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
}
case
LOCATION_GRAVE
:
{
grave
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
grave
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
grave
[
controler
].
size
()
-
1
)
;
break
;
}
case
LOCATION_REMOVED
:
{
remove
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
remove
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
remove
[
controler
].
size
()
-
1
)
;
break
;
}
case
LOCATION_EXTRA
:
{
if
(
extra_p_count
[
controler
]
==
0
||
(
pcard
->
position
&
POS_FACEUP
))
{
extra
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
extra
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
extra
[
controler
].
size
()
-
1
)
;
}
else
{
extra
[
controler
].
push_back
(
0
);
int
p
=
extra
[
controler
].
size
()
-
extra_p_count
[
controler
]
-
1
;
...
...
gframe/data_manager.cpp
View file @
b4387a80
...
...
@@ -238,7 +238,7 @@ code_pointer DataManager::GetCodePointer(unsigned int code) const {
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
return
_strings
.
find
(
code
);
}
bool
DataManager
::
GetString
(
int
code
,
CardString
*
pStr
)
{
bool
DataManager
::
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
{
pStr
->
name
=
unknown_string
;
...
...
@@ -248,7 +248,7 @@ bool DataManager::GetString(int code, CardString* pStr) {
*
pStr
=
csit
->
second
;
return
true
;
}
const
wchar_t
*
DataManager
::
GetName
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetName
(
unsigned
int
code
)
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
...
...
@@ -256,7 +256,7 @@ const wchar_t* DataManager::GetName(int code) {
return
csit
->
second
.
name
.
c_str
();
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetText
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetText
(
unsigned
int
code
)
{
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
...
...
@@ -265,7 +265,7 @@ const wchar_t* DataManager::GetText(int code) {
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
{
if
(
strCode
<
10000u
)
if
(
strCode
<
(
MIN_CARD_ID
<<
4
)
)
return
GetSysString
(
strCode
);
unsigned
int
code
=
(
strCode
>>
4
)
&
0x0fffffff
;
unsigned
int
offset
=
strCode
&
0xf
;
...
...
@@ -277,7 +277,7 @@ const wchar_t* DataManager::GetDesc(unsigned int strCode) {
return
unknown_string
;
}
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
{
if
(
code
<
0
||
code
>=
2048
)
if
(
code
<
0
||
code
>
MAX_STRING_ID
)
return
unknown_string
;
auto
csit
=
_sysStrings
.
find
(
code
);
if
(
csit
==
_sysStrings
.
end
())
...
...
gframe/data_manager.h
View file @
b4387a80
...
...
@@ -10,6 +10,8 @@
#include <unordered_map>
namespace
ygo
{
constexpr
int
MAX_STRING_ID
=
0x7ff
;
constexpr
unsigned
int
MIN_CARD_ID
=
(
unsigned
int
)(
MAX_STRING_ID
+
1
)
>>
4
;
class
DataManager
{
public:
...
...
@@ -28,9 +30,9 @@ public:
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
);
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
bool
GetString
(
int
code
,
CardString
*
pStr
);
const
wchar_t
*
GetName
(
int
code
);
const
wchar_t
*
GetText
(
int
code
);
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
);
const
wchar_t
*
GetName
(
unsigned
int
code
);
const
wchar_t
*
GetText
(
unsigned
int
code
);
const
wchar_t
*
GetDesc
(
unsigned
int
strCode
);
const
wchar_t
*
GetSysString
(
int
code
);
const
wchar_t
*
GetVictoryString
(
int
code
);
...
...
gframe/deck_con.h
View file @
b4387a80
...
...
@@ -41,49 +41,49 @@ public:
void
pop_side
(
int
seq
);
bool
check_limit
(
code_pointer
pointer
);
long
long
filter_effect
;
unsigned
int
filter_type
;
unsigned
int
filter_type2
;
unsigned
int
filter_attrib
;
unsigned
int
filter_race
;
unsigned
int
filter_atktype
;
int
filter_atk
;
unsigned
int
filter_deftype
;
int
filter_def
;
unsigned
int
filter_lvtype
;
unsigned
int
filter_lv
;
unsigned
int
filter_scltype
;
unsigned
int
filter_scl
;
unsigned
int
filter_marks
;
int
filter_lm
;
long
long
filter_effect
{}
;
unsigned
int
filter_type
{}
;
unsigned
int
filter_type2
{}
;
unsigned
int
filter_attrib
{}
;
unsigned
int
filter_race
{}
;
unsigned
int
filter_atktype
{}
;
int
filter_atk
{}
;
unsigned
int
filter_deftype
{}
;
int
filter_def
{}
;
unsigned
int
filter_lvtype
{}
;
unsigned
int
filter_lv
{}
;
unsigned
int
filter_scltype
{}
;
unsigned
int
filter_scl
{}
;
unsigned
int
filter_marks
{}
;
int
filter_lm
{}
;
position2di
mouse_pos
;
int
hovered_code
;
int
hovered_pos
;
int
hovered_seq
;
int
is_lastcard
;
int
click_pos
;
bool
is_draging
;
bool
is_starting_dragging
;
int
dragx
;
int
dragy
;
int
bigcard_code
;
float
bigcard_zoom
;
size_t
pre_mainc
;
size_t
pre_extrac
;
size_t
pre_sidec
;
int
hovered_code
{}
;
int
hovered_pos
{}
;
int
hovered_seq
{
-
1
}
;
int
is_lastcard
{}
;
int
click_pos
{}
;
bool
is_draging
{}
;
bool
is_starting_dragging
{}
;
int
dragx
{}
;
int
dragy
{}
;
int
bigcard_code
{}
;
float
bigcard_zoom
{}
;
size_t
pre_mainc
{}
;
size_t
pre_extrac
{}
;
size_t
pre_sidec
{}
;
code_pointer
draging_pointer
;
int
prev_category
;
int
prev_deck
;
s32
prev_operation
;
int
prev_sel
;
bool
is_modified
;
bool
readonly
;
bool
showing_pack
;
int
prev_category
{}
;
int
prev_deck
{}
;
s32
prev_operation
{}
;
int
prev_sel
{
-
1
}
;
bool
is_modified
{}
;
bool
readonly
{}
;
bool
showing_pack
{}
;
mt19937
rnd
;
const
std
::
unordered_map
<
int
,
int
>*
filterList
;
std
::
vector
<
code_pointer
>
results
;
wchar_t
result_string
[
8
];
wchar_t
result_string
[
8
]
{}
;
std
::
vector
<
std
::
wstring
>
expansionPacks
;
};
...
...
gframe/deck_manager.cpp
View file @
b4387a80
...
...
@@ -7,7 +7,7 @@
namespace
ygo
{
#ifndef YGOPRO_SERVER_MODE
char
DeckManager
::
deckBuffer
[
0x10000
];
char
DeckManager
::
deckBuffer
[
0x10000
]
{}
;
#endif
DeckManager
deckManager
;
...
...
gframe/deck_manager.h
View file @
b4387a80
...
...
@@ -12,7 +12,7 @@
namespace
ygo
{
struct
LFList
{
unsigned
int
hash
;
unsigned
int
hash
{}
;
std
::
wstring
listName
;
std
::
unordered_map
<
int
,
int
>
content
;
};
...
...
gframe/duelclient.cpp
View file @
b4387a80
This diff is collapsed.
Click to expand it.
gframe/event_handler.cpp
View file @
b4387a80
...
...
@@ -127,6 +127,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mainGame
->
dInfo
.
player_type
==
7
)
{
DuelClient
::
StopClient
();
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
CloseDuelWindow
();
...
...
gframe/game.cpp
View file @
b4387a80
...
...
@@ -36,6 +36,7 @@ Game* mainGame;
#ifndef YGOPRO_SERVER_MODE
void
DuelInfo
::
Clear
()
{
isStarted
=
false
;
isInDuel
=
false
;
isFinished
=
false
;
isReplay
=
false
;
isReplaySkiping
=
false
;
...
...
@@ -844,7 +845,7 @@ bool Game::Initialize() {
cbCardType
->
addItem
(
dataManager
.
GetSysString
(
1312
));
cbCardType
->
addItem
(
dataManager
.
GetSysString
(
1313
));
cbCardType
->
addItem
(
dataManager
.
GetSysString
(
1314
));
cbCardType2
=
env
->
addComboBox
(
rect
<
s32
>
(
125
,
25
/
6
,
200
,
20
+
25
/
6
),
wFilter
,
COMBOBOX_SECONDTYPE
);
cbCardType2
=
env
->
addComboBox
(
rect
<
s32
>
(
125
,
25
/
6
,
195
,
20
+
25
/
6
),
wFilter
,
COMBOBOX_SECONDTYPE
);
cbCardType2
->
setMaxSelectionRows
(
10
);
cbCardType2
->
addItem
(
dataManager
.
GetSysString
(
1310
),
0
);
stLimit
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1315
),
rect
<
s32
>
(
205
,
2
+
25
/
6
,
280
,
22
+
25
/
6
),
false
,
false
,
wFilter
);
...
...
@@ -860,13 +861,13 @@ bool Game::Initialize() {
cbLimit
->
addItem
(
dataManager
.
GetSysString
(
1484
));
cbLimit
->
addItem
(
dataManager
.
GetSysString
(
1485
));
stAttribute
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1319
),
rect
<
s32
>
(
10
,
22
+
50
/
6
,
70
,
42
+
50
/
6
),
false
,
false
,
wFilter
);
cbAttribute
=
env
->
addComboBox
(
rect
<
s32
>
(
60
,
20
+
50
/
6
,
19
0
,
40
+
50
/
6
),
wFilter
,
COMBOBOX_ATTRIBUTE
);
cbAttribute
=
env
->
addComboBox
(
rect
<
s32
>
(
60
,
20
+
50
/
6
,
19
5
,
40
+
50
/
6
),
wFilter
,
COMBOBOX_ATTRIBUTE
);
cbAttribute
->
setMaxSelectionRows
(
10
);
cbAttribute
->
addItem
(
dataManager
.
GetSysString
(
1310
),
0
);
for
(
int
filter
=
0x1
;
filter
!=
0x80
;
filter
<<=
1
)
cbAttribute
->
addItem
(
dataManager
.
FormatAttribute
(
filter
),
filter
);
stRace
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1321
),
rect
<
s32
>
(
10
,
42
+
75
/
6
,
70
,
62
+
75
/
6
),
false
,
false
,
wFilter
);
cbRace
=
env
->
addComboBox
(
rect
<
s32
>
(
60
,
40
+
75
/
6
,
19
0
,
60
+
75
/
6
),
wFilter
,
COMBOBOX_RACE
);
cbRace
=
env
->
addComboBox
(
rect
<
s32
>
(
60
,
40
+
75
/
6
,
19
5
,
60
+
75
/
6
),
wFilter
,
COMBOBOX_RACE
);
cbRace
->
setMaxSelectionRows
(
10
);
cbRace
->
addItem
(
dataManager
.
GetSysString
(
1310
),
0
);
for
(
int
filter
=
0x1
;
filter
<
(
1
<<
RACES_COUNT
);
filter
<<=
1
)
...
...
@@ -881,7 +882,7 @@ bool Game::Initialize() {
ebStar
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
60
,
60
+
100
/
6
,
100
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_INPUTS
);
ebStar
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
stScale
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1336
),
rect
<
s32
>
(
101
,
62
+
100
/
6
,
150
,
82
+
100
/
6
),
false
,
false
,
wFilter
);
ebScale
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
150
,
60
+
100
/
6
,
19
0
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_INPUTS
);
ebScale
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
150
,
60
+
100
/
6
,
19
5
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_INPUTS
);
ebScale
->
setTextAlignment
(
irr
::
gui
::
EGUIA_CENTER
,
irr
::
gui
::
EGUIA_CENTER
);
stSearch
=
env
->
addStaticText
(
dataManager
.
GetSysString
(
1325
),
rect
<
s32
>
(
205
,
62
+
100
/
6
,
280
,
82
+
100
/
6
),
false
,
false
,
wFilter
);
ebCardName
=
env
->
addEditBox
(
L""
,
rect
<
s32
>
(
260
,
60
+
100
/
6
,
390
,
80
+
100
/
6
),
true
,
wFilter
,
EDITBOX_KEYWORD
);
...
...
@@ -909,7 +910,7 @@ bool Game::Initialize() {
int
wcatewidth
=
catewidth
*
4
+
16
;
wCategories
->
setRelativePosition
(
rect
<
s32
>
(
1000
-
wcatewidth
,
60
,
1000
,
305
));
btnCategoryOK
->
setRelativePosition
(
recti
(
wcatewidth
/
2
-
50
,
210
,
wcatewidth
/
2
+
50
,
235
));
btnMarksFilter
=
env
->
addButton
(
rect
<
s32
>
(
60
,
80
+
125
/
6
,
19
0
,
100
+
125
/
6
),
wFilter
,
BUTTON_MARKS_FILTER
,
dataManager
.
GetSysString
(
1374
));
btnMarksFilter
=
env
->
addButton
(
rect
<
s32
>
(
60
,
80
+
125
/
6
,
19
5
,
100
+
125
/
6
),
wFilter
,
BUTTON_MARKS_FILTER
,
dataManager
.
GetSysString
(
1374
));
wLinkMarks
=
env
->
addWindow
(
rect
<
s32
>
(
700
,
30
,
820
,
150
),
false
,
L""
);
wLinkMarks
->
getCloseButton
()
->
setVisible
(
false
);
wLinkMarks
->
setDrawTitlebar
(
false
);
...
...
@@ -1190,7 +1191,7 @@ void Game::MainLoop() {
SingleMode
::
StopPlay
(
true
);
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
500
));
SaveConfig
();
//
device->drop();
device
->
drop
();
}
void
Game
::
RefreshTimeDisplay
()
{
for
(
int
i
=
0
;
i
<
2
;
++
i
)
{
...
...
@@ -2161,8 +2162,9 @@ void Game::CloseDuelWindow() {
ClearTextures
();
closeDoneSignal
.
Set
();
}
int
Game
::
LocalPlayer
(
int
player
)
{
return
dInfo
.
isFirst
?
player
:
1
-
player
;
int
Game
::
LocalPlayer
(
int
player
)
const
{
int
pid
=
player
?
1
:
0
;
return
dInfo
.
isFirst
?
pid
:
1
-
pid
;
}
const
wchar_t
*
Game
::
LocalName
(
int
local_player
)
{
return
local_player
==
0
?
dInfo
.
hostname
:
dInfo
.
clientname
;
...
...
@@ -2214,12 +2216,12 @@ void Game::OnResize() {
wFilter
->
setRelativePosition
(
Resize
(
610
,
5
,
1020
,
130
));
scrFilter
->
setRelativePosition
(
Resize
(
999
,
161
,
1019
,
629
));
cbCardType
->
setRelativePosition
(
Resize
(
60
,
25
/
6
,
120
,
20
+
25
/
6
));
cbCardType2
->
setRelativePosition
(
Resize
(
1
30
,
25
/
6
,
190
,
20
+
25
/
6
));
cbRace
->
setRelativePosition
(
Resize
(
60
,
40
+
75
/
6
,
19
0
,
60
+
75
/
6
));
cbAttribute
->
setRelativePosition
(
Resize
(
60
,
20
+
50
/
6
,
19
0
,
40
+
50
/
6
));
cbCardType2
->
setRelativePosition
(
Resize
(
1
25
,
25
/
6
,
195
,
20
+
25
/
6
));
cbRace
->
setRelativePosition
(
Resize
(
60
,
40
+
75
/
6
,
19
5
,
60
+
75
/
6
));
cbAttribute
->
setRelativePosition
(
Resize
(
60
,
20
+
50
/
6
,
19
5
,
40
+
50
/
6
));
cbLimit
->
setRelativePosition
(
Resize
(
260
,
25
/
6
,
390
,
20
+
25
/
6
));
ebStar
->
setRelativePosition
(
Resize
(
60
,
60
+
100
/
6
,
95
,
80
+
100
/
6
));
ebScale
->
setRelativePosition
(
Resize
(
155
,
60
+
100
/
6
,
19
0
,
80
+
100
/
6
));
ebScale
->
setRelativePosition
(
Resize
(
155
,
60
+
100
/
6
,
19
5
,
80
+
100
/
6
));
ebAttack
->
setRelativePosition
(
Resize
(
260
,
20
+
50
/
6
,
340
,
40
+
50
/
6
));
ebDefense
->
setRelativePosition
(
Resize
(
260
,
40
+
75
/
6
,
340
,
60
+
75
/
6
));
ebCardName
->
setRelativePosition
(
Resize
(
260
,
60
+
100
/
6
,
390
,
80
+
100
/
6
));
...
...
@@ -2227,7 +2229,7 @@ void Game::OnResize() {
btnStartFilter
->
setRelativePosition
(
Resize
(
260
,
80
+
125
/
6
,
390
,
100
+
125
/
6
));
if
(
btnClearFilter
)
btnClearFilter
->
setRelativePosition
(
Resize
(
205
,
80
+
125
/
6
,
255
,
100
+
125
/
6
));
btnMarksFilter
->
setRelativePosition
(
Resize
(
60
,
80
+
125
/
6
,
19
0
,
100
+
125
/
6
));
btnMarksFilter
->
setRelativePosition
(
Resize
(
60
,
80
+
125
/
6
,
19
5
,
100
+
125
/
6
));
recti
btncatepos
=
btnEffectFilter
->
getAbsolutePosition
();
wCategories
->
setRelativePosition
(
recti
(
...
...
gframe/game.h
View file @
b4387a80
...
...
@@ -98,7 +98,8 @@ struct Config {
struct
DuelInfo
{
bool
isStarted
{
false
};
bool
isFinished
{
false
};
bool
isInDuel
{
false
};
bool
isFinished
{
false
};
bool
isReplay
{
false
};
bool
isReplaySkiping
{
false
};
bool
isFirst
{
false
};
...
...
@@ -219,7 +220,7 @@ public:
void
CloseGameWindow
();
void
CloseDuelWindow
();
int
LocalPlayer
(
int
player
);
int
LocalPlayer
(
int
player
)
const
;
const
wchar_t
*
LocalName
(
int
local_player
);
const
char
*
GetLocaleDir
(
const
char
*
dir
);
const
wchar_t
*
GetLocaleDirWide
(
const
char
*
dir
);
...
...
gframe/replay_mode.cpp
View file @
b4387a80
...
...
@@ -262,6 +262,7 @@ void ReplayMode::EndDuel() {
}
mainGame
->
gMutex
.
lock
();
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isFinished
=
true
;
mainGame
->
dInfo
.
isReplay
=
false
;
mainGame
->
dInfo
.
isSingleMode
=
false
;
...
...
@@ -280,7 +281,9 @@ void ReplayMode::EndDuel() {
}
void
ReplayMode
::
Restart
(
bool
refresh
)
{
end_duel
(
pduel
);
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isFinished
=
true
;
mainGame
->
dField
.
Clear
();
//mainGame->device->setEventReceiver(&mainGame->dField);
...
...
@@ -370,141 +373,141 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
}
case
MSG_SELECT_BATTLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
+
2
;
ReplayRefresh
();
return
ReadReplayResponse
();
}
case
MSG_SELECT_IDLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
+
3
;
ReplayRefresh
();
return
ReadReplayResponse
();
}
case
MSG_SELECT_EFFECTYN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
12
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_YESNO
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_OPTION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_CARD
:
case
MSG_SELECT_TRIBUTE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
3
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_UNSELECT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_CHAIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
10
+
count
*
13
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_PLACE
:
case
MSG_SELECT_DISFIELD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_POSITION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_COUNTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
9
;
return
ReadReplayResponse
();
}
case
MSG_SELECT_SUM
:
{
pbuf
++
;
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
6
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
return
ReadReplayResponse
();
}
case
MSG_SORT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
return
ReadReplayResponse
();
}
case
MSG_CONFIRM_DECKTOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_CONFIRM_EXTRATOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_CONFIRM_CARDS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_SHUFFLE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
ReplayRefreshDeck
(
player
);
break
;
}
case
MSG_SHUFFLE_HAND
:
{
/*int oplayer = */
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int oplayer = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_SHUFFLE_EXTRA
:
{
/*int oplayer = */
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
/*int oplayer = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
...
...
@@ -515,7 +518,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_SWAP_GRAVE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
ReplayRefreshGrave
(
player
);
break
;
...
...
@@ -533,7 +536,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_SHUFFLE_SET_CARD
:
{
pbuf
++
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
...
...
@@ -547,7 +550,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
gMutex
.
unlock
();
}
}
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
...
...
@@ -671,22 +674,22 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
}
case
MSG_CARD_SELECTED
:
case
MSG_RANDOM_SELECTED
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
pauseable
=
false
;
break
;
}
case
MSG_BECOME_TARGET
:
{
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_DRAW
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
...
...
@@ -779,21 +782,21 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_TOSS_COIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_TOSS_DICE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
}
case
MSG_ROCK_PAPER_SCISSORS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
return
ReadReplayResponse
();
}
case
MSG_HAND_RES
:
{
...
...
@@ -802,18 +805,18 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
}
case
MSG_ANNOUNCE_RACE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
return
ReadReplayResponse
();
}
case
MSG_ANNOUNCE_ATTRIB
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
return
ReadReplayResponse
();
}
case
MSG_ANNOUNCE_CARD
:
case
MSG_ANNOUNCE_NUMBER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
pbuf
+=
4
*
count
;
return
ReadReplayResponse
();
...
...
@@ -845,12 +848,12 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
pbuf
+=
4
;
for
(
int
seq
=
0
;
seq
<
7
;
++
seq
)
{
int
val
=
BufferIO
::
ReadInt8
(
pbuf
);
int
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
pbuf
+=
2
;
}
for
(
int
seq
=
0
;
seq
<
8
;
++
seq
)
{
int
val
=
BufferIO
::
ReadInt8
(
pbuf
);
int
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
pbuf
++
;
}
...
...
gframe/single_duel.cpp
View file @
b4387a80
This diff is collapsed.
Click to expand it.
gframe/single_mode.cpp
View file @
b4387a80
This diff is collapsed.
Click to expand it.
gframe/tag_duel.cpp
View file @
b4387a80
This diff is collapsed.
Click to expand it.
premake5.lua
View file @
b4387a80
...
...
@@ -285,7 +285,7 @@ end
filter
{
"configurations:Release"
,
"action:vs*"
}
flags
{
"LinkTimeOptimization"
}
staticruntime
"On"
disablewarnings
{
"4244"
,
"4267"
,
"4838"
,
"4577"
,
"4
819"
,
"4018"
,
"4996"
,
"4477"
,
"4091"
,
"4828
"
,
"4800"
,
"6011"
,
"6031"
,
"6054"
,
"6262"
}
disablewarnings
{
"4244"
,
"4267"
,
"4838"
,
"4577"
,
"4
018"
,
"4996"
,
"4477"
,
"4091
"
,
"4800"
,
"6011"
,
"6031"
,
"6054"
,
"6262"
}
filter
{
"configurations:Release"
,
"not action:vs*"
}
symbols
"On"
...
...
@@ -295,7 +295,7 @@ end
end
filter
{
"configurations:Debug"
,
"action:vs*"
}
disablewarnings
{
"
4819"
,
"4828"
,
"
6011"
,
"6031"
,
"6054"
,
"6262"
}
disablewarnings
{
"6011"
,
"6031"
,
"6054"
,
"6262"
}
filter
"action:vs*"
vectorextensions
"SSE2"
...
...
strings.conf
View file @
b4387a80
...
...
@@ -665,6 +665,8 @@
!
counter
0
x68
指示物(图腾柱)
!
counter
0
x69
指示物(吠陀-优婆尼沙昙)
!
counter
0
x6a
响鸣指示物
!
counter
0
x6b
狂乱指示物
!
counter
0
x6c
访问指示物
#setnames, using tab for comment
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x2
次世代 ジェネクス
...
...
@@ -1220,3 +1222,9 @@
!
setname
0
x1ab
蕾祸 蕾禍
!
setname
0
x1ac
飞龙炎
Salamandra
!
setname
0
x1ad
灰尽
Ashened
!
setname
0
x1ae
千年 千年/ミレニアム
!
setname
0
x1af
艾格佐德 エグゾード
!
setname
0
x1b0
刻魔 デモンスミス
!
setname
0
x1b1
白森林 白き森
!
setname
0
x1b2
欢聚友伴 マルチャミー
!
setname
0
x1b3
徽记 エンブレーマ
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