VGOEmulator.net

A Development Project for the Vanguard:Saga of Heroes MMO

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • Portal
  • Project Manager
  • Bug Tracker
  • Server List
  • Wiki
  • Donate
  • Login
  • Register
  • Board index Support General Support
  • Search

Error compiling 1418

General Support topics.

Moderator: Community Managers

Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
User avatar
jimm0thy
Posts: 13
Joined: Wed Sep 10, 2014 3:24 pm
Location: NJ
Error compiling 1418
  • Quote

Post by jimm0thy » Fri Aug 21, 2015 5:05 pm

Two days ago I downloaded the source from SVN and attempted to compile in VS2013, however the below error occurs for socketaddress.cpp

Code: Select all

socketaddress.cpp(126): error C4996: 'inet_ntoa': Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
1>          c:\program files (x86)\windows kits\8.1\include\um\winsock2.h(1868) : see declaration of 'inet_ntoa'
Below is lines 123 - 133 of socketaddress.cpp

Code: Select all

#else
    if (addr.sa_family == AF_INET) {
        if (include_port)
            sprintf(addr_str, "%s:%d", inet_ntoa(((struct sockaddr_in *)&addr)->sin_addr), GetPort());
        else
            sprintf(addr_str, "%s", inet_ntoa(((struct sockaddr_in *)&addr)->sin_addr));
        return addr_str;
    }

    return "< IPv6 in early versions of Windows not supported! >";
#endif

I've tried compiling this on both a Windows 10 machine and Windows 7 machine , both 64bit. I was able to get it to compile by editing the last few lines of socketaddress.cpp to the below (which is just a copy of the code from above it at the start of the if/then statement).
I program in vb.net and can follow C# and Java to some extent, but C++ not so much.

Code: Select all

#else
	char buf[sizeof(addr_str)];
    if (addr.sa_family == AF_INET) {
        if (include_port)
            sprintf(addr_str, "%s:%d", inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr, buf, sizeof(buf)), GetPort()); // was inet_ntoa
        else
            sprintf(addr_str, "%s", inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr, buf, sizeof(buf))); // was inet_ntoa
        return addr_str;
    }

    return "< IPv6 in early versions of Windows not supported! >";
#endif
Just wanted to throw that out there, maybe theres something I'm missing, but I have been able to compile and set the VGO server.
Which brings me to something else I noticed, with the vgo-world.xml file. The server settings in the file ask for externalIP= , however using this I can never fully connect to my server (hangs at waiting for data). Leaving the externalIP empty works for local connections, and changing externalIP= completely to worldaddress= seems to work just fine
Top

User avatar
jimm0thy
Posts: 13
Joined: Wed Sep 10, 2014 3:24 pm
Location: NJ
Re: Error compiling 1418
  • Quote

Post by jimm0thy » Sat Aug 22, 2015 8:51 pm

With some testing I found that my compiled code change wasn't allowing external connections. However changing it to the below (basically removing the If / Then statement without actually removing it) it now accepts external connections.
Though the default code from svn still will not compile for me due to the above error.
This also allowed me to set the vgo-world.xml back to using externalIp= , so doubt the worldaddress= in its place was doing anything.

Code: Select all

const char * SocketAddress::ToString(bool include_port) {
#if !defined(_WIN32) || (defined(NTTDI_VERSION) && NTTDI_VERSION >= NTDDI_VISTA)
	char buf[sizeof(addr_str)];
    if (addr.sa_family == AF_INET) {
        if (include_port)
            sprintf(addr_str, "%s:%d", inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr, buf, sizeof(buf)), GetPort());
        else
            sprintf(addr_str, "%s", inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr, buf, sizeof(buf)));
    }
    else {
        if (include_port)
            sprintf(addr_str, "%s:%d", inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&addr)->sin6_addr, buf, sizeof(buf)), GetPort());
        else
            sprintf(addr_str, "%s", inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&addr)->sin6_addr, buf, sizeof(buf)));
    }

    return addr_str;
#else
	char buf[sizeof(addr_str)];
	if (addr.sa_family == AF_INET) {
		if (include_port)
			sprintf(addr_str, "%s:%d", inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr, buf, sizeof(buf)), GetPort());
		else
			sprintf(addr_str, "%s", inet_ntop(AF_INET, &((struct sockaddr_in *)&addr)->sin_addr, buf, sizeof(buf)));
	}
	else {
		if (include_port)
			sprintf(addr_str, "%s:%d", inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&addr)->sin6_addr, buf, sizeof(buf)), GetPort());
		else
			sprintf(addr_str, "%s", inet_ntop(AF_INET6, &((struct sockaddr_in6 *)&addr)->sin6_addr, buf, sizeof(buf)));
	}

    return "< IPv6 in early versions of Windows not supported! >";
#endif
Top

User avatar
John Adams
Retired
Posts: 4582
Joined: Wed Aug 28, 2013 9:40 am
Location: Phoenix, AZ.
Contact:
Contact John Adams
Website
Re: Error compiling 1418
  • Quote

Post by John Adams » Sun Aug 23, 2015 9:27 am

This is very strange, since many other worlds compile fine from Public SVN. We'll look into it. Thanks for the report and research.
Top

User avatar
Xinux
Project Leader
Project Leader
Posts: 2549
Joined: Wed Aug 28, 2013 2:20 pm
Re: Error compiling 1418
  • Quote

Post by Xinux » Sun Aug 23, 2015 9:55 am

It's a issue with vs2013 and winsock i had the same issue when i tried vs2013 i ended up just going back to vs2012.
Top

zippyzee
Developer
Developer
Posts: 1240
Joined: Wed Jul 23, 2014 2:11 pm
Re: Error compiling 1418
  • Quote

Post by zippyzee » Sun Aug 23, 2015 10:09 am

Or do the define that it asks for and all is good. I believe that's what I did.
Top

User avatar
jimm0thy
Posts: 13
Joined: Wed Sep 10, 2014 3:24 pm
Location: NJ
Re: Error compiling 1418
  • Quote

Post by jimm0thy » Sun Aug 23, 2015 12:12 pm

Thanks guys, figured it was something simple I was missing. Installed VS2012 and it compiled fine
Top


Post Reply
  • Print view

6 posts • Page 1 of 1

Return to “General Support”

Jump to
  • Information
  • ↳   Announcements
  • ↳   Dev Chats
  • ↳   Events
  • Community
  • ↳   General Discussions
  • ↳   VGO Team Help Requests
  • ↳   Introductions
  • ↳   Game Features
  • ↳   Wish List
  • ↳   Off-Topic
  • Support
  • ↳   How-To's
  • ↳   General Support
  • ↳   Windows
  • ↳   Linux
  • Bugs
  • ↳   Server Bugs
  • ↳   Server Bugs (Closed)
  • ↳   Content Bugs
  • ↳   Content Bugs (Closed)
  • ↳   Database Bugs
  • ↳   Tools Bugs
  • Board index
  • All times are UTC-07:00
  • Delete cookies
  • Contact us
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD