Initial commit.

This commit is contained in:
Signal 2026-02-22 17:45:44 -05:00
commit 82b4f23c06
56 changed files with 3485 additions and 0 deletions

52
TestGame/main.cpp Normal file
View file

@ -0,0 +1,52 @@
#include <iostream>
#include <thread>
#include <Client.h>
#include <Server.h>
#include <Network/Network.h>
#include <Paths.h>
using namespace Artifact;
struct Args {
bool server = false;
std::string host = "";
std::string port = "";
};
int main(int argc, const char * argv[]) {
Args args {};
for (int i = 0; i < argc; ++i) {
if (strcmp(argv[i], "--server")) {
args.server = true;
} else if (strcmp(argv[i], "--host")) {
args.host = argv[++i];
} else if (strcmp(argv[i], "--port")) {
args.port = argv[++i];
}
}
getDataPath();
Client client;
client.addDefaultSubsystems();
std::thread([&client]() {
Server server;
server.addDefaultSubsystems();
auto serverListener = server.subsystem<NetworkServer>();
auto clientConnection = client.subsystem<NetworkClient>();
serverListener->host(clientConnection);
clientConnection->connect(serverListener);
server.run();
}).detach();
client.run();
return 0;
}