Files
jak-project/common/nrepl/ReplServer.h
T
Tyler Wilding 9fdf0bbc2f tools: Add cutscene player / subtitle editor window (#1429)
* stash

* temp

* tools: subtitle tool works! just gotta fill out the db / polish UX

* tools: added configuration for every subtitle we have so far

* tools: add some colors to the editor, time for repl controls and make it run the code!

* tools: continuing polish of tool, getting very close

* tools: finished UX polish, just need to write deserializers

* tools: added deserializer for subtitle data

* tools: exported subtitle files, all data appears intact

* tools: more UX polish and test all the cutscenes, majority work

* assets: update subtitle files

* lint: formatting and cleanup

* lint: codacy lints
2022-06-11 16:32:27 +01:00

31 lines
626 B
C++

#pragma once
#include "common/cross_sockets/XSocketServer.h"
#include <set>
#include <optional>
enum ReplServerMessageType { PING = 0, EVAL = 10, SHUTDOWN = 20 };
struct ReplServerHeader {
u32 length;
u32 type;
};
class ReplServer : public XSocketServer {
public:
using XSocketServer::XSocketServer;
virtual ~ReplServer();
void post_init() override;
std::optional<std::string> get_msg();
private:
int max_clients = 50;
std::vector<char> header_buffer = std::vector<char>((int)sizeof(ReplServerHeader));
fd_set read_sockets;
std::set<int> client_sockets = {};
void ping_response(int socket);
};