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
REIKAI
ygopro
Commits
3c7b9082
Commit
3c7b9082
authored
Sep 20, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more fix
parent
6a5fbe5c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
8 deletions
+12
-8
gframe/duelclient.cpp
gframe/duelclient.cpp
+11
-7
gframe/premake5.lua
gframe/premake5.lua
+1
-1
No files found.
gframe/duelclient.cpp
View file @
3c7b9082
...
@@ -4373,14 +4373,15 @@ unsigned int DuelClient::LookupHost(char *host) {
...
@@ -4373,14 +4373,15 @@ unsigned int DuelClient::LookupHost(char *host) {
}
}
bool
DuelClient
::
LookupSRV
(
char
*
hostname
,
HostResult
*
result
)
{
bool
DuelClient
::
LookupSRV
(
char
*
hostname
,
HostResult
*
result
)
{
char
resolved
[
100
];
#ifdef _WIN32
#ifdef _WIN32
PDNS_RECORD
ret
;
PDNS_RECORD
ret
;
DNS_STATUS
status
=
DnsQuery_
UTF8
(
hostname
,
DNS_TYPE_SRV
,
DNS_QUERY_STANDARD
,
NULL
,
&
ret
,
NULL
);
DNS_STATUS
status
=
DnsQuery_
W
(
hostname
,
DNS_TYPE_SRV
,
DNS_QUERY_STANDARD
,
NULL
,
&
ret
,
NULL
);
if
(
status
!=
0
)
if
(
status
!=
0
)
return
false
;
return
false
;
result
->
host
=
LookupHost
(
ret
->
Data
.
SRV
.
pNameTarget
);
BufferIO
::
EncodeUTF8
(
ret
->
Data
.
SRV
.
pNameTarget
,
resolved
);
result
->
port
=
ntohs
(
ret
->
Data
.
SRV
.
wPort
);
result
->
port
=
ntohs
(
ret
->
Data
.
SRV
.
wPort
);
return
true
;
DnsRecordListFree
(
ret
,
DnsFreeRecordListDeep
)
;
#else
#else
struct
__res_state
res
;
struct
__res_state
res
;
int
status
=
res_ninit
(
&
res
);
int
status
=
res_ninit
(
&
res
);
...
@@ -4393,6 +4394,7 @@ bool DuelClient::LookupSRV(char *hostname, HostResult* result) {
...
@@ -4393,6 +4394,7 @@ bool DuelClient::LookupSRV(char *hostname, HostResult* result) {
ns_msg
nsMsg
;
ns_msg
nsMsg
;
ns_rr
rr
;
ns_rr
rr
;
ns_initparse
(
answer
,
status
,
&
nsMsg
);
ns_initparse
(
answer
,
status
,
&
nsMsg
);
bool
found
=
false
;
for
(
int
i
=
0
;
i
<
ns_msg_count
(
nsMsg
,
ns_s_an
);
i
++
)
{
for
(
int
i
=
0
;
i
<
ns_msg_count
(
nsMsg
,
ns_s_an
);
i
++
)
{
if
(
ns_parserr
(
&
nsMsg
,
ns_s_an
,
i
,
&
rr
)
<
0
||
ns_rr_type
(
rr
)
!=
T_SRV
)
if
(
ns_parserr
(
&
nsMsg
,
ns_s_an
,
i
,
&
rr
)
<
0
||
ns_rr_type
(
rr
)
!=
T_SRV
)
continue
;
continue
;
...
@@ -4405,11 +4407,13 @@ bool DuelClient::LookupSRV(char *hostname, HostResult* result) {
...
@@ -4405,11 +4407,13 @@ bool DuelClient::LookupSRV(char *hostname, HostResult* result) {
// decompress domain name
// decompress domain name
if
(
dn_expand
(
ns_msg_base
(
nsMsg
),
ns_msg_end
(
nsMsg
),
ns_rr_rdata
(
rr
)
+
3
*
NS_INT16SZ
,
resolved
,
sizeof
(
resolved
))
<
0
)
if
(
dn_expand
(
ns_msg_base
(
nsMsg
),
ns_msg_end
(
nsMsg
),
ns_rr_rdata
(
rr
)
+
3
*
NS_INT16SZ
,
resolved
,
sizeof
(
resolved
))
<
0
)
continue
;
continue
;
result
->
host
=
LookupHost
(
resolved
);
found
=
true
;
return
true
;
}
}
return
false
;
if
(
!
found
)
return
false
;
#endif
#endif
result
->
host
=
LookupHost
(
resolved
);
return
true
;
}
}
HostResult
DuelClient
::
ParseHost
(
char
*
hostname
)
{
HostResult
DuelClient
::
ParseHost
(
char
*
hostname
)
{
...
...
gframe/premake5.lua
View file @
3c7b9082
...
@@ -66,7 +66,7 @@ project "YGOPro"
...
@@ -66,7 +66,7 @@ project "YGOPro"
filter
{}
filter
{}
end
end
end
end
links
{
"opengl32"
,
"ws2_32"
,
"winmm"
,
"gdi32"
,
"kernel32"
,
"user32"
,
"imm32"
}
links
{
"opengl32"
,
"ws2_32"
,
"winmm"
,
"gdi32"
,
"kernel32"
,
"user32"
,
"imm32"
,
"Dnsapi"
}
filter
"not action:vs*"
filter
"not action:vs*"
buildoptions
{
"-std=c++14"
,
"-fno-rtti"
}
buildoptions
{
"-std=c++14"
,
"-fno-rtti"
}
filter
"not system:windows"
filter
"not system:windows"
...
...
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