Skip to content

Commit

Permalink
Add NQRNetworkManager vtable
Browse files Browse the repository at this point in the history
  • Loading branch information
GRAnimated committed Oct 19, 2024
1 parent 6646b0b commit 7f28204
Show file tree
Hide file tree
Showing 7 changed files with 147 additions and 1 deletion.
2 changes: 1 addition & 1 deletion data/mcswitch_functions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -47549,7 +47549,7 @@ Address,Quality,Size,Name
0x00000071007e031c,U,000140,sub_71007E031C
0x00000071007e03a8,U,000040,sub_71007E03A8
0x00000071007e03d0,U,000040,sub_71007E03D0
0x00000071007e03f8,U,000012,_ZN9PlayerUIDC1Ei
0x00000071007e03f8,O,000012,_ZN9PlayerUIDC1Ei
0x00000071007e044c,U,000252,sub_71007E044C
0x00000071007e0548,U,000236,sub_71007E0548
0x00000071007e0634,U,000136,sub_71007E0634
Expand Down
5 changes: 5 additions & 0 deletions src/Minecraft.Core/io/OutputStream.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#include "Minecraft.Core/io/OutputStream.h"

OutputStream::OutputStream() {}

OutputStream::~OutputStream() {}
7 changes: 7 additions & 0 deletions src/Minecraft.World/PlayerUID.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include "Minecraft.World/PlayerUID.h"

#include <cstring>

PlayerUID::PlayerUID(int uid) {
memset(mUIDParts, 0, sizeof(mUIDParts));
}
8 changes: 8 additions & 0 deletions src/Minecraft.World/PlayerUID.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#pragma once

class PlayerUID {
public:
PlayerUID(int uid);

int mUIDParts[8];
};
5 changes: 5 additions & 0 deletions src/PlatformLibraries_Source/CPlatformNetworkManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#pragma once

class CPlatformNetworkManager {
public:
};
66 changes: 66 additions & 0 deletions src/PlatformLibraries_Source/NQRNetworkManager.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#pragma once

#include <string>

namespace nn::friends {
class FriendPresence;
}

class CMatchMakeSearchParam;
class NQRNetworkPlayer;
class PlayerUID;

