Add linux server build

main
root 2 years ago
parent f39def685f
commit 1a3c709c1e

3
.gitignore vendored

@ -1,3 +1,4 @@
flight_server
flight.zip
ipsettings.h
@ -7,4 +8,4 @@ x64/
*.obj
*.pdb
*.ilk
*.gen.h
*.gen.h

@ -0,0 +1,3 @@
#!/usr/bin/env bash
gcc -o flight_server -O2 -Wall -Ithirdparty -Ithirdparty/enet/include -Ithirdparty/minilzo -Ithirdparty/Chipmunk2D/include -Ithirdparty/Chipmunk2D/include/chipmunk server_main.c server.c debugdraw.c gamestate.c sokol_impl.c thirdparty/minilzo/minilzo.c thirdparty/enet/*.c thirdparty/Chipmunk2D/src/*.c -lm -lpthread

@ -1,5 +1,7 @@
#ifdef DEBUG_RENDERING
#include "sokol_gfx.h"
#include "sokol_gp.h"
#endif
#include "types.h"
#define MAX_COMMANDS 64
@ -40,6 +42,8 @@ static THREADLOCAL int command_i = 0;
void dbg_drawall()
{
// return;
#ifdef DEBUG_RENDERING
sgp_set_color(0.4f, 0.8f, 0.2f, 0.8f);
for (int i = 0; i < command_i; i++)
{
@ -62,6 +66,7 @@ void dbg_drawall()
}
}
}
#endif
command_i = 0;
}
@ -84,4 +89,4 @@ void dbg_rect(V2 center)
};
command_i++;
command_i %= MAX_COMMANDS;
}
}

@ -0,0 +1,9 @@
[Unit]
Description=Flight
[Service]
ExecStart=/root/flight/flight_server
Restart=always
[Install]
WantedBy=multi-user.target

@ -0,0 +1,6 @@
#!/usr/bin/env bash
./build_linux_server_release.sh
cp flight.service /etc/systemd/system/
systemctl enable flight
systemctl start flight

@ -0,0 +1,10 @@
#include "types.h"
#define SOKOL_IMPL
#include "sokol_time.h"
int main(int argc, char **argv)
{
server(0);
return 0;
}
Loading…
Cancel
Save