1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-22 12:47:46 +00:00
project-meteor-server/FFXIVClassic Map Server/utils/ActorPropertyPacketUtil.cs
Tahir Akhlaq 8b93abe86e servers now log (almost) everything to file
- regex'd in mysqlexception logging
- servers can now specify server_port, log_path, log_file
- added scripts to import/export all tables (exporting will export a handful of garbage table names, open and check for structure before deleting)
- fixed packet logging (thanks deviltti)
2016-06-09 19:48:06 +01:00

51 lines
1.8 KiB
C#

using FFXIVClassic_Map_Server.packets;
using System.Collections.Generic;
using FFXIVClassic_Map_Server.packets.send.actor;
using FFXIVClassic_Map_Server.Actors;
namespace FFXIVClassic_Map_Server.utils
{
class ActorPropertyPacketUtil
{
private Actor forActor;
private uint playerActorId;
private List<SubPacket> subPackets = new List<SubPacket>();
private SetActorPropetyPacket currentActorPropertyPacket;
private string currentTarget;
public ActorPropertyPacketUtil(string firstTarget, Actor forActor, uint playerActorId)
{
currentActorPropertyPacket = new SetActorPropetyPacket(firstTarget);
this.forActor = forActor;
this.playerActorId = playerActorId;
this.currentTarget = firstTarget;
}
public void addProperty(string property)
{
if (!currentActorPropertyPacket.addProperty(forActor, property))
{
currentActorPropertyPacket.setIsMore(true);
currentActorPropertyPacket.addTarget();
subPackets.Add(currentActorPropertyPacket.buildPacket(playerActorId, forActor.actorId));
currentActorPropertyPacket = new SetActorPropetyPacket(currentTarget);
}
}
public void newTarget(string target)
{
currentActorPropertyPacket.addTarget();
currentTarget = target;
currentActorPropertyPacket.setTarget(target);
}
public List<SubPacket> done()
{
currentActorPropertyPacket.addTarget();
currentActorPropertyPacket.setIsMore(false);
subPackets.Add(currentActorPropertyPacket.buildPacket(playerActorId, forActor.actorId));
return subPackets;
}
}
}