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
xiaoye
ygopro
Commits
204c32d1
"include/svn:/svn.code.sf.net/p/irrlicht/code/trunk@3520" did not exist on "481f5503130f82bef59e94c792b6283d04a5ea94"
Commit
204c32d1
authored
Dec 23, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into server
parents
3f5f506c
c0f1dfab
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
48 additions
and
22 deletions
+48
-22
gframe/base64.h
gframe/base64.h
+6
-6
gframe/client_field.h
gframe/client_field.h
+4
-4
gframe/deck_con.cpp
gframe/deck_con.cpp
+5
-5
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+4
-4
gframe/deck_manager.h
gframe/deck_manager.h
+2
-2
gframe/game.cpp
gframe/game.cpp
+17
-1
gframe/game.h
gframe/game.h
+10
-0
No files found.
gframe/base64.h
View file @
204c32d1
...
...
@@ -53,9 +53,9 @@ class Base64 {
return
(
enc_len
==
out
->
size
());
}
static
bool
Encode
(
const
char
*
input
,
size_t
input_length
,
char
*
out
,
size_t
out_length
)
{
static
bool
Encode
(
const
unsigned
char
*
input
,
size_t
input_length
,
unsigned
char
*
out
,
size_t
out_length
)
{
int
i
=
0
,
j
=
0
;
char
*
out_begin
=
out
;
unsigned
char
*
out_begin
=
out
;
unsigned
char
a3
[
3
];
unsigned
char
a4
[
4
];
...
...
@@ -148,9 +148,9 @@ class Base64 {
return
(
dec_len
==
out
->
size
());
}
static
bool
Decode
(
const
char
*
input
,
size_t
input_length
,
char
*
out
,
size_t
out_length
)
{
static
bool
Decode
(
const
unsigned
char
*
input
,
size_t
input_length
,
unsigned
char
*
out
,
size_t
out_length
)
{
int
i
=
0
,
j
=
0
;
char
*
out_begin
=
out
;
unsigned
char
*
out_begin
=
out
;
unsigned
char
a3
[
3
];
unsigned
char
a4
[
4
];
...
...
@@ -198,10 +198,10 @@ class Base64 {
return
(
out
==
(
out_begin
+
decoded_length
));
}
static
int
DecodedLength
(
const
char
*
in
,
size_t
in_length
)
{
static
int
DecodedLength
(
const
unsigned
char
*
in
,
size_t
in_length
)
{
int
numEq
=
0
;
const
char
*
in_end
=
in
+
in_length
;
const
unsigned
char
*
in_end
=
in
+
in_length
;
while
(
*--
in_end
==
'='
)
++
numEq
;
return
((
6
*
in_length
)
/
8
)
-
numEq
;
...
...
gframe/client_field.h
View file @
204c32d1
...
...
@@ -66,6 +66,7 @@ public:
int
announce_count
{
0
};
int
select_counter_count
{
0
};
int
select_counter_type
{
0
};
int
current_mset_param
{
0
};
std
::
vector
<
ClientCard
*>
selectable_cards
;
std
::
vector
<
ClientCard
*>
selected_cards
;
std
::
set
<
ClientCard
*>
selectsum_cards
;
...
...
@@ -123,13 +124,12 @@ public:
bool
check_sum_trib
(
std
::
set
<
ClientCard
*>::
const_iterator
index
,
std
::
set
<
ClientCard
*>::
const_iterator
end
,
int
acc
);
void
UpdateDeclarableList
();
void
RefreshCardCountDisplay
();
bool
is_dragging_cardtext
;
int
dragging_cardtext_start_pos
;
int
dragging_cardtext_start_y
;
irr
::
gui
::
IGUIElement
*
panel
{
nullptr
};
bool
is_dragging_cardtext
{
false
};
int
dragging_cardtext_start_pos
{
0
};
int
dragging_cardtext_start_y
{
0
};
std
::
vector
<
int
>
ancard
;
int
hovered_controler
{
0
};
int
hovered_location
{
0
};
...
...
gframe/deck_con.cpp
View file @
204c32d1
...
...
@@ -233,9 +233,9 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
wDeckCode
->
setText
(
dataManager
.
GetSysString
(
1387
));
if
(
deckManager
.
current_deck
.
main
.
size
()
>
0
||
deckManager
.
current_deck
.
extra
.
size
()
>
0
||
deckManager
.
current_deck
.
side
.
size
()
>
0
)
{
wchar_t
deck_code
[
2048
];
char
deck_code_utf8
[
1024
];
unsigned
char
deck_code_utf8
[
1024
];
deckManager
.
SaveDeckToCode
(
deckManager
.
current_deck
,
deck_code_utf8
);
BufferIO
::
DecodeUTF8
(
deck_code_utf8
,
deck_code
);
BufferIO
::
DecodeUTF8
(
(
char
*
)
deck_code_utf8
,
deck_code
);
mainGame
->
ebDeckCode
->
setText
(
deck_code
);
}
else
mainGame
->
ebDeckCode
->
setText
(
L""
);
...
...
@@ -249,9 +249,9 @@ bool DeckBuilder::OnEvent(const irr::SEvent& event) {
mainGame
->
HideElement
(
mainGame
->
wDeckCode
);
if
(
prev_operation
==
BUTTON_DECK_CODE
)
{
Deck
new_deck
;
char
deck_code
[
1024
];
BufferIO
::
EncodeUTF8
(
mainGame
->
ebDeckCode
->
getText
(),
deck_code
);
if
(
deckManager
.
LoadDeckFromCode
(
new_deck
,
deck_code
,
strlen
(
deck_code
)))
unsigned
char
deck_code
[
1024
];
BufferIO
::
EncodeUTF8
(
mainGame
->
ebDeckCode
->
getText
(),
(
char
*
)
deck_code
);
if
(
deckManager
.
LoadDeckFromCode
(
new_deck
,
deck_code
,
strlen
(
(
char
*
)
deck_code
)))
deckManager
.
current_deck
=
new_deck
;
else
mainGame
->
env
->
addMessageBox
(
L""
,
dataManager
.
GetSysString
(
1389
));
...
...
gframe/deck_manager.cpp
View file @
204c32d1
...
...
@@ -364,8 +364,8 @@ int DeckManager::TypeCount(std::vector<code_pointer> list, unsigned int ctype) {
}
return
res
;
}
bool
DeckManager
::
LoadDeckFromCode
(
Deck
&
deck
,
const
char
*
code
,
int
len
)
{
char
data
[
1024
],
*
pdeck
=
data
,
*
data_
=
data
;
bool
DeckManager
::
LoadDeckFromCode
(
Deck
&
deck
,
const
unsigned
char
*
code
,
int
len
)
{
unsigned
char
data
[
1024
],
*
pdeck
=
data
,
*
data_
=
data
;
int
decoded_len
=
Base64
::
DecodedLength
(
code
,
len
);
if
(
decoded_len
>
1024
||
decoded_len
<
8
||
!
Base64
::
Decode
(
code
,
len
,
data_
,
decoded_len
))
return
false
;
...
...
@@ -374,8 +374,8 @@ bool DeckManager::LoadDeckFromCode(Deck& deck, const char *code, int len) {
int
errorcode
=
LoadDeck
(
deck
,
(
int
*
)
pdeck
,
mainc
,
sidec
);
return
(
errorcode
==
0
);
}
int
DeckManager
::
SaveDeckToCode
(
Deck
&
deck
,
char
*
code
)
{
char
deckbuf
[
1024
],
*
pdeck
=
deckbuf
;
int
DeckManager
::
SaveDeckToCode
(
Deck
&
deck
,
unsigned
char
*
code
)
{
unsigned
char
deckbuf
[
1024
],
*
pdeck
=
deckbuf
;
BufferIO
::
WriteInt32
(
pdeck
,
deck
.
main
.
size
()
+
deck
.
extra
.
size
());
BufferIO
::
WriteInt32
(
pdeck
,
deck
.
side
.
size
());
for
(
size_t
i
=
0
;
i
<
deck
.
main
.
size
();
++
i
)
...
...
gframe/deck_manager.h
View file @
204c32d1
...
...
@@ -61,8 +61,8 @@ public:
bool
DeleteDeck
(
const
wchar_t
*
file
);
wchar_t
DeckFormatBuffer
[
128
];
int
TypeCount
(
std
::
vector
<
code_pointer
>
list
,
unsigned
int
ctype
);
bool
LoadDeckFromCode
(
Deck
&
deck
,
const
char
*
code
,
int
len
);
int
SaveDeckToCode
(
Deck
&
deck
,
char
*
code
);
bool
LoadDeckFromCode
(
Deck
&
deck
,
const
unsigned
char
*
code
,
int
len
);
int
SaveDeckToCode
(
Deck
&
deck
,
unsigned
char
*
code
);
bool
CreateCategory
(
const
wchar_t
*
name
);
bool
RenameCategory
(
const
wchar_t
*
oldname
,
const
wchar_t
*
newname
);
bool
DeleteCategory
(
const
wchar_t
*
name
);
...
...
gframe/game.cpp
View file @
204c32d1
...
...
@@ -33,6 +33,7 @@ namespace ygo {
Game
*
mainGame
;
#ifndef YGOPRO_SERVER_MODE
void
DuelInfo
::
Clear
()
{
isStarted
=
false
;
isFinished
=
false
;
...
...
@@ -63,7 +64,22 @@ void DuelInfo::Clear() {
time_limit
=
0
;
time_left
[
0
]
=
0
;
time_left
[
1
]
=
0
;
str_time_left
[
0
][
0
]
=
0
;
str_time_left
[
1
][
0
]
=
0
;
time_color
[
0
]
=
0
;
time_color
[
1
]
=
0
;
str_card_count
[
0
][
0
]
=
0
;
str_card_count
[
1
][
0
]
=
0
;
str_total_attack
[
0
][
0
]
=
0
;
str_total_attack
[
1
][
0
]
=
0
;
card_count_color
[
0
]
=
0
;
card_count_color
[
1
]
=
0
;
total_attack_color
[
0
]
=
0
;
total_attack_color
[
1
]
=
0
;
announce_cache
.
clear
();
}
#endif
#ifdef YGOPRO_SERVER_MODE
unsigned
short
server_port
;
...
...
@@ -261,7 +277,7 @@ bool Game::Initialize() {
SetWindowsIcon
();
//main menu
wchar_t
strbuf
[
256
];
myswprintf
(
strbuf
,
L"KoishiPro %X.0%X.%X Te
mpestissimo
"
,
PRO_VERSION
>>
12
,
(
PRO_VERSION
>>
4
)
&
0xff
,
PRO_VERSION
&
0xf
);
myswprintf
(
strbuf
,
L"KoishiPro %X.0%X.%X Te
stify
"
,
PRO_VERSION
>>
12
,
(
PRO_VERSION
>>
4
)
&
0xff
,
PRO_VERSION
&
0xf
);
wMainMenu
=
env
->
addWindow
(
rect
<
s32
>
(
370
,
200
,
650
,
415
),
false
,
strbuf
);
wMainMenu
->
getCloseButton
()
->
setVisible
(
false
);
btnLanMode
=
env
->
addButton
(
rect
<
s32
>
(
10
,
30
,
270
,
60
),
wMainMenu
,
BUTTON_LAN_MODE
,
dataManager
.
GetSysString
(
1200
));
...
...
gframe/game.h
View file @
204c32d1
...
...
@@ -85,10 +85,13 @@ struct DuelInfo {
bool
isTag
{
false
};
bool
isSingleMode
{
false
};
bool
is_shuffling
{
false
};
bool
is_swapped
{
false
};
bool
tag_player
[
2
]{
false
};
bool
isReplaySwapped
{
false
};
int
lp
[
2
]{
0
};
int
start_lp
{
0
};
int
card_count
[
2
]{
0
};
int
total_attack
[
2
]{
0
};
int
duel_rule
{
0
};
int
turn
{
0
};
short
curMsg
{
0
};
...
...
@@ -102,6 +105,13 @@ struct DuelInfo {
unsigned
char
time_player
{
0
};
unsigned
short
time_limit
{
0
};
unsigned
short
time_left
[
2
]{
0
};
wchar_t
str_time_left
[
2
][
16
]{
0
};
video
::
SColor
time_color
[
2
]{
0
};
wchar_t
str_card_count
[
2
][
16
]{
0
};
wchar_t
str_total_attack
[
2
][
16
]{
0
};
video
::
SColor
card_count_color
[
2
]{
0
};
video
::
SColor
total_attack_color
[
2
]{
0
};
std
::
vector
<
unsigned
int
>
announce_cache
;
void
Clear
();
};
...
...
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