Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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
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
MyCard
ygopro-2pick
Commits
24c216be
Commit
24c216be
authored
May 21, 2013
by
Fluorohydride
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #532 from matteoserva/master
hostnames supported in lan mode
parents
5a0227dc
1252ad89
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
1 deletion
+22
-1
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+22
-1
No files found.
gframe/menu_handler.cpp
View file @
24c216be
...
...
@@ -37,7 +37,28 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
while
(
*
pstr
&&
i
<
16
)
ip
[
i
++
]
=
*
pstr
++
;
ip
[
i
]
=
0
;
unsigned
int
remote_addr
=
htonl
(
inet_addr
(
ip
));
struct
addrinfo
hints
,
*
servinfo
;
memset
(
&
hints
,
0
,
sizeof
(
struct
addrinfo
));
hints
.
ai_family
=
AF_INET
;
/* Allow IPv4 or IPv6 */
hints
.
ai_socktype
=
SOCK_STREAM
;
/* Datagram socket */
hints
.
ai_flags
=
AI_PASSIVE
;
/* For wildcard IP address */
hints
.
ai_protocol
=
0
;
/* Any protocol */
hints
.
ai_canonname
=
NULL
;
hints
.
ai_addr
=
NULL
;
hints
.
ai_next
=
NULL
;
int
status
;
char
hostname
[
100
];
BufferIO
::
CopyWStr
((
wchar_t
*
)
mainGame
->
ebJoinIP
->
getText
(),
hostname
,
100
);
if
((
status
=
getaddrinfo
(
hostname
,
NULL
,
&
hints
,
&
servinfo
))
==
-
1
)
{
//fprintf(stderr, "getaddrinfo error: %s\n", gai_strerror(status));
//error handling
}
else
{
inet_ntop
(
AF_INET
,
&
(((
struct
sockaddr_in
*
)
servinfo
->
ai_addr
)
->
sin_addr
),
ip
,
20
);
}
unsigned
int
remote_addr
=
htonl
(
inet_addr
(
ip
));
unsigned
int
remote_port
=
_wtoi
(
mainGame
->
ebJoinPort
->
getText
());
BufferIO
::
CopyWStr
(
mainGame
->
ebJoinIP
->
getText
(),
mainGame
->
gameConf
.
lastip
,
20
);
BufferIO
::
CopyWStr
(
mainGame
->
ebJoinPort
->
getText
(),
mainGame
->
gameConf
.
lastport
,
20
);
...
...
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