Files
Maze/include/server.hpp
ParkSuMin d905c1a3f9 Refactoring and updating
Fix bug, when steps = 0, but player didn't lose
2025-04-30 19:36:14 +03:00

29 lines
562 B
C++

#ifndef SERVER_HPP
#define SERVER_HPP
#include "maze.hpp"
#include <iostream>
#include <thread>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <cstring>
const int MAX_CLIENTS = 512;
const int BUFFER_SIZE = 1024;
class Server {
private:
bool service_mode;
int server_socket;
void handle_client(int socket, bool flag, int steps);
bool check_status(Maze& maze);
public:
Server(const std::string& host, const unsigned short port, bool service_flag);
void start(int steps = 10);
};
#endif