-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6646b0b
commit 7f28204
Showing
7 changed files
with
147 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#include "Minecraft.Core/io/OutputStream.h" | ||
|
||
OutputStream::OutputStream() {} | ||
|
||
OutputStream::~OutputStream() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma once | ||
|
||
class CPlatformNetworkManager { | ||
public: | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |
55 changes: 55 additions & 0 deletions
55
src/PlatformLibraries_Source/Nintendo/NX/Network/NQRNetworkManager_NX.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
}; |