lay down netplay code

This commit is contained in:
SimoneN64
2023-06-13 14:45:52 +02:00
parent c0c5a4f1c0
commit e8cd317d0d
6 changed files with 182 additions and 106 deletions

32
src/backend/Netplay.cpp Normal file
View File

@@ -0,0 +1,32 @@
#include <Netplay.hpp>
#include "log.hpp"
#include <PIF.hpp>
namespace Netplay {
bool isHost = false;
bool connected = false;
n64::Controller players[4]{};
template <int port>
void SyncPlayers(n64::PIF& pif) {
if(connected) {
if(isHost) {
pif.PollController();
} else {
if constexpr (port == 0) {
Util::panic("It shouldn't be possible to be player 1 and not be the host");
} else if constexpr (port == 1) {
} else if constexpr (port == 2) {
} else if constexpr (port == 3) {
} else {
Util::panic("What the heeeeelll oh my gaaaa");
}
}
}
}
template void SyncPlayers(n64::PIF&);
}