mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-22 20:57:47 +00:00
Fixed redundant looping when removing/finishing a director. Fixed issue where packets to delete content group wouldn't send. Fixed issue where ContentGroups/Directors weren't clearing after deletion causing a growing amount of zombie groups/directors.
This commit is contained in:
parent
875b76634a
commit
019e305525
6 changed files with 15 additions and 8 deletions
|
@ -596,6 +596,11 @@ namespace FFXIVClassic_Map_Server
|
|||
player.positionZ = spawnZ;
|
||||
player.rotation = spawnRotation;
|
||||
|
||||
//Delete any GL directors
|
||||
GuildleveDirector glDirector = player.GetGuildleveDirector();
|
||||
if (glDirector != null)
|
||||
player.RemoveDirector(glDirector);
|
||||
|
||||
//Delete content if have
|
||||
if (player.currentContentGroup != null)
|
||||
{
|
||||
|
|
|
@ -501,7 +501,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
lock (directorLock)
|
||||
{
|
||||
Director director = new Director(directorIdCount, this, path, args);
|
||||
currentDirectors.Add(directorIdCount, director);
|
||||
currentDirectors.Add(director.actorId, director);
|
||||
directorIdCount++;
|
||||
return director;
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
lock (directorLock)
|
||||
{
|
||||
GuildleveDirector director = new GuildleveDirector(directorIdCount, this, directorScriptPath, glid, difficulty, owner, args);
|
||||
currentDirectors.Add(directorIdCount, director);
|
||||
currentDirectors.Add(director.actorId, director);
|
||||
directorIdCount++;
|
||||
return director;
|
||||
}
|
||||
|
|
|
@ -1441,12 +1441,12 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
}
|
||||
|
||||
public Director GetGuildleveDirector()
|
||||
public GuildleveDirector GetGuildleveDirector()
|
||||
{
|
||||
foreach (Director d in ownedDirectors)
|
||||
{
|
||||
if (d is GuildleveDirector)
|
||||
return d;
|
||||
return (GuildleveDirector)d;
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||
private List<Actor> members = new List<Actor>();
|
||||
private bool isCreated = false;
|
||||
private bool isDeleted = false;
|
||||
private bool isDeleting = false;
|
||||
|
||||
private Script directorScript;
|
||||
private Coroutine currentCoroutine;
|
||||
|
@ -121,6 +122,7 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||
|
||||
public void EndDirector()
|
||||
{
|
||||
isDeleting = true;
|
||||
if (this is GuildleveDirector)
|
||||
((GuildleveDirector)this).EndGuildleveDirector();
|
||||
|
||||
|
@ -141,7 +143,9 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||
public void RemoveMember(Actor actor)
|
||||
{
|
||||
if (members.Contains(actor))
|
||||
members.Remove(actor);
|
||||
members.Remove(actor);
|
||||
if (GetPlayerMembers().Count == 0 && !isDeleting)
|
||||
EndDirector();
|
||||
}
|
||||
|
||||
public List<Actor> GetMembers()
|
||||
|
|
|
@ -46,8 +46,6 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||
guildleveWork.uiState[3] = 1;
|
||||
|
||||
guildleveWork.aimNumNow[0] = guildleveWork.aimNumNow[1] = guildleveWork.aimNumNow[2] = guildleveWork.aimNumNow[3] = 0;
|
||||
|
||||
LoadGuildleve();
|
||||
}
|
||||
|
||||
public void LoadGuildleve()
|
||||
|
|
|
@ -128,7 +128,7 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||
|
||||
public void DeleteGroup()
|
||||
{
|
||||
SendDeletePackets();
|
||||
SendDeletePackets(members);
|
||||
for (int i = 0; i < members.Count; i++)
|
||||
{
|
||||
Session s = Server.GetServer().GetSession(members[i]);
|
||||
|
|
Loading…
Add table
Reference in a new issue