diff --git a/README.md b/README.md deleted file mode 100644 index 3f7235e..0000000 --- a/README.md +++ /dev/null @@ -1,8 +0,0 @@ -leoservermod -============ - -An Arma 3 dynamic map server. - - - -Thanks to Jack Zhang. diff --git a/c/CMakeLists.txt b/c/CMakeLists.txt deleted file mode 100644 index 230dba6..0000000 --- a/c/CMakeLists.txt +++ /dev/null @@ -1,21 +0,0 @@ -set(CURL_LIBRARY "-lcurl") -find_package(CURL REQUIRED) - -add_library(leoext SHARED lib.c) - -include_directories(${CURL_INCLUDE_DIR}) -target_link_libraries(leoext ${CURL_LIBRARIES}) - -set(CMAKE_C_COMPILER gcc) -set(CMAKE_C_FLAGS "-m32 -L/usr/lib32") - -set(CMAKE_SYSTEM_NAME Linux) - -set(CMAKE_C_COMPILER gcc) -set(CMAKE_C_FLAGS -m32) - -set(CMAKE_FIND_ROOT_PATH /usr/lib32) - -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/c/lib.c b/c/lib.c deleted file mode 100644 index 1544d31..0000000 --- a/c/lib.c +++ /dev/null @@ -1,72 +0,0 @@ -#include -#include - -__attribute__((dllexport)) void RVExtension(char *output, int outputSize, const char *function); -__attribute__((dllexport)) int RVExtensionArgs(char *output, int outputSize, const char *function, const char **argv, int argc); -__attribute__((dllexport)) void RVExtensionVersion(char *output, int outputSize); - -int strncpy_safe(char *output, const char *src, int size) -{ - int i; - size--; - for (i = 0; i < size && src[i] != '\0'; i++) - { - output[i] = src[i]; - } - output[i] = '\0'; - return i; -} - -void RVExtension(char *output, int outputSize, const char *function) -{ - strncpy_safe(output, function, outputSize); - printf("RVExtention: test call\n"); -} - -int RVExtensionArgs(char *output, int outputSize, - const char *function, - const char **argv, int argc) -{ - if(argc < 1) { - printf("leoext: need at least 1 argument to post\n"); - return 101; // SYNTAX_ERROR_WRONG_PARAMS_SIZE - } - - const char* output_string = argv[0]; - - CURL *curl; - CURLcode res; - - /* get a curl handle */ - curl = curl_easy_init(); - if(curl) { - /* First set the URL that is about to receive our POST. This URL can - just as well be a https:// URL if that is what should receive the - data. */ - curl_easy_setopt(curl, CURLOPT_URL, "http://localhost:5000/post-arma3-info"); - /* Now specify the POST data */ - curl_easy_setopt(curl, CURLOPT_POSTFIELDS, output_string); - - struct curl_slist *headers = NULL; - headers = curl_slist_append(headers, "Expect:"); - curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers); - - /* Perform the request, res will get the return code */ - res = curl_easy_perform(curl); - /* Check for errors */ - if(res != CURLE_OK) - fprintf(stderr, "curl_easy_perform() failed: %s\n", - curl_easy_strerror(res)); - - /* always cleanup */ - curl_easy_cleanup(curl); - } - return 0; -} - -void RVExtensionVersion(char *output, int outputSize) -{ - curl_global_init(CURL_GLOBAL_ALL); - printf("leoext loaded!\n"); - strncpy_safe(output, "leoext v0.1", outputSize); -} diff --git a/leoservermod/$PBOPREFIX$ b/leoservermod/$PBOPREFIX$ deleted file mode 100644 index ea6fc79..0000000 --- a/leoservermod/$PBOPREFIX$ +++ /dev/null @@ -1 +0,0 @@ -\leoservermod \ No newline at end of file diff --git a/leoservermod/config.cpp b/leoservermod/config.cpp deleted file mode 100644 index a2aaeef..0000000 --- a/leoservermod/config.cpp +++ /dev/null @@ -1,32 +0,0 @@ -class CfgPatches -{ - class leoservermod - { - // Meta information for editor - name = "leoservermod"; - author = "leo"; - url = "https://leosongwei.github.io/"; - - requiredVersion = 1.69; - - requiredAddons[] = {}; - - units[] = {}; - weapons[] = {}; - // init = "diag_log 'loading leoext...'; call compile preprocessFileLineNumbers '\leoservermod\init.sqf'"; - }; -}; - -class CfgFunctions -{ - class leoservermod - { - class functions - { - class leoservermodInit { - file="\leoservermod\init.sqf"; - postInit=1; - }; - }; - }; -}; \ No newline at end of file diff --git a/leoservermod/init.sqf b/leoservermod/init.sqf deleted file mode 100644 index b4a180e..0000000 --- a/leoservermod/init.sqf +++ /dev/null @@ -1,8 +0,0 @@ -diag_log "leoext: try to initialize..."; - -leoext_stop = false; - -_return = "libleoext" callExtension "foooo"; -execVM "\leoservermod\marker.sqf"; - -diag_log format ["leoext: initialize complete! return: %1", _return]; \ No newline at end of file diff --git a/leoservermod/marker.sqf b/leoservermod/marker.sqf deleted file mode 100644 index a2d9ace..0000000 --- a/leoservermod/marker.sqf +++ /dev/null @@ -1,42 +0,0 @@ -leoext_map_markers_information = { - private _info_list = []; - { - private _text = markerText _x; - private _icon_type = markerType _x; // "Empty" == not icon - private _pos = markerPos _x; - private _color = markerColor _x; - - private _marker_info = [_text, _icon_type, _color, _pos]; - if (_icon_type != "") then { - _info_list pushBack _marker_info; - }; - } forEach allMapMarkers; - - _info_list; -}; - -leoext_units_pos = { - private _units_pos = []; - { - private _side = str (side _x); - private _pos = position _x; - - private _unit = [_side, _pos]; - _units_pos pushBack _unit; - } forEach allUnits; - - _units_pos; -}; - -leoext_markers_start = { - [] spawn { - while {!leoext_stop} do { - sleep 1; - private _markers = call leoext_map_markers_information; - private _units = call leoext_units_pos; - "libleoext" callExtension ["foo", [[_markers, _units]]]; - }; - }; -}; - -call leoext_markers_start; \ No newline at end of file diff --git a/screenshot.png b/screenshot.png deleted file mode 100644 index 83188f9..0000000 Binary files a/screenshot.png and /dev/null differ diff --git a/server.lisp b/server-lisp/server.lisp similarity index 100% rename from server.lisp rename to server-lisp/server.lisp diff --git a/utils.lisp b/server-lisp/utils.lisp similarity index 100% rename from utils.lisp rename to server-lisp/utils.lisp