1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-20 04:09:16 +00:00

Track NPC clones

Manual state management in python was kind of fiddly, so let's track all
avatar clones in the NetApp and unload them as needed. This also seems to
fix a potential bug in plNPCSpawnMod (is that even used?).
This commit is contained in:
2012-05-06 19:22:03 -04:00
parent b8b8e6d730
commit 3b69a4aee3
10 changed files with 89 additions and 54 deletions

View File

@ -115,15 +115,21 @@ public:
plKey LoadPlayer(const char* name, const char *account);
plKey LoadPlayer(const char* name, const char *account, const char *linkName);
plKey LoadAvatar(const char *name, const char *accountName, bool isPlayer, plKey spawnPoint, plAvTask *initialTask, const char *userStr = nil);
/** Unload an avatar - player or npc - both locally and remotely. */
void UnLoadAvatar(plKey avKey, bool isPlayer);
/**
* Unload an avatar clone
*
* This unloads the clone of an avatar (remote player or NPC) from our local game.
* The avatar clone can be unloaded globally by setting netPropagate; however, this
* is highly discouraged.
*/
void UnLoadAvatar(const plKey& avKey, bool isPlayer, bool netPropagate=false) const;
/** send our (already loaded) local player to newly-associated clients - used when linking */
void PropagateLocalPlayer(int spawnPoint = -1);
/** Unload our local player on other machines because we're leaving this age.
The player will stay around on our local machine, though. */
bool UnPropagateLocalPlayer();
void UnLoadRemotePlayer(plKey playerKey);
void UnLoadLocalPlayer();
void AddAvatar(plArmatureMod *avatar);