Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 3.0 #3

Merged
merged 196 commits into from
Dec 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
196 commits
Select commit Hold shift + click to select a range
3d588f1
inital interface change
inlife Sep 19, 2017
9923a33
initial entity system concept
inlife Sep 19, 2017
ac463a1
new component system with reallocating model
inlife Sep 19, 2017
333cf57
Allocate everything at once, when component registration is over.
zpl-zak Sep 19, 2017
57b160f
Added bindings-friendly improvements.
zpl-zak Sep 20, 2017
67b9232
Added small remark.
zpl-zak Sep 20, 2017
a0862ff
WIP context injection.
zpl-zak Sep 23, 2017
c24bf8f
updated dpes
inlife Sep 24, 2017
598ebd1
merged with ctx, added some changes
inlife Sep 24, 2017
889cc9f
Additional changes.
zpl-zak Sep 24, 2017
f29199c
refactored header part
inlife Sep 24, 2017
d3b6478
refactored half of the lib
inlife Sep 24, 2017
eb21915
working on new component iterator implementation
inlife Sep 24, 2017
7d3fdca
added entity iterator
inlife Sep 24, 2017
86dc7d7
added entity iterator
inlife Sep 24, 2017
4285d94
updated part of messages
inlife Sep 24, 2017
5463af9
updated part of messages
inlife Sep 24, 2017
2a55a49
finished main refactor part
inlife Sep 24, 2017
30db0c7
fixed buildtest
inlife Sep 24, 2017
aa46f16
added component shorcusts, started updating test
inlife Sep 24, 2017
9a9a6ac
added basic working test
inlife Sep 24, 2017
b7d5b81
deps update
zpl-zak Sep 24, 2017
713b9a7
fixed few warnings.
zpl-zak Sep 24, 2017
7266238
Added build for static library.
zpl-zak Sep 24, 2017
70ad683
Small changes.
zpl-zak Sep 25, 2017
287ae61
Build mode for library.c enabled.
zpl-zak Sep 25, 2017
b60c070
small update,
zpl-zak Sep 25, 2017
64ca36f
moved register component callback to init
inlife Sep 25, 2017
2c709d4
Merge branch 'version-3.0' of github.com:reguider/librg into version-3.0
inlife Sep 25, 2017
5505e09
added default null value for comp attach, added cmake vs default macro
inlife Sep 25, 2017
dfdb492
fix
zpl-zak Sep 25, 2017
46c9dab
added proper asseret message for component register error
inlife Sep 25, 2017
05fb4d6
deps update
zpl-zak Sep 25, 2017
ad19967
added ability to compile as shared library
inlife Sep 25, 2017
cd9ed68
Merge branch 'version-3.0' of github.com:reguider/librg into version-3.0
inlife Sep 25, 2017
a5a0840
updated deps
inlife Sep 25, 2017
9bddffb
moved scirpts, added cpp build test file
inlife Sep 25, 2017
f59b179
added build script ignore
inlife Sep 25, 2017
1153dc6
added cpp extensions
inlife Sep 25, 2017
a53434d
Static library hackery, but it works now at least.
zpl-zak Sep 26, 2017
c207812
small changes
inlife Sep 26, 2017
82c6fff
callback types renaming
inlife Sep 26, 2017
acba961
inner stuff renaming
inlife Sep 26, 2017
2bcdf7f
refacetored librg_data_t
inlife Sep 26, 2017
b73469d
fixed demo server
inlife Sep 26, 2017
af7d199
updated demo client to new version
inlife Sep 26, 2017
6b78978
added streams autoinit and free
inlife Sep 26, 2017
0541bf3
MSVC fixes
zpl-zak Sep 26, 2017
ea44e64
made peer, host, and packet proper ptrs
inlife Sep 26, 2017
fd405b4
Merge branch 'version-3.0' of github.com:librg/librg into version-3.0
inlife Sep 26, 2017
a6cabc6
fixes
zpl-zak Sep 26, 2017
ab8f0bb
Merge branch 'version-3.0' of https://github.com/librg/librg into ver…
zpl-zak Sep 26, 2017
5a77f0c
added super duper client cli with 1200 clients
inlife Sep 26, 2017
0c719ed
Merge branch 'version-3.0' of https://github.com/librg/librg into ver…
zpl-zak Sep 26, 2017
861d6b4
added new streams
inlife Sep 26, 2017
dc8be26
added measuing bandwidth for the server
inlife Sep 27, 2017
f88099c
some cleanups
inlife Sep 27, 2017
9b6a18a
updated message/send stuff
inlife Sep 27, 2017
ad3706b
added 3d autoconfig to culler
inlife Sep 27, 2017
8782b2f
fixed bracket
inlife Sep 27, 2017
a51980a
aadded configurable option per branch for culler
inlife Sep 27, 2017
7ec95b4
experimenting with branch size
inlife Sep 27, 2017
cb282a9
Merge branch 'version-3.0' of https://github.com/librg/librg into ver…
zpl-zak Sep 27, 2017
a12b076
some cleanups
inlife Sep 27, 2017
5d13adb
added visibility getters
inlife Sep 27, 2017
6895f9b
added entity control getter
inlife Sep 27, 2017
07ecc57
integrated visibility getters
inlife Sep 27, 2017
7b2df7a
Merge branch 'version-3.0' of https://github.com/librg/librg into ver…
zpl-zak Sep 27, 2017
c4d29a5
changed entity u32 to defined type
inlife Sep 27, 2017
5831c15
Merge branch 'version-3.0' of https://github.com/librg/librg into ver…
zpl-zak Sep 27, 2017
bf3f542
deps
zpl-zak Sep 27, 2017
8d12aa9
updated event structure
inlife Sep 27, 2017
858367d
updated message structure
inlife Sep 27, 2017
f12caf7
refactored librg_query
inlife Sep 27, 2017
1b1d347
added count return to query, restored raw query
inlife Sep 27, 2017
859adad
testing cli build
inlife Sep 27, 2017
bf00ed5
fixed macro shame
inlife Sep 27, 2017
6ac0c30
fixed macro rename, added vs folders to ignore
inlife Sep 27, 2017
93dceb6
resttored debug mode for cli
inlife Sep 27, 2017
fb53c78
got rid of the eachx inside update and insert
inlife Sep 27, 2017
ec7659a
fixed crash
inlife Sep 27, 2017
f4fc869
WIP multi-threaded updates
zpl-zak Sep 28, 2017
609770d
WIP MT, added mutex to protect packet sending
zpl-zak Sep 28, 2017
9fd03e3
Sleep if idling
zpl-zak Sep 28, 2017
8524d5a
Small API change
zpl-zak Sep 28, 2017
25cc00b
Hotfix for data reset
zpl-zak Sep 28, 2017
ede8229
Small fixes in MT code
zpl-zak Sep 28, 2017
14273e6
Added user_data ptr to ctx
zpl-zak Sep 28, 2017
96fdbdf
Fixes and deps update
zpl-zak Sep 28, 2017
846baf3
Fixed bugs and fiddled with tests a bit
zpl-zak Sep 29, 2017
f3934b9
This did not happen...
zpl-zak Sep 29, 2017
0e372ce
Another bug fixed. Quite an adventure!
zpl-zak Sep 29, 2017
3c3ca32
Several fixes
zpl-zak Sep 29, 2017
3f6c925
Partial kd-tree reconstruction
zpl-zak Oct 3, 2017
761a40e
Overhaul of entity scene insertion
zpl-zak Oct 3, 2017
8469458
WIP insertion enabled
zpl-zak Oct 3, 2017
eaf15ab
WIP disabled stuff
zpl-zak Oct 3, 2017
1b849fb
This bug is FINALLY fixed!
zpl-zak Oct 3, 2017
bb6d503
HACK fix asap (or later, time will tell)
zpl-zak Oct 3, 2017
d7f323b
Got rid of obsolete function
zpl-zak Oct 12, 2017
0cd663c
Added support for zplc min_bounds checks
zpl-zak Oct 13, 2017
6d48dbe
changed tabs to spaces
inlife Oct 14, 2017
9f5298a
removed trailing spaces
inlife Oct 14, 2017
c5b5869
fixed on some c files, added editorconfig
inlife Oct 14, 2017
8519b55
ctx->user_data => ctx->userptr
inlife Oct 14, 2017
3321abd
renamed userptr to user_data
inlife Oct 14, 2017
5498241
fixed warnings
inlife Oct 14, 2017
4101c1a
fixed thread issue, update zplc
inlife Oct 14, 2017
198599a
fixed tabs
inlife Oct 25, 2017
c10d748
updated msg and event structures
inlife Oct 25, 2017
9320b3b
minimized example projects
inlife Oct 25, 2017
55c8f71
fixed MT bug
inlife Oct 25, 2017
8931caa
fixing stuff wup
inlife Oct 26, 2017
a8d6a9b
added warning about LIBRG_MAX_THREADS_PER_UPDATE
inlife Oct 30, 2017
e78194a
added event rejection for create/update/remove
inlife Nov 1, 2017
163cc1b
fixed minor error with sending
inlife Nov 1, 2017
af62633
C++ fixes, casts mostly.
zpl-zak Nov 16, 2017
24f1c53
Options bug fixed
zpl-zak Nov 18, 2017
d9ba6b2
working on entity system
inlife Nov 22, 2017
ed7deb8
Merge branch 'version-3.0' of github.com:librg/librg into version-3.0
inlife Nov 22, 2017
fba6df1
added concept of new ec
inlife Nov 22, 2017
645f723
finished interface reworking
inlife Nov 22, 2017
79cacab
finished interface reworking
inlife Nov 22, 2017
ad77d74
achieved compilable state
inlife Nov 22, 2017
0762fed
achieved compilable state
inlife Nov 22, 2017
7f7c70f
fixed minor issues with destruction
inlife Nov 22, 2017
8ce0aea
fixed bitwise selectors
inlife Nov 22, 2017
c11c462
fixed democli project
inlife Nov 22, 2017
7bf1292
fixed demo build
inlife Nov 22, 2017
3d9bb54
changed and fixes for various issues
inlife Nov 25, 2017
b0e46db
fixed wincpp minor comp issue
inlife Nov 26, 2017
a765190
renamed librg_entity_t to librg_entity_id
inlife Nov 26, 2017
051f891
renamed librg_entity_blob_t -> librg_entity_t
inlife Nov 26, 2017
e697c0c
some minor fixes, added LIBRG_DEFAULT_STREAM_RANGE option
inlife Nov 26, 2017
7a6cfb9
added event blocking to connection request
inlife Nov 26, 2017
d64b17e
small cleanups
inlife Nov 26, 2017
f241228
added event rejectable flag
inlife Nov 26, 2017
d05f68e
added librg_event_rejectable method for event
inlife Nov 26, 2017
dda4501
added LIBRG_EVENT_LOCAL and LIBRG_EVENT_REMOTE flags (event categoriz…
inlife Nov 26, 2017
f5a5ce6
added old enet config stuff
inlife Nov 27, 2017
66c3f13
removed old config,
inlife Nov 27, 2017
cb8eb14
added discord build notifciations
inlife Nov 27, 2017
be39d12
updated notif
inlife Nov 27, 2017
5fe48ab
changed make param
inlife Nov 27, 2017
9316dfb
added config for cmake
inlife Nov 27, 2017
27f4a36
removed make atg
inlife Nov 27, 2017
73b7bc8
changed travis yml file
inlife Nov 27, 2017
27f2d2d
updated travis yml
inlife Nov 27, 2017
fb45ec8
working with new travis build
inlife Nov 27, 2017
a24ae5d
working with new travis build 2
inlife Nov 27, 2017
bb052f3
fixes for cpp builld
inlife Nov 27, 2017
9f02b23
fixes for gcc linker
inlife Nov 27, 2017
b495a22
improvments for travis
inlife Nov 27, 2017
dab2075
updated zpl.h, some changed in readme
inlife Nov 28, 2017
9551896
added enet stuff into librg cmake
inlife Nov 28, 2017
f55f9f3
migrated event->entity to the librg_entity_t
inlife Nov 28, 2017
e93c117
Added 3 types of entity update policy
zpl-zak Nov 29, 2017
7462dec
Satisfied GCC by adding more code redundancy (thanks GCC)
zpl-zak Nov 29, 2017
e3f6395
some readme and warn changes
inlife Nov 29, 2017
195c903
Added max update rate
zpl-zak Nov 29, 2017
8bdc9ed
Added AI movement to the demo. Small cooling fixes
zpl-zak Nov 29, 2017
2bca2b1
Updated the cooling flow. Test now properly handles AI movement
zpl-zak Nov 29, 2017
43aa720
Very slight bug fix (don't look)
zpl-zak Nov 29, 2017
17fae88
Small fixes
zpl-zak Nov 29, 2017
080b07f
Clarification on demo NPCs update rate
zpl-zak Nov 29, 2017
f5c642d
Fix in entity removal stream flow
zpl-zak Nov 29, 2017
dd57829
Added movement epsilon
zpl-zak Nov 29, 2017
9537ae8
World reconstruction is back online!
zpl-zak Nov 29, 2017
61c85f2
Got rid of obsolete code
zpl-zak Nov 29, 2017
06e52ae
extracted limiter as a component
inlife Nov 29, 2017
9c348a8
Merge branch 'world-reconstruction' into version-3.0-entity-cooling
inlife Nov 29, 2017
af4c978
merged with world reconstruction
inlife Nov 29, 2017
151bf5d
updated travis
inlife Nov 29, 2017
1a4fb9a
Merge branch 'version-3.0-entity-cooling' into version-3.0
inlife Nov 29, 2017
8a1f9c4
Fixed issue where event->entity is null on connection_disconnect
zpl-zak Nov 29, 2017
03b7caa
removed leftovers in cli-server
zpl-zak Nov 29, 2017
575fc32
Added very basic ped movement interpolation
zpl-zak Dec 1, 2017
e37a80d
Yes. Small mistake was made
zpl-zak Dec 1, 2017
ef96d8a
added some descriptions about flags
inlife Dec 1, 2017
cac1ae0
locked MT stuff under define
inlife Dec 1, 2017
d81eb67
demo broken
inlife Dec 1, 2017
84ee4d6
demo fixes.
zpl-zak Dec 1, 2017
11221a4
updated zpl.h
inlife Dec 1, 2017
64bdaf9
demo fixed. again
zpl-zak Dec 1, 2017
f1da0ee
Merge branch 'version-3.0' of https://github.com/librg/librg into ver…
zpl-zak Dec 1, 2017
a2d7177
udpated readme with for ios comp
inlife Dec 1, 2017
c21ab4f
cleaned up librg.h
inlife Dec 1, 2017
66cd535
tests cleanup
zpl-zak Dec 1, 2017
c6f8223
tests cleanup
zpl-zak Dec 1, 2017
bc7fa60
fixed warning in demo
zpl-zak Dec 1, 2017
63fb5bc
updated readme
inlife Dec 1, 2017
28987c5
Merge branch 'version-3.0' of github.com:librg/librg into version-3.0
inlife Dec 1, 2017
9cb41d2
removed table of contentxs
inlife Dec 1, 2017
73ee959
Update README.md
zpl-zak Dec 1, 2017
43a0537
updated android build stuff
inlife Dec 1, 2017
9771dc0
Merge branch 'master' into version-3.0
zpl-zak Dec 1, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true

# Set default charset
charset = utf-8

# 4 space indentation
indent_style = space
indent_size = 4
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Folders
build/*
node_modules/
build-win/*

# vs shit
*.dir/
x64/

# Other
.DS_store

# local build scripts
build.sh
build.bat
25 changes: 16 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
language: c
compiler:
- clang
- gcc

before_install:
- curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- sudo apt-get install -y nodejs
- curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- sudo apt-get install -y nodejs

after_failure:
- curl -v -H User-Agent:bot -H Content-Type:application/json -d '{"content":"Latest build has FAILED!"}' https://discordapp.com/api/webhooks/$DISCORD_WEBHOOK_CHANNEL_ID/$DISCORD_WEBHOOK_TOKEN

after_success:
- curl -v -H User-Agent:bot -H Content-Type:application/json -d '{"content":"Latest build has SUCCEEDED!"}' https://discordapp.com/api/webhooks/$DISCORD_WEBHOOK_CHANNEL_ID/$DISCORD_WEBHOOK_TOKEN

script:
- npm install
- cmake -DLIBRG_TEST=1
- make
- ./librg_test
- npm install
- mkdir -p build
- export INCLUDES="-I include -I node_modules/zpl.c/include -I node_modules/zpl_math.c/include -I node_modules/zpl_cull.c/include -I node_modules/zpl_event.c/include -I node_modules/enet.c/include -DHAS_SOCKLEN_T=1"
- export LINKER="-pthread -lm -ldl"
- gcc -g -std=c99 $INCLUDES test/build-test.c $LINKER -o build/test-gcc-c.o && build/test-gcc-c.o
- clang -g -std=c99 $INCLUDES test/build-test.c $LINKER -o build/test-clang-c.o && build/test-clang-c.o
- g++ -g -std=c++11 $INCLUDES test/build-test.cpp $LINKER -o build/test-gpp-cpp.o && build/test-gpp-cpp.o
- clang++ -g -std=c++11 $INCLUDES test/build-test.cpp $LINKER -o build/test-clang-cpp.o && build/test-clang-cpp.o
125 changes: 118 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ else()
set(LIBRG_VENDOR_FOLDER ${CMAKE_SOURCE_DIR}/${LIBRG_VENDOR_FOLDER})
endif()

add_subdirectory(
${LIBRG_VENDOR_FOLDER}/enet${LIBRG_POSTFIX}
${CMAKE_CURRENT_BINARY_DIR}/enet)

# define librg as a library (not really)
add_library(librg INTERFACE)

Expand All @@ -27,6 +23,61 @@ else()
target_compile_options(librg INTERFACE -std=c99)
endif()

### ENET STUFF
# The "configure" step.
include(CheckFunctionExists)
include(CheckStructHasMember)
include(CheckTypeSize)
check_function_exists("fcntl" HAS_FCNTL)
check_function_exists("poll" HAS_POLL)
check_function_exists("getaddrinfo" HAS_GETADDRINFO)
check_function_exists("getnameinfo" HAS_GETNAMEINFO)
check_function_exists("gethostbyname_r" HAS_GETHOSTBYNAME_R)
check_function_exists("gethostbyaddr_r" HAS_GETHOSTBYADDR_R)
check_function_exists("inet_pton" HAS_INET_PTON)
check_function_exists("inet_ntop" HAS_INET_NTOP)
check_struct_has_member("struct msghdr" "msg_flags" "sys/types.h;sys/socket.h" HAS_MSGHDR_FLAGS)
set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h" "sys/socket.h")
check_type_size("socklen_t" HAS_SOCKLEN_T BUILTIN_TYPES_ONLY)
unset(CMAKE_EXTRA_INCLUDE_FILES)
if(MSVC)
add_definitions(-W3)
else()
add_definitions(-Wno-error)
endif()

if(HAS_FCNTL)
add_definitions(-DHAS_FCNTL=1)
endif()
if(HAS_POLL)
add_definitions(-DHAS_POLL=1)
endif()
if(HAS_GETNAMEINFO)
add_definitions(-DHAS_GETNAMEINFO=1)
endif()
if(HAS_GETADDRINFO)
add_definitions(-DHAS_GETADDRINFO=1)
endif()
if(HAS_GETHOSTBYNAME_R)
add_definitions(-DHAS_GETHOSTBYNAME_R=1)
endif()
if(HAS_GETHOSTBYADDR_R)
add_definitions(-DHAS_GETHOSTBYADDR_R=1)
endif()
if(HAS_INET_PTON)
add_definitions(-DHAS_INET_PTON=1)
endif()
if(HAS_INET_NTOP)
add_definitions(-DHAS_INET_NTOP=1)
endif()
if(HAS_MSGHDR_FLAGS)
add_definitions(-DHAS_MSGHDR_FLAGS=1)
endif()
if(HAS_SOCKLEN_T)
add_definitions(-DHAS_SOCKLEN_T=1)
endif()
### END ENET STUFF

# proxy our includes to outside world
target_include_directories(librg INTERFACE include
${LIBRG_VENDOR_FOLDER}/zpl${LIBRG_POSTFIX}/include
Expand All @@ -37,12 +88,11 @@ target_include_directories(librg INTERFACE include
${LIBRG_VENDOR_FOLDER}/enet${LIBRG_POSTFIX}/include)

# link all the deps
target_link_libraries(librg INTERFACE
enet ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(librg INTERFACE ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})

if (WIN32)
# windows libraries for enet
target_link_libraries(librg INTERFACE ws2_32 winmm)
target_link_libraries(librg INTERFACE Ws2_32 Winmm)
elseif (UNIX)
# unix math library for us
target_link_libraries(librg INTERFACE m)
Expand All @@ -60,8 +110,69 @@ if (LIBRG_DEMO)
target_link_libraries(librg_demo_client librg SDL2)
endif()

if (LIBRG_CLI_TEST)
add_executable(librg_cli_server test/cli-server.c)
add_executable(librg_cli_client test/cli-client.c)

target_link_libraries(librg_cli_server librg)
target_link_libraries(librg_cli_client librg)
endif()

# test for travis/etc
if (LIBRG_TEST)
add_executable(librg_test test/build-test.c)
target_link_libraries(librg_test librg)
endif()

# static library
if (LIBRG_STATIC)
# special flags for MSVC
if (MSVC OR "${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")

# This piece of crap could be very well replaced by something
# like replace(ARRAY PRED VALUE)
# But instead, we get to use this. Uh!
set(CompilerFlags
CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_RELEASE
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_RELEASE
)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
endif()

add_definitions(-DLIBRG_STATIC)

# Once again, one has to hack in cmake to achieve what he needs...
add_library(librg_static STATIC test/library.c)

# This doesn't actually make any significant difference, only
# makes sure the includes are further propagated.
target_link_libraries(librg_static librg)
endif()

# shared library
if (LIBRG_SHARED)
add_definitions(-DLIBRG_SHARED -DENET_DLL)
add_library(librg_shared SHARED test/library.c)

# if (WIN32)
# set_target_properties(librg_shared PROPERTIES
# LINK_FLAGS "/WHOLEARCHIVE"
# )
# elseif (APPLE)
# set_target_properties(librg_shared PROPERTIES
# LINK_FLAGS "-Wl,-all_load"
# )
# else ()
# set_target_properties(librg_shared PROPERTIES
# LINK_FLAGS "-Wl,--whole-archive"
# )
# endif ()

target_link_libraries(librg_shared librg)
endif()
Loading