From 61c0c9f53d3a57ee7fd5db5faa74c4b51e2da396 Mon Sep 17 00:00:00 2001 From: Alexander Pickering Date: Sat, 28 Oct 2017 18:12:50 -0400 Subject: Lots of updates * Networking is finally working * Started moveing physics into the shared domain * Streams now have a readString() and writeString() method * streams are passed to the lua context for networking * Refactored cameras and physboxes to use metatables * Finally wrote the pushvector3* and popvector3* methods * Fixed a few crashes in ;main * Deleted a lot of code --- src/shared/lua_api/stream.hpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/shared/lua_api/stream.hpp (limited to 'src/shared/lua_api/stream.hpp') diff --git a/src/shared/lua_api/stream.hpp b/src/shared/lua_api/stream.hpp new file mode 100644 index 0000000..71eaf0a --- /dev/null +++ b/src/shared/lua_api/stream.hpp @@ -0,0 +1,28 @@ +#include + +//Char is not definitvely a byte, read the fucking standard +#define byte char + +typedef struct stream { + long length; + byte* data; + long read; +} stream; + +struct stream* stream_create(); + +void stream_writeInt(struct stream* s, int number); +int stream_readInt(struct stream* s); + +void stream_writeString(struct stream* s, const char* string, size_t len); +char* stream_readString(struct stream* s); + +void stream_writeData(struct stream* s, const char* data, int len); +void stream_readData(struct stream* s, int len, char* out); + +void stream_writeDouble(struct stream* s, double number); +double stream_readDouble(struct stream* s); + +void stream_print(struct stream* s); + +void stream_free(struct stream* s); -- cgit v1.2.3-70-g09d2