Skip to content

Commit 3b81cb9

Browse files
authored
Merge pull request #19830 from hrydgard/socket-remap-prep
Socket remap prep
2 parents f5c2360 + baf6bcc commit 3b81cb9

File tree

7 files changed

+19
-13
lines changed

7 files changed

+19
-13
lines changed

Common/Net/HTTPClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ int Client::ReadResponseHeaders(net::Buffer *readbuf, std::vector<std::string> &
429429
int sz = readbuf->TakeLineCRLF(&line);
430430
if (!sz || sz < 0)
431431
break;
432-
INFO_LOG(Log::HTTP, "Header line: %s", line.c_str());
432+
VERBOSE_LOG(Log::HTTP, "Header line: %s", line.c_str());
433433
responseHeaders.push_back(line);
434434
}
435435

Common/Net/SocketCompat.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
inline bool connectInProgress(int errcode) { return (errcode == WSAEWOULDBLOCK || errcode == WSAEINPROGRESS || errcode == WSAEALREADY || errcode == WSAEINVAL); } // WSAEINVAL should be treated as WSAEALREADY during connect for backward-compatibility with Winsock 1.1
8383
inline bool isDisconnected(int errcode) { return (errcode == WSAECONNRESET || errcode == WSAECONNABORTED || errcode == WSAESHUTDOWN); }
8484
#else
85+
#define SOCKET int
8586
#define INVALID_SOCKET -1
8687
#define SOCKET_ERROR -1
8788
#define closesocket close

Core/Dialog/PSPNetconfDialog.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@ int PSPNetconfDialog::Update(int animSpeed) {
248248
UpdateFade(animSpeed);
249249
StartDraw();
250250

251+
// This disables the notice that we don't support the internet below.
252+
// Keeping the code in case we need it for something later.
253+
hideNotice = true;
254+
251255
if (!hideNotice) {
252256
auto err = GetI18NCategory(I18NCat::ERRORS);
253257
const float WRAP_WIDTH = 254.0f;

Core/HLE/NetInetConstants.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#pragma once
2-
31
#include "ppsspp_config.h"
42

53
#if PPSSPP_PLATFORM(WINDOWS)

Core/HLE/sceNetInet.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,6 +1000,9 @@ static int sceNetInetRecvmsg(int socket, u32 msghdrPtr, int flags) {
10001000
// TODO: Do similar to the already working sceNetInetSendmsg but in reverse
10011001
//if (pspMsghdr->msg_name != 0) { ... }
10021002

1003+
//UNFINISHED
1004+
free(iov);
1005+
10031006
return hleLogError(Log::sceNet, retval); // returns number of bytes received?
10041007
}
10051008

Core/HLE/sceNetInet.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@
44

55
#include "Core/HLE/HLE.h"
66

7-
#if PPSSPP_PLATFORM(WINDOWS)
8-
#include "Common/CommonWindows.h"
9-
#include <winsock.h>
10-
#endif
7+
#include "Common/Net/SocketCompat.h"
118

129
#include <memory>
1310
#include <shared_mutex>
@@ -106,6 +103,7 @@ typedef struct SceNetInetPollfd { //similar format to pollfd in 32bit (pollfd in
106103
} PACK SceNetInetPollfd;
107104

108105
// TCP & UDP Socket Union (Internal use only)
106+
/*
109107
typedef struct InetSocket {
110108
s32_le id; // posix socket id
111109
s32_le domain; // AF_INET/PF_INET/etc
@@ -115,6 +113,7 @@ typedef struct InetSocket {
115113
s32_le so_broadcast; // broadcast flag (ie. SO_BROADCAST) to keep track of the broadcast flag, since we're using fake broadcast
116114
s32_le tcp_state; // to keep track TCP connection state
117115
} PACK InetSocket;
116+
*/
118117

119118
#ifdef _MSC_VER
120119
#pragma pack(pop)

Core/HLE/sceNp.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,18 @@ SceNpAuthMemoryStat npAuthMemStat = {};
3838
PSPTimeval npSigninTimestamp{};
3939

4040
// TODO: These should probably be grouped in a struct, since they're used to generate an auth ticket
41-
int npParentalControl = PARENTAL_CONTROL_ENABLED;
42-
int npUserAge = 24; // faking user Age to 24 yo
43-
int npChatRestriction = 0; // default/initial value on Patapon 3 is 1 (restricted boolean?)
44-
SceNpMyLanguages npMyLangList = { 1033, 2057, 1036 };
41+
constexpr int npParentalControl = PARENTAL_CONTROL_ENABLED;
42+
constexpr int npUserAge = 24; // faking user Age to 24 yo
43+
constexpr int npChatRestriction = 0; // default/initial value on Patapon 3 is 1 (restricted boolean?)
44+
static const SceNpMyLanguages npMyLangList = { 1033, 2057, 1036 }; // Languages the user is assumed to know. No known games make use of this.
4545
// Fields are 4-sized, so the data needs to be too.
46-
char npCountryCode[4] = "fr"; // dummy data taken from https://www.psdevwiki.com/ps3/X-I-5-Ticket. France?
47-
char npRegionCode[4] = "c9"; // not sure what "c9" meant, since it was close to country code data, might be region-related data?
46+
static const char npCountryCode[4] = "us"; // dummy data taken from https://www.psdevwiki.com/ps3/X-I-5-Ticket. Mainly affects what EULA is downloaded.
47+
static const char npRegionCode[4] = "c9"; // not sure what "c9" meant, since it was close to country code data, might be region-related data?
4848
std::string npOnlineId = "DummyOnlineId"; // SceNpOnlineId struct?
4949
std::string npServiceId = ""; // UNO game uses EP2006-NPEH00020_00
5050
std::string npAvatarUrl = "http://DummyAvatarUrl"; // SceNpAvatarUrl struct?
5151

52+
// Game-specific ID, I guess we can use this to auto-choose DNS?
5253
SceNpCommunicationId npTitleId;
5354

5455
std::recursive_mutex npAuthEvtMtx;

0 commit comments

Comments
 (0)