Commit Graph

21 Commits

Author SHA1 Message Date
cee09f6344 [refactor] Mark all internal functions static
All packet handlers and helper functions that are only used in the
source file they're declared in have been taken out of the namespaces in
the corresponding header files, have been marked static, and have been
reordered to avoid the need for declarations at the top of each source
file.

Each source file now contains a "using namespace" directive so that the
static functions don't need to prefix the source file's symbols with
their namespace. All redundant namespace prefixes found have been
removed.

An unused nano power resetting function in NanoManager has been removed.
2021-03-16 22:54:41 +01:00
Gent S
95b385dee1 Reimplement chunk data caching 2020-11-19 19:16:51 -05:00
Gent S
e50a4c2edd Experimental chunk refactor. 2020-11-19 17:37:02 -05:00
Gent S
8ad3f3aabd CHUNKPOS macro -> ChunkPos typedef 2020-11-16 09:59:53 -05:00
Gent S
b22ba781c8 Possible fix for chunking desyncs + CHUNKPOS macro 2020-11-15 14:41:56 -05:00
cc06fdcf60 Possibly fixed all chunking desyncs
* Players/NPCs that initialize chunks now correctly pull their main chunk into their viewdata.
* Tested on the public server, seems to have solved the chunking issues.
2020-10-24 03:47:34 +01:00
c9f9b093f4 Bugfixes.
* Add newly created chunks to nearby players and NPCs. This fixes the
slider/static path mob pop-in problem.
* Update a player's chunks when resurrecting. This fixes a mob desync
problem.
* Use a private instance for the Time Lab
* Spawn a slider for every stop
* Fix mobs in private lairs using the template chunk mobs's current
health for their max health
* Don't call into the JSON lib in the loop in aggroCheck(). This is an
optimization found after using gprof.
* Don't print NPC deletions to console. This stops the spam when a
private instance is deleted.
* Changed default view distance to half the length of a map tile, so
chunks are aligned to map tiles
* Update tdata reference
2020-10-21 02:38:30 +02:00
10534886b8 Cleanup for 1.2.
Cleaned up whitespace, comments, brace style, etc.
Updated tdata reference.
2020-10-19 20:48:57 +02:00
e97b58ccaf Fixed private instance memory leaks. 2020-10-19 04:30:12 +02:00
Gent
da725d21e6 Delete instances with no players 2020-10-16 11:50:03 -04:00
Gent
85530ef57f Implement instance copying
and make respawn points match the player instance
2020-10-15 17:07:58 -04:00
Gent
d4aed0abf4 Add support for unique instances 2020-10-15 11:46:53 -04:00
5a80c53e79 Remove the pointer to the deallocated chunk from the current player/NPC.
This fixes the Great Crash Bug(tm).
2020-10-15 04:36:38 +02:00
843b2e6e38 chunks are now cleaned up when not in use 2020-10-13 17:30:19 -05:00
4cd7b7cb53 added basework for instancing 2020-09-30 20:44:37 -05:00
Gent
f2596bfb6a Add NPC chunk management + Generalize lerp 2020-09-23 12:06:25 -04:00
ac1fd1e5be Implemented mob roaming.
Will likely need further tuning.
Mobs in vacant chunks are skipped.
2020-09-22 20:33:10 +02:00
4cc1cf4f7e minor chunk refactor 2020-09-21 14:55:34 -05:00
228a181b74 removed ChunkManager::removeNPC() 2020-09-20 10:34:43 -05:00
ce9285bab5 support for /unsummon 2020-09-18 16:24:15 -05:00
f4db0830ba huge refactoring, chunking added 2020-09-17 17:45:43 -05:00