[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.
This commit is contained in:
2021-03-16 22:06:10 +01:00
parent 04c56ce426
commit cee09f6344
36 changed files with 1808 additions and 1957 deletions

View File

@@ -23,25 +23,8 @@ namespace Combat {
extern std::map<int32_t, std::map<int8_t, Bullet>> Bullets;
void init();
void playerTick(CNServer*, time_t);
void pcAttackNpcs(CNSocket *sock, CNPacketData *data);
void combatBegin(CNSocket *sock, CNPacketData *data);
void combatEnd(CNSocket *sock, CNPacketData *data);
void dotDamageOnOff(CNSocket *sock, CNPacketData *data);
void dealGooDamage(CNSocket *sock, int amount);
void npcAttackPc(Mob *mob, time_t currTime);
int hitMob(CNSocket *sock, Mob *mob, int damage);
void killMob(CNSocket *sock, Mob *mob);
std::pair<int,int> lerp(int, int, int, int, int);
std::pair<int,int> getDamage(int, int, bool, bool, int, int, int);
void pcAttackChars(CNSocket *sock, CNPacketData *data);
void grenadeFire(CNSocket* sock, CNPacketData* data);
void rocketFire(CNSocket* sock, CNPacketData* data);
void projectileHit(CNSocket* sock, CNPacketData* data);
/// returns bullet id
int8_t addBullet(Player* plr, bool isGrenade);
}