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
1ee0c651
Commit
1ee0c651
authored
Dec 19, 2015
by
VanillaSalt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
2a5b5bba
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
49 additions
and
61 deletions
+49
-61
gframe/client_field.cpp
gframe/client_field.cpp
+34
-0
gframe/client_field.h
gframe/client_field.h
+7
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+1
-0
gframe/event_handler.cpp
gframe/event_handler.cpp
+2
-56
gframe/event_handler.h
gframe/event_handler.h
+0
-4
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+1
-0
gframe/single_duel.cpp
gframe/single_duel.cpp
+1
-0
gframe/single_mode.cpp
gframe/single_mode.cpp
+1
-0
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+1
-0
ocgcore
ocgcore
+1
-1
No files found.
gframe/client_field.cpp
View file @
1ee0c651
...
...
@@ -1244,4 +1244,38 @@ bool ClientField::check_sum(std::set<ClientCard*>::const_iterator index, std::se
||
(
l2
>
0
&&
acc
>
l2
&&
check_sum
(
index
,
end
,
acc
-
l2
,
count
+
1
))
||
check_sum
(
index
,
end
,
acc
,
count
);
}
template
<
class
T
>
static
bool
is_declarable
(
T
const
&
cd
,
int
declarable_type
)
{
if
(
!
(
cd
.
type
&
declarable_type
))
return
false
;
return
cd
.
code
==
CARD_MARINE_DOLPHIN
||
cd
.
code
==
CARD_TWINKLE_MOSS
||
(
!
cd
.
alias
&&
(
cd
.
type
&
(
TYPE_MONSTER
+
TYPE_TOKEN
))
!=
(
TYPE_MONSTER
+
TYPE_TOKEN
));
}
void
ClientField
::
UpdateDeclarableCode
()
{
const
wchar_t
*
pname
=
mainGame
->
ebANCard
->
getText
();
int
trycode
=
BufferIO
::
GetVal
(
pname
);
CardString
cstr
;
CardData
cd
;
if
(
dataManager
.
GetString
(
trycode
,
&
cstr
)
&&
dataManager
.
GetData
(
trycode
,
&
cd
)
&&
is_declarable
(
cd
,
declarable_type
))
{
mainGame
->
lstANCard
->
clear
();
ancard
.
clear
();
mainGame
->
lstANCard
->
addItem
(
cstr
.
name
);
ancard
.
push_back
(
trycode
);
return
;
}
if
(
pname
[
0
]
==
0
||
pname
[
1
]
==
0
)
return
;
mainGame
->
lstANCard
->
clear
();
ancard
.
clear
();
for
(
auto
cit
=
dataManager
.
_strings
.
begin
();
cit
!=
dataManager
.
_strings
.
end
();
++
cit
)
{
if
(
wcsstr
(
cit
->
second
.
name
,
pname
)
!=
0
)
{
auto
cp
=
dataManager
.
GetCodePointer
(
cit
->
first
);
//verified by _strings
//datas.alias can be double card names or alias
if
(
is_declarable
(
cp
->
second
,
declarable_type
))
{
mainGame
->
lstANCard
->
addItem
(
cit
->
second
.
name
);
ancard
.
push_back
(
cit
->
first
);
}
}
}
}
}
gframe/client_field.h
View file @
1ee0c651
...
...
@@ -56,6 +56,7 @@ public:
int
select_mode
;
bool
select_ready
;
int
announce_count
;
int
declarable_type
;
int
select_counter_count
;
int
select_counter_type
;
std
::
vector
<
ClientCard
*>
selectable_cards
;
...
...
@@ -101,6 +102,8 @@ public:
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
);
void
UpdateDeclarableCode
();
irr
::
gui
::
IGUIElement
*
panel
;
std
::
vector
<
int
>
ancard
;
int
hovered_controler
;
...
...
@@ -124,4 +127,8 @@ public:
}
//special cards
#define CARD_MARINE_DOLPHIN 78734254
#define CARD_TWINKLE_MOSS 13857930
#endif //CLIENT_FIELD_H
gframe/duelclient.cpp
View file @
1ee0c651
...
...
@@ -2872,6 +2872,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
}
case
MSG_ANNOUNCE_CARD
:
{
/*int player = */
mainGame
->
LocalPlayer
(
BufferIO
::
ReadInt8
(
pbuf
));
mainGame
->
dField
.
declarable_type
=
BufferIO
::
ReadInt32
(
pbuf
);
if
(
select_hint
)
myswprintf
(
textBuffer
,
L"%ls"
,
dataManager
.
GetDesc
(
select_hint
));
else
myswprintf
(
textBuffer
,
dataManager
.
GetSysString
(
564
));
...
...
gframe/event_handler.cpp
View file @
1ee0c651
...
...
@@ -799,34 +799,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
gui
::
EGET_EDITBOX_CHANGED
:
{
switch
(
id
)
{
case
EDITBOX_ANCARD
:
{
const
wchar_t
*
pname
=
mainGame
->
ebANCard
->
getText
();
int
trycode
=
BufferIO
::
GetVal
(
pname
);
CardString
cstr
;
CardData
cd
;
if
(
dataManager
.
GetString
(
trycode
,
&
cstr
)
&&
dataManager
.
GetData
(
trycode
,
&
cd
)
&&
(
cd
.
code
==
CARD_MARINE_DOLPHIN
||
cd
.
code
==
CARD_TWINKLE_MOSS
||
!
cd
.
alias
&&
!
((
cd
.
type
&
(
TYPE_MONSTER
+
TYPE_TOKEN
))
==
(
TYPE_MONSTER
+
TYPE_TOKEN
))))
{
mainGame
->
lstANCard
->
clear
();
ancard
.
clear
();
mainGame
->
lstANCard
->
addItem
(
cstr
.
name
);
ancard
.
push_back
(
trycode
);
break
;
}
if
(
pname
[
0
]
==
0
||
pname
[
1
]
==
0
)
break
;
mainGame
->
lstANCard
->
clear
();
ancard
.
clear
();
for
(
auto
cit
=
dataManager
.
_strings
.
begin
();
cit
!=
dataManager
.
_strings
.
end
();
++
cit
)
{
if
(
wcsstr
(
cit
->
second
.
name
,
pname
)
!=
0
)
{
auto
cp
=
dataManager
.
GetCodePointer
(
cit
->
first
);
//verified by _strings
//datas.alias can be double card names or alias
if
(
cp
->
second
.
code
==
CARD_MARINE_DOLPHIN
||
cp
->
second
.
code
==
CARD_TWINKLE_MOSS
||
!
cp
->
second
.
alias
&&
!
((
cp
->
second
.
type
&
(
TYPE_MONSTER
+
TYPE_TOKEN
))
==
(
TYPE_MONSTER
+
TYPE_TOKEN
)))
{
mainGame
->
lstANCard
->
addItem
(
cit
->
second
.
name
);
ancard
.
push_back
(
cit
->
first
);
}
}
}
UpdateDeclarableCode
();
break
;
}
}
...
...
@@ -835,34 +808,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
case
irr
:
:
gui
::
EGET_EDITBOX_ENTER
:
{
switch
(
id
)
{
case
EDITBOX_ANCARD
:
{
const
wchar_t
*
pname
=
mainGame
->
ebANCard
->
getText
();
int
trycode
=
BufferIO
::
GetVal
(
pname
);
CardString
cstr
;
CardData
cd
;
if
(
dataManager
.
GetString
(
trycode
,
&
cstr
)
&&
dataManager
.
GetData
(
trycode
,
&
cd
)
&&
(
cd
.
code
==
CARD_MARINE_DOLPHIN
||
cd
.
code
==
CARD_TWINKLE_MOSS
||
!
cd
.
alias
&&
!
((
cd
.
type
&
(
TYPE_MONSTER
+
TYPE_TOKEN
))
==
(
TYPE_MONSTER
+
TYPE_TOKEN
))))
{
mainGame
->
lstANCard
->
clear
();
ancard
.
clear
();
mainGame
->
lstANCard
->
addItem
(
cstr
.
name
);
ancard
.
push_back
(
trycode
);
break
;
}
if
(
pname
[
0
]
==
0
)
break
;
mainGame
->
lstANCard
->
clear
();
ancard
.
clear
();
for
(
auto
cit
=
dataManager
.
_strings
.
begin
();
cit
!=
dataManager
.
_strings
.
end
();
++
cit
)
{
if
(
wcsstr
(
cit
->
second
.
name
,
pname
)
!=
0
)
{
auto
cp
=
dataManager
.
GetCodePointer
(
cit
->
first
);
//verified by _strings
//datas.alias can be double card names or alias
if
(
cp
->
second
.
code
==
CARD_MARINE_DOLPHIN
||
cp
->
second
.
code
==
CARD_TWINKLE_MOSS
||
!
cp
->
second
.
alias
&&
!
((
cp
->
second
.
type
&
(
TYPE_MONSTER
+
TYPE_TOKEN
))
==
(
TYPE_MONSTER
+
TYPE_TOKEN
)))
{
mainGame
->
lstANCard
->
addItem
(
cit
->
second
.
name
);
ancard
.
push_back
(
cit
->
first
);
}
}
}
UpdateDeclarableCode
();
break
;
}
case
EDITBOX_CHAT
:
{
...
...
gframe/event_handler.h
View file @
1ee0c651
#ifndef EVENT_HANDLER_H
#define EVENT_HANDLER_H
//special cards
#define CARD_MARINE_DOLPHIN 78734254
#define CARD_TWINKLE_MOSS 13857930
#include "config.h"
#include "game.h"
#include "client_card.h"
...
...
gframe/replay_mode.cpp
View file @
1ee0c651
...
...
@@ -636,6 +636,7 @@ bool ReplayMode::ReplayAnalyze(char* msg, unsigned int len) {
}
case
MSG_ANNOUNCE_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
4
;
return
ReadReplayResponse
();
}
case
MSG_ANNOUNCE_NUMBER
:
{
...
...
gframe/single_duel.cpp
View file @
1ee0c651
...
...
@@ -1258,6 +1258,7 @@ int SingleDuel::Analyze(char* msgbuffer, unsigned int len) {
case
MSG_ANNOUNCE_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
WaitforResponse
(
player
);
pbuf
+=
4
;
NetServer
::
SendBufferToPlayer
(
players
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
}
...
...
gframe/single_mode.cpp
View file @
1ee0c651
...
...
@@ -578,6 +578,7 @@ bool SingleMode::SinglePlayAnalyze(char* msg, unsigned int len) {
}
case
MSG_ANNOUNCE_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
4
;
if
(
!
DuelClient
::
ClientAnalyze
(
offset
,
pbuf
-
offset
))
{
mainGame
->
singleSignal
.
Reset
();
mainGame
->
singleSignal
.
Wait
();
...
...
gframe/tag_duel.cpp
View file @
1ee0c651
...
...
@@ -1296,6 +1296,7 @@ int TagDuel::Analyze(char* msgbuffer, unsigned int len) {
}
case
MSG_ANNOUNCE_CARD
:
{
player
=
BufferIO
::
ReadInt8
(
pbuf
);
pbuf
+=
4
;
WaitforResponse
(
player
);
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
offset
,
pbuf
-
offset
);
return
1
;
...
...
ocgcore
@
ea2ad25d
Subproject commit e
92e8c0b75f7fc3ba01f3c266667c5000baf168a
Subproject commit e
a2ad25d577e98a7915389298f190ba6bac5079b
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