-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from PackmanDude/main
Update 0.6.0
- Loading branch information
Showing
22 changed files
with
939 additions
and
363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
BullshitCore-* | ||
libbullshitcore-*.so | ||
*.o |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,52 @@ | ||
#!/bin/sh | ||
|
||
(cd "$(dirname "$0")/source" || exit 1 | ||
(set -u | ||
cd "$(dirname "$0")/source" || exit 1 | ||
. ../version || { printf "Version formatted wrong\n" >&2; exit 1; } | ||
output="../BullshitCore-$MINECRAFT_VERSION-$VERSION" | ||
gcc -std=c99 -Wall -Wextra -Wpedantic -Wformat=2 -Wshadow -Wwrite-strings \ | ||
-Wstrict-prototypes -Wold-style-definition -Wredundant-decls -Wnested-externs \ | ||
-Wmissing-include-dirs -Wjump-misses-init -Wlogical-op -I../include -I. \ | ||
-O2 -flto -pthread -DNDEBUG network.c log.c world.c nbt.c ../main.c \ | ||
-o "$output" "$@" -lwolfssl && strip "$output") | ||
app="../BullshitCore-$MINECRAFT_VERSION-$VERSION" || | ||
{ printf "Version formatted wrong\n" >&2; exit 1; } | ||
lib="../libbullshitcore-$MINECRAFT_VERSION-$VERSION" | ||
set +u | ||
case $1 in | ||
debug) | ||
shift | ||
gcc -c -std=c99 -fPIC -Wall -Wextra -Wpedantic -Wformat=2 -Wshadow \ | ||
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition \ | ||
-Wredundant-decls -Wnested-externs -Wmissing-include-dirs \ | ||
-Wjump-misses-init -Wlogical-op -I../include -I.. -g -pthread ./*.c \ | ||
"$@" | ||
gcc -std=c99 -fPIC -shared -g -pthread ./*.o -o "$lib-debug.so" "$@" \ | ||
-lwolfssl | ||
gcc -std=c99 -Wall -Wextra -Wpedantic -Wformat=2 -Wshadow \ | ||
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition \ | ||
-Wredundant-decls -Wnested-externs -Wmissing-include-dirs \ | ||
-Wjump-misses-init -Wlogical-op -I../include -I. -g -pthread ./*.o \ | ||
../main.c -o "$app-debug" "$@" -lwolfssl;; | ||
test) | ||
for module in ../test/*.c; do | ||
printf %s:\\n "$module" | ||
for test in $(awk '/ifdef/ { print $NF }' "$module"); do | ||
printf %s:\ "$test" | ||
timeout 5 tcc "-run -D$test -I../include -L.. -lbullshitcore-$MINECRAFT_VERSION-$VERSION" \ | ||
"$module" | ||
case $? in | ||
124) printf "Timed out.\n";; | ||
0) printf Passed.\\n;; | ||
esac | ||
done | ||
done;; | ||
*) | ||
gcc -c -std=c99 -fPIC -Wall -Wextra -Wpedantic -Wformat=2 -Wshadow \ | ||
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition \ | ||
-Wredundant-decls -Wnested-externs -Wmissing-include-dirs \ | ||
-Wjump-misses-init -Wlogical-op -I../include -I.. -O2 -flto \ | ||
-fno-fat-lto-objects -pthread -DNDEBUG ./*.c "$@" | ||
gcc -std=c99 -fPIC -shared -O2 -flto -flto-partition=one -pthread \ | ||
./*.o -o "$lib.so" "$@" -lwolfssl | ||
gcc -std=c99 -Wall -Wextra -Wpedantic -Wformat=2 -Wshadow \ | ||
-Wwrite-strings -Wstrict-prototypes -Wold-style-definition \ | ||
-Wredundant-decls -Wnested-externs -Wmissing-include-dirs \ | ||
-Wjump-misses-init -Wlogical-op -I../include -I. -O2 -flto \ | ||
-flto-partition=one -fno-fat-lto-objects -fwhole-program -pthread \ | ||
-DNDEBUG ./*.o ../main.c -o "$app" "$@" -lwolfssl && strip "$app";; | ||
esac) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// An IPv4/6 address to listen on (only dotted-decimal format for IPv4 and no | ||
// hostnames). | ||
#define ADDRESS "0.0.0.0" | ||
// An integer signifying the size in bytes for the chunk data buffer. Has the | ||
// following suffixes: c = 1, w = 2, b = 512, kB = 1000, K = 1024, MB = 1000 * | ||
// 1000, M = 1024 * 1024, xM = M, GB = 1000 * 1000 * 1000, G = 1024 * 1024 * | ||
// 1024, and so on for T, P, E, Z, Y, R, Q. Binary suffixes can be used, too: | ||
// KiB = K, MiB = M, and so on. For optimal performance, choose a multiple of | ||
// the physical block size of the storage device where the world data is | ||
// stored. | ||
#define CHUNK_READ_BUFFER_SIZE "512" | ||
// A description of the server to show on the servers list screen. | ||
#define DESCRIPTION "A Minecraft Server" | ||
// A base64 data URI for a PNG image (alpha channel is supported) with | ||
// dimensions of 64 x 64 pixels to display as the icon of the server. | ||
#define FAVICON "" | ||
// A toggle for the IPv6 support (ADDRESS shall be IPv6). | ||
//#define IPV6 | ||
// An integer in the range [-2147483648, 2147483647] signifying the maximum | ||
// number of players allowed on the server. Due to limitations associated with | ||
// the current configuration parsing, adding the L suffix to signify a long | ||
// integer will cause the ping to fail, making the effective range be at least | ||
// [-32768, 32767]. Currently only affects the number on the servers list | ||
// screen. | ||
#define MAX_PLAYERS 20 | ||
// An integer in the range [0, 65535] signifying the port to listen on. | ||
#define PORT 25565 | ||
// An integer in the range [2, 32] signifying the radius in chunks (16 by 16 | ||
// blocks areas) of the world data to send to the client. | ||
#define RENDER_DISTANCE 2 | ||
// A brand of the server to show in the crash logs and on the debug screen. | ||
#define SERVER_BRAND "BullshitCore" | ||
// An integer in the range [5, 32] signifying the radius in chunks (16 by 16 | ||
// blocks areas) for entities to get simulated around a player. | ||
#define SIMULATION_DISTANCE 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#ifndef BULLSHITCORE_MEMORY | ||
#define BULLSHITCORE_MEMORY | ||
|
||
#include <stddef.h> | ||
|
||
void *bullshitcore_memory_retrieve(size_t size); | ||
void bullshitcore_memory_leave(void * restrict pointer, size_t size); | ||
|
||
#endif |
Oops, something went wrong.