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
3e9c6036
Commit
3e9c6036
authored
Sep 20, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
finish
parent
454d04b4
Pipeline
#16755
failed with stages
in 4 minutes and 9 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
gframe/duelclient.cpp
gframe/duelclient.cpp
+4
-3
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+1
-0
No files found.
gframe/duelclient.cpp
View file @
3e9c6036
...
...
@@ -4361,11 +4361,11 @@ unsigned int DuelClient::LookupHost(char *host) {
if (status != 0) {
return 0;
}
evutil_freeaddrinfo(answer);
sockaddr_in * sin = ((struct sockaddr_in *)answer->ai_addr);
char ip[20];
evutil_inet_ntop(AF_INET, &(sin->sin_addr), ip, 20);
remote_addr = htonl(inet_addr(ip));
evutil_freeaddrinfo(answer);
}
return remote_addr;
}
...
...
@@ -4411,7 +4411,6 @@ bool DuelClient::LookupSRV(char *hostname, HostResult* result) {
rnd.reset((unsigned int)time(nullptr));
rnd.shuffle_vector(records);
auto record = records.front();
printf("Result: %s:%d\n", record.host, record.port);
memcpy(resolved, record.host, 100);
result->port = record.port;
#endif
...
...
@@ -4431,7 +4430,9 @@ HostResult DuelClient::ParseHost(char *hostname) {
}
} else {
char host[100];
strncpy(host, hostname, trySplitter - hostname);
auto hostLength = trySplitter - hostname;
strncpy(host, hostname, hostLength);
host[hostLength] = '\0';
result.host = LookupHost(host);
result.port = atoi(trySplitter + 1);
}
...
...
gframe/menu_handler.cpp
View file @
3e9c6036
...
...
@@ -69,6 +69,7 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
const
wchar_t
*
pstr
=
mainGame
->
ebJoinHost
->
getText
();
BufferIO
::
CopyWStr
(
pstr
,
hostname
,
100
);
HostResult
remote
=
DuelClient
::
ParseHost
(
hostname
);
==
if
(
!
remote
.
isValid
())
{
mainGame
->
gMutex
.
lock
();
soundManager
.
PlaySoundEffect
(
SOUND_INFO
);
...
...
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