Skip to content

Commit

Permalink
started work on Windows port
Browse files Browse the repository at this point in the history
replaced hiredis with cpp_redis
replaced build system with CMake
  • Loading branch information
Southclaws committed May 7, 2018
1 parent f15f72c commit db14d8c
Show file tree
Hide file tree
Showing 111 changed files with 4,215 additions and 10,592 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.vs/
.vscode/
50 changes: 49 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
#
# Package only files
#

# Compiled Bytecode
*.amx

# Vendor directory for dependencies
dependencies/

# Dependency versions lockfile
pawn.lock


#
# Server/gamemode related files
#

# compiled settings file
# keep `samp.json` file on version control
# but make sure the `rcon_password` field is set externally
# you can use the environment variable `SAMP_RCON_PASSWORD` to do this.
server.cfg

# Plugins directory
plugins/

# binaries
*.exe
*.dll
*.so
build/
announce
samp03svr
samp-npc

# logs
logs/
server_log.txt

#
# Common files
#

*.sublime-workspace
*.sublime-project

build/
.vs/
*.so
*.o
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[submodule "lib/samp-plugin-sdk"]
path = lib/samp-plugin-sdk
url = https://github.com/maddinat0r/samp-plugin-sdk
[submodule "lib/cmake-modules"]
path = lib/cmake-modules
url = https://github.com/Zeex/cmake-modules
[submodule "src/plugin-natives"]
path = src/plugin-natives
url = https://github.com/Y-Less/plugin-natives
[submodule "lib/cpp_redis"]
path = lib/cpp_redis
url = https://github.com/Cylix/cpp_redis
5 changes: 5 additions & 0 deletions .vscode/.cmaketools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"variant": null,
"activeEnvironments": [],
"codeModel": null
}
10 changes: 6 additions & 4 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/include",
"${workspaceRoot}",
"${workspaceRoot}/src",
"${workspaceRoot}/src/sdk"
"${workspaceRoot}/lib/samp-plugin-sdk"
],
"defines": [],
"intelliSenseMode": "clang-x64",
Expand All @@ -21,7 +20,8 @@
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/9.0.0/include",
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include",
"/usr/include",
"${workspaceRoot}"
"${workspaceRoot}",
"${workspaceRoot}/lib/samp-plugin-sdk"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
Expand Down Expand Up @@ -68,7 +68,9 @@
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 3
Expand Down
18 changes: 17 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
{
"files.associations": {
"__config": "cpp",
"__nullptr": "cpp",
"exception": "cpp",
"initializer_list": "cpp",
"new": "cpp",
"stdexcept": "cpp",
"typeinfo": "cpp",
"iosfwd": "cpp",
"cstdlib": "cpp",
"__locale": "cpp",
"vector": "cpp"
"string": "cpp",
"fstream": "cpp",
"ios": "cpp",
"locale": "cpp",
"filesystem": "cpp",
"xstring": "cpp",
"system_error": "cpp",
"xlocale": "cpp"
}
}
20 changes: 20 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"type": "shell",
"command": "make build-e2e",
"group": {
"kind": "build",
"isDefault": true
},
"isBackground": false,
"presentation": {
"reveal": "silent",
"panel": "dedicated"
},
"problemMatcher": "$gcc"
}
]
}
22 changes: 22 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.0)

project(pawn-redis)

list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/lib/cmake-modules")

if(UNIX)
set(CMAKE_CXX_FLAGS "-m32 -fvisibility=hidden")
set(CMAKE_C_FLAGS "-m32 -fvisibility=hidden")
set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS OFF)
endif()

# removes the sprintf warnings from plugin-natives
add_definitions(-D_CRT_SECURE_NO_WARNINGS)

set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/test/plugins)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})

add_subdirectory(lib/cpp_redis)
include_directories(lib/cpp_redis/includes)
add_subdirectory(src)
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM maddinat0r/debian-samp

COPY . .

CMD [ "make", "all" ]
ADD . .
RUN mkdir build
ENTRYPOINT [ "make", "build-inside" ]
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License

Copyright (c) 2018 Barnaby "Southclaws" Keene

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Binary file removed allaboardtheredismobile.png
Binary file not shown.
18 changes: 0 additions & 18 deletions docs/idm/readme.md

This file was deleted.

45 changes: 0 additions & 45 deletions docs/readme.md

This file was deleted.

Binary file removed docs/ss/01-old-arch.png
Binary file not shown.
Binary file removed docs/ss/02-database-api.png
Binary file not shown.
Binary file removed docs/ss/03-integrate-redis.png
Binary file not shown.
Loading

0 comments on commit db14d8c

Please sign in to comment.