Implemented more of the Guildleve Director. Correct script is now autoloaded based on leveplate. Players are now added to the contentgroup on leve start. Moved animation and stuff to C# side of things. Cleaned up code.

This commit is contained in:
Filip Maj
2017-06-25 14:25:54 -04:00
parent c42f1a08de
commit 875b76634a
9 changed files with 292 additions and 55 deletions

View File

@@ -25,7 +25,13 @@ namespace FFXIVClassic_Map_Server.actors.group
if (initialMembers != null)
{
for (int i = 0; i < initialMembers.Length; i++)
{
Session s = Server.GetServer().GetSession(initialMembers[i]);
if (s != null)
s.GetActor().SetCurrentContentGroup(this);
members.Add(initialMembers[i]);
}
}
this.director = director;
@@ -38,11 +44,10 @@ namespace FFXIVClassic_Map_Server.actors.group
return;
members.Add(actor.actorId);
if (actor is Character)
{
((Character)actor).SetCurrentContentGroup(this);
SendCurrentContentSync(actor);
}
if (actor is Character)
((Character)actor).SetCurrentContentGroup(this);
SendGroupPacketsAll(members);
}
@@ -110,20 +115,6 @@ namespace FFXIVClassic_Map_Server.actors.group
}
public void SendCurrentContentSync(Actor currentContentChanged)
{
foreach (uint memberId in members)
{
Session session = Server.GetServer().GetSession(memberId);
if (session != null)
{
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/currentContentGroup", currentContentChanged, session.id);
propPacketUtil.AddProperty("charaWork.currentContentGroup");
session.GetActor().QueuePackets(propPacketUtil.Done());
}
}
}
public override uint GetTypeId()
{
return Group.ContentGroup_SimpleContentGroup24B;
@@ -135,12 +126,19 @@ namespace FFXIVClassic_Map_Server.actors.group
SendGroupPacketsAll(members);
}
public void DeleteAll()
public void DeleteGroup()
{
SendDeletePackets(members);
SendDeletePackets();
for (int i = 0; i < members.Count; i++)
{
Session s = Server.GetServer().GetSession(members[i]);
if (s != null)
s.GetActor().SetCurrentContentGroup(null);
members.Remove(members[i]);
}
Server.GetWorldManager().DeleteContentGroup(groupIndex);
}
public void CheckDestroy()
{
bool foundSession = false;
@@ -155,7 +153,7 @@ namespace FFXIVClassic_Map_Server.actors.group
}
if (!foundSession)
Server.GetWorldManager().DeleteContentGroup(groupIndex);
DeleteGroup();
}
}

View File

@@ -0,0 +1,29 @@
using FFXIVClassic.Common;
using FFXIVClassic_Map_Server.actors.director;
using FFXIVClassic_Map_Server.actors.group.Work;
using FFXIVClassic_Map_Server.Actors;
using FFXIVClassic_Map_Server.dataobjects;
using FFXIVClassic_Map_Server.packets.send.group;
using FFXIVClassic_Map_Server.packets.send.groups;
using FFXIVClassic_Map_Server.utils;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
{
class GLContentGroup : ContentGroup
{
public GLContentGroup(ulong groupIndex, Director director, uint[] initialMembers)
: base(groupIndex, director, initialMembers)
{
}
public override uint GetTypeId()
{
return Group.ContentGroup_GuildleveGroup;
}
}
}