Compare commits

..
17 Commits
Author SHA1 Message Date
Cameron Gutman aeb288b62b Version 1.3 2018-10-23 17:38:06 -07:00
Cameron Gutman d9320bed7d Print a version header on logs and console output 2018-10-23 17:36:48 -07:00
Cameron Gutman e8c39d1919 Print a message when we discover no UPnP devices at all 2018-10-23 17:13:09 -07:00
Cameron Gutman 1efebca1bd Fix displaying 2 dialogs when we detect a Double NAT 2018-10-23 17:12:47 -07:00
Cameron Gutman 222ed5a568 Catch bogus private port values returned for NAT-PMP conflict 2018-10-23 17:11:55 -07:00
Cameron Gutman 5da85a1fb2 Fix malformed UPnP lease duration 2018-10-23 17:11:05 -07:00
Cameron Gutman 83c4413926 Remove port forwarding entries when MISS is stopped 2018-10-22 09:33:18 -07:00
Cameron Gutman 15d60ed10a Offer to show the troubleshooting log for terminal warnings too 2018-10-21 23:45:22 -07:00
Cameron Gutman f1738fc11e Fix a misleading message if GameStream has never been enabled 2018-10-21 21:41:36 -07:00
Cameron Gutman 0867814ae8 Fix double NAT port test 2018-10-21 21:32:30 -07:00
Cameron Gutman 541a0bf9d9 Version 1.2 2018-10-21 21:23:02 -07:00
Cameron Gutman 632bba6da8 Minor cosmetic changes to wording and warnings 2018-10-21 21:17:25 -07:00
Cameron Gutman 0ec33223f4 Rename mist.log to mis-test.log 2018-10-21 21:04:29 -07:00
Cameron Gutman 45b624c203 Improve reliability with NAT reflection disabled, UPnP IGD reporting disconnected, double-NATs, and CGNs 2018-10-21 21:04:08 -07:00
Cameron Gutman 7bc806edb4 Increase polling rate to once per 2 minutes to ensure rules are updated quickly after a router reboot 2018-10-21 20:33:18 -07:00
Cameron Gutman afe60bfe30 Fix handling of IGD returning empty IP address and success status 2018-10-21 19:27:55 -07:00
Cameron Gutman ac4e0101f2 Fix brown-paper-bag comment mistake in subnet calculation 2018-10-21 19:25:11 -07:00
5 changed files with 206 additions and 98 deletions
+29 -4
View File
@@ -11,6 +11,8 @@
#include <assert.h>
#include <stdlib.h>
#include "..\version.h"
#pragma comment(lib, "miniupnpc.lib")
#pragma comment(lib, "libnatpmp.lib")
#pragma comment(lib, "ws2_32.lib")
@@ -25,10 +27,10 @@
#include <natpmp.h>
#define NL "\n"
#define STR(x) #x
#define SERVICE_NAME "MISS"
#define UPNP_SERVICE_NAME "Moonlight"
#define POLLING_DELAY_SEC 120
#define PORT_MAPPING_DURATION_SEC 3600
#define UPNP_DISCOVERY_DELAY_MS 5000
@@ -148,10 +150,11 @@ bool UPnPMapPort(struct UPNPUrls* urls, struct IGDdatas* data, int proto, const
}
// Create or update the expiration time of an existing mapping
snprintf(leaseDuration, sizeof(leaseDuration), "%d", PORT_MAPPING_DURATION_SEC);
printf("Updating UPnP port mapping for %s %s -> %s...", protoStr, portStr, myAddr);
err = UPNP_AddPortMapping(
urls->controlURL, data->first.servicetype, portStr,
portStr, myAddr, myDesc, protoStr, nullptr, STR(PORT_MAPPING_DURATION_SEC));
portStr, myAddr, myDesc, protoStr, nullptr, leaseDuration);
if (err == 725) { // OnlyPermanentLeasesSupported
err = UPNP_AddPortMapping(
urls->controlURL, data->first.servicetype, portStr,
@@ -384,9 +387,20 @@ bool NATPMPMapPort(natpmp_t* natpmp, int proto, int port, bool enable)
}
else if (response.pnu.newportmapping.mappedpublicport != port) {
printf("CONFLICT" NL);
// Some buggy routers (Untangle) will change the *internal* port when
// adjusting a port mapping request that collides. This is why we also
// pass privateport back from the response and not from the port we originally
// asked for. Warn in this case.
if (response.pnu.newportmapping.privateport != port) {
printf("Buggy router changed the internal port when handling NAT-PMP conflict! (%d -> %d)" NL,
port, response.pnu.newportmapping.privateport);
}
// It couldn't assign us the external port we requested and gave us an alternate external port.
// We can't use this alternate mapping, so immediately release it.
sendnewportmappingrequest(natpmp, natPmpProto, port, response.pnu.newportmapping.mappedpublicport, 0);
sendnewportmappingrequest(natpmp, natPmpProto, response.pnu.newportmapping.privateport,
response.pnu.newportmapping.mappedpublicport, 0);
return false;
}
else {
@@ -536,6 +550,9 @@ void ResetLogFile()
// Redirect stdout to this new file
freopen(currentLogFilePath, "w", stdout);
// Print a log header
printf("Moonlight Internet Streaming Service v" VER_VERSION_STR NL);
}
DWORD WINAPI GameStreamStateChangeThread(PVOID Context)
@@ -590,7 +607,7 @@ int Run()
fflush(stdout);
ULONGLONG beforeSleepTime = GetTickCount64();
DWORD ret = WaitForMultipleObjects(ARRAYSIZE(events), events, false, (PORT_MAPPING_DURATION_SEC * 1000) / 2);
DWORD ret = WaitForMultipleObjects(ARRAYSIZE(events), events, false, POLLING_DELAY_SEC * 1000);
if (ret == WAIT_OBJECT_0) {
ResetLogFile();
@@ -627,6 +644,14 @@ HandlerEx(DWORD dwControl, DWORD dwEventType, LPVOID lpEventData, LPVOID lpConte
return NO_ERROR;
case SERVICE_CONTROL_STOP:
ServiceStatus.dwCurrentState = SERVICE_STOP_PENDING;
ServiceStatus.dwControlsAccepted = 0;
SetServiceStatus(ServiceStatusHandle, &ServiceStatus);
printf("Removing UPnP/NAT-PMP rules after service stop request\n");
UpdatePortMappings(false);
printf("The service is stopping\n");
ServiceStatus.dwCurrentState = SERVICE_STOPPED;
SetServiceStatus(ServiceStatusHandle, &ServiceStatus);
return NO_ERROR;
+2 -2
View File
@@ -2,7 +2,7 @@
#include "../version.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
FILEVERSION VER_VERSION
BEGIN
BLOCK "StringFileInfo"
BEGIN
@@ -10,7 +10,7 @@ BEGIN
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", "Moonlight Internet Streaming Service"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
END
END
+169 -88
View File
@@ -12,6 +12,8 @@
#include <shellapi.h>
#include <objbase.h>
#include "..\version.h"
#pragma comment(lib, "miniupnpc.lib")
#pragma comment(lib, "libnatpmp.lib")
#pragma comment(lib, "ws2_32.lib")
@@ -65,33 +67,53 @@ static struct port_entry {
char logFilePath[MAX_PATH + 1];
void DisplayMessage(const char* message, bool error = true)
enum MessagePriority {
MpInfo,
MpWarn,
MpError
};
void DisplayMessage(const char* message, MessagePriority priority = MpError, bool terminal = true)
{
printf("%s\n", message);
printf("--------------- MISS LOG -------------------\n");
char missPath[MAX_PATH + 1];
ExpandEnvironmentStringsA("%ProgramData%\\MISS\\miss-current.log", missPath, sizeof(missPath));
FILE* f = fopen(missPath, "r");
if (f != nullptr) {
char buffer[1024];
while (!feof(f)) {
int bytesRead = fread(buffer, 1, ARRAYSIZE(buffer), f);
fwrite(buffer, 1, bytesRead, stdout);
if (terminal) {
printf("--------------- MISS LOG -------------------\n");
char missPath[MAX_PATH + 1];
ExpandEnvironmentStringsA("%ProgramData%\\MISS\\miss-current.log", missPath, sizeof(missPath));
FILE* f = fopen(missPath, "r");
if (f != nullptr) {
char buffer[1024];
while (!feof(f)) {
int bytesRead = fread(buffer, 1, ARRAYSIZE(buffer), f);
fwrite(buffer, 1, bytesRead, stdout);
}
fclose(f);
}
fclose(f);
}
else {
printf("Failed to find MISS log\n");
else {
printf("Failed to find MISS log\n");
}
fflush(stdout);
}
fflush(stdout);
DWORD flags = MB_OK | MB_TOPMOST | MB_SETFOREGROUND;
flags |= error ? MB_ICONERROR : MB_ICONINFORMATION;
switch (priority) {
case MpInfo:
flags |= MB_ICONINFORMATION;
break;
case MpWarn:
flags |= MB_ICONWARNING;
break;
case MpError:
flags |= MB_ICONERROR;
break;
}
MessageBoxA(nullptr, message, "Moonlight Internet Streaming Tester", flags);
if (error) {
if (priority != MpInfo && terminal) {
flags = MB_YESNO | MB_TOPMOST | MB_SETFOREGROUND | MB_ICONINFORMATION;
switch (MessageBoxA(nullptr, "Would you like to view the troubleshooting log?",
"Moonlight Internet Streaming Tester", flags))
@@ -115,19 +137,18 @@ bool IsGameStreamEnabled()
error = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\NVIDIA Corporation\\NvStream", 0, KEY_READ | KEY_WOW64_64KEY, &key);
if (error != ERROR_SUCCESS) {
printf("RegOpenKeyEx() failed: %d\n", error);
DisplayMessage("GeForce Experience is not installed. Please install GeForce Experience to use Moonlight.");
DisplayMessage("GeForce Experience was not detected on this PC. Make sure you're installing this utility on your GeForce GameStream-compatible PC, not the device running Moonlight.");
return false;
}
len = sizeof(enabled);
error = RegQueryValueExA(key, "EnableStreaming", nullptr, nullptr, (LPBYTE)&enabled, &len);
RegCloseKey(key);
if (error != ERROR_SUCCESS) {
printf("RegQueryValueExA() failed: %d\n", error);
DisplayMessage("GeForce Experience is not installed. Please install GeForce Experience to use Moonlight.");
return false;
}
else if (!enabled) {
if (error != ERROR_SUCCESS || !enabled) {
// GFE may not even write EnableStreaming until the user enables GameStream for the first time
if (error != ERROR_SUCCESS) {
printf("RegQueryValueExA() failed: %d\n", error);
}
DisplayMessage("GameStream is not enabled in GeForce Experience. Please open GeForce Experience settings, navigate to the Shield tab, and turn GameStream on.");
return false;
}
@@ -253,7 +274,7 @@ PortTestStatus TestPort(PSOCKADDR_STORAGE addr, int proto, int port, bool withSe
return err == 1 ? PortTestOk : PortTestError;
}
else {
const char testMsg[] = "mist-test";
const char testMsg[] = "moonlight-test";
err = sendto(clientSock, testMsg, sizeof(testMsg), 0, (struct sockaddr*)&sin6, addrLen);
if (err == SOCKET_ERROR) {
printf("sendto() failed: %d\n", WSAGetLastError());
@@ -289,13 +310,10 @@ PortTestStatus TestPort(PSOCKADDR_STORAGE addr, int proto, int port, bool withSe
}
}
bool TestAllPorts(PSOCKADDR_STORAGE addr, const char* baseMessage, char* message, int messageLength)
bool TestAllPorts(PSOCKADDR_STORAGE addr, char* portMsg, int portMsgLen)
{
strcpy_s(message, messageLength, baseMessage);
message += strlen(baseMessage);
messageLength -= strlen(baseMessage);
bool ret = true;
for (int i = 0; i < ARRAYSIZE(k_Ports); i++) {
printf("Testing %s %d...",
k_Ports[i].proto == IPPROTO_TCP ? "TCP" : "UDP",
@@ -305,11 +323,11 @@ bool TestAllPorts(PSOCKADDR_STORAGE addr, const char* baseMessage, char* message
// If we got an unknown result, assume it matches with whatever
// we've gotten so far.
if (status == PortTestError || !ret) {
int msgLen = snprintf(message, messageLength, "%s %d\n",
int msgLen = snprintf(portMsg, portMsgLen, "%s %d\n",
k_Ports[i].proto == IPPROTO_TCP ? "TCP" : "UDP",
k_Ports[i].port);
message += msgLen;
messageLength -= msgLen;
portMsg += msgLen;
portMsgLen -= msgLen;
// Keep going to check all ports and report the failing ones
ret = false;
@@ -524,14 +542,14 @@ bool STUNFindWanAddress(PSOCKADDR_IN wanAddr)
return true;
}
bool CheckWANAccess(PSOCKADDR_IN wanAddr, bool* foundPortForwardingRules)
bool CheckWANAccess(PSOCKADDR_IN wanAddr, PSOCKADDR_IN reportedWanAddr, bool* foundPortForwardingRules, bool* igdDisconnected)
{
natpmp_t natpmp;
*foundPortForwardingRules = false;
*igdDisconnected = false;
printf("Finding WAN IP address...");
bool gotWanAddress = false;
bool gotReportedWanAddress = false;
int natPmpErr = initnatpmp(&natpmp, 0, 0);
if (natPmpErr != 0) {
printf("initnatpmp() failed: %d\n", natPmpErr);
@@ -556,11 +574,22 @@ bool CheckWANAccess(PSOCKADDR_IN wanAddr, bool* foundPortForwardingRules)
if (ret != 0) {
// Connected or disconnected IGD
if (ret == 1 || ret == 2) {
if (ret == 2) {
*igdDisconnected = true;
}
printf("Discovered UPnP IGD at: %s\n", urls.controlURL);
printf("Detecting WAN IP address via UPnP...");
ret = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, wanAddrStr);
if (ret == UPNPCOMMAND_SUCCESS) {
wanAddr->sin_addr.S_un.S_addr = inet_addr(wanAddrStr);
printf("%s (UPnP)\n", wanAddrStr);
gotWanAddress = true;
if (ret == UPNPCOMMAND_SUCCESS && strlen(wanAddrStr) > 0) {
reportedWanAddr->sin_addr.S_un.S_addr = wanAddr->sin_addr.S_un.S_addr = inet_addr(wanAddrStr);
printf("%s\n", wanAddrStr);
if (wanAddr->sin_addr.S_un.S_addr != 0) {
gotReportedWanAddress = true;
}
}
else {
printf("FAILED %d\n", ret);
}
char conflictMessage[512];
@@ -585,52 +614,70 @@ bool CheckWANAccess(PSOCKADDR_IN wanAddr, bool* foundPortForwardingRules)
}
}
}
else {
printf("No UPnP IGD detected\n");
}
FreeUPNPUrls(&urls);
}
else {
printf("No UPnP devices detected\n");
}
}
// Use the delay of upnpDiscoverAll() to also allow the NAT-PMP endpoint time to respond
if (natPmpErr >= 0) {
printf("Detecting WAN IP address via NAT-PMP...");
natpmpresp_t response;
natPmpErr = readnatpmpresponseorretry(&natpmp, &response);
closenatpmp(&natpmp);
if (natPmpErr == 0 && !gotWanAddress) {
if (natPmpErr == 0) {
char addrStr[64];
wanAddr->sin_addr = response.pnu.publicaddress.addr;
reportedWanAddr->sin_addr = wanAddr->sin_addr = response.pnu.publicaddress.addr;
inet_ntop(AF_INET, &response.pnu.publicaddress.addr, addrStr, sizeof(addrStr));
printf("%s (NAT-PMP)\n", addrStr);
gotWanAddress = true;
printf("%s\n", addrStr);
if (wanAddr->sin_addr.S_un.S_addr != 0) {
gotReportedWanAddress = true;
}
}
else {
printf("FAILED %d\n", natPmpErr);
}
}
if (!gotWanAddress) {
if (!STUNFindWanAddress(wanAddr)) {
printf("FAILED\n");
DisplayMessage("MIST was unable to determine your public IP address. Please check your Internet connection.");
printf("Detecting WAN IP address via STUN...");
if (!STUNFindWanAddress(wanAddr)) {
if (!gotReportedWanAddress) {
DisplayMessage("Unable to determine your public IP address. Please check your Internet connection.");
return false;
}
char addrStr[64];
inet_ntop(AF_INET, &wanAddr->sin_addr, addrStr, sizeof(addrStr));
printf("%s (STUN)\n", addrStr);
return true;
}
else {
return true;
char addrStr[64];
inet_ntop(AF_INET, &wanAddr->sin_addr, addrStr, sizeof(addrStr));
printf("%s\n", addrStr);
if (!gotReportedWanAddress) {
// If we didn't get anything from UPnP or NAT-PMP, just populate the reported
// address with what we got from STUN
*reportedWanAddr = *wanAddr;
}
}
return true;
}
bool IsPossibleCGN(PSOCKADDR_IN wanAddr)
{
DWORD addr = htonl(wanAddr->sin_addr.S_un.S_addr);
// 10.0.0.0/24 - ISPs used to use this
// 10.0.0.0/8 - ISPs used to use this
if ((addr & 0xFF000000) == 0x0A000000) {
return true;
}
// 100.64.0.0 - RFC6598 official CGN address
// 100.64.0.0/10 - RFC6598 official CGN address
else if ((addr & 0xFFC0) == 0x64400000) {
return true;
}
@@ -642,11 +689,11 @@ bool IsDoubleNAT(PSOCKADDR_IN wanAddr)
{
DWORD addr = htonl(wanAddr->sin_addr.S_un.S_addr);
// 10.0.0.0/24
// 10.0.0.0/8
if ((addr & 0xFF000000) == 0x0A000000) {
return true;
}
// 172.16.0.0/20
// 172.16.0.0/12
else if ((addr & 0xFFF00000) == 0xAC100000) {
return true;
}
@@ -665,9 +712,15 @@ int main(int argc, char* argv[])
char tempPath[MAX_PATH + 1];
GetTempPathA(sizeof(tempPath), tempPath);
snprintf(logFilePath, sizeof(logFilePath), "%s\\%s", tempPath, "mist.log");
snprintf(logFilePath, sizeof(logFilePath), "%s\\%s", tempPath, "mis-test.log");
freopen(logFilePath, "w", stdout);
// Print a log header
printf("Moonlight Internet Streaming Tester v" VER_VERSION_STR "\n");
// Print a console header
fprintf(stderr, "Moonlight Internet Streaming Tester v" VER_VERSION_STR "\n\n");
int err = WSAStartup(MAKEWORD(2, 2), &wsaData);
if (err != NO_ERROR) {
DisplayMessage("Unable to initialize WinSock");
@@ -687,6 +740,7 @@ int main(int argc, char* argv[])
SOCKADDR_IN6 sin6;
};
char msgBuf[2048];
char portMsgBuf[512];
fprintf(stderr, "Testing local GameStream connectivity...\n");
@@ -695,9 +749,10 @@ int main(int argc, char* argv[])
sin.sin_family = AF_INET;
sin.sin_addr = in4addr_loopback;
printf("Testing GameStream ports via loopback\n");
if (!TestAllPorts(&ss,
"Local GameStream connectivity check failed. Please try reinstalling GeForce Experience.\n\nThe following ports were not working:\n",
msgBuf, sizeof(msgBuf))) {
if (!TestAllPorts(&ss, portMsgBuf, sizeof(portMsgBuf))) {
snprintf(msgBuf, sizeof(msgBuf),
"Local GameStream connectivity check failed. Please try reinstalling GeForce Experience.\n\nThe following ports were not working:\n%s",
portMsgBuf);
DisplayMessage(msgBuf);
return -1;
}
@@ -711,47 +766,73 @@ int main(int argc, char* argv[])
// Try to connect via LAN IPv4 address
printf("Testing GameStream ports via local network\n");
if (!TestAllPorts(&ss,
"Local network GameStream connectivity check failed. Try temporarily disabling your firewall software or adding firewall exceptions for the following ports:\n",
msgBuf, sizeof(msgBuf))) {
if (!TestAllPorts(&ss, portMsgBuf, sizeof(portMsgBuf))) {
snprintf(msgBuf, sizeof(msgBuf),
"Local network GameStream connectivity check failed. Try temporarily disabling your firewall software or adding firewall exceptions for the following ports:\n%s",
portMsgBuf);
DisplayMessage(msgBuf);
return -1;
}
fprintf(stderr, "Detecting public IP address...\n");
bool upnpRulesFound;
if (!CheckWANAccess(&sin, &upnpRulesFound)) {
bool upnpRulesFound, igdDisconnected;
SOCKADDR_IN locallyReportedWanAddr;
if (!CheckWANAccess(&sin, &locallyReportedWanAddr, &upnpRulesFound, &igdDisconnected)) {
return -1;
}
if (igdDisconnected) {
DisplayMessage("Your router reports to be disconnected from the Internet. Make sure UPnP is enabled in your router settings. "
"If this message persists, make sure your router isn't connected to the Internet through another router. If it is, switch one of the routers to bridge/AP mode.\n\n"
"Just in case this warning is due to a buggy router, the test will continue anyway.", MpWarn, false);
}
// Detect a double NAT by detecting STUN and and UPnP mismatches
if (sin.sin_addr.S_un.S_addr != locallyReportedWanAddr.sin_addr.S_un.S_addr) {
printf("Testing GameStream ports via UPnP/NAT-PMP reported WAN address\n");
// We don't actually care about the outcome here but it's nice to have in logs
// to determine whether solving the double NAT will actually make Moonlight work.
TestAllPorts((PSOCKADDR_STORAGE)&locallyReportedWanAddr, portMsgBuf, sizeof(portMsgBuf));
printf("Detected inconsistency between UPnP/NAT-PMP and STUN reported WAN addresses!\n");
}
fprintf(stderr, "Testing Internet GameStream connectivity...\n");
char wanAddrStr[64];
inet_ntop(AF_INET, &sin.sin_addr, wanAddrStr, sizeof(wanAddrStr));
// Try to connect via WAN IPv4 address
printf("Testing GameStream ports via WAN address\n");
if (!TestAllPorts(&ss,
upnpRulesFound ? "Found UPnP rules, but they did not work correctly. Check for conflicting port forwarding entries in your router settings.\n\nThe following ports were not forwarded properly:\n" :
"Internet GameStream connectivity check failed. Make sure UPnP is enabled in your router settings.\n\nThe following ports were not forwarded properly:\n",
msgBuf, sizeof(msgBuf))) {
DisplayMessage(msgBuf);
printf("Testing GameStream ports via STUN-reported WAN address\n");
if (!TestAllPorts(&ss, portMsgBuf, sizeof(portMsgBuf))) {
if (IsDoubleNAT(&locallyReportedWanAddr)) {
snprintf(msgBuf, sizeof(msgBuf), "Your router appears be connected to the Internet through another router. This configuration breaks port forwarding. To resolve this, switch one of the routers into bridge/AP mode.");
DisplayMessage(msgBuf);
}
else if (IsPossibleCGN(&locallyReportedWanAddr)) {
snprintf(msgBuf, sizeof(msgBuf), "Your ISP is running a Carrier-Grade NAT that is preventing you from hosting services like Moonlight on the Internet. Contact your ISP and ask for a dedicated public IP address.");
DisplayMessage(msgBuf);
}
else if (igdDisconnected) {
snprintf(msgBuf, sizeof(msgBuf), "Internet GameStream connectivity check failed. Make sure UPnP is enabled in your router settings and that you don't have two devices acting as routers connected together.");
DisplayMessage(msgBuf);
}
else if (upnpRulesFound) {
snprintf(msgBuf, sizeof(msgBuf), "We found the correct UPnP rules, but we couldn't confirm that they are working. You can try streaming from a different network by typing the following address into Moonlight's Add PC dialog: %s\n\n"
"If that doesn't work, check your router settings for any existing Moonlight port forwarding entries and delete them.", wanAddrStr);
DisplayMessage(msgBuf, MpWarn);
}
else {
snprintf(msgBuf, sizeof(msgBuf), "Internet GameStream connectivity check failed. Make sure UPnP is enabled in your router settings.\n\nThe following ports were not forwarded properly:\n%s", portMsgBuf);
DisplayMessage(msgBuf);
}
return -1;
}
// Check for double-NAT
if (IsDoubleNAT(&sin)) {
DisplayMessage("Your router appears be connected to another router. This configuration breaks port forwarding. To resolve this, switch one of the devices into bridge mode.");
return -1;
}
// Check for CGN
else if (IsPossibleCGN(&sin)) {
DisplayMessage("Your ISP is running a Carrier-Grade NAT. This prevents you from hosting services like GameStream. Contact your ISP to get a real public IP address.");
return -1;
}
char addrStr[64];
inet_ntop(AF_INET, &sin.sin_addr, addrStr, sizeof(addrStr));
snprintf(msgBuf, sizeof(msgBuf), "All tests passed! You should be able to stream by typing the following address into Moonlight's Add PC dialog: %s", addrStr);
DisplayMessage(msgBuf, false);
snprintf(msgBuf, sizeof(msgBuf), "All tests passed! You should be able to stream by typing the following address into Moonlight's Add PC dialog: %s", wanAddrStr);
DisplayMessage(msgBuf, MpInfo);
return 0;
}
+2 -2
View File
@@ -2,7 +2,7 @@
#include "../version.h"
VS_VERSION_INFO VERSIONINFO
FILEVERSION VER_FILEVERSION
FILEVERSION VER_VERSION
BEGIN
BLOCK "StringFileInfo"
BEGIN
@@ -10,7 +10,7 @@ BEGIN
BEGIN
VALUE "CompanyName", VER_COMPANYNAME_STR
VALUE "FileDescription", "Moonlight Internet Streaming Tester"
VALUE "FileVersion", VER_FILEVERSION_STR
VALUE "ProductName", VER_PRODUCTNAME_STR
END
END
+4 -2
View File
@@ -1,5 +1,7 @@
#pragma once
#define VER_VERSION 1,3,0,0
#define VER_VERSION_STR "1.3.0.0"
#define VER_COMPANYNAME_STR "Moonlight Game Streaming Project"
#define VER_FILEVERSION 1,1,0,0
#define VER_FILEVERSION_STR "1.1.0.0\0"
#define VER_PRODUCTNAME_STR "Moonlight Internet Streaming Helper"