class NQRNetworkManager {
public:
class SessionSearchResult;
class PresenceSyncInfo;

virtual ~NQRNetworkManager();
virtual void Tick() = 0;
virtual void Initialise() = 0;
virtual void Terminate() = 0;
virtual void GetState() = 0;
virtual void IsHost() = 0;
virtual void IsReadyToPlayOrIdle() = 0;
virtual void IsInSession() = 0;
virtual void IsMatchmakingEnabled() = 0;
virtual void CreateAndJoinRoom(int, int, void*, int, int*, int, bool, unsigned char) = 0;
virtual void UpdateExternalRoomData() = 0;
virtual void FriendRoomManagerIsBusy() = 0;
virtual void FriendRoomManagerSearch() = 0;
virtual void FriendRoomManagerSearch2() = 0;
virtual void FriendRoomManagerGetCount() = 0;
virtual void FriendRoomManagerGetRoomInfo(int, NQRNetworkManager::SessionSearchResult*) = 0;
virtual void JoinRoom(NQRNetworkManager::SessionSearchResult*, int) = 0;
virtual void JoinRoom(unsigned int, int, NQRNetworkManager::PresenceSyncInfo const*) = 0;
virtual void JoinRoom(int, nn::friends::FriendPresence const*) = 0;
virtual void FriendPresenceUpdatedRoomList() = 0;
virtual void GetFriendRoomSearchResults(int*) = 0;
virtual void GetExtDataForRoom(unsigned int, void*, void (*)(bool, void*), void*) = 0;
virtual void FindAndJoinRoom(int, unsigned int, CMatchMakeSearchParam*, unsigned char) = 0;
virtual void StartGame() = 0;
virtual void LeaveRoom(bool) = 0;
virtual void EndGame() = 0;
virtual void SessionHasSpace(int) = 0;
virtual void SessionHasMii(int) = 0;
virtual void AddLocalPlayerByUserIndex(int) = 0;
virtual void RemoveLocalPlayerByUserIndex(int) = 0;
virtual void SendInviteGUI() = 0;
virtual void GetPlayerCount() = 0;
virtual void GetOnlinePlayerCount() = 0;
virtual void GetPlayerByIndex(int) = 0;
virtual void GetPlayerBySmallId(int) = 0;
virtual void GetPlayerByXuid(PlayerUID) = 0;
virtual void GetDisplayNameByGamertag(std::wstring) = 0;
virtual void GetLocalPlayerByUserIndex(int) = 0;
virtual void GetHostPlayer() = 0;
virtual void SetPresenceDataStartHostingGame() = 0;
virtual void GetJoiningReadyPercentage() = 0;
virtual void LocalDataSend(NQRNetworkPlayer*, NQRNetworkPlayer*, void const*, unsigned int) = 0;
virtual void RemoteDataSend(NQRNetworkPlayer*, NQRNetworkPlayer*, void const*, unsigned int) = 0;
virtual void GetSessionIndex(NQRNetworkPlayer*) = 0;
virtual void TryToConnectOnline(int (*)(void*, bool, int), void*, bool) = 0;
virtual void isAdhocConnected() = 0;
virtual void connectToAdhoc() = 0;
virtual void isLanConnected() = 0;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#pragma once

#include "PlatformLibraries_Source/NQRNetworkManager.h"

class NQRNetworkManager_NX : public NQRNetworkManager {
public:
virtual ~NQRNetworkManager_NX() override;
virtual void Tick() override;
virtual void Initialise() override;
virtual void Terminate() override;
virtual void GetState() override;
virtual void IsHost() override;
virtual void IsReadyToPlayOrIdle() override;
virtual void IsInSession() override;
virtual void IsMatchmakingEnabled() override;
virtual void CreateAndJoinRoom(int, int, void*, int, int*, int, bool, unsigned char) override;
virtual void UpdateExternalRoomData() override;
virtual void FriendRoomManagerIsBusy() override;
virtual void FriendRoomManagerSearch() override;
virtual void FriendRoomManagerSearch2() override;
virtual void FriendRoomManagerGetCount() override;
virtual void FriendRoomManagerGetRoomInfo(int, NQRNetworkManager::SessionSearchResult*) override;
virtual void JoinRoom(NQRNetworkManager::SessionSearchResult*, int) override;
virtual void JoinRoom(unsigned int, int, NQRNetworkManager::PresenceSyncInfo const*) override;
virtual void JoinRoom(int, nn::friends::FriendPresence const*) override;
virtual void FriendPresenceUpdatedRoomList() override;
virtual void GetFriendRoomSearchResults(int*) override;
virtual void GetExtDataForRoom(unsigned int, void*, void (*)(bool, void*), void*) override;
virtual void FindAndJoinRoom(int, unsigned int, CMatchMakeSearchParam*, unsigned char) override;
virtual void StartGame() override;
virtual void LeaveRoom(bool) override;
virtual void EndGame() override;
virtual void SessionHasSpace(int) override;
virtual void SessionHasMii(int) override;
virtual void AddLocalPlayerByUserIndex(int) override;
virtual void RemoveLocalPlayerByUserIndex(int) override;
virtual void SendInviteGUI() override;
virtual void GetPlayerCount() override;
virtual void GetOnlinePlayerCount() override;
virtual void GetPlayerByIndex(int) override;
virtual void GetPlayerBySmallId(int) override;
virtual void GetPlayerByXuid(PlayerUID) override;
virtual void GetDisplayNameByGamertag(std::wstring) override;
virtual void GetLocalPlayerByUserIndex(int) override;
virtual void GetHostPlayer() override;
virtual void SetPresenceDataStartHostingGame() override;
virtual void GetJoiningReadyPercentage() override;
virtual void LocalDataSend(NQRNetworkPlayer*, NQRNetworkPlayer*, void const*, unsigned int) override;
virtual void RemoteDataSend(NQRNetworkPlayer*, NQRNetworkPlayer*, void const*, unsigned int) override;
virtual void GetSessionIndex(NQRNetworkPlayer*) override;
virtual void TryToConnectOnline(int (*)(void*, bool, int), void*, bool) override;
virtual void isAdhocConnected() override;
virtual void connectToAdhoc() override;
virtual void isLanConnected() override;
};

0 comments on commit 7f28204

Please sign in to comment.