Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
R
rd-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
苍蓝
rd-ygopro
Commits
e677f04b
Commit
e677f04b
authored
Dec 27, 2023
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:Fluorohydride/ygopro
parents
74a18ab3
62fe61c7
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
89 additions
and
64 deletions
+89
-64
gframe/client_card.h
gframe/client_card.h
+6
-6
gframe/client_field.h
gframe/client_field.h
+2
-2
gframe/game.h
gframe/game.h
+17
-17
gframe/network.h
gframe/network.h
+22
-17
gframe/single_duel.cpp
gframe/single_duel.cpp
+32
-14
gframe/single_duel.h
gframe/single_duel.h
+7
-6
ocgcore
ocgcore
+1
-1
script
script
+1
-1
strings.conf
strings.conf
+1
-0
No files found.
gframe/client_card.h
View file @
e677f04b
...
...
@@ -92,12 +92,12 @@ public:
std
::
set
<
ClientCard
*>
ownerTarget
;
std
::
map
<
int
,
int
>
counters
;
std
::
map
<
int
,
int
>
desc_hints
;
wchar_t
atkstring
[
16
]{
0
};
wchar_t
defstring
[
16
]{
0
};
wchar_t
lvstring
[
16
]{
0
};
wchar_t
linkstring
[
16
]{
0
};
wchar_t
lscstring
[
16
]{
0
};
wchar_t
rscstring
[
16
]{
0
};
wchar_t
atkstring
[
16
]{};
wchar_t
defstring
[
16
]{};
wchar_t
lvstring
[
16
]{};
wchar_t
linkstring
[
16
]{};
wchar_t
lscstring
[
16
]{};
wchar_t
rscstring
[
16
]{};
ClientCard
()
=
default
;
~
ClientCard
();
...
...
gframe/client_field.h
View file @
e677f04b
...
...
@@ -47,7 +47,7 @@ public:
std
::
vector
<
int
>
select_options
;
std
::
vector
<
int
>
select_options_index
;
std
::
vector
<
ChainInfo
>
chains
;
int
extra_p_count
[
2
]{
0
};
int
extra_p_count
[
2
]{};
size_t
selected_option
{
0
};
ClientCard
*
attacker
{
nullptr
};
...
...
@@ -79,7 +79,7 @@ public:
bool
remove_act
{
false
};
bool
deck_act
{
false
};
bool
extra_act
{
false
};
bool
pzone_act
[
2
]{
false
};
bool
pzone_act
[
2
]{};
bool
conti_act
{
false
};
bool
chain_forced
{
false
};
ChainInfo
current_chain
;
...
...
gframe/game.h
View file @
e677f04b
...
...
@@ -81,31 +81,31 @@ struct DuelInfo {
bool
isSingleMode
{
false
};
bool
is_shuffling
{
false
};
bool
is_swapped
{
false
};
bool
tag_player
[
2
]{
false
};
bool
tag_player
[
2
]{};
bool
isReplaySwapped
{
false
};
int
lp
[
2
]{
0
};
int
lp
[
2
]{};
int
start_lp
{
0
};
int
card_count
[
2
]{
0
};
int
total_attack
[
2
]{
0
};
int
card_count
[
2
]{};
int
total_attack
[
2
]{};
int
duel_rule
{
0
};
int
turn
{
0
};
short
curMsg
{
0
};
wchar_t
hostname
[
20
]{
0
};
wchar_t
clientname
[
20
]{
0
};
wchar_t
hostname_tag
[
20
]{
0
};
wchar_t
clientname_tag
[
20
]{
0
};
wchar_t
strLP
[
2
][
16
]{
0
};
wchar_t
*
vic_string
{
0
};
wchar_t
hostname
[
20
]{};
wchar_t
clientname
[
20
]{};
wchar_t
hostname_tag
[
20
]{};
wchar_t
clientname_tag
[
20
]{};
wchar_t
strLP
[
2
][
16
]{};
wchar_t
*
vic_string
{
nullptr
};
unsigned
char
player_type
{
0
};
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
};
unsigned
short
time_left
[
2
]{};
wchar_t
str_time_left
[
2
][
16
]{};
video
::
SColor
time_color
[
2
]{};
wchar_t
str_card_count
[
2
][
16
]{};
wchar_t
str_total_attack
[
2
][
16
]{};
video
::
SColor
card_count_color
[
2
]{};
video
::
SColor
total_attack_color
[
2
]{};
std
::
vector
<
unsigned
int
>
announce_cache
;
void
Clear
();
...
...
gframe/network.h
View file @
e677f04b
...
...
@@ -12,16 +12,16 @@
namespace
ygo
{
struct
HostInfo
{
unsigned
int
lflist
{
0
}
;
unsigned
char
rule
{
0
}
;
unsigned
char
mode
{
0
}
;
unsigned
char
duel_rule
{
0
}
;
bool
no_check_deck
{
false
}
;
bool
no_shuffle_deck
{
false
}
;
unsigned
int
start_lp
{
0
}
;
unsigned
char
start_hand
{
0
}
;
unsigned
char
draw_count
{
0
}
;
unsigned
short
time_limit
{
0
}
;
unsigned
int
lflist
;
unsigned
char
rule
;
unsigned
char
mode
;
unsigned
char
duel_rule
;
bool
no_check_deck
;
bool
no_shuffle_deck
;
unsigned
int
start_lp
;
unsigned
char
start_hand
;
unsigned
char
draw_count
;
unsigned
short
time_limit
;
};
struct
HostPacket
{
unsigned
short
identifier
;
...
...
@@ -99,17 +99,22 @@ struct STOC_HS_WatchChange {
class
DuelMode
;
struct
DuelPlayer
{
unsigned
short
name
[
20
]{
0
};
DuelMode
*
game
{
nullptr
};
unsigned
char
player_id
{
0xff
};
unsigned
char
type
{
0
};
unsigned
char
state
{
0
};
bufferevent
*
bev
{
0
};
unsigned
short
name
[
20
];
DuelMode
*
game
;
unsigned
char
type
;
unsigned
char
state
;
bufferevent
*
bev
;
DuelPlayer
()
{
game
=
0
;
type
=
0
;
state
=
0
;
bev
=
0
;
}
};
class
DuelMode
{
public:
DuelMode
()
:
host_player
(
nullptr
),
pduel
(
0
),
duel_stage
(
0
)
{}
DuelMode
()
:
host_player
(
0
),
pduel
(
0
),
duel_stage
(
0
)
{}
virtual
~
DuelMode
()
{}
virtual
void
Chat
(
DuelPlayer
*
dp
,
void
*
pdata
,
int
len
)
{}
virtual
void
JoinGame
(
DuelPlayer
*
dp
,
void
*
pdata
,
bool
is_creater
)
{}
...
...
gframe/single_duel.cpp
View file @
e677f04b
...
...
@@ -342,8 +342,6 @@ void SingleDuel::StartDuel(DuelPlayer* dp) {
hand_result
[
1
]
=
0
;
players
[
0
]
->
state
=
CTOS_HAND_RESULT
;
players
[
1
]
->
state
=
CTOS_HAND_RESULT
;
players
[
0
]
->
player_id
=
0
;
players
[
1
]
->
player_id
=
1
;
duel_stage
=
DUEL_STAGE_FINGER
;
}
void
SingleDuel
::
HandResult
(
DuelPlayer
*
dp
,
unsigned
char
res
)
{
...
...
@@ -391,6 +389,8 @@ void SingleDuel::TPResult(DuelPlayer* dp, unsigned char tp) {
return
;
duel_stage
=
DUEL_STAGE_DUELING
;
bool
swapped
=
false
;
pplayer
[
0
]
=
players
[
0
];
pplayer
[
1
]
=
players
[
1
];
if
((
tp
&&
dp
->
type
==
1
)
||
(
!
tp
&&
dp
->
type
==
0
))
{
DuelPlayer
*
p
=
players
[
0
];
players
[
0
]
=
players
[
1
];
...
...
@@ -533,6 +533,15 @@ void SingleDuel::DuelEndProc() {
NetServer
::
ReSendToPlayer
(
*
oit
);
duel_stage
=
DUEL_STAGE_END
;
}
else
{
if
(
players
[
0
]
!=
pplayer
[
0
])
{
players
[
0
]
=
pplayer
[
0
];
players
[
1
]
=
pplayer
[
1
];
players
[
0
]
->
type
=
0
;
players
[
1
]
->
type
=
1
;
Deck
d
=
pdeck
[
0
];
pdeck
[
0
]
=
pdeck
[
1
];
pdeck
[
1
]
=
d
;
}
ready
[
0
]
=
false
;
ready
[
1
]
=
false
;
players
[
0
]
->
state
=
CTOS_UPDATE_DECK
;
...
...
@@ -546,7 +555,7 @@ void SingleDuel::DuelEndProc() {
}
}
void
SingleDuel
::
Surrender
(
DuelPlayer
*
dp
)
{
if
(
dp
->
type
>
1
||
dp
->
player_id
>
1
||
!
pduel
)
if
(
dp
->
type
>
1
||
!
pduel
)
return
;
unsigned
char
wbuf
[
3
];
uint32
player
=
dp
->
type
;
...
...
@@ -557,9 +566,13 @@ void SingleDuel::Surrender(DuelPlayer* dp) {
NetServer
::
ReSendToPlayer
(
players
[
1
]);
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
match_result
[
duel_count
]
=
1
-
dp
->
player_id
;
++
duel_count
;
tp_player
=
player
;
if
(
players
[
player
]
==
pplayer
[
player
])
{
match_result
[
duel_count
++
]
=
1
-
player
;
tp_player
=
player
;
}
else
{
match_result
[
duel_count
++
]
=
player
;
tp_player
=
1
-
player
;
}
EndDuel
();
DuelEndProc
();
event_del
(
etimer
);
...
...
@@ -633,14 +646,15 @@ int SingleDuel::Analyze(unsigned char* msgbuffer, unsigned int len) {
for
(
auto
oit
=
observers
.
begin
();
oit
!=
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
if
(
player
>
1
)
{
match_result
[
duel_count
]
=
2
;
match_result
[
duel_count
++
]
=
2
;
tp_player
=
1
-
tp_player
;
}
else
{
match_result
[
duel_count
]
=
players
[
player
]
->
player_id
;
}
else
if
(
players
[
player
]
==
pplayer
[
player
])
{
match_result
[
duel_count
++
]
=
player
;
tp_player
=
1
-
player
;
}
else
{
match_result
[
duel_count
++
]
=
1
-
player
;
tp_player
=
player
;
}
++
duel_count
;
EndDuel
();
return
2
;
}
...
...
@@ -1599,9 +1613,13 @@ void SingleDuel::SingleTimer(evutil_socket_t fd, short events, void* arg) {
NetServer
::
ReSendToPlayer
(
sd
->
players
[
1
]);
for
(
auto
oit
=
sd
->
observers
.
begin
();
oit
!=
sd
->
observers
.
end
();
++
oit
)
NetServer
::
ReSendToPlayer
(
*
oit
);
sd
->
match_result
[
sd
->
duel_count
]
=
sd
->
players
[
1
-
player
]
->
player_id
;
++
sd
->
duel_count
;
sd
->
tp_player
=
player
;
if
(
sd
->
players
[
player
]
==
sd
->
pplayer
[
player
])
{
sd
->
match_result
[
sd
->
duel_count
++
]
=
1
-
player
;
sd
->
tp_player
=
player
;
}
else
{
sd
->
match_result
[
sd
->
duel_count
++
]
=
player
;
sd
->
tp_player
=
1
-
player
;
}
sd
->
EndDuel
();
sd
->
DuelEndProc
();
event_del
(
sd
->
etimer
);
...
...
gframe/single_duel.h
View file @
e677f04b
...
...
@@ -45,11 +45,12 @@ private:
int
WriteUpdateData
(
int
&
player
,
int
location
,
int
&
flag
,
unsigned
char
*&
qbuf
,
int
&
use_cache
);
protected:
DuelPlayer
*
players
[
2
]{
nullptr
};
bool
ready
[
2
]{
false
};
DuelPlayer
*
players
[
2
]{};
DuelPlayer
*
pplayer
[
2
]{};
bool
ready
[
2
]{};
Deck
pdeck
[
2
];
int
deck_error
[
2
]{
0
};
unsigned
char
hand_result
[
2
]{
0
};
int
deck_error
[
2
]{};
unsigned
char
hand_result
[
2
]{};
unsigned
char
last_response
{
0
};
std
::
set
<
DuelPlayer
*>
observers
;
Replay
last_replay
;
...
...
@@ -57,8 +58,8 @@ protected:
int
match_kill
{
0
};
unsigned
char
duel_count
{
0
};
unsigned
char
tp_player
{
0
};
unsigned
char
match_result
[
3
]{
0
};
short
time_limit
[
2
]{
0
};
unsigned
char
match_result
[
3
]{};
short
time_limit
[
2
]{};
short
time_elapsed
{
0
};
};
...
...
ocgcore
@
16af5ec2
Subproject commit
a159e87ee061cd273568ce53d51ee52530335219
Subproject commit
16af5ec2714a40a7eef6a393a8724801bfcfa6a1
script
@
7feb4173
Subproject commit
5a38fb44ade94757f87226d16606787eb447c843
Subproject commit
7feb4173949fff6bbf7d698790217427adc772a6
strings.conf
View file @
e677f04b
...
...
@@ -1214,3 +1214,4 @@
!
setname
0
x1a5
于贝尔 ユベル
!
setname
0
x1a6
肃声 粛声
!
setname
0
x1a7
白斗气 ホワイト・オーラ
!
setname
0
x1a8
玩具 トイ
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