mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-20 19:57:46 +00:00
Added subclassed groups to auto-set workvalues.
This commit is contained in:
parent
c2a3641d08
commit
feb73a8444
7 changed files with 95 additions and 77 deletions
|
@ -81,7 +81,11 @@
|
||||||
<Compile Include="actors\chara\player\Equipment.cs" />
|
<Compile Include="actors\chara\player\Equipment.cs" />
|
||||||
<Compile Include="actors\chara\player\Inventory.cs" />
|
<Compile Include="actors\chara\player\Inventory.cs" />
|
||||||
<Compile Include="actors\chara\Work.cs" />
|
<Compile Include="actors\chara\Work.cs" />
|
||||||
<Compile Include="actors\group\ContentWork.cs" />
|
<Compile Include="actors\group\GroupInvitationRelationGroup.cs" />
|
||||||
|
<Compile Include="actors\group\LinkshellGroup.cs" />
|
||||||
|
<Compile Include="actors\group\PartyGroup.cs" />
|
||||||
|
<Compile Include="actors\group\RetainerGroup.cs" />
|
||||||
|
<Compile Include="actors\group\work\ContentWork.cs" />
|
||||||
<Compile Include="actors\debug\Debug.cs" />
|
<Compile Include="actors\debug\Debug.cs" />
|
||||||
<Compile Include="actors\director\Director.cs" />
|
<Compile Include="actors\director\Director.cs" />
|
||||||
<Compile Include="actors\director\OpeningDirector.cs" />
|
<Compile Include="actors\director\OpeningDirector.cs" />
|
||||||
|
@ -91,15 +95,15 @@
|
||||||
<Compile Include="actors\director\WeatherDirector.cs" />
|
<Compile Include="actors\director\WeatherDirector.cs" />
|
||||||
<Compile Include="actors\EventList.cs" />
|
<Compile Include="actors\EventList.cs" />
|
||||||
<Compile Include="actors\group\Group.cs" />
|
<Compile Include="actors\group\Group.cs" />
|
||||||
<Compile Include="actors\group\GroupGlobalSave.cs" />
|
<Compile Include="actors\group\work\GroupGlobalSave.cs" />
|
||||||
<Compile Include="actors\group\GroupGlobalTemp.cs" />
|
<Compile Include="actors\group\work\GroupGlobalTemp.cs" />
|
||||||
<Compile Include="actors\group\GroupMemberSave.cs" />
|
<Compile Include="actors\group\work\GroupMemberSave.cs" />
|
||||||
<Compile Include="actors\judge\Judge.cs" />
|
<Compile Include="actors\judge\Judge.cs" />
|
||||||
<Compile Include="actors\group\LinkshellWork.cs" />
|
<Compile Include="actors\group\work\LinkshellWork.cs" />
|
||||||
<Compile Include="actors\group\PartyWork.cs" />
|
<Compile Include="actors\group\work\PartyWork.cs" />
|
||||||
<Compile Include="actors\quest\Quest.cs" />
|
<Compile Include="actors\quest\Quest.cs" />
|
||||||
<Compile Include="actors\group\RelationWork.cs" />
|
<Compile Include="actors\group\work\RelationWork.cs" />
|
||||||
<Compile Include="actors\group\RetainerWork.cs" />
|
<Compile Include="actors\group\work\RetainerWork.cs" />
|
||||||
<Compile Include="actors\StaticActors.cs" />
|
<Compile Include="actors\StaticActors.cs" />
|
||||||
<Compile Include="actors\world\WorldMaster.cs" />
|
<Compile Include="actors\world\WorldMaster.cs" />
|
||||||
<Compile Include="dataobjects\ZoneConnection.cs" />
|
<Compile Include="dataobjects\ZoneConnection.cs" />
|
||||||
|
|
|
@ -486,11 +486,11 @@ namespace FFXIVClassic_Map_Server.Actors
|
||||||
|
|
||||||
#region Groups
|
#region Groups
|
||||||
RetainerGroup retainerGroup = new RetainerGroup(0x800000000004e639);
|
RetainerGroup retainerGroup = new RetainerGroup(0x800000000004e639);
|
||||||
PartyGroup partyGroup = new PartyGroup(0x8000000000696df2);
|
PartyGroup partyGroup = new PartyGroup(0x8000000000696df2, actorId);
|
||||||
retainerGroup.add(this);
|
retainerGroup.add(this);
|
||||||
partyGroup.add(this);
|
partyGroup.add(this);
|
||||||
retainerGroup.sendMemberPackets(this);
|
retainerGroup.sendMemberPackets(this);
|
||||||
partyGroup.sendMemberPackets(this);
|
partyGroup.sendMemberPackets(this);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Inventory & Equipment
|
#region Inventory & Equipment
|
||||||
|
|
|
@ -28,20 +28,12 @@ namespace FFXIVClassic_Map_Server.actors.group
|
||||||
public int localizedNamed = -1;
|
public int localizedNamed = -1;
|
||||||
public string groupName = "";
|
public string groupName = "";
|
||||||
|
|
||||||
public PartyWork partyGroupWork; //For party group types
|
|
||||||
public Object work; //For the rest
|
|
||||||
|
|
||||||
public List<GroupMember> members = new List<GroupMember>();
|
public List<GroupMember> members = new List<GroupMember>();
|
||||||
|
|
||||||
public Group(ulong id, uint typeId, object work)
|
public Group(ulong id, uint typeId)
|
||||||
{
|
{
|
||||||
groupId = id;
|
groupId = id;
|
||||||
groupTypeId = typeId;
|
groupTypeId = typeId;
|
||||||
|
|
||||||
if (work is PartyWork)
|
|
||||||
partyGroupWork = (PartyWork)work;
|
|
||||||
else
|
|
||||||
this.work = work;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Group(ulong id, uint typeId, int nameId, object work)
|
public Group(ulong id, uint typeId, int nameId, object work)
|
||||||
|
@ -49,11 +41,6 @@ namespace FFXIVClassic_Map_Server.actors.group
|
||||||
groupId = id;
|
groupId = id;
|
||||||
groupTypeId = typeId;
|
groupTypeId = typeId;
|
||||||
localizedNamed = nameId;
|
localizedNamed = nameId;
|
||||||
|
|
||||||
if (work is PartyWork)
|
|
||||||
partyGroupWork = (PartyWork)work;
|
|
||||||
else
|
|
||||||
this.work = (PartyWork)work;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Group(ulong id, uint typeId, string name, object work)
|
public Group(ulong id, uint typeId, string name, object work)
|
||||||
|
@ -62,11 +49,6 @@ namespace FFXIVClassic_Map_Server.actors.group
|
||||||
groupTypeId = typeId;
|
groupTypeId = typeId;
|
||||||
groupName = name;
|
groupName = name;
|
||||||
localizedNamed = -1;
|
localizedNamed = -1;
|
||||||
|
|
||||||
if (work is PartyWork)
|
|
||||||
partyGroupWork = (PartyWork)work;
|
|
||||||
else
|
|
||||||
this.work = work;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(Actor actor)
|
public void add(Actor actor)
|
||||||
|
@ -103,40 +85,7 @@ namespace FFXIVClassic_Map_Server.actors.group
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendWorkValues(Player player)
|
public virtual void sendWorkValues(Player player){}
|
||||||
{
|
|
||||||
if (groupTypeId == PlayerPartyGroup)
|
|
||||||
{
|
|
||||||
SynchGroupWorkValuesPacket groupWork = new SynchGroupWorkValuesPacket(groupId);
|
|
||||||
groupWork.addProperty(this, "partyGroupWork._globalTemp.owner");
|
|
||||||
groupWork.setTarget("/_init");
|
|
||||||
|
|
||||||
SubPacket test = groupWork.buildPacket(player.actorId, player.actorId);
|
|
||||||
player.QueuePacket(test);
|
|
||||||
}
|
|
||||||
else if (groupTypeId == GroupInvitationRelationGroup)
|
|
||||||
{
|
|
||||||
SynchGroupWorkValuesPacket groupWork = new SynchGroupWorkValuesPacket(groupId);
|
|
||||||
groupWork.addProperty(this, "work._globalTemp.host");
|
|
||||||
groupWork.addProperty(this, "work._globalTemp.variableCommand");
|
|
||||||
groupWork.setTarget("/_init");
|
|
||||||
|
|
||||||
SubPacket test = groupWork.buildPacket(player.actorId, player.actorId);
|
|
||||||
test.DebugPrintSubPacket();
|
|
||||||
player.QueuePacket(test);
|
|
||||||
}
|
|
||||||
else if (groupTypeId == RetainerGroup)
|
|
||||||
{
|
|
||||||
SynchGroupWorkValuesPacket groupWork = new SynchGroupWorkValuesPacket(groupId);
|
|
||||||
groupWork.addProperty(this, "work._memberSave[0].cdIDOffset");
|
|
||||||
groupWork.addProperty(this, "work._memberSave[0].placeName");
|
|
||||||
groupWork.addProperty(this, "work._memberSave[0].conditions");
|
|
||||||
groupWork.addProperty(this, "work._memberSave[0].level");
|
|
||||||
groupWork.setTarget("/_init");
|
|
||||||
|
|
||||||
SubPacket test = groupWork.buildPacket(player.actorId, player.actorId);
|
|
||||||
player.QueuePacket(test);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
using FFXIVClassic.Common;
|
||||||
|
using FFXIVClassic_Map_Server.actors.group.work;
|
||||||
|
using FFXIVClassic_Map_Server.Actors;
|
||||||
|
using FFXIVClassic_Map_Server.packets.send.groups;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.actors.group
|
||||||
|
{
|
||||||
|
class GroupInvitationRelationGroup : Group
|
||||||
|
{
|
||||||
|
RelationWork work;
|
||||||
|
|
||||||
|
public GroupInvitationRelationGroup(uint id, uint hostActorId, uint commandType) : base(id, Group.GroupInvitationRelationGroup)
|
||||||
|
{
|
||||||
|
work = new RelationWork();
|
||||||
|
work._globalTemp.host = hostActorId;
|
||||||
|
work._globalTemp.variableCommand = commandType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void sendWorkValues(Player player)
|
||||||
|
{
|
||||||
|
SynchGroupWorkValuesPacket groupWork = new SynchGroupWorkValuesPacket(groupId);
|
||||||
|
groupWork.addProperty(this, "work._globalTemp.host");
|
||||||
|
groupWork.addProperty(this, "work._globalTemp.variableCommand");
|
||||||
|
groupWork.setTarget("/_init");
|
||||||
|
|
||||||
|
SubPacket test = groupWork.buildPacket(player.actorId, player.actorId);
|
||||||
|
test.DebugPrintSubPacket();
|
||||||
|
player.QueuePacket(test);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -11,7 +11,7 @@ namespace FFXIVClassic_Map_Server.actors.group
|
||||||
{
|
{
|
||||||
private LinkshellWork linkshellWork;
|
private LinkshellWork linkshellWork;
|
||||||
|
|
||||||
public LinkshellGroup(ulong id) : base(id, Group.CompanyGroup, null)
|
public LinkshellGroup(ulong id) : base(id, Group.CompanyGroup)
|
||||||
{
|
{
|
||||||
linkshellWork = new LinkshellWork();
|
linkshellWork = new LinkshellWork();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
using FFXIVClassic_Map_Server.actors.group.work;
|
using FFXIVClassic.Common;
|
||||||
|
using FFXIVClassic_Map_Server.actors.group.work;
|
||||||
|
using FFXIVClassic_Map_Server.packets.send.groups;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -9,16 +11,27 @@ namespace FFXIVClassic_Map_Server.actors.group
|
||||||
{
|
{
|
||||||
class PartyGroup : Group
|
class PartyGroup : Group
|
||||||
{
|
{
|
||||||
private PartyWork partyWork;
|
private PartyWork partyGroupWork;
|
||||||
|
|
||||||
public PartyGroup(ulong id) : base(id, Group.PlayerPartyGroup, null)
|
public PartyGroup(ulong id, uint owner) : base(id, Group.PlayerPartyGroup)
|
||||||
{
|
{
|
||||||
partyWork = new PartyWork();
|
partyGroupWork = new PartyWork();
|
||||||
|
partyGroupWork._globalTemp.owner = (ulong)((0xB36F92 << 8) | owner);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setPartyOwner(uint actorId)
|
public void setPartyOwner(uint actorId)
|
||||||
{
|
{
|
||||||
partyWork._globalTemp.owner = (ulong)((0xB36F92 << 8) | actorId);
|
partyGroupWork._globalTemp.owner = (ulong)((0xB36F92 << 8) | actorId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void sendWorkValues(Actors.Player player)
|
||||||
|
{
|
||||||
|
SynchGroupWorkValuesPacket groupWork = new SynchGroupWorkValuesPacket(groupId);
|
||||||
|
groupWork.addProperty(this, "partyGroupWork._globalTemp.owner");
|
||||||
|
groupWork.setTarget("/_init");
|
||||||
|
|
||||||
|
SubPacket test = groupWork.buildPacket(player.actorId, player.actorId);
|
||||||
|
player.QueuePacket(test);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
using FFXIVClassic_Map_Server.actors.group.work;
|
using FFXIVClassic.Common;
|
||||||
|
using FFXIVClassic_Map_Server.actors.group.work;
|
||||||
|
using FFXIVClassic_Map_Server.packets.send.groups;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -9,21 +11,34 @@ namespace FFXIVClassic_Map_Server.actors.group
|
||||||
{
|
{
|
||||||
class RetainerGroup : Group
|
class RetainerGroup : Group
|
||||||
{
|
{
|
||||||
private RetainerWork retainerWork;
|
private RetainerWork work;
|
||||||
|
|
||||||
public RetainerGroup(ulong id) : base(id, Group.RetainerGroup, null)
|
public RetainerGroup(ulong id) : base(id, Group.RetainerGroup)
|
||||||
{
|
{
|
||||||
retainerWork = new RetainerWork();
|
work = new RetainerWork();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRetainerProperties(int index, byte cdIDOffset, ushort placeName, byte condition, byte level)
|
public void setRetainerProperties(int index, byte cdIDOffset, ushort placeName, byte condition, byte level)
|
||||||
{
|
{
|
||||||
if (members.Count >= index)
|
if (members.Count >= index)
|
||||||
return;
|
return;
|
||||||
retainerWork._memberSave[index].cdIDOffset = cdIDOffset;
|
work._memberSave[index].cdIDOffset = cdIDOffset;
|
||||||
retainerWork._memberSave[index].placeName = placeName;
|
work._memberSave[index].placeName = placeName;
|
||||||
retainerWork._memberSave[index].conditions = condition;
|
work._memberSave[index].conditions = condition;
|
||||||
retainerWork._memberSave[index].level = level;
|
work._memberSave[index].level = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void sendWorkValues(Actors.Player player)
|
||||||
|
{
|
||||||
|
SynchGroupWorkValuesPacket groupWork = new SynchGroupWorkValuesPacket(groupId);
|
||||||
|
groupWork.addProperty(this, "work._memberSave[0].cdIDOffset");
|
||||||
|
groupWork.addProperty(this, "work._memberSave[0].placeName");
|
||||||
|
groupWork.addProperty(this, "work._memberSave[0].conditions");
|
||||||
|
groupWork.addProperty(this, "work._memberSave[0].level");
|
||||||
|
groupWork.setTarget("/_init");
|
||||||
|
|
||||||
|
SubPacket test = groupWork.buildPacket(player.actorId, player.actorId);
|
||||||
|
player.QueuePacket(test);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue