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
MobiusMei
ygopro
Commits
eb62b494
Commit
eb62b494
authored
Sep 22, 2022
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fh' into patch-show-pack
parents
929e6b4e
26d7f2fe
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
58 additions
and
18 deletions
+58
-18
gframe/client_field.h
gframe/client_field.h
+1
-0
gframe/duelclient.cpp
gframe/duelclient.cpp
+15
-5
gframe/duelclient.h
gframe/duelclient.h
+2
-1
gframe/event_handler.cpp
gframe/event_handler.cpp
+25
-12
gframe/game.cpp
gframe/game.cpp
+7
-0
gframe/game.h
gframe/game.h
+2
-0
gframe/netserver.cpp
gframe/netserver.cpp
+1
-0
strings.conf
strings.conf
+4
-0
system.conf
system.conf
+1
-0
No files found.
gframe/client_field.h
View file @
eb62b494
...
...
@@ -141,6 +141,7 @@ public:
virtual
bool
OnCommonEvent
(
const
irr
::
SEvent
&
event
);
void
GetHoverField
(
int
x
,
int
y
);
void
ShowMenu
(
int
flag
,
int
x
,
int
y
);
void
HideMenu
();
void
UpdateChainButtons
();
void
ShowCancelOrFinishButton
(
int
buttonOp
);
void
SetShowMark
(
ClientCard
*
pcard
,
bool
enable
);
...
...
gframe/duelclient.cpp
View file @
eb62b494
...
...
@@ -34,7 +34,7 @@ mt19937 DuelClient::rnd;
bool
DuelClient
::
is_refreshing
=
false
;
int
DuelClient
::
match_kill
=
0
;
std
::
vector
<
HostPacket
>
DuelClient
::
hosts
;
std
::
set
<
unsigned
int
>
DuelClient
::
remotes
;
std
::
set
<
std
::
pair
<
unsigned
int
,
unsigned
short
>
>
DuelClient
::
remotes
;
event
*
DuelClient
::
resp_event
=
0
;
bool
DuelClient
::
StartClient
(
unsigned
int
ip
,
unsigned
short
port
,
bool
create_game
)
{
...
...
@@ -603,6 +603,11 @@ void DuelClient::HandleSTOCPacketLan(char* data, unsigned int len) {
mainGame
->
btnShuffle
->
setVisible
(
false
);
if
(
!
mainGame
->
chkIgnore1
->
isChecked
())
mainGame
->
wChat
->
setVisible
(
true
);
if
(
mainGame
->
chkDefaultShowChain
->
isChecked
())
{
mainGame
->
always_chain
=
true
;
mainGame
->
ignore_chain
=
false
;
mainGame
->
chain_when_avail
=
false
;
}
mainGame
->
device
->
setEventReceiver
(
&
mainGame
->
dField
);
if
(
!
mainGame
->
dInfo
.
isTag
)
{
if
(
selftype
>
1
)
{
...
...
@@ -874,7 +879,7 @@ int DuelClient::ClientAnalyze(char * msg, unsigned int len) {
memcpy
(
last_successful_msg
,
msg
,
len
);
last_successful_msg_length
=
len
;
}
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
dField
.
HideMenu
(
);
if
(
!
mainGame
->
dInfo
.
isReplay
&&
mainGame
->
dInfo
.
curMsg
!=
MSG_WAITING
&&
mainGame
->
dInfo
.
curMsg
!=
MSG_CARD_SELECTED
)
{
mainGame
->
waitFrame
=
-
1
;
mainGame
->
stHintMsg
->
setVisible
(
false
);
...
...
@@ -4033,11 +4038,16 @@ void DuelClient::BroadcastReply(evutil_socket_t fd, short events, void * arg) {
socklen_t
sz
=
sizeof
(
sockaddr_in
);
char
buf
[
256
];
/*int ret = */
recvfrom
(
fd
,
buf
,
256
,
0
,
(
sockaddr
*
)
&
bc_addr
,
&
sz
);
unsigned
int
ipaddr
=
bc_addr
.
sin_addr
.
s_addr
;
HostPacket
*
pHP
=
(
HostPacket
*
)
buf
;
if
(
!
is_closing
&&
pHP
->
identifier
==
NETWORK_SERVER_ID
&&
pHP
->
version
==
PRO_VERSION
&&
remotes
.
find
(
ipaddr
)
==
remotes
.
end
()
)
{
if
(
is_closing
||
pHP
->
identifier
!=
NETWORK_SERVER_ID
)
return
;
if
(
pHP
->
version
!=
PRO_VERSION
)
return
;
unsigned
int
ipaddr
=
bc_addr
.
sin_addr
.
s_addr
;
const
auto
remote
=
std
::
make_pair
(
ipaddr
,
pHP
->
port
);
if
(
remotes
.
find
(
remote
)
==
remotes
.
end
())
{
mainGame
->
gMutex
.
lock
();
remotes
.
insert
(
ipaddr
);
remotes
.
insert
(
remote
);
pHP
->
ipaddr
=
ipaddr
;
hosts
.
push_back
(
*
pHP
);
std
::
wstring
hoststr
;
...
...
gframe/duelclient.h
View file @
eb62b494
...
...
@@ -4,6 +4,7 @@
#include "config.h"
#include <vector>
#include <set>
#include <utility>
#include <event2/event.h>
#include <event2/listener.h>
#include <event2/bufferevent.h>
...
...
@@ -76,7 +77,7 @@ protected:
static
bool
is_refreshing
;
static
int
match_kill
;
static
event
*
resp_event
;
static
std
::
set
<
unsigned
int
>
remotes
;
static
std
::
set
<
std
::
pair
<
unsigned
int
,
unsigned
short
>
>
remotes
;
public:
static
std
::
vector
<
HostPacket
>
hosts
;
static
void
BeginRefreshHost
();
...
...
gframe/event_handler.cpp
View file @
eb62b494
...
...
@@ -363,7 +363,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
case
BUTTON_CMD_ACTIVATE
:
case
BUTTON_CMD_RESET
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
ShowCancelOrFinishButton
(
0
);
if
(
!
list_command
)
{
if
(
!
menu_card
)
...
...
@@ -449,7 +449,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_CMD_SUMMON
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
if
(
!
menu_card
)
break
;
for
(
size_t
i
=
0
;
i
<
summonable_cards
.
size
();
++
i
)
{
...
...
@@ -463,7 +463,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_CMD_SPSUMMON
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
if
(
!
list_command
)
{
if
(
!
menu_card
)
break
;
...
...
@@ -506,7 +506,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_CMD_MSET
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
if
(
!
menu_card
)
break
;
for
(
size_t
i
=
0
;
i
<
msetable_cards
.
size
();
++
i
)
{
...
...
@@ -519,7 +519,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_CMD_SSET
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
if
(
!
menu_card
)
break
;
for
(
size_t
i
=
0
;
i
<
ssetable_cards
.
size
();
++
i
)
{
...
...
@@ -532,7 +532,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_CMD_REPOS
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
if
(
!
menu_card
)
break
;
for
(
size_t
i
=
0
;
i
<
reposable_cards
.
size
();
++
i
)
{
...
...
@@ -545,7 +545,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_CMD_ATTACK
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
if
(
!
menu_card
)
break
;
for
(
size_t
i
=
0
;
i
<
attackable_cards
.
size
();
++
i
)
{
...
...
@@ -558,7 +558,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
break
;
}
case
BUTTON_CMD_SHOWLIST
:
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
selectable_cards
.
clear
();
wchar_t
formatBuffer
[
2048
];
switch
(
command_location
)
{
...
...
@@ -1074,7 +1074,11 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
UpdateChainButtons
();
}
if
(
mainGame
->
wCmdMenu
->
isVisible
()
&&
!
mainGame
->
wCmdMenu
->
getRelativePosition
().
isPointInside
(
mousepos
))
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
();
if
(
mainGame
->
btnBP
->
isVisible
()
&&
mainGame
->
btnBP
->
getAbsolutePosition
().
isPointInside
(
mousepos
))
break
;
if
(
mainGame
->
btnM2
->
isVisible
()
&&
mainGame
->
btnM2
->
getAbsolutePosition
().
isPointInside
(
mousepos
))
break
;
if
(
panel
&&
panel
->
isVisible
())
break
;
GetHoverField
(
x
,
y
);
...
...
@@ -1480,7 +1484,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
UpdateChainButtons
();
}
mainGame
->
HideElement
(
mainGame
->
wSurrender
);
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
if
(
mainGame
->
fadingList
.
size
())
break
;
CancelOrFinish
();
...
...
@@ -1563,7 +1567,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
}
if
(
mcard
)
{
if
(
mcard
!=
menu_card
)
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
if
(
hovered_location
==
LOCATION_HAND
)
{
mcard
->
is_hovered
=
true
;
MoveCard
(
mcard
,
5
);
...
...
@@ -2248,7 +2252,7 @@ void ClientField::GetHoverField(int x, int y) {
}
void
ClientField
::
ShowMenu
(
int
flag
,
int
x
,
int
y
)
{
if
(
!
flag
)
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
HideMenu
(
);
return
;
}
menu_card
=
clicked_card
;
...
...
@@ -2316,11 +2320,20 @@ void ClientField::ShowMenu(int flag, int x, int y) {
}
else
mainGame
->
btnReset
->
setVisible
(
false
);
panel
=
mainGame
->
wCmdMenu
;
mainGame
->
wCmdMenu
->
setVisible
(
true
);
mainGame
->
btnBP
->
setEnabled
(
false
);
mainGame
->
btnM2
->
setEnabled
(
false
);
mainGame
->
btnEP
->
setEnabled
(
false
);
if
(
mainGame
->
gameConf
.
resize_popup_menu
)
mainGame
->
wCmdMenu
->
setRelativePosition
(
mainGame
->
Resize
(
x
-
20
,
y
-
20
,
x
+
80
,
y
-
20
,
0
,
-
height
,
0
,
0
));
else
mainGame
->
wCmdMenu
->
setRelativePosition
(
mainGame
->
Resize
(
x
,
y
,
x
,
y
,
-
20
,
-
(
20
+
height
),
80
,
-
20
));
}
void
ClientField
::
HideMenu
()
{
mainGame
->
wCmdMenu
->
setVisible
(
false
);
mainGame
->
btnBP
->
setEnabled
(
true
);
mainGame
->
btnM2
->
setEnabled
(
true
);
mainGame
->
btnEP
->
setEnabled
(
true
);
}
void
ClientField
::
UpdateChainButtons
()
{
if
(
mainGame
->
btnChainAlways
->
isVisible
())
{
mainGame
->
btnChainIgnore
->
setPressed
(
mainGame
->
ignore_chain
);
...
...
gframe/game.cpp
View file @
eb62b494
...
...
@@ -368,6 +368,9 @@ bool Game::Initialize() {
chkWaitChain
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabHelper
,
-
1
,
dataManager
.
GetSysString
(
1277
));
chkWaitChain
->
setChecked
(
gameConf
.
chkWaitChain
!=
0
);
posY
+=
30
;
chkDefaultShowChain
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabHelper
,
-
1
,
dataManager
.
GetSysString
(
1354
));
chkDefaultShowChain
->
setChecked
(
gameConf
.
chkDefaultShowChain
!=
0
);
posY
+=
30
;
chkQuickAnimation
=
env
->
addCheckBox
(
false
,
rect
<
s32
>
(
posX
,
posY
,
posX
+
260
,
posY
+
25
),
tabHelper
,
CHECKBOX_QUICK_ANIMATION
,
dataManager
.
GetSysString
(
1299
));
chkQuickAnimation
->
setChecked
(
gameConf
.
quick_animation
!=
0
);
posY
+=
30
;
...
...
@@ -1298,6 +1301,7 @@ void Game::LoadConfig() {
gameConf
.
chkRandomPos
=
0
;
gameConf
.
chkAutoChain
=
0
;
gameConf
.
chkWaitChain
=
0
;
gameConf
.
chkDefaultShowChain
=
0
;
gameConf
.
chkIgnore1
=
0
;
gameConf
.
chkIgnore2
=
0
;
gameConf
.
use_lflist
=
1
;
...
...
@@ -1366,6 +1370,8 @@ void Game::LoadConfig() {
gameConf
.
chkAutoChain
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"waitchain"
))
{
gameConf
.
chkWaitChain
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"showchain"
))
{
gameConf
.
chkDefaultShowChain
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"mute_opponent"
))
{
gameConf
.
chkIgnore1
=
atoi
(
valbuf
);
}
else
if
(
!
strcmp
(
strbuf
,
"mute_spectators"
))
{
...
...
@@ -1481,6 +1487,7 @@ void Game::SaveConfig() {
fprintf
(
fp
,
"randompos = %d
\n
"
,
(
chkRandomPos
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"autochain = %d
\n
"
,
(
chkAutoChain
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"waitchain = %d
\n
"
,
(
chkWaitChain
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"showchain = %d
\n
"
,
(
chkDefaultShowChain
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"mute_opponent = %d
\n
"
,
(
chkIgnore1
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"mute_spectators = %d
\n
"
,
(
chkIgnore2
->
isChecked
()
?
1
:
0
));
fprintf
(
fp
,
"use_lflist = %d
\n
"
,
gameConf
.
use_lflist
);
...
...
gframe/game.h
View file @
eb62b494
...
...
@@ -33,6 +33,7 @@ struct Config {
int
chkRandomPos
;
int
chkAutoChain
;
int
chkWaitChain
;
int
chkDefaultShowChain
;
int
chkIgnore1
;
int
chkIgnore2
;
int
use_lflist
;
...
...
@@ -290,6 +291,7 @@ public:
irr
::
gui
::
IGUICheckBox
*
chkRandomPos
;
irr
::
gui
::
IGUICheckBox
*
chkAutoChain
;
irr
::
gui
::
IGUICheckBox
*
chkWaitChain
;
irr
::
gui
::
IGUICheckBox
*
chkDefaultShowChain
;
irr
::
gui
::
IGUICheckBox
*
chkQuickAnimation
;
irr
::
gui
::
IGUICheckBox
*
chkAutoSaveReplay
;
irr
::
gui
::
IGUICheckBox
*
chkDrawSingleChain
;
...
...
gframe/netserver.cpp
View file @
eb62b494
...
...
@@ -42,6 +42,7 @@ bool NetServer::StartBroadcast() {
SOCKET
udp
=
socket
(
AF_INET
,
SOCK_DGRAM
,
IPPROTO_UDP
);
BOOL
opt
=
TRUE
;
setsockopt
(
udp
,
SOL_SOCKET
,
SO_BROADCAST
,
(
const
char
*
)
&
opt
,
sizeof
(
BOOL
));
setsockopt
(
udp
,
SOL_SOCKET
,
SO_REUSEADDR
,
(
const
char
*
)
&
opt
,
sizeof
(
BOOL
));
sockaddr_in
addr
;
memset
(
&
addr
,
0
,
sizeof
(
addr
));
addr
.
sin_family
=
AF_INET
;
...
...
strings.conf
View file @
eb62b494
...
...
@@ -401,6 +401,7 @@
!
system
1351
投降
!
system
1352
主要信息:
!
system
1353
播放起始于回合:
!
system
1354
开局默认显示所有时点
!
system
1356
此操作将放弃对当前卡组的修改,是否继续?
!
system
1357
不提示保留对卡组的修改
!
system
1358
键入关键字后自动进行搜索
...
...
@@ -1157,3 +1158,6 @@
!
setname
0
x188
深渊之兽 ビーステッド
!
setname
0
x189
俱舍怒威族 クシャトリラ
!
setname
0
x18a
魊影
Ghoti
!
setname
0
x18b
救援
ACE
队
R
-
ACE
!
setname
0
x18c
纯爱妖精 ピュアリィ
!
setname
0
x18d
御巫
system.conf
View file @
eb62b494
...
...
@@ -18,6 +18,7 @@ autospellpos = 0
randompos
=
0
autochain
=
0
waitchain
=
0
showchain
=
0
mute_opponent
=
0
mute_spectators
=
0
use_lflist
=
1
...
...
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