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
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
nanahira
ygopro
Commits
91ec2551
Commit
91ec2551
authored
May 04, 2024
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into server-develop
parents
a9bc4252
0ca71d8e
Changes
20
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
765 additions
and
735 deletions
+765
-735
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
+5
-3
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
ocgcore
ocgcore
+1
-1
premake5.lua
premake5.lua
+2
-2
script
script
+1
-1
strings.conf
strings.conf
+8
-0
No files found.
gframe/bufferio.h
View file @
91ec2551
#ifndef BUFFERIO_H
#ifndef BUFFERIO_H
#define BUFFERIO_H
#define BUFFERIO_H
#ifdef _MSC_VER
#pragma warning(disable: 4244)
#endif
class
BufferIO
{
class
BufferIO
{
public:
public:
...
@@ -53,7 +50,7 @@ public:
...
@@ -53,7 +50,7 @@ public:
inline
static
int
CopyWStr
(
T1
*
src
,
T2
*
pstr
,
int
bufsize
)
{
inline
static
int
CopyWStr
(
T1
*
src
,
T2
*
pstr
,
int
bufsize
)
{
int
l
=
0
;
int
l
=
0
;
while
(
src
[
l
]
&&
l
<
bufsize
-
1
)
{
while
(
src
[
l
]
&&
l
<
bufsize
-
1
)
{
pstr
[
l
]
=
src
[
l
];
pstr
[
l
]
=
(
T2
)
src
[
l
];
l
++
;
l
++
;
}
}
pstr
[
l
]
=
0
;
pstr
[
l
]
=
0
;
...
@@ -63,7 +60,7 @@ public:
...
@@ -63,7 +60,7 @@ public:
inline
static
int
CopyWStrRef
(
T1
*
src
,
T2
*&
pstr
,
int
bufsize
)
{
inline
static
int
CopyWStrRef
(
T1
*
src
,
T2
*&
pstr
,
int
bufsize
)
{
int
l
=
0
;
int
l
=
0
;
while
(
src
[
l
]
&&
l
<
bufsize
-
1
)
{
while
(
src
[
l
]
&&
l
<
bufsize
-
1
)
{
pstr
[
l
]
=
src
[
l
];
pstr
[
l
]
=
(
T2
)
src
[
l
];
l
++
;
l
++
;
}
}
pstr
+=
l
;
pstr
+=
l
;
...
@@ -75,7 +72,7 @@ public:
...
@@ -75,7 +72,7 @@ public:
char
*
pstr
=
str
;
char
*
pstr
=
str
;
while
(
*
wsrc
!=
0
)
{
while
(
*
wsrc
!=
0
)
{
if
(
*
wsrc
<
0x80
)
{
if
(
*
wsrc
<
0x80
)
{
*
str
=
*
wsrc
;
*
str
=
(
char
)
*
wsrc
;
++
str
;
++
str
;
}
else
if
(
*
wsrc
<
0x800
)
{
}
else
if
(
*
wsrc
<
0x800
)
{
str
[
0
]
=
((
*
wsrc
>>
6
)
&
0x1f
)
|
0xc0
;
str
[
0
]
=
((
*
wsrc
>>
6
)
&
0x1f
)
|
0xc0
;
...
@@ -141,12 +138,14 @@ public:
...
@@ -141,12 +138,14 @@ public:
return
wp
-
wstr
;
return
wp
-
wstr
;
}
}
static
int
GetVal
(
const
wchar_t
*
pstr
)
{
static
int
GetVal
(
const
wchar_t
*
pstr
)
{
int
ret
=
0
;
unsigned
int
ret
=
0
;
while
(
*
pstr
>=
L'0'
&&
*
pstr
<=
L'9'
)
{
while
(
*
pstr
>=
L'0'
&&
*
pstr
<=
L'9'
)
{
ret
=
ret
*
10
+
(
*
pstr
-
L'0'
);
ret
=
ret
*
10
+
(
*
pstr
-
L'0'
);
pstr
++
;
pstr
++
;
}
}
return
ret
;
if
(
*
pstr
==
0
)
return
(
int
)
ret
;
return
0
;
}
}
};
};
...
...
gframe/client_card.cpp
View file @
91ec2551
...
@@ -113,10 +113,10 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
...
@@ -113,10 +113,10 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
if
(
flag
&
QUERY_REASON_CARD
)
if
(
flag
&
QUERY_REASON_CARD
)
buf
+=
4
;
buf
+=
4
;
if
(
flag
&
QUERY_EQUIP_CARD
)
{
if
(
flag
&
QUERY_EQUIP_CARD
)
{
int
c
=
BufferIO
::
ReadInt8
(
buf
);
int
c
=
BufferIO
::
Read
U
Int8
(
buf
);
int
l
=
BufferIO
::
Read
Int8
(
buf
);
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
buf
);
int
s
=
BufferIO
::
ReadInt8
(
buf
);
int
s
=
BufferIO
::
Read
U
Int8
(
buf
);
BufferIO
::
ReadInt8
(
buf
);
BufferIO
::
Read
U
Int8
(
buf
);
ClientCard
*
ecard
=
mainGame
->
dField
.
GetCard
(
mainGame
->
LocalPlayer
(
c
),
l
,
s
);
ClientCard
*
ecard
=
mainGame
->
dField
.
GetCard
(
mainGame
->
LocalPlayer
(
c
),
l
,
s
);
if
(
ecard
)
{
if
(
ecard
)
{
equipTarget
=
ecard
;
equipTarget
=
ecard
;
...
@@ -126,10 +126,10 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
...
@@ -126,10 +126,10 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
if
(
flag
&
QUERY_TARGET_CARD
)
{
if
(
flag
&
QUERY_TARGET_CARD
)
{
int
count
=
BufferIO
::
ReadInt32
(
buf
);
int
count
=
BufferIO
::
ReadInt32
(
buf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
int
c
=
BufferIO
::
ReadInt8
(
buf
);
int
c
=
BufferIO
::
Read
U
Int8
(
buf
);
int
l
=
BufferIO
::
Read
Int8
(
buf
);
unsigned
int
l
=
BufferIO
::
ReadU
Int8
(
buf
);
int
s
=
BufferIO
::
ReadInt8
(
buf
);
int
s
=
BufferIO
::
Read
U
Int8
(
buf
);
BufferIO
::
ReadInt8
(
buf
);
BufferIO
::
Read
U
Int8
(
buf
);
ClientCard
*
tcard
=
mainGame
->
dField
.
GetCard
(
mainGame
->
LocalPlayer
(
c
),
l
,
s
);
ClientCard
*
tcard
=
mainGame
->
dField
.
GetCard
(
mainGame
->
LocalPlayer
(
c
),
l
,
s
);
if
(
tcard
)
{
if
(
tcard
)
{
cardTarget
.
insert
(
tcard
);
cardTarget
.
insert
(
tcard
);
...
...
gframe/client_field.cpp
View file @
91ec2551
...
@@ -197,7 +197,7 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
...
@@ -197,7 +197,7 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
case
LOCATION_DECK
:
{
case
LOCATION_DECK
:
{
if
(
sequence
!=
0
||
deck
[
controler
].
size
()
==
0
)
{
if
(
sequence
!=
0
||
deck
[
controler
].
size
()
==
0
)
{
deck
[
controler
].
push_back
(
pcard
);
deck
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
deck
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
deck
[
controler
].
size
()
-
1
)
;
}
else
{
}
else
{
deck
[
controler
].
push_back
(
0
);
deck
[
controler
].
push_back
(
0
);
for
(
int
i
=
deck
[
controler
].
size
()
-
1
;
i
>
0
;
--
i
)
{
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
...
@@ -212,7 +212,7 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
}
}
case
LOCATION_HAND
:
{
case
LOCATION_HAND
:
{
hand
[
controler
].
push_back
(
pcard
);
hand
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
hand
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
hand
[
controler
].
size
()
-
1
)
;
break
;
break
;
}
}
case
LOCATION_MZONE
:
{
case
LOCATION_MZONE
:
{
...
@@ -225,18 +225,18 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
...
@@ -225,18 +225,18 @@ void ClientField::AddCard(ClientCard* pcard, int controler, int location, int se
}
}
case
LOCATION_GRAVE
:
{
case
LOCATION_GRAVE
:
{
grave
[
controler
].
push_back
(
pcard
);
grave
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
grave
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
grave
[
controler
].
size
()
-
1
)
;
break
;
break
;
}
}
case
LOCATION_REMOVED
:
{
case
LOCATION_REMOVED
:
{
remove
[
controler
].
push_back
(
pcard
);
remove
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
remove
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
remove
[
controler
].
size
()
-
1
)
;
break
;
break
;
}
}
case
LOCATION_EXTRA
:
{
case
LOCATION_EXTRA
:
{
if
(
extra_p_count
[
controler
]
==
0
||
(
pcard
->
position
&
POS_FACEUP
))
{
if
(
extra_p_count
[
controler
]
==
0
||
(
pcard
->
position
&
POS_FACEUP
))
{
extra
[
controler
].
push_back
(
pcard
);
extra
[
controler
].
push_back
(
pcard
);
pcard
->
sequence
=
extra
[
controler
].
size
()
-
1
;
pcard
->
sequence
=
(
unsigned
char
)(
extra
[
controler
].
size
()
-
1
)
;
}
else
{
}
else
{
extra
[
controler
].
push_back
(
0
);
extra
[
controler
].
push_back
(
0
);
int
p
=
extra
[
controler
].
size
()
-
extra_p_count
[
controler
]
-
1
;
int
p
=
extra
[
controler
].
size
()
-
extra_p_count
[
controler
]
-
1
;
...
...
gframe/data_manager.cpp
View file @
91ec2551
...
@@ -238,7 +238,7 @@ code_pointer DataManager::GetCodePointer(unsigned int code) const {
...
@@ -238,7 +238,7 @@ code_pointer DataManager::GetCodePointer(unsigned int code) const {
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
return
_strings
.
find
(
code
);
return
_strings
.
find
(
code
);
}
}
bool
DataManager
::
GetString
(
int
code
,
CardString
*
pStr
)
{
bool
DataManager
::
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
{
auto
csit
=
_strings
.
find
(
code
);
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
{
if
(
csit
==
_strings
.
end
())
{
pStr
->
name
=
unknown_string
;
pStr
->
name
=
unknown_string
;
...
@@ -248,7 +248,7 @@ bool DataManager::GetString(int code, CardString* pStr) {
...
@@ -248,7 +248,7 @@ bool DataManager::GetString(int code, CardString* pStr) {
*
pStr
=
csit
->
second
;
*
pStr
=
csit
->
second
;
return
true
;
return
true
;
}
}
const
wchar_t
*
DataManager
::
GetName
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetName
(
unsigned
int
code
)
{
auto
csit
=
_strings
.
find
(
code
);
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
return
unknown_string
;
...
@@ -256,7 +256,7 @@ const wchar_t* DataManager::GetName(int code) {
...
@@ -256,7 +256,7 @@ const wchar_t* DataManager::GetName(int code) {
return
csit
->
second
.
name
.
c_str
();
return
csit
->
second
.
name
.
c_str
();
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
GetText
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetText
(
unsigned
int
code
)
{
auto
csit
=
_strings
.
find
(
code
);
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
return
unknown_string
;
...
@@ -265,7 +265,7 @@ const wchar_t* DataManager::GetText(int code) {
...
@@ -265,7 +265,7 @@ const wchar_t* DataManager::GetText(int code) {
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
{
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
{
if
(
strCode
<
10000u
)
if
(
strCode
<
(
MIN_CARD_ID
<<
4
)
)
return
GetSysString
(
strCode
);
return
GetSysString
(
strCode
);
unsigned
int
code
=
(
strCode
>>
4
)
&
0x0fffffff
;
unsigned
int
code
=
(
strCode
>>
4
)
&
0x0fffffff
;
unsigned
int
offset
=
strCode
&
0xf
;
unsigned
int
offset
=
strCode
&
0xf
;
...
@@ -277,7 +277,7 @@ const wchar_t* DataManager::GetDesc(unsigned int strCode) {
...
@@ -277,7 +277,7 @@ const wchar_t* DataManager::GetDesc(unsigned int strCode) {
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
{
if
(
code
<
0
||
code
>=
2048
)
if
(
code
<
0
||
code
>
MAX_STRING_ID
)
return
unknown_string
;
return
unknown_string
;
auto
csit
=
_sysStrings
.
find
(
code
);
auto
csit
=
_sysStrings
.
find
(
code
);
if
(
csit
==
_sysStrings
.
end
())
if
(
csit
==
_sysStrings
.
end
())
...
...
gframe/data_manager.h
View file @
91ec2551
...
@@ -10,6 +10,8 @@
...
@@ -10,6 +10,8 @@
#include <unordered_map>
#include <unordered_map>
namespace
ygo
{
namespace
ygo
{
constexpr
int
MAX_STRING_ID
=
0x7ff
;
constexpr
unsigned
int
MIN_CARD_ID
=
(
unsigned
int
)(
MAX_STRING_ID
+
1
)
>>
4
;
class
DataManager
{
class
DataManager
{
public:
public:
...
@@ -28,9 +30,9 @@ public:
...
@@ -28,9 +30,9 @@ public:
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
);
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
);
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
bool
GetString
(
int
code
,
CardString
*
pStr
);
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
);
const
wchar_t
*
GetName
(
int
code
);
const
wchar_t
*
GetName
(
unsigned
int
code
);
const
wchar_t
*
GetText
(
int
code
);
const
wchar_t
*
GetText
(
unsigned
int
code
);
const
wchar_t
*
GetDesc
(
unsigned
int
strCode
);
const
wchar_t
*
GetDesc
(
unsigned
int
strCode
);
const
wchar_t
*
GetSysString
(
int
code
);
const
wchar_t
*
GetSysString
(
int
code
);
const
wchar_t
*
GetVictoryString
(
int
code
);
const
wchar_t
*
GetVictoryString
(
int
code
);
...
...
gframe/deck_con.h
View file @
91ec2551
...
@@ -41,49 +41,49 @@ public:
...
@@ -41,49 +41,49 @@ public:
void
pop_side
(
int
seq
);
void
pop_side
(
int
seq
);
bool
check_limit
(
code_pointer
pointer
);
bool
check_limit
(
code_pointer
pointer
);
long
long
filter_effect
;
long
long
filter_effect
{}
;
unsigned
int
filter_type
;
unsigned
int
filter_type
{}
;
unsigned
int
filter_type2
;
unsigned
int
filter_type2
{}
;
unsigned
int
filter_attrib
;
unsigned
int
filter_attrib
{}
;
unsigned
int
filter_race
;
unsigned
int
filter_race
{}
;
unsigned
int
filter_atktype
;
unsigned
int
filter_atktype
{}
;
int
filter_atk
;
int
filter_atk
{}
;
unsigned
int
filter_deftype
;
unsigned
int
filter_deftype
{}
;
int
filter_def
;
int
filter_def
{}
;
unsigned
int
filter_lvtype
;
unsigned
int
filter_lvtype
{}
;
unsigned
int
filter_lv
;
unsigned
int
filter_lv
{}
;
unsigned
int
filter_scltype
;
unsigned
int
filter_scltype
{}
;
unsigned
int
filter_scl
;
unsigned
int
filter_scl
{}
;
unsigned
int
filter_marks
;
unsigned
int
filter_marks
{}
;
int
filter_lm
;
int
filter_lm
{}
;
position2di
mouse_pos
;
position2di
mouse_pos
;
int
hovered_code
;
int
hovered_code
{}
;
int
hovered_pos
;
int
hovered_pos
{}
;
int
hovered_seq
;
int
hovered_seq
{
-
1
}
;
int
is_lastcard
;
int
is_lastcard
{}
;
int
click_pos
;
int
click_pos
{}
;
bool
is_draging
;
bool
is_draging
{}
;
bool
is_starting_dragging
;
bool
is_starting_dragging
{}
;
int
dragx
;
int
dragx
{}
;
int
dragy
;
int
dragy
{}
;
int
bigcard_code
;
int
bigcard_code
{}
;
float
bigcard_zoom
;
float
bigcard_zoom
{}
;
size_t
pre_mainc
;
size_t
pre_mainc
{}
;
size_t
pre_extrac
;
size_t
pre_extrac
{}
;
size_t
pre_sidec
;
size_t
pre_sidec
{}
;
code_pointer
draging_pointer
;
code_pointer
draging_pointer
;
int
prev_category
;
int
prev_category
{}
;
int
prev_deck
;
int
prev_deck
{}
;
s32
prev_operation
;
s32
prev_operation
{}
;
int
prev_sel
;
int
prev_sel
{
-
1
}
;
bool
is_modified
;
bool
is_modified
{}
;
bool
readonly
;
bool
readonly
{}
;
bool
showing_pack
;
bool
showing_pack
{}
;
mt19937
rnd
;
mt19937
rnd
;
const
std
::
unordered_map
<
int
,
int
>*
filterList
;
const
std
::
unordered_map
<
int
,
int
>*
filterList
;
std
::
vector
<
code_pointer
>
results
;
std
::
vector
<
code_pointer
>
results
;
wchar_t
result_string
[
8
];
wchar_t
result_string
[
8
]
{}
;
std
::
vector
<
std
::
wstring
>
expansionPacks
;
std
::
vector
<
std
::
wstring
>
expansionPacks
;
};
};
...
...
gframe/deck_manager.cpp
View file @
91ec2551
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
namespace
ygo
{
namespace
ygo
{
#ifndef YGOPRO_SERVER_MODE
#ifndef YGOPRO_SERVER_MODE
char
DeckManager
::
deckBuffer
[
0x10000
];
char
DeckManager
::
deckBuffer
[
0x10000
]
{}
;
#endif
#endif
DeckManager
deckManager
;
DeckManager
deckManager
;
...
...
gframe/deck_manager.h
View file @
91ec2551
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
namespace
ygo
{
namespace
ygo
{
struct
LFList
{
struct
LFList
{
unsigned
int
hash
;
unsigned
int
hash
{}
;
std
::
wstring
listName
;
std
::
wstring
listName
;
std
::
unordered_map
<
int
,
int
>
content
;
std
::
unordered_map
<
int
,
int
>
content
;
};
};
...
...
gframe/duelclient.cpp
View file @
91ec2551
This diff is collapsed.
Click to expand it.
gframe/event_handler.cpp
View file @
91ec2551
...
@@ -127,6 +127,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -127,6 +127,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
if
(
mainGame
->
dInfo
.
player_type
==
7
)
{
if
(
mainGame
->
dInfo
.
player_type
==
7
)
{
DuelClient
::
StopClient
();
DuelClient
::
StopClient
();
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
dInfo
.
isFinished
=
false
;
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
menuHandler
);
mainGame
->
CloseDuelWindow
();
mainGame
->
CloseDuelWindow
();
...
...
gframe/game.cpp
View file @
91ec2551
...
@@ -36,6 +36,7 @@ Game* mainGame;
...
@@ -36,6 +36,7 @@ Game* mainGame;
#ifndef YGOPRO_SERVER_MODE
#ifndef YGOPRO_SERVER_MODE
void
DuelInfo
::
Clear
()
{
void
DuelInfo
::
Clear
()
{
isStarted
=
false
;
isStarted
=
false
;
isInDuel
=
false
;
isFinished
=
false
;
isFinished
=
false
;
isReplay
=
false
;
isReplay
=
false
;
isReplaySkiping
=
false
;
isReplaySkiping
=
false
;
...
@@ -1190,7 +1191,7 @@ void Game::MainLoop() {
...
@@ -1190,7 +1191,7 @@ void Game::MainLoop() {
SingleMode
::
StopPlay
(
true
);
SingleMode
::
StopPlay
(
true
);
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
500
));
std
::
this_thread
::
sleep_for
(
std
::
chrono
::
milliseconds
(
500
));
SaveConfig
();
SaveConfig
();
//
device->drop();
device
->
drop
();
}
}
void
Game
::
RefreshTimeDisplay
()
{
void
Game
::
RefreshTimeDisplay
()
{
for
(
int
i
=
0
;
i
<
2
;
++
i
)
{
for
(
int
i
=
0
;
i
<
2
;
++
i
)
{
...
@@ -2161,8 +2162,9 @@ void Game::CloseDuelWindow() {
...
@@ -2161,8 +2162,9 @@ void Game::CloseDuelWindow() {
ClearTextures
();
ClearTextures
();
closeDoneSignal
.
Set
();
closeDoneSignal
.
Set
();
}
}
int
Game
::
LocalPlayer
(
int
player
)
{
int
Game
::
LocalPlayer
(
int
player
)
const
{
return
dInfo
.
isFirst
?
player
:
1
-
player
;
int
pid
=
player
?
1
:
0
;
return
dInfo
.
isFirst
?
pid
:
1
-
pid
;
}
}
const
wchar_t
*
Game
::
LocalName
(
int
local_player
)
{
const
wchar_t
*
Game
::
LocalName
(
int
local_player
)
{
return
local_player
==
0
?
dInfo
.
hostname
:
dInfo
.
clientname
;
return
local_player
==
0
?
dInfo
.
hostname
:
dInfo
.
clientname
;
...
...
gframe/game.h
View file @
91ec2551
...
@@ -98,7 +98,8 @@ struct Config {
...
@@ -98,7 +98,8 @@ struct Config {
struct
DuelInfo
{
struct
DuelInfo
{
bool
isStarted
{
false
};
bool
isStarted
{
false
};
bool
isFinished
{
false
};
bool
isInDuel
{
false
};
bool
isFinished
{
false
};
bool
isReplay
{
false
};
bool
isReplay
{
false
};
bool
isReplaySkiping
{
false
};
bool
isReplaySkiping
{
false
};
bool
isFirst
{
false
};
bool
isFirst
{
false
};
...
@@ -219,7 +220,7 @@ public:
...
@@ -219,7 +220,7 @@ public:
void
CloseGameWindow
();
void
CloseGameWindow
();
void
CloseDuelWindow
();
void
CloseDuelWindow
();
int
LocalPlayer
(
int
player
);
int
LocalPlayer
(
int
player
)
const
;
const
wchar_t
*
LocalName
(
int
local_player
);
const
wchar_t
*
LocalName
(
int
local_player
);
const
char
*
GetLocaleDir
(
const
char
*
dir
);
const
char
*
GetLocaleDir
(
const
char
*
dir
);
const
wchar_t
*
GetLocaleDirWide
(
const
char
*
dir
);
const
wchar_t
*
GetLocaleDirWide
(
const
char
*
dir
);
...
...
gframe/replay_mode.cpp
View file @
91ec2551
...
@@ -262,6 +262,7 @@ void ReplayMode::EndDuel() {
...
@@ -262,6 +262,7 @@ void ReplayMode::EndDuel() {
}
}
mainGame
->
gMutex
.
lock
();
mainGame
->
gMutex
.
lock
();
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isFinished
=
true
;
mainGame
->
dInfo
.
isFinished
=
true
;
mainGame
->
dInfo
.
isReplay
=
false
;
mainGame
->
dInfo
.
isReplay
=
false
;
mainGame
->
dInfo
.
isSingleMode
=
false
;
mainGame
->
dInfo
.
isSingleMode
=
false
;
...
@@ -280,7 +281,9 @@ void ReplayMode::EndDuel() {
...
@@ -280,7 +281,9 @@ void ReplayMode::EndDuel() {
}
}
void
ReplayMode
::
Restart
(
bool
refresh
)
{
void
ReplayMode
::
Restart
(
bool
refresh
)
{
end_duel
(
pduel
);
end_duel
(
pduel
);
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isStarted
=
false
;
mainGame
->
dInfo
.
isInDuel
=
false
;
mainGame
->
dInfo
.
isFinished
=
true
;
mainGame
->
dInfo
.
isFinished
=
true
;
mainGame
->
dField
.
Clear
();
mainGame
->
dField
.
Clear
();
//mainGame->device->setEventReceiver(&mainGame->dField);
//mainGame->device->setEventReceiver(&mainGame->dField);
...
@@ -370,141 +373,141 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -370,141 +373,141 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
return
false
;
return
false
;
}
}
case
MSG_SELECT_BATTLECMD
:
{
case
MSG_SELECT_BATTLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
+
2
;
pbuf
+=
count
*
8
+
2
;
ReplayRefresh
();
ReplayRefresh
();
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_IDLECMD
:
{
case
MSG_SELECT_IDLECMD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
+
3
;
pbuf
+=
count
*
11
+
3
;
ReplayRefresh
();
ReplayRefresh
();
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_EFFECTYN
:
{
case
MSG_SELECT_EFFECTYN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
12
;
pbuf
+=
12
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_YESNO
:
{
case
MSG_SELECT_YESNO
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
pbuf
+=
4
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_OPTION
:
{
case
MSG_SELECT_OPTION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
pbuf
+=
count
*
4
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_CARD
:
case
MSG_SELECT_CARD
:
case
MSG_SELECT_TRIBUTE
:
{
case
MSG_SELECT_TRIBUTE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
3
;
pbuf
+=
3
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
pbuf
+=
count
*
8
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_UNSELECT_CARD
:
{
case
MSG_SELECT_UNSELECT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
pbuf
+=
count
*
8
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
pbuf
+=
count
*
8
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_CHAIN
:
{
case
MSG_SELECT_CHAIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
10
+
count
*
13
;
pbuf
+=
10
+
count
*
13
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_PLACE
:
case
MSG_SELECT_PLACE
:
case
MSG_SELECT_DISFIELD
:
{
case
MSG_SELECT_DISFIELD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
pbuf
+=
5
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_POSITION
:
{
case
MSG_SELECT_POSITION
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
pbuf
+=
5
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_COUNTER
:
{
case
MSG_SELECT_COUNTER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
4
;
pbuf
+=
4
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
9
;
pbuf
+=
count
*
9
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SELECT_SUM
:
{
case
MSG_SELECT_SUM
:
{
pbuf
++
;
pbuf
++
;
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
6
;
pbuf
+=
6
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
11
;
pbuf
+=
count
*
11
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_SORT_CARD
:
{
case
MSG_SORT_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_CONFIRM_DECKTOP
:
{
case
MSG_CONFIRM_DECKTOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
case
MSG_CONFIRM_EXTRATOP
:
{
case
MSG_CONFIRM_EXTRATOP
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
case
MSG_CONFIRM_CARDS
:
{
case
MSG_CONFIRM_CARDS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
7
;
pbuf
+=
count
*
7
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
case
MSG_SHUFFLE_DECK
:
{
case
MSG_SHUFFLE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
ReplayRefreshDeck
(
player
);
ReplayRefreshDeck
(
player
);
break
;
break
;
}
}
case
MSG_SHUFFLE_HAND
:
{
case
MSG_SHUFFLE_HAND
:
{
/*int oplayer = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int oplayer = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
case
MSG_SHUFFLE_EXTRA
:
{
case
MSG_SHUFFLE_EXTRA
:
{
/*int oplayer = */
BufferIO
::
ReadInt8
(
pbuf
);
/*int oplayer = */
BufferIO
::
Read
U
Int8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
...
@@ -515,7 +518,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -515,7 +518,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
break
;
}
}
case
MSG_SWAP_GRAVE_DECK
:
{
case
MSG_SWAP_GRAVE_DECK
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
ReplayRefreshGrave
(
player
);
ReplayRefreshGrave
(
player
);
break
;
break
;
...
@@ -533,7 +536,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -533,7 +536,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
}
}
case
MSG_SHUFFLE_SET_CARD
:
{
case
MSG_SHUFFLE_SET_CARD
:
{
pbuf
++
;
pbuf
++
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
8
;
pbuf
+=
count
*
8
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
...
@@ -547,7 +550,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -547,7 +550,7 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
mainGame
->
gMutex
.
unlock
();
mainGame
->
gMutex
.
unlock
();
}
}
}
}
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
...
@@ -671,22 +674,22 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -671,22 +674,22 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
}
}
case
MSG_CARD_SELECTED
:
case
MSG_CARD_SELECTED
:
case
MSG_RANDOM_SELECTED
:
{
case
MSG_RANDOM_SELECTED
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
pauseable
=
false
;
pauseable
=
false
;
break
;
break
;
}
}
case
MSG_BECOME_TARGET
:
{
case
MSG_BECOME_TARGET
:
{
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
case
MSG_DRAW
:
{
case
MSG_DRAW
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
*
4
;
pbuf
+=
count
*
4
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
...
@@ -779,21 +782,21 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -779,21 +782,21 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
break
;
}
}
case
MSG_TOSS_COIN
:
{
case
MSG_TOSS_COIN
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
pbuf
+=
count
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
case
MSG_TOSS_DICE
:
{
case
MSG_TOSS_DICE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadInt8
(
pbuf
);
count
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
count
;
pbuf
+=
count
;
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
);
break
;
break
;
}
}
case
MSG_ROCK_PAPER_SCISSORS
:
{
case
MSG_ROCK_PAPER_SCISSORS
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_HAND_RES
:
{
case
MSG_HAND_RES
:
{
...
@@ -802,18 +805,18 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -802,18 +805,18 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
break
;
break
;
}
}
case
MSG_ANNOUNCE_RACE
:
{
case
MSG_ANNOUNCE_RACE
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
pbuf
+=
5
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_ANNOUNCE_ATTRIB
:
{
case
MSG_ANNOUNCE_ATTRIB
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
pbuf
+=
5
;
pbuf
+=
5
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
}
}
case
MSG_ANNOUNCE_CARD
:
case
MSG_ANNOUNCE_CARD
:
case
MSG_ANNOUNCE_NUMBER
:
{
case
MSG_ANNOUNCE_NUMBER
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
player
=
BufferIO
::
Read
U
Int8
(
pbuf
);
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
count
=
BufferIO
::
ReadUInt8
(
pbuf
);
pbuf
+=
4
*
count
;
pbuf
+=
4
*
count
;
return
ReadReplayResponse
();
return
ReadReplayResponse
();
...
@@ -845,12 +848,12 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
...
@@ -845,12 +848,12 @@ bool ReplayMode::ReplayAnalyze(unsigned char* msg, unsigned int len) {
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
for
(
int
p
=
0
;
p
<
2
;
++
p
)
{
pbuf
+=
4
;
pbuf
+=
4
;
for
(
int
seq
=
0
;
seq
<
7
;
++
seq
)
{
for
(
int
seq
=
0
;
seq
<
7
;
++
seq
)
{
int
val
=
BufferIO
::
ReadInt8
(
pbuf
);
int
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
if
(
val
)
pbuf
+=
2
;
pbuf
+=
2
;
}
}
for
(
int
seq
=
0
;
seq
<
8
;
++
seq
)
{
for
(
int
seq
=
0
;
seq
<
8
;
++
seq
)
{
int
val
=
BufferIO
::
ReadInt8
(
pbuf
);
int
val
=
BufferIO
::
Read
U
Int8
(
pbuf
);
if
(
val
)
if
(
val
)
pbuf
++
;
pbuf
++
;
}
}
...
...
gframe/single_duel.cpp
View file @
91ec2551
This diff is collapsed.
Click to expand it.
gframe/single_mode.cpp
View file @
91ec2551
This diff is collapsed.
Click to expand it.
gframe/tag_duel.cpp
View file @
91ec2551
This diff is collapsed.
Click to expand it.
ocgcore
@
4d72fdb3
Subproject commit
dcb3ee6c25f775562c1ad6f353e30ed928e16866
Subproject commit
4d72fdb3395fcce97c79954d789d033a1fd5175e
premake5.lua
View file @
91ec2551
...
@@ -285,7 +285,7 @@ end
...
@@ -285,7 +285,7 @@ end
filter
{
"configurations:Release"
,
"action:vs*"
}
filter
{
"configurations:Release"
,
"action:vs*"
}
flags
{
"LinkTimeOptimization"
}
flags
{
"LinkTimeOptimization"
}
staticruntime
"On"
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*"
}
filter
{
"configurations:Release"
,
"not action:vs*"
}
symbols
"On"
symbols
"On"
...
@@ -295,7 +295,7 @@ end
...
@@ -295,7 +295,7 @@ end
end
end
filter
{
"configurations:Debug"
,
"action:vs*"
}
filter
{
"configurations:Debug"
,
"action:vs*"
}
disablewarnings
{
"
4819"
,
"4828"
,
"
6011"
,
"6031"
,
"6054"
,
"6262"
}
disablewarnings
{
"6011"
,
"6031"
,
"6054"
,
"6262"
}
filter
"action:vs*"
filter
"action:vs*"
vectorextensions
"SSE2"
vectorextensions
"SSE2"
...
...
script
@
59e5af14
Subproject commit
afdda75bf93d44ca28fe0e7563dc3001eca9320b
Subproject commit
59e5af144e6e35f842b1abb62bede801d5f5f005
strings.conf
View file @
91ec2551
...
@@ -665,6 +665,8 @@
...
@@ -665,6 +665,8 @@
!
counter
0
x68
指示物(图腾柱)
!
counter
0
x68
指示物(图腾柱)
!
counter
0
x69
指示物(吠陀-优婆尼沙昙)
!
counter
0
x69
指示物(吠陀-优婆尼沙昙)
!
counter
0
x6a
响鸣指示物
!
counter
0
x6a
响鸣指示物
!
counter
0
x6b
狂乱指示物
!
counter
0
x6c
访问指示物
#setnames, using tab for comment
#setnames, using tab for comment
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x2
次世代 ジェネクス
!
setname
0
x2
次世代 ジェネクス
...
@@ -1220,3 +1222,9 @@
...
@@ -1220,3 +1222,9 @@
!
setname
0
x1ab
蕾祸 蕾禍
!
setname
0
x1ab
蕾祸 蕾禍
!
setname
0
x1ac
飞龙炎
Salamandra
!
setname
0
x1ac
飞龙炎
Salamandra
!
setname
0
x1ad
灰尽
Ashened
!
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