Initial commit.

This commit is contained in:
Signal 2026-02-22 17:45:44 -05:00
commit 74c23c0ad5
57 changed files with 3491 additions and 0 deletions

45
Shared/Network/Network.h Normal file
View file

@ -0,0 +1,45 @@
#pragma once
#include "Shared.h"
#include "Events.h"
#include "Connection.h"
namespace Artifact {
namespace Events {
struct NetworkMessage {
void * data;
};
}
class NetworkClient;
class NetworkServer: public BaseSubsystem, public EventTarget {
NetworkClient * localClient = nullptr;
std::unique_ptr<ServerListener> server = nullptr;
bool active = false;
uint64_t listener;
public:
void host(NetworkClient * client);
void host(std::string port);
void unhost();
};
class NetworkClient: public BaseSubsystem, public EventTarget {
NetworkServer * localServer = nullptr;
std::unique_ptr<Connection> server = nullptr;
bool active = false;
uint64_t listener;
public:
void connect(NetworkServer * local);
void connect(std::string host, std::string port);
void disconnect();
};
}