mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-07-21 01:56:01 +02:00
Rewrote directors so that they can work in the new system. Began adding content groups to the map server.
This commit is contained in:
parent
ad88c0b28a
commit
f7482781e5
26 changed files with 638 additions and 359 deletions
|
@ -1,6 +1,7 @@
|
|||
using FFXIVClassic.Common;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.packets.send.group;
|
||||
using FFXIVClassic_Map_Server.packets.send.groups;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
@ -17,6 +18,27 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||
|
||||
public const uint RetainerGroup = 80001;
|
||||
|
||||
public const uint MonsterPartyGroup = 10002;
|
||||
|
||||
public const uint ContentGroup_GuildleveGroup = 30001;
|
||||
public const uint ContentGroup_PublicPopGroup = 30002;
|
||||
public const uint ContentGroup_SimpleContentGroup24A = 30003;
|
||||
public const uint ContentGroup_SimpleContentGroup32A = 30004;
|
||||
public const uint ContentGroup_SimpleContentGroup128 = 30005;
|
||||
public const uint ContentGroup_SimpleContentGroup24B = 30006;
|
||||
public const uint ContentGroup_SimpleContentGroup32B = 30007;
|
||||
public const uint ContentGroup_RetainerAccessGroup = 30008;
|
||||
public const uint ContentGroup_SimpleContentGroup99999 = 30009;
|
||||
public const uint ContentGroup_SimpleContentGroup512 = 30010;
|
||||
public const uint ContentGroup_SimpleContentGroup64A = 30011;
|
||||
public const uint ContentGroup_SimpleContentGroup64B = 30012;
|
||||
public const uint ContentGroup_SimpleContentGroup64C = 30013;
|
||||
public const uint ContentGroup_SimpleContentGroup64D = 30014;
|
||||
public const uint ContentGroup_SimpleContentGroup64E = 30015;
|
||||
public const uint ContentGroup_SimpleContentGroup64F = 30016;
|
||||
public const uint ContentGroup_SimpleContentGroup64G = 30017;
|
||||
public const uint ContentGroup_SimpleContentGroup24C = 30018;
|
||||
|
||||
public readonly ulong groupIndex;
|
||||
|
||||
public Group(ulong groupIndex)
|
||||
|
@ -44,39 +66,89 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||
return -1;
|
||||
}
|
||||
|
||||
public virtual List<GroupMember> BuildMemberList()
|
||||
public virtual List<GroupMember> BuildMemberList(uint id)
|
||||
{
|
||||
return new List<GroupMember>();
|
||||
}
|
||||
|
||||
public void SendGroupPacketsAll(params uint[] ids)
|
||||
{
|
||||
for (int i = 0; i < ids.Length; i++)
|
||||
{
|
||||
Session session = Server.GetServer().GetSession(ids[i]);
|
||||
|
||||
if (session != null)
|
||||
SendGroupPackets(session);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendGroupPacketsAll(List<uint> ids)
|
||||
{
|
||||
for (int i = 0; i < ids.Count; i++)
|
||||
{
|
||||
Session session = Server.GetServer().GetSession(ids[i]);
|
||||
|
||||
if (session != null)
|
||||
SendGroupPackets(session);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendDeletePackets(params uint[] ids)
|
||||
{
|
||||
for (int i = 0; i < ids.Length; i++)
|
||||
{
|
||||
Session session = Server.GetServer().GetSession(ids[i]);
|
||||
|
||||
if (session != null)
|
||||
SendDeletePacket(session);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendDeletePackets(List<uint> ids)
|
||||
{
|
||||
for (int i = 0; i < ids.Count; i++)
|
||||
{
|
||||
Session session = Server.GetServer().GetSession(ids[i]);
|
||||
|
||||
if (session != null)
|
||||
SendDeletePacket(session);
|
||||
}
|
||||
}
|
||||
|
||||
public void SendGroupPackets(Session session)
|
||||
{
|
||||
ulong time = Utils.MilisUnixTimeStampUTC();
|
||||
List<GroupMember> members = BuildMemberList();
|
||||
List<GroupMember> members = BuildMemberList(session.id);
|
||||
|
||||
Server.GetWorldConnection().QueuePacket(GroupHeaderPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
||||
Server.GetWorldConnection().QueuePacket(GroupMembersBeginPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
||||
session.QueuePacket(GroupHeaderPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
||||
session.QueuePacket(GroupMembersBeginPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
||||
|
||||
int currentIndex = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
if (GetMemberCount() - currentIndex >= 64)
|
||||
Server.GetWorldConnection().QueuePacket(GroupMembersX64Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
||||
session.QueuePacket(GroupMembersX64Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
||||
else if (GetMemberCount() - currentIndex >= 32)
|
||||
Server.GetWorldConnection().QueuePacket(GroupMembersX32Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
||||
session.QueuePacket(GroupMembersX32Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
||||
else if (GetMemberCount() - currentIndex >= 16)
|
||||
Server.GetWorldConnection().QueuePacket(GroupMembersX16Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
||||
session.QueuePacket(GroupMembersX16Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
||||
else if (GetMemberCount() - currentIndex > 0)
|
||||
Server.GetWorldConnection().QueuePacket(GroupMembersX08Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
||||
session.QueuePacket(GroupMembersX08Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
Server.GetWorldConnection().QueuePacket(GroupMembersEndPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
||||
session.QueuePacket(GroupMembersEndPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
||||
|
||||
}
|
||||
|
||||
public void SendDeletePacket(Session session)
|
||||
{
|
||||
if (session != null)
|
||||
session.QueuePacket(DeleteGroupPacket.buildPacket(session.id, this), true, false);
|
||||
}
|
||||
|
||||
public virtual void SendInitWorkValues(Session session)
|
||||
{
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue