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
2a5b5bba
Commit
2a5b5bba
authored
Dec 19, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
c07b9172
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
48 additions
and
26 deletions
+48
-26
gframe/client_field.cpp
gframe/client_field.cpp
+15
-12
gframe/client_field.h
gframe/client_field.h
+4
-3
gframe/duelclient.cpp
gframe/duelclient.cpp
+19
-9
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+2
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+2
-0
gframe/single_mode.cpp
gframe/single_mode.cpp
+2
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+2
-0
ocgcore
ocgcore
+1
-1
script
script
+1
-1
No files found.
gframe/client_field.cpp
View file @
2a5b5bba
...
...
@@ -1108,7 +1108,10 @@ bool ClientField::CheckSelectSum() {
selable
.
insert
(
selectsum_all
[
i
]);
}
for
(
size_t
i
=
0
;
i
<
selected_cards
.
size
();
++
i
)
{
selected_cards
[
i
]
->
is_selectable
=
true
;
if
(
i
<
must_select_count
)
selected_cards
[
i
]
->
is_selectable
=
false
;
else
selected_cards
[
i
]
->
is_selectable
=
true
;
selected_cards
[
i
]
->
is_selected
=
true
;
selable
.
erase
(
selected_cards
[
i
]);
}
...
...
@@ -1194,7 +1197,7 @@ bool ClientField::check_min(std::set<ClientCard*>& left, std::set<ClientCard*>::
return
(
min
>
m
&&
check_min
(
left
,
index
,
min
-
m
,
max
-
m
))
||
check_min
(
left
,
index
,
min
,
max
);
}
bool
ClientField
::
check_sel_sum_s
(
std
::
set
<
ClientCard
*>&
left
,
int
index
,
int
acc
)
{
bool
ClientField
::
check_sel_sum_s
(
const
std
::
set
<
ClientCard
*>&
left
,
int
index
,
int
acc
)
{
if
(
index
==
(
int
)
selected_cards
.
size
())
{
if
(
acc
==
0
)
return
true
;
...
...
@@ -1210,9 +1213,9 @@ bool ClientField::check_sel_sum_s(std::set<ClientCard*>& left, int index, int ac
res2
=
check_sel_sum_s
(
left
,
index
+
1
,
acc
-
l2
);
return
res1
||
res2
;
}
void
ClientField
::
check_sel_sum_t
(
std
::
set
<
ClientCard
*>&
left
,
int
acc
)
{
std
::
set
<
ClientCard
*>::
iterator
sit
;
for
(
sit
=
left
.
begin
();
sit
!=
left
.
end
();
++
sit
)
{
void
ClientField
::
check_sel_sum_t
(
const
std
::
set
<
ClientCard
*>&
left
,
int
acc
)
{
int
count
=
selected_cards
.
size
()
+
1
;
for
(
auto
sit
=
left
.
begin
();
sit
!=
left
.
end
();
++
sit
)
{
if
(
selectsum_cards
.
find
(
*
sit
)
!=
selectsum_cards
.
end
())
continue
;
std
::
set
<
ClientCard
*>
testlist
(
left
);
...
...
@@ -1220,16 +1223,16 @@ void ClientField::check_sel_sum_t(std::set<ClientCard*>& left, int acc) {
int
l
=
(
*
sit
)
->
opParam
;
int
l1
=
l
&
0xffff
;
int
l2
=
l
>>
16
;
if
(
check_sum
(
testlist
,
testlist
.
begin
(),
acc
-
l1
,
selected_cards
.
size
()
+
1
)
||
(
l2
>
0
&&
check_sum
(
testlist
,
testlist
.
begin
(),
acc
-
l2
,
selected_cards
.
size
()
+
1
)))
{
if
(
check_sum
(
testlist
.
begin
(),
testlist
.
end
(),
acc
-
l1
,
count
)
||
(
l2
>
0
&&
check_sum
(
testlist
.
begin
(),
testlist
.
end
(),
acc
-
l2
,
count
)))
{
selectsum_cards
.
insert
(
*
sit
);
}
}
}
bool
ClientField
::
check_sum
(
std
::
set
<
ClientCard
*>
&
testlist
,
std
::
set
<
ClientCard
*>::
iterator
index
,
int
acc
,
int
count
)
{
bool
ClientField
::
check_sum
(
std
::
set
<
ClientCard
*>
::
const_iterator
index
,
std
::
set
<
ClientCard
*>::
const_iterator
end
,
int
acc
,
int
count
)
{
if
(
acc
==
0
)
return
count
>=
select_min
&&
count
<=
select_max
;
if
(
acc
<
0
||
index
==
testlist
.
end
()
)
if
(
acc
<
0
||
index
==
end
)
return
false
;
int
l
=
(
*
index
)
->
opParam
;
int
l1
=
l
&
0xffff
;
...
...
@@ -1237,8 +1240,8 @@ bool ClientField::check_sum(std::set<ClientCard*>& testlist, std::set<ClientCard
if
((
l1
==
acc
||
(
l2
>
0
&&
l2
==
acc
))
&&
(
count
+
1
>=
select_min
)
&&
(
count
+
1
<=
select_max
))
return
true
;
++
index
;
return
(
acc
>
l1
&&
check_sum
(
testlist
,
index
,
acc
-
l1
,
count
+
1
))
||
(
l2
>
0
&&
acc
>
l2
&&
check_sum
(
testlist
,
index
,
acc
-
l2
,
count
+
1
))
||
check_sum
(
testlist
,
index
,
acc
,
count
);
return
(
acc
>
l1
&&
check_sum
(
index
,
end
,
acc
-
l1
,
count
+
1
))
||
(
l2
>
0
&&
acc
>
l2
&&
check_sum
(
index
,
end
,
acc
-
l2
,
count
+
1
))
||
check_sum
(
index
,
end
,
acc
,
count
);
}
}
gframe/client_field.h
View file @
2a5b5bba
...
...
@@ -50,6 +50,7 @@ public:
int
selected_field
;
int
select_min
;
int
select_max
;
int
must_select_count
;
int
select_sumval
;
int
select_cancelable
;
int
select_mode
;
...
...
@@ -96,9 +97,9 @@ public:
void
FadeCard
(
ClientCard
*
pcard
,
int
alpha
,
int
frame
);
bool
CheckSelectSum
();
bool
check_min
(
std
::
set
<
ClientCard
*>&
left
,
std
::
set
<
ClientCard
*>::
iterator
index
,
int
min
,
int
max
);
bool
check_sel_sum_s
(
std
::
set
<
ClientCard
*>&
left
,
int
index
,
int
acc
);
void
check_sel_sum_t
(
std
::
set
<
ClientCard
*>&
left
,
int
acc
);
bool
check_sum
(
std
::
set
<
ClientCard
*>
&
testlist
,
std
::
set
<
ClientCard
*>::
iterator
index
,
int
acc
,
int
count
);
bool
check_sel_sum_s
(
const
std
::
set
<
ClientCard
*>&
left
,
int
index
,
int
acc
);
void
check_sel_sum_t
(
const
std
::
set
<
ClientCard
*>&
left
,
int
acc
);
bool
check_sum
(
std
::
set
<
ClientCard
*>
::
const_iterator
index
,
std
::
set
<
ClientCard
*>::
const_iterator
end
,
int
acc
,
int
count
);
irr
::
gui
::
IGUIElement
*
panel
;
std
::
vector
<
int
>
ancard
;
...
...
gframe/duelclient.cpp
View file @
2a5b5bba
...
...
@@ -1416,20 +1416,30 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
mainGame
->
dField
.
select_sumval
=
BufferIO
::
ReadInt32
(
pbuf
);
mainGame
->
dField
.
select_min
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
select_max
=
BufferIO
::
ReadInt8
(
pbuf
);
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
must_select_
count
=
BufferIO
::
ReadInt8
(
pbuf
);
mainGame
->
dField
.
selectsum_all
.
clear
();
mainGame
->
dField
.
selected_cards
.
clear
();
mainGame
->
dField
.
selectsum_cards
.
clear
();
int
c
,
l
,
s
;
unsigned
int
code
;
bool
panelmode
=
false
;
ClientCard
*
pcard
;
for
(
int
i
=
0
;
i
<
mainGame
->
dField
.
must_select_count
;
++
i
)
{
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
ReadInt8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
pcard
->
opParam
=
BufferIO
::
ReadInt32
(
pbuf
);
pcard
->
select_seq
=
0
;
mainGame
->
dField
.
selected_cards
.
push_back
(
pcard
);
}
int
count
=
BufferIO
::
ReadInt8
(
pbuf
);
for
(
int
i
=
0
;
i
<
count
;
++
i
)
{
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
l
=
BufferIO
::
ReadInt8
(
pbuf
);
s
=
BufferIO
::
ReadInt8
(
pbuf
);
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
unsigned
int
code
=
(
unsigned
int
)
BufferIO
::
ReadInt32
(
pbuf
);
int
c
=
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
int
l
=
BufferIO
::
ReadInt8
(
pbuf
);
int
s
=
BufferIO
::
ReadInt8
(
pbuf
);
ClientCard
*
pcard
=
mainGame
->
dField
.
GetCard
(
c
,
l
,
s
);
if
(
code
!=
0
&&
pcard
->
code
!=
code
)
pcard
->
SetCode
(
code
);
pcard
->
opParam
=
BufferIO
::
ReadInt32
(
pbuf
);
...
...
gframe/replay_mode.cpp
View file @
2a5b5bba
...
...
@@ -308,6 +308,8 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
pbuf
+=
6
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
;
return
ReadReplayResponse
();
}
case
MSG_SORT_CARD
:
...
...
gframe/single_duel.cpp
View file @
2a5b5bba
...
...
@@ -727,6 +727,8 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
pbuf
+=
6
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
...
...
gframe/single_mode.cpp
View file @
2a5b5bba
...
...
@@ -257,6 +257,8 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
pbuf
+=
6
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Wait
();
...
...
gframe/tag_duel.cpp
View file @
2a5b5bba
...
...
@@ -660,6 +660,8 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
pbuf
+=
6
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
;
count
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
count
*
11
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
...
...
ocgcore
@
e92e8c0b
Subproject commit
dcde72e410c233b44a71cf2dd4112d036cc2d25e
Subproject commit
e92e8c0b75f7fc3ba01f3c266667c5000baf168a
script
@
eeefb35c
Subproject commit
9f8bf9e40dfb023a2c95a14f708cd52c7e7d9521
Subproject commit
eeefb35c2a6b85ae7ed68075818894886bd5a89a
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