Extended "Group" and created all the subgroups to cleanup code as well as make setting "work" values easier.

This commit is contained in:
Filip Maj 2016-12-04 11:59:54 -05:00
parent f286922974
commit c2a3641d08
13 changed files with 108 additions and 11 deletions

View File

@ -485,8 +485,8 @@ namespace FFXIVClassic_Map_Server.Actors
//GetSpawnPackets(actorId, spawnType).DebugPrintPacket();
#region Groups
Group retainerGroup = new Group(0x800000000004e639, Group.RetainerGroup, null);
Group partyGroup = new Group(0x8000000000696df2, Group.PlayerPartyGroup, null);
RetainerGroup retainerGroup = new RetainerGroup(0x800000000004e639);
PartyGroup partyGroup = new PartyGroup(0x8000000000696df2);
retainerGroup.add(this);
partyGroup.add(this);
retainerGroup.sendMemberPackets(this);

View File

@ -1,4 +1,5 @@
using FFXIVClassic.Common;
using FFXIVClassic_Map_Server.actors.group.work;
using FFXIVClassic_Map_Server.Actors;
using FFXIVClassic_Map_Server.packets.send.actor;
using FFXIVClassic_Map_Server.packets.send.group;

View File

@ -0,0 +1,42 @@
using FFXIVClassic_Map_Server.actors.group.work;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
{
class LinkshellGroup : Group
{
private LinkshellWork linkshellWork;
public LinkshellGroup(ulong id) : base(id, Group.CompanyGroup, null)
{
linkshellWork = new LinkshellWork();
}
public void setMaster(uint actorId)
{
linkshellWork._globalSave.master = (ulong)((0xB36F92 << 8) | actorId);
}
public void setCrest(ushort crestId)
{
linkshellWork._globalSave.crestIcon[0] = crestId;
}
public void setRank(byte rank = 1)
{
linkshellWork._globalSave.rank = rank;
}
public void setMemberRank(int index, byte rank)
{
if (members.Count >= index)
return;
linkshellWork._memberSave[index].rank = rank;
}
}
}

View File

@ -0,0 +1,24 @@
using FFXIVClassic_Map_Server.actors.group.work;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
{
class PartyGroup : Group
{
private PartyWork partyWork;
public PartyGroup(ulong id) : base(id, Group.PlayerPartyGroup, null)
{
partyWork = new PartyWork();
}
public void setPartyOwner(uint actorId)
{
partyWork._globalTemp.owner = (ulong)((0xB36F92 << 8) | actorId);
}
}
}

View File

@ -0,0 +1,29 @@
using FFXIVClassic_Map_Server.actors.group.work;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
{
class RetainerGroup : Group
{
private RetainerWork retainerWork;
public RetainerGroup(ulong id) : base(id, Group.RetainerGroup, null)
{
retainerWork = new RetainerWork();
}
public void setRetainerProperties(int index, byte cdIDOffset, ushort placeName, byte condition, byte level)
{
if (members.Count >= index)
return;
retainerWork._memberSave[index].cdIDOffset = cdIDOffset;
retainerWork._memberSave[index].placeName = placeName;
retainerWork._memberSave[index].conditions = condition;
retainerWork._memberSave[index].level = level;
}
}
}

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
namespace FFXIVClassic_Map_Server.actors.group.work
{
class ContentWork
{

View File

@ -4,11 +4,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
namespace FFXIVClassic_Map_Server.actors.group.work
{
class GroupGlobalSave
{
public ulong master;
public byte[] crestIcon = new byte[4];
public ushort[] crestIcon = new ushort[4];
public byte rank = 1;
}
}

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
namespace FFXIVClassic_Map_Server.actors.group.work
{
class GroupGlobalTemp
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
namespace FFXIVClassic_Map_Server.actors.group.work
{
class GroupMemberSave
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
namespace FFXIVClassic_Map_Server.actors.group.work
{
class LinkshellWork
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
namespace FFXIVClassic_Map_Server.actors.group.work
{
class PartyWork
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
namespace FFXIVClassic_Map_Server.actors.group.work
{
class RelationWork
{

View File

@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFXIVClassic_Map_Server.actors.group
namespace FFXIVClassic_Map_Server.actors.group.work
{
class RetainerWork
{