-
Notifications
You must be signed in to change notification settings - Fork 0
/
Server.h
46 lines (42 loc) · 1.05 KB
/
Server.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// Created by admin on 11/3/2020.
//
#ifndef SERVER_C_VERSION__SERVER_H
#define SERVER_C_VERSION__SERVER_H
#include <stdbool.h>
#include"SDL_net.h"
typedef struct Server_Config{
const char* section;
int ip_address;
int port;
const char* owner_name;
bool HasMods;
bool CanBeModded;
}Server_Config;
typedef struct Version {
int major;
int minor;
int patch;
const char* build_type;
const char* build_info;
}Version;
const char* current_command;
void CreateServer(const char* server_address);
void InitNetworking();
void StartServer();
void ServerInput();
TCPsocket GetTCPSocket();
//Borrowed for the client
void SendServerVersion();
void HandleDisconnection();
void HandleConnectionError();
void OnConnectFailed();
void OnConnectSuccess();
void OnDisconnection();
void FileExists(const char* path);
void FileCanWrite(const char* path);
void FileCanRead(const char* path);
void FileCanExecute(const char* path);
void ServerLoop();
void StopServer();
#endif //SERVER_C_VERSION__SERVER_H