Commit Graph

22 Commits

Author SHA1 Message Date
224ffe05e7 [WIP] Convert most of Chunking to Entity-based system
Player and all NPCs now have a common superclass, with virtual functions
so smooth over shared behavior. EntityRef is a simple class that points
to an arbitrary Entity.

This commit is not yet functional.
2021-03-31 22:28:27 +02:00
7f9cdfc9ae Use direct members instead of pointers for viewableChunks and buyback
We had avoided putting STL containers into Players back when we thought
Players was still POD and needed to remain POD, but it turned out that
neither were the case all along, so there's no need for the indirection.
2021-03-31 21:10:54 +02:00
a55a34e09a [refactor] Move files to core/ and servers/ subdirectories
CNProtocol, CNShared, CNStructs and Defines are now in core/.
CNLoginServer, CNShardServer and Monitor are now in servers/.

core/Core.hpp wraps all the core headers except for CNShared.hpp.

Defines.cpp has been renamed to Packets.cpp, and so has its
corresponding namespace, but not the header file. This is in preparation
for upcoming changes.
2021-03-17 20:16:48 +01:00
e9bc2fe561 [refactor] Remove the word 'Manager' from most source files/namespaces
ChatManager -> Chat
MissionManager -> Missions
NanoManager -> Nanos
TransportManager -> Transport
ChunkManager -> Chunking
BuddyManager -> Buddies
GroupManager -> Groups
RacingManager -> Racing
ItemManager -> Items

NPCManager and PlayerManager remain.

Note: You can use git log --follow src/file.cpp to trace the history of
a file from before it was renamed.
2021-03-17 20:16:43 +01:00
Gent S
fa7b6e6145 Properly set default NPC class 2020-11-26 09:05:44 -05:00
Gent S
d1baa0d9f9 Replace inPopulatedChunks with player counter for NPCs 2020-11-22 16:48:29 -05:00
Gent S
95b385dee1 Reimplement chunk data caching 2020-11-19 19:16:51 -05:00
Gent S
dae3b24093 Reimplement chunk position caching 2020-11-19 17:37:07 -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
Gent
d4aed0abf4 Add support for unique instances 2020-10-15 11:46:53 -04:00
6ee5e6d1ae Load NPC angles from NPCs.json. 2020-10-14 02:34:00 +02:00
4cd7b7cb53 added basework for instancing 2020-09-30 20:44:37 -05:00
874479d1cf fixed NPC spawning bug 2020-09-24 21:32:14 -05:00
279cb78d5f Mob-related cleanup.
* NPCs now keep track of their chunk information like PlayerView does
for players
* NPCManager::sendToViewable() parallels PlayerManager::sendToViewable()
* Nano damage and debuffs now count as attacking a mob
* Mobs will de-aggro if something else killed their target
2020-09-25 02:00:26 +02:00
72d625fd8d Summoned mobs are now actually treated as mobs.
Unfortunetly, this necessitated keeping around yet more JSON objects for
the duration of the server's runtime.
It also involved unifying the way NPC IDs are handled, such that they
may be allocated and deallocated out of order.

If any NPCID-related bugs occour, this commit should be regarded as
the prime suspect.
2020-09-25 00:51:18 +02:00
Gent
6f05f0f2c8 Add NPCClass enum 2020-09-22 23:41:43 -04:00
e79f179628 Mobs respawn now.
Began work on mob logic. Also cleaned up TableData a little.
2020-09-17 01:43:48 +02:00
3e5101892b Populated the future with scraped mobs.
This system is temporary; meant to ease testing.
2020-08-26 04:57:59 +02:00
f289c72f6f populated NPCManager 2020-08-21 17:14:11 -05:00
6857f50c30 added basic NPCManager 2020-08-20 16:43:48 -05:00