mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
9ff71412e5
* toggle for ripping level models * Create pckernel.gc * builds and works * fix defs * resolution info works * native letterboxing * menu * Fullscreen buttons * Update glfw * fix fullscreen taking over everything for some reason * fix screenshots and add more menu options * Cleanup DMA mess in load boundary render code (first try!!) * Update default-menu.gc * clang * fix accidental macros in pairs * refs * fix null reference bugs * add lavatube * custom aspect ratios work (3D only) * custom aspect ratios work (3D only) * fix aspect ratio and non-4x3 debug text * change `sceOpen` * deadzone setting * merge fixes * check out `debug-pad-display` * update readme imgs * settings save works * oops * settings read/load (incomplete) * add `:stop` to debugger and fix detach on Windows * settings load works * fullscreen and aspect ratio setting fixes * swap menu options for convenience * settings loads automatically properly * fix panic and font hack edge case * add rolling, ogre, snow, swamp, sunken b, jungle b * Fixed borderless on windows please work * Update fake_iso.txt * remove error from opengl debug filter * update refs * minor tfrag tod palette lookup change * accidentally nuked all opengl errors
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#pragma once
|
|
|
|
/*!
|
|
* @file Deci2Server.h
|
|
* Basic implementation of a DECI2 server.
|
|
* Works with deci2.cpp (sceDeci2) to implement the networking on target
|
|
*/
|
|
|
|
#ifdef __linux
|
|
#include <netinet/in.h>
|
|
#elif _WIN32
|
|
#include <Windows.h>
|
|
#endif
|
|
#include <thread>
|
|
#include <mutex>
|
|
#include <condition_variable>
|
|
#include <functional>
|
|
#include "game/system/deci_common.h"
|
|
|
|
class Deci2Server {
|
|
public:
|
|
static constexpr int BUFFER_SIZE = 32 * 1024 * 1024;
|
|
Deci2Server(std::function<bool()> shutdown_callback);
|
|
~Deci2Server();
|
|
bool init();
|
|
bool check_for_listener();
|
|
void send_data(void* buf, u16 len);
|
|
|
|
void lock();
|
|
void unlock();
|
|
void wait_for_protos_ready();
|
|
void send_proto_ready(Deci2Driver* drivers, int* driver_count);
|
|
|
|
void run();
|
|
|
|
private:
|
|
void close_server_socket();
|
|
void accept_thread_func();
|
|
bool kill_accept_thread = false;
|
|
char* buffer = nullptr;
|
|
int server_socket = -1;
|
|
struct sockaddr_in addr = {};
|
|
int new_sock = -1;
|
|
bool server_initialized = false;
|
|
bool accept_thread_running = false;
|
|
bool server_connected = false;
|
|
std::function<bool()> want_exit;
|
|
std::thread accept_thread;
|
|
|
|
std::condition_variable cv;
|
|
bool protocols_ready = false;
|
|
std::mutex deci_mutex;
|
|
Deci2Driver* d2_drivers = nullptr;
|
|
int* d2_driver_count = nullptr;
|
|
};
|