mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-02 19:42:05 -04:00
Merge branch 'develop' of https://bitbucket.org/Ioncannon/ffxiv-classic-server into ai
# Conflicts: # FFXIVClassic Map Server/actors/Actor.cs # FFXIVClassic Map Server/dataobjects/Session.cs # FFXIVClassic Map Server/lua/LuaEngine.cs
This commit is contained in:
commit
4695193aa0
@ -72,9 +72,9 @@ namespace FFXIVClassic.Common
|
|||||||
offset += header.subpacketSize;
|
offset += header.subpacketSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket(ushort opcode, uint sourceId, uint targetId, byte[] data) : this(true, opcode, sourceId, targetId, data) { }
|
public SubPacket(ushort opcode, uint sourceId, byte[] data) : this(true, opcode, sourceId, data) { }
|
||||||
|
|
||||||
public SubPacket(bool isGameMessage, ushort opcode, uint sourceId, uint targetId, byte[] data)
|
public SubPacket(bool isGameMessage, ushort opcode, uint sourceId, byte[] data)
|
||||||
{
|
{
|
||||||
header = new SubPacketHeader();
|
header = new SubPacketHeader();
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ namespace FFXIVClassic.Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
header.sourceId = sourceId;
|
header.sourceId = sourceId;
|
||||||
header.targetId = targetId;
|
header.targetId = 0;
|
||||||
|
|
||||||
if (isGameMessage)
|
if (isGameMessage)
|
||||||
header.type = 0x03;
|
header.type = 0x03;
|
||||||
@ -117,6 +117,11 @@ namespace FFXIVClassic.Common
|
|||||||
data = original.data;
|
data = original.data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void SetTargetId(uint target)
|
||||||
|
{
|
||||||
|
this.header.targetId = target;
|
||||||
|
}
|
||||||
|
|
||||||
public byte[] GetHeaderBytes()
|
public byte[] GetHeaderBytes()
|
||||||
{
|
{
|
||||||
var size = Marshal.SizeOf(header);
|
var size = Marshal.SizeOf(header);
|
||||||
|
@ -90,14 +90,15 @@ namespace FFXIVClassic_Lobby_Server
|
|||||||
|
|
||||||
if (userId == 0)
|
if (userId == 0)
|
||||||
{
|
{
|
||||||
ErrorPacket errorPacket = new ErrorPacket(sessionPacket.sequence, 0, 0, 13001, "Your session has expired, please login again.");
|
ErrorPacket errorPacket = new ErrorPacket(sessionPacket.sequence, 0, 0, 13001, "Your session has expired, please login again.");
|
||||||
SubPacket subpacket = errorPacket.BuildPacket();
|
SubPacket subpacket = errorPacket.BuildPacket();
|
||||||
BasePacket errorBasePacket = BasePacket.CreatePacket(subpacket, true, false);
|
subpacket.SetTargetId(0xe0006868);
|
||||||
BasePacket.EncryptPacket(client.blowfish, errorBasePacket);
|
BasePacket errorBasePacket = BasePacket.CreatePacket(subpacket, true, false);
|
||||||
client.QueuePacket(errorBasePacket);
|
BasePacket.EncryptPacket(client.blowfish, errorBasePacket);
|
||||||
|
client.QueuePacket(errorBasePacket);
|
||||||
|
|
||||||
Program.Log.Info("Invalid session, kicking...");
|
Program.Log.Info("Invalid session, kicking...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Program.Log.Info("USER ID: {0}", userId);
|
Program.Log.Info("USER ID: {0}", userId);
|
||||||
|
@ -61,7 +61,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
accountCount = 0;
|
accountCount = 0;
|
||||||
}
|
}
|
||||||
@ -88,7 +89,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
|
|
||||||
return new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
return new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
characterCount = 0;
|
characterCount = 0;
|
||||||
}
|
}
|
||||||
@ -133,7 +134,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
characterCount = 0;
|
characterCount = 0;
|
||||||
}
|
}
|
||||||
@ -145,7 +147,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
return subpacket;
|
return subpacket;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -64,7 +64,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
namesCount = 0;
|
namesCount = 0;
|
||||||
}
|
}
|
||||||
@ -91,7 +92,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +65,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
retainerCount = 0;
|
retainerCount = 0;
|
||||||
}
|
}
|
||||||
@ -92,7 +93,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
data = memStream.GetBuffer();
|
data = memStream.GetBuffer();
|
||||||
}
|
}
|
||||||
|
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
|
|
||||||
return subPackets;
|
return subPackets;
|
||||||
|
@ -63,7 +63,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
serverCount = 0;
|
serverCount = 0;
|
||||||
}
|
}
|
||||||
@ -90,7 +91,8 @@ namespace FFXIVClassic_Lobby_Server.packets
|
|||||||
byte[] data = memStream.GetBuffer();
|
byte[] data = memStream.GetBuffer();
|
||||||
binWriter.Dispose();
|
binWriter.Dispose();
|
||||||
memStream.Dispose();
|
memStream.Dispose();
|
||||||
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, 0xe0006868, data);
|
SubPacket subpacket = new SubPacket(OPCODE, 0xe0006868, data);
|
||||||
|
subpacket.SetTargetId(0xe0006868);
|
||||||
subPackets.Add(subpacket);
|
subPackets.Add(subpacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
{
|
{
|
||||||
class CommandProcessor
|
class CommandProcessor
|
||||||
{
|
{
|
||||||
private static Dictionary<uint, Item> gamedataItems = Server.GetGamedataItems();
|
private static Dictionary<uint, ItemData> gamedataItems = Server.GetGamedataItems();
|
||||||
|
|
||||||
const UInt32 ITEM_GIL = 1000001;
|
const UInt32 ITEM_GIL = 1000001;
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
private void SendMessage(Session session, String message)
|
private void SendMessage(Session session, String message)
|
||||||
{
|
{
|
||||||
if (session != null)
|
if (session != null)
|
||||||
session.GetActor().QueuePacket(SendMessagePacket.BuildPacket(session.id, session.id, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", message));
|
session.GetActor().QueuePacket(SendMessagePacket.BuildPacket(session.id, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", message));
|
||||||
}
|
}
|
||||||
|
|
||||||
internal bool DoCommand(string input, Session session)
|
internal bool DoCommand(string input, Session session)
|
||||||
|
@ -70,11 +70,11 @@ namespace FFXIVClassic_Map_Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dictionary<uint, Item> GetItemGamedata()
|
public static Dictionary<uint, ItemData> GetItemGamedata()
|
||||||
{
|
{
|
||||||
using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
||||||
{
|
{
|
||||||
Dictionary<uint, Item> gamedataItems = new Dictionary<uint, Item>();
|
Dictionary<uint, ItemData> gamedataItems = new Dictionary<uint, ItemData>();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@ -98,16 +98,16 @@ namespace FFXIVClassic_Map_Server
|
|||||||
while (reader.Read())
|
while (reader.Read())
|
||||||
{
|
{
|
||||||
uint id = reader.GetUInt32("catalogID");
|
uint id = reader.GetUInt32("catalogID");
|
||||||
Item item = null;
|
ItemData item = null;
|
||||||
|
|
||||||
if (Item.IsWeapon(id))
|
if (ItemData.IsWeapon(id))
|
||||||
item = new WeaponItem(reader);
|
item = new WeaponItem(reader);
|
||||||
else if (Item.IsArmor(id))
|
else if (ItemData.IsArmor(id))
|
||||||
item = new ArmorItem(reader);
|
item = new ArmorItem(reader);
|
||||||
else if (Item.IsAccessory(id))
|
else if (ItemData.IsAccessory(id))
|
||||||
item = new AccessoryItem(reader);
|
item = new AccessoryItem(reader);
|
||||||
else
|
else
|
||||||
item = new Item(reader);
|
item = new ItemData(reader);
|
||||||
|
|
||||||
gamedataItems.Add(item.catalogID, item);
|
gamedataItems.Add(item.catalogID, item);
|
||||||
}
|
}
|
||||||
@ -126,6 +126,47 @@ namespace FFXIVClassic_Map_Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static Dictionary<uint, GuildleveData> GetGuildleveGamedata()
|
||||||
|
{
|
||||||
|
using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
||||||
|
{
|
||||||
|
Dictionary<uint, GuildleveData> gamedataGuildleves = new Dictionary<uint, GuildleveData>();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
string query = @"
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM gamedata_guildleves
|
||||||
|
";
|
||||||
|
|
||||||
|
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||||
|
|
||||||
|
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||||
|
{
|
||||||
|
while (reader.Read())
|
||||||
|
{
|
||||||
|
uint id = reader.GetUInt32("id");
|
||||||
|
GuildleveData guildleve = new GuildleveData(reader);
|
||||||
|
gamedataGuildleves.Add(guildleve.id, guildleve);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (MySqlException e)
|
||||||
|
{
|
||||||
|
Program.Log.Error(e.ToString());
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
conn.Dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
return gamedataGuildleves;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void SavePlayerAppearance(Player player)
|
public static void SavePlayerAppearance(Player player)
|
||||||
{
|
{
|
||||||
string query;
|
string query;
|
||||||
@ -391,6 +432,42 @@ namespace FFXIVClassic_Map_Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void MarkGuildleve(Player player, uint glId, bool isAbandoned, bool isCompleted)
|
||||||
|
{
|
||||||
|
string query;
|
||||||
|
MySqlCommand cmd;
|
||||||
|
|
||||||
|
using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD)))
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
conn.Open();
|
||||||
|
|
||||||
|
query = @"
|
||||||
|
UPDATE characters_quest_guildleve_regional
|
||||||
|
SET abandoned = @abandoned, completed = @completed
|
||||||
|
WHERE characterId = @charaId and guildleveId = @guildleveId
|
||||||
|
";
|
||||||
|
|
||||||
|
cmd = new MySqlCommand(query, conn);
|
||||||
|
cmd.Parameters.AddWithValue("@charaId", player.actorId);
|
||||||
|
cmd.Parameters.AddWithValue("@guildleveId", glId);
|
||||||
|
cmd.Parameters.AddWithValue("@abandoned", isAbandoned);
|
||||||
|
cmd.Parameters.AddWithValue("@completed", isCompleted);
|
||||||
|
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
}
|
||||||
|
catch (MySqlException e)
|
||||||
|
{
|
||||||
|
Program.Log.Error(e.ToString());
|
||||||
|
}
|
||||||
|
finally
|
||||||
|
{
|
||||||
|
conn.Dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void SaveGuildleve(Player player, uint glId, int slot)
|
public static void SaveGuildleve(Player player, uint glId, int slot)
|
||||||
{
|
{
|
||||||
string query;
|
string query;
|
||||||
|
@ -108,7 +108,10 @@
|
|||||||
<Compile Include="actors\chara\Work.cs" />
|
<Compile Include="actors\chara\Work.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\GuildleveDirector.cs" />
|
||||||
|
<Compile Include="actors\director\Work\GuildleveWork.cs" />
|
||||||
<Compile Include="actors\EventList.cs" />
|
<Compile Include="actors\EventList.cs" />
|
||||||
|
<Compile Include="actors\group\GLContentGroup.cs" />
|
||||||
<Compile Include="actors\group\ContentGroup.cs" />
|
<Compile Include="actors\group\ContentGroup.cs" />
|
||||||
<Compile Include="actors\group\Work\ContentGroupWork.cs" />
|
<Compile Include="actors\group\Work\ContentGroupWork.cs" />
|
||||||
<Compile Include="actors\group\Work\GlobalTemp.cs" />
|
<Compile Include="actors\group\Work\GlobalTemp.cs" />
|
||||||
@ -125,6 +128,7 @@
|
|||||||
<Compile Include="actors\quest\Quest.cs" />
|
<Compile Include="actors\quest\Quest.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\GuildleveData.cs" />
|
||||||
<Compile Include="dataobjects\ZoneConnection.cs" />
|
<Compile Include="dataobjects\ZoneConnection.cs" />
|
||||||
<Compile Include="CommandProcessor.cs" />
|
<Compile Include="CommandProcessor.cs" />
|
||||||
<Compile Include="ConfigConstants.cs" />
|
<Compile Include="ConfigConstants.cs" />
|
||||||
@ -144,7 +148,7 @@
|
|||||||
<Compile Include="actors\chara\player\PlayerWork.cs" />
|
<Compile Include="actors\chara\player\PlayerWork.cs" />
|
||||||
<Compile Include="dataobjects\InventoryItem.cs" />
|
<Compile Include="dataobjects\InventoryItem.cs" />
|
||||||
<Compile Include="dataobjects\Session.cs" />
|
<Compile Include="dataobjects\Session.cs" />
|
||||||
<Compile Include="dataobjects\Item.cs" />
|
<Compile Include="dataobjects\ItemData.cs" />
|
||||||
<Compile Include="dataobjects\RecruitmentDetails.cs" />
|
<Compile Include="dataobjects\RecruitmentDetails.cs" />
|
||||||
<Compile Include="dataobjects\SeamlessBoundry.cs" />
|
<Compile Include="dataobjects\SeamlessBoundry.cs" />
|
||||||
<Compile Include="dataobjects\SearchEntry.cs" />
|
<Compile Include="dataobjects\SearchEntry.cs" />
|
||||||
@ -176,7 +180,6 @@
|
|||||||
<Compile Include="packets\send\actor\ActorDoEmotePacket.cs" />
|
<Compile Include="packets\send\actor\ActorDoEmotePacket.cs" />
|
||||||
<Compile Include="packets\send\actor\ActorInstantiatePacket.cs" />
|
<Compile Include="packets\send\actor\ActorInstantiatePacket.cs" />
|
||||||
<Compile Include="packets\send\actor\ActorSpecialGraphicPacket.cs" />
|
<Compile Include="packets\send\actor\ActorSpecialGraphicPacket.cs" />
|
||||||
<Compile Include="packets\send\actor\BattleAction1Packet.cs" />
|
|
||||||
<Compile Include="packets\send\actor\battle\BattleAction.cs" />
|
<Compile Include="packets\send\actor\battle\BattleAction.cs" />
|
||||||
<Compile Include="packets\send\actor\battle\BattleActionX00Packet.cs" />
|
<Compile Include="packets\send\actor\battle\BattleActionX00Packet.cs" />
|
||||||
<Compile Include="packets\send\actor\battle\BattleActionX18Packet.cs" />
|
<Compile Include="packets\send\actor\battle\BattleActionX18Packet.cs" />
|
||||||
@ -219,8 +222,7 @@
|
|||||||
<Compile Include="packets\send\actor\SetActorIconPacket.cs" />
|
<Compile Include="packets\send\actor\SetActorIconPacket.cs" />
|
||||||
<Compile Include="packets\send\actor\SetActorSubStatPacket.cs" />
|
<Compile Include="packets\send\actor\SetActorSubStatPacket.cs" />
|
||||||
<Compile Include="packets\send\actor\SetActorStatusPacket.cs" />
|
<Compile Include="packets\send\actor\SetActorStatusPacket.cs" />
|
||||||
<Compile Include="packets\send\actor\_0xD9Packet.cs" />
|
<Compile Include="packets\send\actor\SetActorBGPropertiesPacket.cs" />
|
||||||
<Compile Include="packets\send\actor\_0xD8Packet.cs" />
|
|
||||||
<Compile Include="packets\send\actor\_0xFPacket.cs" />
|
<Compile Include="packets\send\actor\_0xFPacket.cs" />
|
||||||
<Compile Include="packets\send\groups\CreateNamedGroup.cs" />
|
<Compile Include="packets\send\groups\CreateNamedGroup.cs" />
|
||||||
<Compile Include="packets\send\groups\CreateNamedGroupMultiple.cs" />
|
<Compile Include="packets\send\groups\CreateNamedGroupMultiple.cs" />
|
||||||
@ -260,7 +262,6 @@
|
|||||||
<Compile Include="packets\send\actor\MoveActorToPositionPacket.cs" />
|
<Compile Include="packets\send\actor\MoveActorToPositionPacket.cs" />
|
||||||
<Compile Include="packets\send\actor\SetActorAppearancePacket.cs" />
|
<Compile Include="packets\send\actor\SetActorAppearancePacket.cs" />
|
||||||
<Compile Include="packets\send\actor\SetActorPositionPacket.cs" />
|
<Compile Include="packets\send\actor\SetActorPositionPacket.cs" />
|
||||||
<Compile Include="packets\send\login\0x7ResponsePacket.cs" />
|
|
||||||
<Compile Include="packets\send\LogoutPacket.cs" />
|
<Compile Include="packets\send\LogoutPacket.cs" />
|
||||||
<Compile Include="packets\send\player\SetCompletedAchievementsPacket.cs" />
|
<Compile Include="packets\send\player\SetCompletedAchievementsPacket.cs" />
|
||||||
<Compile Include="packets\send\player\AchievementEarnedPacket.cs" />
|
<Compile Include="packets\send\player\AchievementEarnedPacket.cs" />
|
||||||
@ -359,8 +360,8 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PostBuildEvent>xcopy "$(SolutionDir)data\map_config.ini" "$(SolutionDir)$(ProjectName)\$(OutDir)" /d
|
<PostBuildEvent>
|
||||||
xcopy "$(SolutionDir)data\scripts" "$(SolutionDir)$(ProjectName)\$(OutDir)scripts\" /e /d /y /s</PostBuildEvent>
|
</PostBuildEvent>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PreBuildEvent>
|
<PreBuildEvent>
|
||||||
|
@ -35,7 +35,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
|
|
||||||
public void ProcessPacket(ZoneConnection client, SubPacket subpacket)
|
public void ProcessPacket(ZoneConnection client, SubPacket subpacket)
|
||||||
{
|
{
|
||||||
Session session = mServer.GetSession(subpacket.header.targetId);
|
Session session = mServer.GetSession(subpacket.header.sourceId);
|
||||||
|
|
||||||
if (session == null && subpacket.gameMessage.opcode != 0x1000)
|
if (session == null && subpacket.gameMessage.opcode != 0x1000)
|
||||||
return;
|
return;
|
||||||
@ -59,7 +59,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
|
|
||||||
SessionBeginPacket beginSessionPacket = new SessionBeginPacket(subpacket.data);
|
SessionBeginPacket beginSessionPacket = new SessionBeginPacket(subpacket.data);
|
||||||
|
|
||||||
session = mServer.AddSession(subpacket.header.targetId);
|
session = mServer.AddSession(subpacket.header.sourceId);
|
||||||
|
|
||||||
if (!beginSessionPacket.isLogin)
|
if (!beginSessionPacket.isLogin)
|
||||||
Server.GetWorldManager().DoZoneIn(session.GetActor(), false, session.GetActor().destinationSpawnType);
|
Server.GetWorldManager().DoZoneIn(session.GetActor(), false, session.GetActor().destinationSpawnType);
|
||||||
@ -80,7 +80,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
Server.GetServer().RemoveSession(session.id);
|
Server.GetServer().RemoveSession(session.id);
|
||||||
Program.Log.Info("{0} has been removed from the session list.", session.GetActor().customDisplayName);
|
Program.Log.Info("{0} has been removed from the session list.", session.GetActor().customDisplayName);
|
||||||
|
|
||||||
client.QueuePacket(SessionEndConfirmPacket.BuildPacket(session, endSessionPacket.destinationZoneId), true, false);
|
session.QueuePacket(SessionEndConfirmPacket.BuildPacket(session, endSessionPacket.destinationZoneId));
|
||||||
client.FlushQueuedSendPackets();
|
client.FlushQueuedSendPackets();
|
||||||
break;
|
break;
|
||||||
//World Server - Party Synch
|
//World Server - Party Synch
|
||||||
@ -92,14 +92,14 @@ namespace FFXIVClassic_Map_Server
|
|||||||
case 0x0001:
|
case 0x0001:
|
||||||
//subpacket.DebugPrintSubPacket();
|
//subpacket.DebugPrintSubPacket();
|
||||||
PingPacket pingPacket = new PingPacket(subpacket.data);
|
PingPacket pingPacket = new PingPacket(subpacket.data);
|
||||||
client.QueuePacket(BasePacket.CreatePacket(PongPacket.BuildPacket(session.id, pingPacket.time), true, false));
|
session.QueuePacket(PongPacket.BuildPacket(session.id, pingPacket.time));
|
||||||
session.Ping();
|
session.Ping();
|
||||||
break;
|
break;
|
||||||
//Unknown
|
//Unknown
|
||||||
case 0x0002:
|
case 0x0002:
|
||||||
|
|
||||||
subpacket.DebugPrintSubPacket();
|
subpacket.DebugPrintSubPacket();
|
||||||
client.QueuePacket(_0x2Packet.BuildPacket(session.id), true, false);
|
session.QueuePacket(_0x2Packet.BuildPacket(session.id));
|
||||||
client.FlushQueuedSendPackets();
|
client.FlushQueuedSendPackets();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -115,14 +115,12 @@ namespace FFXIVClassic_Map_Server
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (chatMessage.logType == SendMessagePacket.MESSAGE_TYPE_SAY || chatMessage.logType == SendMessagePacket.MESSAGE_TYPE_SHOUT)
|
if (chatMessage.logType == SendMessagePacket.MESSAGE_TYPE_SAY || chatMessage.logType == SendMessagePacket.MESSAGE_TYPE_SHOUT)
|
||||||
session.GetActor().BroadcastPacket(SendMessagePacket.BuildPacket(session.id, session.id, chatMessage.logType, session.GetActor().customDisplayName, chatMessage.message), false);
|
session.GetActor().BroadcastPacket(SendMessagePacket.BuildPacket(session.id, chatMessage.logType, session.GetActor().customDisplayName, chatMessage.message), false);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
//Langauge Code (Client safe to send packets to now)
|
//Langauge Code (Client safe to send packets to now)
|
||||||
case 0x0006:
|
case 0x0006:
|
||||||
LangaugeCodePacket langCode = new LangaugeCodePacket(subpacket.data);
|
LangaugeCodePacket langCode = new LangaugeCodePacket(subpacket.data);
|
||||||
session = mServer.GetSession(subpacket.header.targetId);
|
|
||||||
|
|
||||||
LuaEngine.GetInstance().CallLuaFunction(session.GetActor(), session.GetActor(), "onBeginLogin", true);
|
LuaEngine.GetInstance().CallLuaFunction(session.GetActor(), session.GetActor(), "onBeginLogin", true);
|
||||||
Server.GetWorldManager().DoZoneIn(session.GetActor(), true, 0x1);
|
Server.GetWorldManager().DoZoneIn(session.GetActor(), true, 0x1);
|
||||||
LuaEngine.GetInstance().CallLuaFunction(session.GetActor(), session.GetActor(), "onLogin", true);
|
LuaEngine.GetInstance().CallLuaFunction(session.GetActor(), session.GetActor(), "onLogin", true);
|
||||||
@ -150,7 +148,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
|
|
||||||
SetTargetPacket setTarget = new SetTargetPacket(subpacket.data);
|
SetTargetPacket setTarget = new SetTargetPacket(subpacket.data);
|
||||||
session.GetActor().currentTarget = setTarget.actorID;
|
session.GetActor().currentTarget = setTarget.actorID;
|
||||||
session.GetActor().BroadcastPacket(SetActorTargetAnimatedPacket.BuildPacket(session.id, session.id, setTarget.actorID), true);
|
session.GetActor().BroadcastPacket(SetActorTargetAnimatedPacket.BuildPacket(session.id, setTarget.actorID), true);
|
||||||
break;
|
break;
|
||||||
//Lock Target
|
//Lock Target
|
||||||
case 0x00CC:
|
case 0x00CC:
|
||||||
@ -247,15 +245,15 @@ namespace FFXIVClassic_Map_Server
|
|||||||
//Start Recruiting
|
//Start Recruiting
|
||||||
case 0x01C3:
|
case 0x01C3:
|
||||||
StartRecruitingRequestPacket recruitRequestPacket = new StartRecruitingRequestPacket(subpacket.data);
|
StartRecruitingRequestPacket recruitRequestPacket = new StartRecruitingRequestPacket(subpacket.data);
|
||||||
client.QueuePacket(BasePacket.CreatePacket(StartRecruitingResponse.BuildPacket(session.id, true), true, false));
|
session.QueuePacket(StartRecruitingResponse.BuildPacket(session.id, true));
|
||||||
break;
|
break;
|
||||||
//End Recruiting
|
//End Recruiting
|
||||||
case 0x01C4:
|
case 0x01C4:
|
||||||
client.QueuePacket(BasePacket.CreatePacket(EndRecruitmentPacket.BuildPacket(session.id), true, false));
|
session.QueuePacket(EndRecruitmentPacket.BuildPacket(session.id));
|
||||||
break;
|
break;
|
||||||
//Party Window Opened, Request State
|
//Party Window Opened, Request State
|
||||||
case 0x01C5:
|
case 0x01C5:
|
||||||
client.QueuePacket(BasePacket.CreatePacket(RecruiterStatePacket.BuildPacket(session.id, false, false, 0), true, false));
|
session.QueuePacket(RecruiterStatePacket.BuildPacket(session.id, false, false, 0));
|
||||||
break;
|
break;
|
||||||
//Search Recruiting
|
//Search Recruiting
|
||||||
case 0x01C7:
|
case 0x01C7:
|
||||||
@ -271,7 +269,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
details.subTaskId = 1;
|
details.subTaskId = 1;
|
||||||
details.comment = "This is a test details packet sent by the server. No implementation has been Created yet...";
|
details.comment = "This is a test details packet sent by the server. No implementation has been Created yet...";
|
||||||
details.num[0] = 1;
|
details.num[0] = 1;
|
||||||
client.QueuePacket(BasePacket.CreatePacket(CurrentRecruitmentDetailsPacket.BuildPacket(session.id, details), true, false));
|
session.QueuePacket(CurrentRecruitmentDetailsPacket.BuildPacket(session.id, details));
|
||||||
break;
|
break;
|
||||||
//Accepted Recruiting
|
//Accepted Recruiting
|
||||||
case 0x01C6:
|
case 0x01C6:
|
||||||
@ -280,64 +278,64 @@ namespace FFXIVClassic_Map_Server
|
|||||||
/* SOCIAL STUFF */
|
/* SOCIAL STUFF */
|
||||||
case 0x01C9:
|
case 0x01C9:
|
||||||
AddRemoveSocialPacket addBlackList = new AddRemoveSocialPacket(subpacket.data);
|
AddRemoveSocialPacket addBlackList = new AddRemoveSocialPacket(subpacket.data);
|
||||||
client.QueuePacket(BasePacket.CreatePacket(BlacklistAddedPacket.BuildPacket(session.id, true, addBlackList.name), true, false));
|
session.QueuePacket(BlacklistAddedPacket.BuildPacket(session.id, true, addBlackList.name));
|
||||||
break;
|
break;
|
||||||
case 0x01CA:
|
case 0x01CA:
|
||||||
AddRemoveSocialPacket RemoveBlackList = new AddRemoveSocialPacket(subpacket.data);
|
AddRemoveSocialPacket RemoveBlackList = new AddRemoveSocialPacket(subpacket.data);
|
||||||
client.QueuePacket(BasePacket.CreatePacket(BlacklistRemovedPacket.BuildPacket(session.id, true, RemoveBlackList.name), true, false));
|
session.QueuePacket(BlacklistRemovedPacket.BuildPacket(session.id, true, RemoveBlackList.name));
|
||||||
break;
|
break;
|
||||||
case 0x01CB:
|
case 0x01CB:
|
||||||
int offset1 = 0;
|
int offset1 = 0;
|
||||||
client.QueuePacket(BasePacket.CreatePacket(SendBlacklistPacket.BuildPacket(session.id, new String[] { "Test" }, ref offset1), true, false));
|
session.QueuePacket(SendBlacklistPacket.BuildPacket(session.id, new String[] { "Test" }, ref offset1));
|
||||||
break;
|
break;
|
||||||
case 0x01CC:
|
case 0x01CC:
|
||||||
AddRemoveSocialPacket addFriendList = new AddRemoveSocialPacket(subpacket.data);
|
AddRemoveSocialPacket addFriendList = new AddRemoveSocialPacket(subpacket.data);
|
||||||
client.QueuePacket(BasePacket.CreatePacket(FriendlistAddedPacket.BuildPacket(session.id, true, (uint)addFriendList.name.GetHashCode(), true, addFriendList.name), true, false));
|
session.QueuePacket(FriendlistAddedPacket.BuildPacket(session.id, true, (uint)addFriendList.name.GetHashCode(), true, addFriendList.name));
|
||||||
break;
|
break;
|
||||||
case 0x01CD:
|
case 0x01CD:
|
||||||
AddRemoveSocialPacket RemoveFriendList = new AddRemoveSocialPacket(subpacket.data);
|
AddRemoveSocialPacket RemoveFriendList = new AddRemoveSocialPacket(subpacket.data);
|
||||||
client.QueuePacket(BasePacket.CreatePacket(FriendlistRemovedPacket.BuildPacket(session.id, true, RemoveFriendList.name), true, false));
|
session.QueuePacket(FriendlistRemovedPacket.BuildPacket(session.id, true, RemoveFriendList.name));
|
||||||
break;
|
break;
|
||||||
case 0x01CE:
|
case 0x01CE:
|
||||||
int offset2 = 0;
|
int offset2 = 0;
|
||||||
client.QueuePacket(BasePacket.CreatePacket(SendFriendlistPacket.BuildPacket(session.id, new Tuple<long, string>[] { new Tuple<long, string>(01, "Test2") }, ref offset2), true, false));
|
session.QueuePacket(SendFriendlistPacket.BuildPacket(session.id, new Tuple<long, string>[] { new Tuple<long, string>(01, "Test2") }, ref offset2));
|
||||||
break;
|
break;
|
||||||
case 0x01CF:
|
case 0x01CF:
|
||||||
client.QueuePacket(BasePacket.CreatePacket(FriendStatusPacket.BuildPacket(session.id, null), true, false));
|
session.QueuePacket(FriendStatusPacket.BuildPacket(session.id, null));
|
||||||
break;
|
break;
|
||||||
/* SUPPORT DESK STUFF */
|
/* SUPPORT DESK STUFF */
|
||||||
//Request for FAQ/Info List
|
//Request for FAQ/Info List
|
||||||
case 0x01D0:
|
case 0x01D0:
|
||||||
FaqListRequestPacket faqRequest = new FaqListRequestPacket(subpacket.data);
|
FaqListRequestPacket faqRequest = new FaqListRequestPacket(subpacket.data);
|
||||||
client.QueuePacket(BasePacket.CreatePacket(FaqListResponsePacket.BuildPacket(session.id, new string[] { "Testing FAQ1", "Coded style!" }), true, false));
|
session.QueuePacket(FaqListResponsePacket.BuildPacket(session.id, new string[] { "Testing FAQ1", "Coded style!" }));
|
||||||
break;
|
break;
|
||||||
//Request for body of a faq/info selection
|
//Request for body of a faq/info selection
|
||||||
case 0x01D1:
|
case 0x01D1:
|
||||||
FaqBodyRequestPacket faqBodyRequest = new FaqBodyRequestPacket(subpacket.data);
|
FaqBodyRequestPacket faqBodyRequest = new FaqBodyRequestPacket(subpacket.data);
|
||||||
client.QueuePacket(BasePacket.CreatePacket(FaqBodyResponsePacket.BuildPacket(session.id, "HERE IS A GIANT BODY. Nothing else to say!"), true, false));
|
session.QueuePacket(FaqBodyResponsePacket.BuildPacket(session.id, "HERE IS A GIANT BODY. Nothing else to say!"));
|
||||||
break;
|
break;
|
||||||
//Request issue list
|
//Request issue list
|
||||||
case 0x01D2:
|
case 0x01D2:
|
||||||
GMTicketIssuesRequestPacket issuesRequest = new GMTicketIssuesRequestPacket(subpacket.data);
|
GMTicketIssuesRequestPacket issuesRequest = new GMTicketIssuesRequestPacket(subpacket.data);
|
||||||
client.QueuePacket(BasePacket.CreatePacket(IssueListResponsePacket.BuildPacket(session.id, new string[] { "Test1", "Test2", "Test3", "Test4", "Test5" }), true, false));
|
session.QueuePacket(IssueListResponsePacket.BuildPacket(session.id, new string[] { "Test1", "Test2", "Test3", "Test4", "Test5" }));
|
||||||
break;
|
break;
|
||||||
//Request if GM ticket exists
|
//Request if GM ticket exists
|
||||||
case 0x01D3:
|
case 0x01D3:
|
||||||
client.QueuePacket(BasePacket.CreatePacket(StartGMTicketPacket.BuildPacket(session.id, false), true, false));
|
session.QueuePacket(StartGMTicketPacket.BuildPacket(session.id, false));
|
||||||
break;
|
break;
|
||||||
//Request for GM response message
|
//Request for GM response message
|
||||||
case 0x01D4:
|
case 0x01D4:
|
||||||
client.QueuePacket(BasePacket.CreatePacket(GMTicketPacket.BuildPacket(session.id, "This is a GM Ticket Title", "This is a GM Ticket Body."), true, false));
|
session.QueuePacket(GMTicketPacket.BuildPacket(session.id, "This is a GM Ticket Title", "This is a GM Ticket Body."));
|
||||||
break;
|
break;
|
||||||
//GM Ticket Sent
|
//GM Ticket Sent
|
||||||
case 0x01D5:
|
case 0x01D5:
|
||||||
GMSupportTicketPacket gmTicket = new GMSupportTicketPacket(subpacket.data);
|
GMSupportTicketPacket gmTicket = new GMSupportTicketPacket(subpacket.data);
|
||||||
Program.Log.Info("Got GM Ticket: \n" + gmTicket.ticketTitle + "\n" + gmTicket.ticketBody);
|
Program.Log.Info("Got GM Ticket: \n" + gmTicket.ticketTitle + "\n" + gmTicket.ticketBody);
|
||||||
client.QueuePacket(BasePacket.CreatePacket(GMTicketSentResponsePacket.BuildPacket(session.id, true), true, false));
|
session.QueuePacket(GMTicketSentResponsePacket.BuildPacket(session.id, true));
|
||||||
break;
|
break;
|
||||||
//Request to end ticket
|
//Request to end ticket
|
||||||
case 0x01D6:
|
case 0x01D6:
|
||||||
client.QueuePacket(BasePacket.CreatePacket(EndGMTicketPacket.BuildPacket(session.id), true, false));
|
session.QueuePacket(EndGMTicketPacket.BuildPacket(session.id));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Program.Log.Debug("Unknown command 0x{0:X} received.", subpacket.gameMessage.opcode);
|
Program.Log.Debug("Unknown command 0x{0:X} received.", subpacket.gameMessage.opcode);
|
||||||
|
@ -22,7 +22,6 @@ namespace FFXIVClassic_Map_Server
|
|||||||
|
|
||||||
static void Main(string[] args)
|
static void Main(string[] args)
|
||||||
{
|
{
|
||||||
|
|
||||||
// set up logging
|
// set up logging
|
||||||
Log = LogManager.GetCurrentClassLogger();
|
Log = LogManager.GetCurrentClassLogger();
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
@ -27,7 +27,8 @@ namespace FFXIVClassic_Map_Server
|
|||||||
private static CommandProcessor mCommandProcessor = new CommandProcessor();
|
private static CommandProcessor mCommandProcessor = new CommandProcessor();
|
||||||
private static ZoneConnection mWorldConnection = new ZoneConnection();
|
private static ZoneConnection mWorldConnection = new ZoneConnection();
|
||||||
private static WorldManager mWorldManager;
|
private static WorldManager mWorldManager;
|
||||||
private static Dictionary<uint, Item> mGamedataItems;
|
private static Dictionary<uint, ItemData> mGamedataItems;
|
||||||
|
private static Dictionary<uint, GuildleveData> mGamedataGuildleves;
|
||||||
private static StaticActors mStaticActors;
|
private static StaticActors mStaticActors;
|
||||||
|
|
||||||
private PacketProcessor mProcessor;
|
private PacketProcessor mProcessor;
|
||||||
@ -43,6 +44,8 @@ namespace FFXIVClassic_Map_Server
|
|||||||
|
|
||||||
mGamedataItems = Database.GetItemGamedata();
|
mGamedataItems = Database.GetItemGamedata();
|
||||||
Program.Log.Info("Loaded {0} items.", mGamedataItems.Count);
|
Program.Log.Info("Loaded {0} items.", mGamedataItems.Count);
|
||||||
|
mGamedataGuildleves = Database.GetGuildleveGamedata();
|
||||||
|
Program.Log.Info("Loaded {0} guildleves.", mGamedataGuildleves.Count);
|
||||||
|
|
||||||
mWorldManager = new WorldManager(this);
|
mWorldManager = new WorldManager(this);
|
||||||
mWorldManager.LoadZoneList();
|
mWorldManager.LoadZoneList();
|
||||||
@ -267,7 +270,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
return mWorldManager;
|
return mWorldManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Dictionary<uint, Item> GetGamedataItems()
|
public static Dictionary<uint, ItemData> GetGamedataItems()
|
||||||
{
|
{
|
||||||
return mGamedataItems;
|
return mGamedataItems;
|
||||||
}
|
}
|
||||||
@ -282,7 +285,7 @@ namespace FFXIVClassic_Map_Server
|
|||||||
return mStaticActors.FindStaticActor(name);
|
return mStaticActors.FindStaticActor(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Item GetItemGamedata(uint id)
|
public static ItemData GetItemGamedata(uint id)
|
||||||
{
|
{
|
||||||
if (mGamedataItems.ContainsKey(id))
|
if (mGamedataItems.ContainsKey(id))
|
||||||
return mGamedataItems[id];
|
return mGamedataItems[id];
|
||||||
@ -290,5 +293,13 @@ namespace FFXIVClassic_Map_Server
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static GuildleveData GetGuildleveGamedata(uint id)
|
||||||
|
{
|
||||||
|
if (mGamedataGuildleves.ContainsKey(id))
|
||||||
|
return mGamedataGuildleves[id];
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -600,19 +600,24 @@ namespace FFXIVClassic_Map_Server
|
|||||||
player.positionZ = spawnZ;
|
player.positionZ = spawnZ;
|
||||||
player.rotation = spawnRotation;
|
player.rotation = spawnRotation;
|
||||||
|
|
||||||
|
//Delete any GL directors
|
||||||
|
GuildleveDirector glDirector = player.GetGuildleveDirector();
|
||||||
|
if (glDirector != null)
|
||||||
|
player.RemoveDirector(glDirector);
|
||||||
|
|
||||||
//Delete content if have
|
//Delete content if have
|
||||||
if (player.currentContentGroup != null)
|
if (player.currentContentGroup != null)
|
||||||
{
|
{
|
||||||
player.currentContentGroup.RemoveMember(player.actorId);
|
player.currentContentGroup.RemoveMember(player.actorId);
|
||||||
player.SetCurrentContentGroup(null, player);
|
player.SetCurrentContentGroup(null);
|
||||||
|
|
||||||
if (oldZone is PrivateAreaContent)
|
if (oldZone is PrivateAreaContent)
|
||||||
((PrivateAreaContent)oldZone).CheckDestroy();
|
((PrivateAreaContent)oldZone).CheckDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
//Send packets
|
//Send packets
|
||||||
player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId), true, false);
|
player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId));
|
||||||
player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x10), true, false);
|
player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x2));
|
||||||
player.SendZoneInPackets(this, spawnType);
|
player.SendZoneInPackets(this, spawnType);
|
||||||
player.playerSession.ClearInstance();
|
player.playerSession.ClearInstance();
|
||||||
player.SendInstanceUpdate();
|
player.SendInstanceUpdate();
|
||||||
@ -660,8 +665,8 @@ namespace FFXIVClassic_Map_Server
|
|||||||
player.rotation = spawnRotation;
|
player.rotation = spawnRotation;
|
||||||
|
|
||||||
//Send packets
|
//Send packets
|
||||||
player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x10), true, false);
|
player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x10));
|
||||||
player.playerSession.QueuePacket(player.CreateSpawnTeleportPacket(player.actorId, spawnType), true, false);
|
player.playerSession.QueuePacket(player.CreateSpawnTeleportPacket(spawnType));
|
||||||
|
|
||||||
player.playerSession.LockUpdates(false);
|
player.playerSession.LockUpdates(false);
|
||||||
player.SendInstanceUpdate();
|
player.SendInstanceUpdate();
|
||||||
@ -704,8 +709,8 @@ namespace FFXIVClassic_Map_Server
|
|||||||
player.SendGameMessage(GetActor(), 34108, 0x20);
|
player.SendGameMessage(GetActor(), 34108, 0x20);
|
||||||
|
|
||||||
//Send packets
|
//Send packets
|
||||||
player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId), true, false);
|
player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId));
|
||||||
player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x10), true, false);
|
player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x10));
|
||||||
player.SendZoneInPackets(this, spawnType);
|
player.SendZoneInPackets(this, spawnType);
|
||||||
player.playerSession.ClearInstance();
|
player.playerSession.ClearInstance();
|
||||||
player.SendInstanceUpdate();
|
player.SendInstanceUpdate();
|
||||||
@ -739,8 +744,8 @@ namespace FFXIVClassic_Map_Server
|
|||||||
//Send packets
|
//Send packets
|
||||||
if (!isLogin)
|
if (!isLogin)
|
||||||
{
|
{
|
||||||
player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId), true, false);
|
player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId));
|
||||||
player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x2), true, false);
|
player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x2));
|
||||||
//player.SendZoneInPackets(this, spawnType);
|
//player.SendZoneInPackets(this, spawnType);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -766,11 +771,6 @@ namespace FFXIVClassic_Map_Server
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContentGroup CreateContentGroup(Director director)
|
|
||||||
{
|
|
||||||
return CreateContentGroup(director, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
public ContentGroup CreateContentGroup(Director director, params Actor[] actors)
|
public ContentGroup CreateContentGroup(Director director, params Actor[] actors)
|
||||||
{
|
{
|
||||||
if (director == null)
|
if (director == null)
|
||||||
@ -799,6 +799,62 @@ namespace FFXIVClassic_Map_Server
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ContentGroup CreateContentGroup(Director director, List<Actor> actors)
|
||||||
|
{
|
||||||
|
if (director == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
lock (groupLock)
|
||||||
|
{
|
||||||
|
uint[] initialMembers = null;
|
||||||
|
|
||||||
|
if (actors != null)
|
||||||
|
{
|
||||||
|
initialMembers = new uint[actors.Count];
|
||||||
|
for (int i = 0; i < actors.Count; i++)
|
||||||
|
initialMembers[i] = actors[i].actorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
groupIndexId = groupIndexId | 0x3000000000000000;
|
||||||
|
|
||||||
|
ContentGroup contentGroup = new ContentGroup(groupIndexId, director, initialMembers);
|
||||||
|
mContentGroups.Add(groupIndexId, contentGroup);
|
||||||
|
groupIndexId++;
|
||||||
|
if (initialMembers != null && initialMembers.Length != 0)
|
||||||
|
contentGroup.SendAll();
|
||||||
|
|
||||||
|
return contentGroup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public ContentGroup CreateGLContentGroup(Director director, List<Actor> actors)
|
||||||
|
{
|
||||||
|
if (director == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
lock (groupLock)
|
||||||
|
{
|
||||||
|
uint[] initialMembers = null;
|
||||||
|
|
||||||
|
if (actors != null)
|
||||||
|
{
|
||||||
|
initialMembers = new uint[actors.Count];
|
||||||
|
for (int i = 0; i < actors.Count; i++)
|
||||||
|
initialMembers[i] = actors[i].actorId;
|
||||||
|
}
|
||||||
|
|
||||||
|
groupIndexId = groupIndexId | 0x2000000000000000;
|
||||||
|
|
||||||
|
GLContentGroup contentGroup = new GLContentGroup(groupIndexId, director, initialMembers);
|
||||||
|
mContentGroups.Add(groupIndexId, contentGroup);
|
||||||
|
groupIndexId++;
|
||||||
|
if (initialMembers != null && initialMembers.Length != 0)
|
||||||
|
contentGroup.SendAll();
|
||||||
|
|
||||||
|
return contentGroup;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void DeleteContentGroup(ulong groupId)
|
public void DeleteContentGroup(ulong groupId)
|
||||||
{
|
{
|
||||||
lock (groupLock)
|
lock (groupLock)
|
||||||
@ -806,7 +862,6 @@ namespace FFXIVClassic_Map_Server
|
|||||||
if (mContentGroups.ContainsKey(groupId) && mContentGroups[groupId] is ContentGroup)
|
if (mContentGroups.ContainsKey(groupId) && mContentGroups[groupId] is ContentGroup)
|
||||||
{
|
{
|
||||||
ContentGroup group = (ContentGroup)mContentGroups[groupId];
|
ContentGroup group = (ContentGroup)mContentGroups[groupId];
|
||||||
group.SendDeletePackets();
|
|
||||||
mContentGroups.Remove(groupId);
|
mContentGroups.Remove(groupId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -825,55 +880,55 @@ namespace FFXIVClassic_Map_Server
|
|||||||
public void RequestWorldLinkshellCreate(Player player, string name, ushort crest)
|
public void RequestWorldLinkshellCreate(Player player, string name, ushort crest)
|
||||||
{
|
{
|
||||||
SubPacket packet = CreateLinkshellPacket.BuildPacket(player.playerSession, name, crest, player.actorId);
|
SubPacket packet = CreateLinkshellPacket.BuildPacket(player.playerSession, name, crest, player.actorId);
|
||||||
Server.GetWorldConnection().QueuePacket(packet, true, false);
|
player.QueuePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestWorldLinkshellCrestModify(Player player, string name, ushort crest)
|
public void RequestWorldLinkshellCrestModify(Player player, string name, ushort crest)
|
||||||
{
|
{
|
||||||
SubPacket packet = ModifyLinkshellPacket.BuildPacket(player.playerSession, 1, name, null, crest, 0);
|
SubPacket packet = ModifyLinkshellPacket.BuildPacket(player.playerSession, 1, name, null, crest, 0);
|
||||||
Server.GetWorldConnection().QueuePacket(packet, true, false);
|
player.QueuePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestWorldLinkshellDelete(Player player, string name)
|
public void RequestWorldLinkshellDelete(Player player, string name)
|
||||||
{
|
{
|
||||||
SubPacket packet = DeleteLinkshellPacket.BuildPacket(player.playerSession, name);
|
SubPacket packet = DeleteLinkshellPacket.BuildPacket(player.playerSession, name);
|
||||||
Server.GetWorldConnection().QueuePacket(packet, true, false);
|
player.QueuePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestWorldLinkshellRankChange(Player player, string lsname, string memberName, byte newRank)
|
public void RequestWorldLinkshellRankChange(Player player, string lsname, string memberName, byte newRank)
|
||||||
{
|
{
|
||||||
SubPacket packet = LinkshellRankChangePacket.BuildPacket(player.playerSession, memberName, lsname, newRank);
|
SubPacket packet = LinkshellRankChangePacket.BuildPacket(player.playerSession, memberName, lsname, newRank);
|
||||||
Server.GetWorldConnection().QueuePacket(packet, true, false);
|
player.QueuePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestWorldLinkshellInviteMember(Player player, string lsname, uint invitedActorId)
|
public void RequestWorldLinkshellInviteMember(Player player, string lsname, uint invitedActorId)
|
||||||
{
|
{
|
||||||
SubPacket packet = LinkshellInvitePacket.BuildPacket(player.playerSession, invitedActorId, lsname);
|
SubPacket packet = LinkshellInvitePacket.BuildPacket(player.playerSession, invitedActorId, lsname);
|
||||||
Server.GetWorldConnection().QueuePacket(packet, true, false);
|
player.QueuePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestWorldLinkshellCancelInvite(Player player)
|
public void RequestWorldLinkshellCancelInvite(Player player)
|
||||||
{
|
{
|
||||||
SubPacket packet = LinkshellInviteCancelPacket.BuildPacket(player.playerSession);
|
SubPacket packet = LinkshellInviteCancelPacket.BuildPacket(player.playerSession);
|
||||||
Server.GetWorldConnection().QueuePacket(packet, true, false);
|
player.QueuePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestWorldLinkshellLeave(Player player, string lsname)
|
public void RequestWorldLinkshellLeave(Player player, string lsname)
|
||||||
{
|
{
|
||||||
SubPacket packet = LinkshellLeavePacket.BuildPacket(player.playerSession, lsname, null, false);
|
SubPacket packet = LinkshellLeavePacket.BuildPacket(player.playerSession, lsname, null, false);
|
||||||
Server.GetWorldConnection().QueuePacket(packet, true, false);
|
player.QueuePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestWorldLinkshellKick(Player player, string lsname, string kickedName)
|
public void RequestWorldLinkshellKick(Player player, string lsname, string kickedName)
|
||||||
{
|
{
|
||||||
SubPacket packet = LinkshellLeavePacket.BuildPacket(player.playerSession, lsname, kickedName, true);
|
SubPacket packet = LinkshellLeavePacket.BuildPacket(player.playerSession, lsname, kickedName, true);
|
||||||
Server.GetWorldConnection().QueuePacket(packet, true, false);
|
player.QueuePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RequestWorldLinkshellChangeActive(Player player, string lsname)
|
public void RequestWorldLinkshellChangeActive(Player player, string lsname)
|
||||||
{
|
{
|
||||||
SubPacket packet = LinkshellChangePacket.BuildPacket(player.playerSession, lsname);
|
SubPacket packet = LinkshellChangePacket.BuildPacket(player.playerSession, lsname);
|
||||||
Server.GetWorldConnection().QueuePacket(packet, true, false);
|
player.QueuePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RequestWorldServerZoneChange(Player player, uint destinationZoneId, byte spawnType, float spawnX, float spawnY, float spawnZ, float spawnRotation)
|
private void RequestWorldServerZoneChange(Player player, uint destinationZoneId, byte spawnType, float spawnX, float spawnY, float spawnZ, float spawnRotation)
|
||||||
|
@ -9,6 +9,7 @@ using System.Collections.Generic;
|
|||||||
using FFXIVClassic_Map_Server.actors.area;
|
using FFXIVClassic_Map_Server.actors.area;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using FFXIVClassic_Map_Server.packets.send.actor.battle;
|
||||||
|
|
||||||
namespace FFXIVClassic_Map_Server.Actors
|
namespace FFXIVClassic_Map_Server.Actors
|
||||||
{
|
{
|
||||||
@ -94,56 +95,62 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
hasMoved = true;
|
hasMoved = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateAddActorPacket(uint playerActorId, byte val)
|
public SubPacket CreateAddActorPacket(byte val) {
|
||||||
{
|
return AddActorPacket.BuildPacket(actorId, val);
|
||||||
return AddActorPacket.BuildPacket(actorId, playerActorId, val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateNamePacket(uint playerActorId)
|
public SubPacket CreateNamePacket()
|
||||||
{
|
{
|
||||||
return SetActorNamePacket.BuildPacket(actorId, playerActorId, displayNameId, displayNameId == 0xFFFFFFFF | displayNameId == 0x0 ? customDisplayName : "");
|
return SetActorNamePacket.BuildPacket(actorId, displayNameId, displayNameId == 0xFFFFFFFF | displayNameId == 0x0 ? customDisplayName : "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateSpeedPacket(uint playerActorId)
|
public SubPacket CreateSpeedPacket()
|
||||||
{
|
{
|
||||||
return SetActorSpeedPacket.BuildPacket(actorId, playerActorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2], moveSpeeds[3]);
|
return SetActorSpeedPacket.BuildPacket(actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2], moveSpeeds[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateSpawnPositonPacket(uint playerActorId, ushort spawnType)
|
public SubPacket CreateSpawnPositonPacket(ushort spawnType)
|
||||||
{
|
{
|
||||||
|
return CreateSpawnPositonPacket(null, spawnType);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SubPacket CreateSpawnPositonPacket(Player player, ushort spawnType)
|
||||||
|
{
|
||||||
|
//TODO: FIX THIS IF
|
||||||
|
uint playerActorId = player == null ? 0 : player.actorId; //Get Rid
|
||||||
SubPacket spawnPacket;
|
SubPacket spawnPacket;
|
||||||
if (!spawnedFirstTime && playerActorId == actorId)
|
if (!spawnedFirstTime && playerActorId == actorId)
|
||||||
spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, 0, positionX, positionY, positionZ, rotation, 0x1, false);
|
spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0, positionX, positionY, positionZ, rotation, 0x1, false);
|
||||||
else if (playerActorId == actorId)
|
else if (playerActorId == actorId)
|
||||||
spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, true);
|
spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, true);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (this is Player)
|
if (this is Player)
|
||||||
spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, 0, positionX, positionY, positionZ, rotation, spawnType, false);
|
spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0, positionX, positionY, positionZ, rotation, spawnType, false);
|
||||||
else
|
else
|
||||||
spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, actorId, positionX, positionY, positionZ, rotation, spawnType, false);
|
spawnPacket = SetActorPositionPacket.BuildPacket(actorId, actorId, positionX, positionY, positionZ, rotation, spawnType, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//return SetActorPositionPacket.BuildPacket(actorId, playerActorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE);
|
//return SetActorPositionPacket.BuildPacket(actorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE);
|
||||||
spawnedFirstTime = true;
|
spawnedFirstTime = true;
|
||||||
|
|
||||||
return spawnPacket;
|
return spawnPacket;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateSpawnTeleportPacket(uint playerActorId, ushort spawnType)
|
public SubPacket CreateSpawnTeleportPacket(ushort spawnType)
|
||||||
{
|
{
|
||||||
SubPacket spawnPacket;
|
SubPacket spawnPacket;
|
||||||
|
|
||||||
spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, false);
|
spawnPacket = SetActorPositionPacket.BuildPacket(actorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, false);
|
||||||
|
|
||||||
//return SetActorPositionPacket.BuildPacket(actorId, playerActorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE);
|
//return SetActorPositionPacket.BuildPacket(actorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE);
|
||||||
|
|
||||||
//spawnPacket.DebugPrintSubPacket();
|
//spawnPacket.DebugPrintSubPacket();
|
||||||
|
|
||||||
return spawnPacket;
|
return spawnPacket;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreatePositionUpdatePacket(uint playerActorId)
|
public SubPacket CreatePositionUpdatePacket()
|
||||||
{
|
{
|
||||||
int updateMs = 300;
|
int updateMs = 300;
|
||||||
var diffTime = (DateTime.Now - lastMoveUpdate);
|
var diffTime = (DateTime.Now - lastMoveUpdate);
|
||||||
@ -171,17 +178,16 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
positionUpdates.RemoveAt(0);
|
positionUpdates.RemoveAt(0);
|
||||||
}
|
}
|
||||||
lastMoveUpdate = DateTime.Now;
|
lastMoveUpdate = DateTime.Now;
|
||||||
return MoveActorToPositionPacket.BuildPacket(actorId, playerActorId, positionX, positionY, positionZ, rotation, moveState);
|
return MoveActorToPositionPacket.BuildPacket(actorId, positionX, positionY, positionZ, rotation, moveState);
|
||||||
}
|
}
|
||||||
return null;
|
return null; }
|
||||||
}
|
|
||||||
|
|
||||||
public SubPacket CreateStatePacket(uint playerActorID)
|
public SubPacket CreateStatePacket()
|
||||||
{
|
{
|
||||||
return SetActorStatePacket.BuildPacket(actorId, playerActorID, currentMainState, currentSubState);
|
return SetActorStatePacket.BuildPacket(actorId, currentMainState, currentSubState);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SubPacket> GetEventConditionPackets(uint playerActorId)
|
public List<SubPacket> GetEventConditionPackets()
|
||||||
{
|
{
|
||||||
List<SubPacket> subpackets = new List<SubPacket>();
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
|
|
||||||
@ -192,126 +198,147 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
if (eventConditions.talkEventConditions != null)
|
if (eventConditions.talkEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions)
|
foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions)
|
||||||
subpackets.Add(SetTalkEventCondition.BuildPacket(playerActorId, actorId, condition));
|
subpackets.Add(SetTalkEventCondition.BuildPacket(actorId, condition));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventConditions.noticeEventConditions != null)
|
if (eventConditions.noticeEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions)
|
foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions)
|
||||||
subpackets.Add(SetNoticeEventCondition.BuildPacket(playerActorId, actorId, condition));
|
subpackets.Add(SetNoticeEventCondition.BuildPacket(actorId, condition));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventConditions.emoteEventConditions != null)
|
if (eventConditions.emoteEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions)
|
foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions)
|
||||||
subpackets.Add(SetEmoteEventCondition.BuildPacket(playerActorId, actorId, condition));
|
subpackets.Add(SetEmoteEventCondition.BuildPacket(actorId, condition));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventConditions.pushWithCircleEventConditions != null)
|
if (eventConditions.pushWithCircleEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions)
|
foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions)
|
||||||
subpackets.Add(SetPushEventConditionWithCircle.BuildPacket(playerActorId, actorId, condition));
|
subpackets.Add(SetPushEventConditionWithCircle.BuildPacket(actorId, condition));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventConditions.pushWithFanEventConditions != null)
|
if (eventConditions.pushWithFanEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions)
|
foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions)
|
||||||
subpackets.Add(SetPushEventConditionWithFan.BuildPacket(playerActorId, actorId, condition));
|
subpackets.Add(SetPushEventConditionWithFan.BuildPacket(actorId, condition));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventConditions.pushWithBoxEventConditions != null)
|
if (eventConditions.pushWithBoxEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions)
|
foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions)
|
||||||
subpackets.Add(SetPushEventConditionWithTriggerBox.BuildPacket(playerActorId, actorId, condition));
|
subpackets.Add(SetPushEventConditionWithTriggerBox.BuildPacket(actorId, condition));
|
||||||
}
|
}
|
||||||
|
|
||||||
return subpackets;
|
return subpackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasePacket GetSetEventStatusPackets(uint playerActorId)
|
public List<SubPacket> GetSetEventStatusPackets()
|
||||||
{
|
{
|
||||||
List<SubPacket> subpackets = new List<SubPacket>();
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
|
|
||||||
//Return empty list
|
//Return empty list
|
||||||
if (eventConditions == null)
|
if (eventConditions == null)
|
||||||
return BasePacket.CreatePacket(subpackets, true, false);
|
return subpackets;
|
||||||
|
|
||||||
if (eventConditions.talkEventConditions != null)
|
if (eventConditions.talkEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions)
|
foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions)
|
||||||
subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 1, condition.conditionName));
|
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 1, condition.conditionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventConditions.noticeEventConditions != null)
|
if (eventConditions.noticeEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions)
|
foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions)
|
||||||
subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 1, condition.conditionName));
|
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 1, condition.conditionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventConditions.emoteEventConditions != null)
|
if (eventConditions.emoteEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions)
|
foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions)
|
||||||
subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 3, condition.conditionName));
|
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 3, condition.conditionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventConditions.pushWithCircleEventConditions != null)
|
if (eventConditions.pushWithCircleEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions)
|
foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions)
|
||||||
subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 2, condition.conditionName));
|
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 2, condition.conditionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventConditions.pushWithFanEventConditions != null)
|
if (eventConditions.pushWithFanEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions)
|
foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions)
|
||||||
subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 2, condition.conditionName));
|
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 2, condition.conditionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (eventConditions.pushWithBoxEventConditions != null)
|
if (eventConditions.pushWithBoxEventConditions != null)
|
||||||
{
|
{
|
||||||
foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions)
|
foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions)
|
||||||
subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 2, condition.conditionName));
|
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 2, condition.conditionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
return BasePacket.CreatePacket(subpackets, true, false);
|
return subpackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateIsZoneingPacket(uint playerActorId)
|
public SubPacket CreateIsZoneingPacket()
|
||||||
{
|
{
|
||||||
return SetActorIsZoningPacket.BuildPacket(actorId, playerActorId, false);
|
return SetActorIsZoningPacket.BuildPacket(actorId, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual SubPacket CreateScriptBindPacket(uint playerActorId)
|
public virtual SubPacket CreateScriptBindPacket(Player player)
|
||||||
{
|
{
|
||||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, classParams);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, classParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual BasePacket GetSpawnPackets(uint playerActorId)
|
public virtual SubPacket CreateScriptBindPacket()
|
||||||
{
|
{
|
||||||
return GetSpawnPackets(playerActorId, 0x1);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, classParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual BasePacket GetSpawnPackets(uint playerActorId, ushort spawnType)
|
public virtual List<SubPacket> GetSpawnPackets(Player player, ushort spawnType)
|
||||||
{
|
{
|
||||||
List<SubPacket> subpackets = new List<SubPacket>();
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
subpackets.Add(CreateAddActorPacket(playerActorId, 8));
|
subpackets.Add(CreateAddActorPacket(8));
|
||||||
subpackets.AddRange(GetEventConditionPackets(playerActorId));
|
subpackets.AddRange(GetEventConditionPackets());
|
||||||
subpackets.Add(CreateSpeedPacket(playerActorId));
|
subpackets.Add(CreateSpeedPacket());
|
||||||
subpackets.Add(CreateSpawnPositonPacket(playerActorId, spawnType));
|
subpackets.Add(CreateSpawnPositonPacket(player, spawnType));
|
||||||
subpackets.Add(CreateNamePacket(playerActorId));
|
subpackets.Add(CreateNamePacket());
|
||||||
subpackets.Add(CreateStatePacket(playerActorId));
|
subpackets.Add(CreateStatePacket());
|
||||||
subpackets.Add(CreateIsZoneingPacket(playerActorId));
|
subpackets.Add(CreateIsZoneingPacket());
|
||||||
subpackets.Add(CreateScriptBindPacket(playerActorId));
|
subpackets.Add(CreateScriptBindPacket(player));
|
||||||
return BasePacket.CreatePacket(subpackets, true, false);
|
return subpackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual BasePacket GetInitPackets(uint playerActorId)
|
public virtual List<SubPacket> GetSpawnPackets()
|
||||||
{
|
{
|
||||||
|
return GetSpawnPackets(0x1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual List<SubPacket> GetSpawnPackets(ushort spawnType)
|
||||||
|
{
|
||||||
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
|
subpackets.Add(CreateAddActorPacket(8));
|
||||||
|
subpackets.AddRange(GetEventConditionPackets());
|
||||||
|
subpackets.Add(CreateSpeedPacket());
|
||||||
|
subpackets.Add(CreateSpawnPositonPacket(null, spawnType));
|
||||||
|
subpackets.Add(CreateNamePacket());
|
||||||
|
subpackets.Add(CreateStatePacket());
|
||||||
|
subpackets.Add(CreateIsZoneingPacket());
|
||||||
|
subpackets.Add(CreateScriptBindPacket());
|
||||||
|
return subpackets;
|
||||||
|
}
|
||||||
|
|
||||||
|
public virtual List<SubPacket> GetInitPackets()
|
||||||
|
{
|
||||||
|
List<SubPacket> packets = new List<SubPacket>();
|
||||||
SetActorPropetyPacket initProperties = new SetActorPropetyPacket("/_init");
|
SetActorPropetyPacket initProperties = new SetActorPropetyPacket("/_init");
|
||||||
initProperties.AddByte(0xE14B0CA8, 1);
|
initProperties.AddByte(0xE14B0CA8, 1);
|
||||||
initProperties.AddByte(0x2138FD71, 1);
|
initProperties.AddByte(0x2138FD71, 1);
|
||||||
initProperties.AddByte(0xFBFBCFB1, 1);
|
initProperties.AddByte(0xFBFBCFB1, 1);
|
||||||
initProperties.AddTarget();
|
initProperties.AddTarget();
|
||||||
return BasePacket.CreatePacket(initProperties.BuildPacket(playerActorId, actorId), true, false);
|
packets.Add(initProperties.BuildPacket(actorId));
|
||||||
|
return packets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool Equals(Object obj)
|
public override bool Equals(Object obj)
|
||||||
@ -346,8 +373,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
public void ChangeState(ushort newState)
|
public void ChangeState(ushort newState)
|
||||||
{
|
{
|
||||||
currentMainState = newState;
|
currentMainState = newState;
|
||||||
SubPacket ChangeStatePacket = SetActorStatePacket.BuildPacket(actorId, actorId, newState, currentSubState);
|
SubPacket ChangeStatePacket = SetActorStatePacket.BuildPacket(actorId, newState, currentSubState);
|
||||||
SubPacket battleActionPacket = BattleAction1Packet.BuildPacket(actorId, actorId);
|
SubPacket battleActionPacket = BattleActionX01Packet.BuildPacket(actorId, actorId, actorId, 0x72000062, 1, 0, 0x05209, 0, 0);
|
||||||
zone.BroadcastPacketAroundActor(this, ChangeStatePacket);
|
zone.BroadcastPacketAroundActor(this, ChangeStatePacket);
|
||||||
zone.BroadcastPacketAroundActor(this, battleActionPacket);
|
zone.BroadcastPacketAroundActor(this, battleActionPacket);
|
||||||
}
|
}
|
||||||
@ -355,7 +382,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
public void ChangeSpeed(int type, float value)
|
public void ChangeSpeed(int type, float value)
|
||||||
{
|
{
|
||||||
moveSpeeds[type] = value;
|
moveSpeeds[type] = value;
|
||||||
SubPacket ChangeSpeedPacket = SetActorSpeedPacket.BuildPacket(actorId, actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2], moveSpeeds[3]);
|
SubPacket ChangeSpeedPacket = SetActorSpeedPacket.BuildPacket(actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2], moveSpeeds[3]);
|
||||||
zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket);
|
zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -365,7 +392,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
moveSpeeds[1] = speedWalk;
|
moveSpeeds[1] = speedWalk;
|
||||||
moveSpeeds[2] = speedRun;
|
moveSpeeds[2] = speedRun;
|
||||||
moveSpeeds[3] = speedActive;
|
moveSpeeds[3] = speedActive;
|
||||||
SubPacket ChangeSpeedPacket = SetActorSpeedPacket.BuildPacket(actorId, actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2], moveSpeeds[3]);
|
SubPacket ChangeSpeedPacket = SetActorSpeedPacket.BuildPacket(actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2], moveSpeeds[3]);
|
||||||
zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket);
|
zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,8 +502,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(uiFunc);
|
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(uiFunc);
|
||||||
changeProperty.AddProperty(this, name);
|
changeProperty.AddProperty(this, name);
|
||||||
changeProperty.AddTarget();
|
changeProperty.AddTarget();
|
||||||
SubPacket subpacket = changeProperty.BuildPacket(player.actorId, player.actorId);
|
SubPacket subpacket = changeProperty.BuildPacket(player.actorId);
|
||||||
player.playerSession.QueuePacket(subpacket, true, false);
|
player.playerSession.QueuePacket(subpacket);
|
||||||
subpacket.DebugPrintSubPacket();
|
subpacket.DebugPrintSubPacket();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -493,8 +520,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(uiFunc);
|
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(uiFunc);
|
||||||
changeProperty.AddProperty(this, name);
|
changeProperty.AddProperty(this, name);
|
||||||
changeProperty.AddTarget();
|
changeProperty.AddTarget();
|
||||||
SubPacket subpacket = changeProperty.BuildPacket(player.actorId, player.actorId);
|
SubPacket subpacket = changeProperty.BuildPacket(player.actorId);
|
||||||
player.playerSession.QueuePacket(subpacket, true, false);
|
player.playerSession.QueuePacket(subpacket);
|
||||||
subpacket.DebugPrintSubPacket();
|
subpacket.DebugPrintSubPacket();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -529,7 +556,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
rotation = rot;
|
rotation = rot;
|
||||||
|
|
||||||
// todo: handle zone?
|
// todo: handle zone?
|
||||||
zone.BroadcastPacketAroundActor(this, MoveActorToPositionPacket.BuildPacket(this.actorId, this.actorId, x, y, z, rot, moveState));
|
zone.BroadcastPacketAroundActor(this, MoveActorToPositionPacket.BuildPacket(actorId, x, y, z, rot, moveState));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Area GetZone()
|
public Area GetZone()
|
||||||
|
@ -84,24 +84,24 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override SubPacket CreateScriptBindPacket(uint playerActorId)
|
public override SubPacket CreateScriptBindPacket()
|
||||||
{
|
{
|
||||||
List<LuaParam> lParams;
|
List<LuaParam> lParams;
|
||||||
lParams = LuaUtils.CreateLuaParamList(classPath, false, true, zoneName, "/Area/Zone/ZoneDefault", -1, (byte)1, true, false, false, false, false, false, false, false);
|
lParams = LuaUtils.CreateLuaParamList(classPath, false, true, zoneName, "/Area/Zone/ZoneDefault", -1, (byte)1, true, false, false, false, false, false, false, false);
|
||||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, "ZoneDefault", lParams);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, "ZoneDefault", lParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BasePacket GetSpawnPackets(uint playerActorId)
|
public override List<SubPacket> GetSpawnPackets()
|
||||||
{
|
{
|
||||||
List<SubPacket> subpackets = new List<SubPacket>();
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
subpackets.Add(CreateAddActorPacket(playerActorId, 0));
|
subpackets.Add(CreateAddActorPacket(0));
|
||||||
subpackets.Add(CreateSpeedPacket(playerActorId));
|
subpackets.Add(CreateSpeedPacket());
|
||||||
subpackets.Add(CreateSpawnPositonPacket(playerActorId, 0x1));
|
subpackets.Add(CreateSpawnPositonPacket(0x1));
|
||||||
subpackets.Add(CreateNamePacket(playerActorId));
|
subpackets.Add(CreateNamePacket());
|
||||||
subpackets.Add(CreateStatePacket(playerActorId));
|
subpackets.Add(CreateStatePacket());
|
||||||
subpackets.Add(CreateIsZoneingPacket(playerActorId));
|
subpackets.Add(CreateIsZoneingPacket());
|
||||||
subpackets.Add(CreateScriptBindPacket(playerActorId));
|
subpackets.Add(CreateScriptBindPacket());
|
||||||
return BasePacket.CreatePacket(subpackets, true, false);
|
return subpackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Actor Management
|
#region Actor Management
|
||||||
@ -368,6 +368,12 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void BroadcastPacketsAroundActor(Actor actor, List<SubPacket> packets)
|
||||||
|
{
|
||||||
|
foreach (SubPacket packet in packets)
|
||||||
|
BroadcastPacketAroundActor(actor, packet);
|
||||||
|
}
|
||||||
|
|
||||||
public void BroadcastPacketAroundActor(Actor actor, SubPacket packet)
|
public void BroadcastPacketAroundActor(Actor actor, SubPacket packet)
|
||||||
{
|
{
|
||||||
if (isIsolated)
|
if (isIsolated)
|
||||||
@ -466,6 +472,11 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
RemoveActorFromZone(FindActorInZoneByUniqueID(uniqueId));
|
RemoveActorFromZone(FindActorInZoneByUniqueID(uniqueId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void DespawnActor(Actor actor)
|
||||||
|
{
|
||||||
|
RemoveActorFromZone(actor);
|
||||||
|
}
|
||||||
|
|
||||||
public Director GetWeatherDirector()
|
public Director GetWeatherDirector()
|
||||||
{
|
{
|
||||||
return mWeatherDirector;
|
return mWeatherDirector;
|
||||||
@ -477,7 +488,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
if (player != null && !zoneWide)
|
if (player != null && !zoneWide)
|
||||||
{
|
{
|
||||||
player.QueuePacket(BasePacket.CreatePacket(SetWeatherPacket.BuildPacket(player.actorId, weather, transitionTime), true, false));
|
player.QueuePacket(SetWeatherPacket.BuildPacket(player.actorId, weather, transitionTime));
|
||||||
}
|
}
|
||||||
if (zoneWide)
|
if (zoneWide)
|
||||||
{
|
{
|
||||||
@ -488,23 +499,67 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
if (actor.Value is Player)
|
if (actor.Value is Player)
|
||||||
{
|
{
|
||||||
player = ((Player)actor.Value);
|
player = ((Player)actor.Value);
|
||||||
player.QueuePacket(BasePacket.CreatePacket(SetWeatherPacket.BuildPacket(player.actorId, weather, transitionTime), true, false));
|
player.QueuePacket(SetWeatherPacket.BuildPacket(player.actorId, weather, transitionTime));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Director CreateDirector(string path)
|
public Director CreateDirector(string path, params object[] args)
|
||||||
{
|
{
|
||||||
lock (directorLock)
|
lock (directorLock)
|
||||||
{
|
{
|
||||||
Director director = new Director(directorIdCount, this, path);
|
Director director = new Director(directorIdCount, this, path, args);
|
||||||
|
currentDirectors.Add(director.actorId, director);
|
||||||
|
directorIdCount++;
|
||||||
|
return director;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!director.IsCreated())
|
public Director CreateGuildleveDirector(uint glid, byte difficulty, Player owner, params object[] args)
|
||||||
return null;
|
{
|
||||||
|
String directorScriptPath = "";
|
||||||
|
|
||||||
currentDirectors.Add(directorIdCount, director);
|
uint type = Server.GetGuildleveGamedata(glid).plateId;
|
||||||
|
|
||||||
|
if (glid == 10801 || glid == 12401 || glid == 11601)
|
||||||
|
directorScriptPath = "Guildleve/PrivateGLBattleTutorial";
|
||||||
|
else
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case 20021:
|
||||||
|
directorScriptPath = "Guildleve/PrivateGLBattleSweepNormal";
|
||||||
|
break;
|
||||||
|
case 20022:
|
||||||
|
directorScriptPath = "Guildleve/PrivateGLBattleChaseNormal";
|
||||||
|
break;
|
||||||
|
case 20023:
|
||||||
|
directorScriptPath = "Guildleve/PrivateGLBattleOrbNormal";
|
||||||
|
break;
|
||||||
|
case 20024:
|
||||||
|
directorScriptPath = "Guildleve/PrivateGLBattleHuntNormal";
|
||||||
|
break;
|
||||||
|
case 20025:
|
||||||
|
directorScriptPath = "Guildleve/PrivateGLBattleGatherNormal";
|
||||||
|
break;
|
||||||
|
case 20026:
|
||||||
|
directorScriptPath = "Guildleve/PrivateGLBattleRoundNormal";
|
||||||
|
break;
|
||||||
|
case 20027:
|
||||||
|
directorScriptPath = "Guildleve/PrivateGLBattleSurviveNormal";
|
||||||
|
break;
|
||||||
|
case 20028:
|
||||||
|
directorScriptPath = "Guildleve/PrivateGLBattleDetectNormal";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lock (directorLock)
|
||||||
|
{
|
||||||
|
GuildleveDirector director = new GuildleveDirector(directorIdCount, this, directorScriptPath, glid, difficulty, owner, args);
|
||||||
|
currentDirectors.Add(director.actorId, director);
|
||||||
directorIdCount++;
|
directorIdCount++;
|
||||||
return director;
|
return director;
|
||||||
}
|
}
|
||||||
@ -516,7 +571,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
{
|
{
|
||||||
if (currentDirectors.ContainsKey(id))
|
if (currentDirectors.ContainsKey(id))
|
||||||
{
|
{
|
||||||
currentDirectors[id].RemoveChildren();
|
if (!currentDirectors[id].IsDeleted())
|
||||||
|
currentDirectors[id].EndDirector();
|
||||||
currentDirectors.Remove(id);
|
currentDirectors.Remove(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,7 @@ namespace FFXIVClassic_Map_Server.actors.area
|
|||||||
return parentZone;
|
return parentZone;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override SubPacket CreateScriptBindPacket(uint playerActorId)
|
public override SubPacket CreateScriptBindPacket()
|
||||||
{
|
{
|
||||||
List<LuaParam> lParams;
|
List<LuaParam> lParams;
|
||||||
|
|
||||||
@ -50,8 +50,8 @@ namespace FFXIVClassic_Map_Server.actors.area
|
|||||||
string realClassName = className.Substring(className.LastIndexOf("/") + 1);
|
string realClassName = className.Substring(className.LastIndexOf("/") + 1);
|
||||||
|
|
||||||
lParams = LuaUtils.CreateLuaParamList(classPath, false, true, zoneName, privateAreaName, privateAreaType, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, false, false, false);
|
lParams = LuaUtils.CreateLuaParamList(classPath, false, true, zoneName, privateAreaName, privateAreaType, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, false, false, false);
|
||||||
ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, realClassName, lParams).DebugPrintSubPacket();
|
ActorInstantiatePacket.BuildPacket(actorId, actorName, realClassName, lParams).DebugPrintSubPacket();
|
||||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, realClassName, lParams);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, realClassName, lParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -75,13 +75,13 @@ namespace FFXIVClassic_Map_Server.actors.area
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override SubPacket CreateScriptBindPacket(uint playerActorId)
|
public override SubPacket CreateScriptBindPacket()
|
||||||
{
|
{
|
||||||
bool isEntranceDesion = false;
|
bool isEntranceDesion = false;
|
||||||
|
|
||||||
List<LuaParam> lParams;
|
List<LuaParam> lParams;
|
||||||
lParams = LuaUtils.CreateLuaParamList(classPath, false, true, zoneName, "", -1, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, true, isInstanceRaid, isEntranceDesion);
|
lParams = LuaUtils.CreateLuaParamList(classPath, false, true, zoneName, "", -1, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, true, isInstanceRaid, isEntranceDesion);
|
||||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddSpawnLocation(SpawnLocation spawn)
|
public void AddSpawnLocation(SpawnLocation spawn)
|
||||||
|
@ -75,33 +75,33 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
this.statusEffects = new StatusEffects(this);
|
this.statusEffects = new StatusEffects(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateAppearancePacket(uint playerActorId)
|
public SubPacket CreateAppearancePacket()
|
||||||
{
|
{
|
||||||
SetActorAppearancePacket setappearance = new SetActorAppearancePacket(modelId, appearanceIds);
|
SetActorAppearancePacket setappearance = new SetActorAppearancePacket(modelId, appearanceIds);
|
||||||
return setappearance.BuildPacket(actorId, playerActorId);
|
return setappearance.BuildPacket(actorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateInitStatusPacket(uint playerActorId)
|
public SubPacket CreateInitStatusPacket()
|
||||||
{
|
{
|
||||||
return (SetActorStatusAllPacket.BuildPacket(actorId, playerActorId, charaWork.status));
|
return (SetActorStatusAllPacket.BuildPacket(actorId, charaWork.status));
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateSetActorIconPacket(uint playerActorId)
|
public SubPacket CreateSetActorIconPacket()
|
||||||
{
|
{
|
||||||
return SetActorIconPacket.BuildPacket(actorId, playerActorId, currentActorIcon);
|
return SetActorIconPacket.BuildPacket(actorId, currentActorIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateIdleAnimationPacket(uint playerActorId)
|
public SubPacket CreateIdleAnimationPacket()
|
||||||
{
|
{
|
||||||
return SetActorSubStatPacket.BuildPacket(actorId, playerActorId, 0, 0, 0, 0, 0, 0, animationId);
|
return SetActorSubStatPacket.BuildPacket(actorId, 0, 0, 0, 0, 0, 0, animationId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetQuestGraphic(Player player, int graphicNum)
|
public void SetQuestGraphic(Player player, int graphicNum)
|
||||||
{
|
{
|
||||||
player.QueuePacket(SetActorQuestGraphicPacket.BuildPacket(player.actorId, actorId, graphicNum));
|
player.QueuePacket(SetActorQuestGraphicPacket.BuildPacket(actorId, graphicNum));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetCurrentContentGroup(ContentGroup group, Player player = null)
|
public void SetCurrentContentGroup(ContentGroup group)
|
||||||
{
|
{
|
||||||
if (group != null)
|
if (group != null)
|
||||||
charaWork.currentContentGroup = group.GetTypeId();
|
charaWork.currentContentGroup = group.GetTypeId();
|
||||||
@ -110,17 +110,21 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
currentContentGroup = group;
|
currentContentGroup = group;
|
||||||
|
|
||||||
if (player != null)
|
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/currentContentGroup", this);
|
||||||
{
|
propPacketUtil.AddProperty("charaWork.currentContentGroup");
|
||||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("charaWork/currentContentGroup", this, actorId);
|
zone.BroadcastPacketsAroundActor(this, propPacketUtil.Done());
|
||||||
propPacketUtil.AddProperty("charaWork.currentContentGroup");
|
|
||||||
player.QueuePackets(propPacketUtil.Done());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PlayAnimation(uint animId)
|
public void PlayAnimation(uint animId, bool onlySelf = false)
|
||||||
{
|
{
|
||||||
zone.BroadcastPacketAroundActor(this, PlayAnimationOnActorPacket.BuildPacket(actorId, actorId, animId));
|
if (onlySelf)
|
||||||
|
{
|
||||||
|
if (this is Player)
|
||||||
|
((Player)this).QueuePacket(PlayAnimationOnActorPacket.BuildPacket(actorId, animId));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
zone.BroadcastPacketAroundActor(this, PlayAnimationOnActorPacket.BuildPacket(actorId, animId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void PathTo(float x, float y, float z, float stepSize = 0.70f, int maxPath = 40, float polyRadius = 0.0f)
|
public void PathTo(float x, float y, float z, float stepSize = 0.70f, int maxPath = 40, float polyRadius = 0.0f)
|
||||||
|
@ -127,27 +127,18 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
GenerateActorName((int)actorNumber);
|
GenerateActorName((int)actorNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket CreateAddActorPacket(uint playerActorId)
|
public SubPacket CreateAddActorPacket()
|
||||||
{
|
{
|
||||||
return AddActorPacket.BuildPacket(actorId, playerActorId, 8);
|
return AddActorPacket.BuildPacket(actorId, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
int val = 0x0b00;
|
|
||||||
// actorClassId, [], [], numBattleCommon, [battleCommon], numEventCommon, [eventCommon], args for either initForBattle/initForEvent
|
// actorClassId, [], [], numBattleCommon, [battleCommon], numEventCommon, [eventCommon], args for either initForBattle/initForEvent
|
||||||
public override SubPacket CreateScriptBindPacket(uint playerActorId)
|
public override SubPacket CreateScriptBindPacket(Player player)
|
||||||
{
|
{
|
||||||
List<LuaParam> lParams;
|
List<LuaParam> lParams;
|
||||||
|
|
||||||
Player player = Server.GetWorldManager().GetPCInWorld(playerActorId);
|
|
||||||
lParams = LuaEngine.GetInstance().CallLuaFunctionForReturn(player, this, "init", false);
|
lParams = LuaEngine.GetInstance().CallLuaFunctionForReturn(player, this, "init", false);
|
||||||
|
|
||||||
if (uniqueIdentifier.Equals("1"))
|
|
||||||
{
|
|
||||||
lParams[5].value = val;
|
|
||||||
val++;
|
|
||||||
player.SendMessage(0x20, "", String.Format("ID is now: 0x{0:X}", val));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (lParams != null && lParams.Count >= 3 && lParams[2].typeID == 0 && (int)lParams[2].value == 0)
|
if (lParams != null && lParams.Count >= 3 && lParams[2].typeID == 0 && (int)lParams[2].value == 0)
|
||||||
isStatic = true;
|
isStatic = true;
|
||||||
else
|
else
|
||||||
@ -162,8 +153,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
string classNameFake = "PopulaceStandard";
|
string classNameFake = "PopulaceStandard";
|
||||||
lParams = LuaUtils.CreateLuaParamList(classPathFake, false, false, false, false, false, 0xF47F6, false, false, 0, 0);
|
lParams = LuaUtils.CreateLuaParamList(classPathFake, false, false, false, false, false, 0xF47F6, false, false, 0, 0);
|
||||||
isStatic = true;
|
isStatic = true;
|
||||||
//ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, classNameFake, lParams).DebugPrintSubPacket();
|
//ActorInstantiatePacket.BuildPacket(actorId, actorName, classNameFake, lParams).DebugPrintSubPacket();
|
||||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, classNameFake, lParams);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, classNameFake, lParams);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -176,37 +167,37 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
lParams.Insert(6, new LuaParam(0, (int)actorClassId));
|
lParams.Insert(6, new LuaParam(0, (int)actorClassId));
|
||||||
}
|
}
|
||||||
|
|
||||||
//ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams).DebugPrintSubPacket();
|
//ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams).DebugPrintSubPacket();
|
||||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BasePacket GetSpawnPackets(uint playerActorId, ushort spawnType)
|
public override List<SubPacket> GetSpawnPackets(Player player, ushort spawnType)
|
||||||
{
|
{
|
||||||
List<SubPacket> subpackets = new List<SubPacket>();
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
subpackets.Add(CreateAddActorPacket(playerActorId));
|
subpackets.Add(CreateAddActorPacket());
|
||||||
subpackets.AddRange(GetEventConditionPackets(playerActorId));
|
subpackets.AddRange(GetEventConditionPackets());
|
||||||
subpackets.Add(CreateSpeedPacket(playerActorId));
|
subpackets.Add(CreateSpeedPacket());
|
||||||
subpackets.Add(CreateSpawnPositonPacket(playerActorId, 0x0));
|
subpackets.Add(CreateSpawnPositonPacket(0x0));
|
||||||
|
|
||||||
if (isMapObj)
|
if (isMapObj)
|
||||||
subpackets.Add(_0xD8Packet.BuildPacket(actorId, playerActorId, instance, layout));
|
subpackets.Add(SetActorBGPropertiesPacket.BuildPacket(actorId, instance, layout));
|
||||||
else
|
else
|
||||||
subpackets.Add(CreateAppearancePacket(playerActorId));
|
subpackets.Add(CreateAppearancePacket());
|
||||||
|
|
||||||
subpackets.Add(CreateNamePacket(playerActorId));
|
subpackets.Add(CreateNamePacket());
|
||||||
subpackets.Add(CreateStatePacket(playerActorId));
|
subpackets.Add(CreateStatePacket());
|
||||||
subpackets.Add(CreateIdleAnimationPacket(playerActorId));
|
subpackets.Add(CreateIdleAnimationPacket());
|
||||||
subpackets.Add(CreateInitStatusPacket(playerActorId));
|
subpackets.Add(CreateInitStatusPacket());
|
||||||
subpackets.Add(CreateSetActorIconPacket(playerActorId));
|
subpackets.Add(CreateSetActorIconPacket());
|
||||||
subpackets.Add(CreateIsZoneingPacket(playerActorId));
|
subpackets.Add(CreateIsZoneingPacket());
|
||||||
subpackets.Add(CreateScriptBindPacket(playerActorId));
|
subpackets.Add(CreateScriptBindPacket(player));
|
||||||
|
|
||||||
return BasePacket.CreatePacket(subpackets, true, false);
|
return subpackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BasePacket GetInitPackets(uint playerActorId)
|
public override List<SubPacket> GetInitPackets()
|
||||||
{
|
{
|
||||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("/_init", this, playerActorId);
|
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("/_init", this);
|
||||||
|
|
||||||
//Potential
|
//Potential
|
||||||
propPacketUtil.AddProperty("charaWork.battleSave.potencial");
|
propPacketUtil.AddProperty("charaWork.battleSave.potencial");
|
||||||
@ -260,7 +251,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
propPacketUtil.AddProperty("npcWork.pushCommandPriority");
|
propPacketUtil.AddProperty("npcWork.pushCommandPriority");
|
||||||
}
|
}
|
||||||
|
|
||||||
return BasePacket.CreatePacket(propPacketUtil.Done(), true, false);
|
return propPacketUtil.Done();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GetUniqueId()
|
public string GetUniqueId()
|
||||||
@ -276,7 +267,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
public void ChangeNpcAppearance(uint id)
|
public void ChangeNpcAppearance(uint id)
|
||||||
{
|
{
|
||||||
LoadNpcAppearance(id);
|
LoadNpcAppearance(id);
|
||||||
zone.BroadcastPacketAroundActor(this, CreateAppearancePacket(actorId));
|
zone.BroadcastPacketAroundActor(this, CreateAppearancePacket());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void LoadNpcAppearance(uint id)
|
public void LoadNpcAppearance(uint id)
|
||||||
@ -394,7 +385,12 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
public void PlayMapObjAnimation(Player player, string animationName)
|
public void PlayMapObjAnimation(Player player, string animationName)
|
||||||
{
|
{
|
||||||
player.QueuePacket(PlayBGAnimation.BuildPacket(actorId, player.actorId, animationName));
|
player.QueuePacket(PlayBGAnimation.BuildPacket(actorId, animationName));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Despawn()
|
||||||
|
{
|
||||||
|
zone.DespawnActor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Update(DateTime tick)
|
public void Update(DateTime tick)
|
||||||
|
@ -63,24 +63,24 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, toPlayer.actorId, 0x23, Inventory.EQUIPMENT_OTHERPLAYER));
|
toPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, 0x23, Inventory.EQUIPMENT_OTHERPLAYER));
|
||||||
int currentIndex = 0;
|
int currentIndex = 0;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (items.Count - currentIndex >= 16)
|
if (items.Count - currentIndex >= 16)
|
||||||
toPlayer.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex));
|
toPlayer.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex));
|
||||||
else if (items.Count - currentIndex > 1)
|
else if (items.Count - currentIndex > 1)
|
||||||
toPlayer.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex));
|
toPlayer.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex));
|
||||||
else if (items.Count - currentIndex == 1)
|
else if (items.Count - currentIndex == 1)
|
||||||
{
|
{
|
||||||
toPlayer.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, toPlayer.actorId, items[currentIndex]));
|
toPlayer.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex]));
|
||||||
currentIndex++;
|
currentIndex++;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
toPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId, toPlayer.actorId));
|
toPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendFullEquipment(bool DoClear)
|
public void SendFullEquipment(bool DoClear)
|
||||||
|
@ -92,7 +92,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||||||
if (!IsSpaceForAdd(itemId, quantity))
|
if (!IsSpaceForAdd(itemId, quantity))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Item gItem = Server.GetItemGamedata(itemId);
|
ItemData gItem = Server.GetItemGamedata(itemId);
|
||||||
List<ushort> slotsToUpdate = new List<ushort>();
|
List<ushort> slotsToUpdate = new List<ushort>();
|
||||||
List<SubPacket> addItemPackets = new List<SubPacket>();
|
List<SubPacket> addItemPackets = new List<SubPacket>();
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||||||
//New item that spilled over
|
//New item that spilled over
|
||||||
for (int i = 0; i < itemId.Length; i++)
|
for (int i = 0; i < itemId.Length; i++)
|
||||||
{
|
{
|
||||||
Item gItem = Server.GetItemGamedata(itemId[i]);
|
ItemData gItem = Server.GetItemGamedata(itemId[i]);
|
||||||
InventoryItem addedItem = Database.AddItem(owner, itemId[i], 1, (byte)1, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability, inventoryCode);
|
InventoryItem addedItem = Database.AddItem(owner, itemId[i], 1, (byte)1, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability, inventoryCode);
|
||||||
list.Add(addedItem);
|
list.Add(addedItem);
|
||||||
}
|
}
|
||||||
@ -457,7 +457,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||||||
for (int i = 0; i < list.Count; i++)
|
for (int i = 0; i < list.Count; i++)
|
||||||
{
|
{
|
||||||
InventoryItem item = list[i];
|
InventoryItem item = list[i];
|
||||||
Item gItem = Server.GetItemGamedata(item.itemId);
|
ItemData gItem = Server.GetItemGamedata(item.itemId);
|
||||||
if (item.itemId == itemId && item.quantity < gItem.maxStack)
|
if (item.itemId == itemId && item.quantity < gItem.maxStack)
|
||||||
{
|
{
|
||||||
quantityCount -= (gItem.maxStack - item.quantity);
|
quantityCount -= (gItem.maxStack - item.quantity);
|
||||||
|
@ -253,17 +253,17 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
this.aiContainer = new AIContainer(this, new PlayerController(this), null, new TargetFind(this));
|
this.aiContainer = new AIContainer(this, new PlayerController(this), null, new TargetFind(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SubPacket> Create0x132Packets(uint playerActorId)
|
public List<SubPacket> Create0x132Packets()
|
||||||
{
|
{
|
||||||
List<SubPacket> packets = new List<SubPacket>();
|
List<SubPacket> packets = new List<SubPacket>();
|
||||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0xB, "commandForced"));
|
packets.Add(_0x132Packet.BuildPacket(actorId, 0xB, "commandForced"));
|
||||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0xA, "commandDefault"));
|
packets.Add(_0x132Packet.BuildPacket(actorId, 0xA, "commandDefault"));
|
||||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x6, "commandWeak"));
|
packets.Add(_0x132Packet.BuildPacket(actorId, 0x6, "commandWeak"));
|
||||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x4, "commandContent"));
|
packets.Add(_0x132Packet.BuildPacket(actorId, 0x4, "commandContent"));
|
||||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x6, "commandJudgeMode"));
|
packets.Add(_0x132Packet.BuildPacket(actorId, 0x6, "commandJudgeMode"));
|
||||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x100, "commandRequest"));
|
packets.Add(_0x132Packet.BuildPacket(actorId, 0x100, "commandRequest"));
|
||||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x100, "widgetCreate"));
|
packets.Add(_0x132Packet.BuildPacket(actorId, 0x100, "widgetCreate"));
|
||||||
packets.Add(_0x132Packet.BuildPacket(playerActorId, 0x100, "macroRequest"));
|
packets.Add(_0x132Packet.BuildPacket(actorId, 0x100, "macroRequest"));
|
||||||
return packets;
|
return packets;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -278,10 +278,10 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
* Timer Array - 20 Number
|
* Timer Array - 20 Number
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public override SubPacket CreateScriptBindPacket(uint playerActorId)
|
public override SubPacket CreateScriptBindPacket(Player requestPlayer)
|
||||||
{
|
{
|
||||||
List<LuaParam> lParams;
|
List<LuaParam> lParams;
|
||||||
if (IsMyPlayer(playerActorId))
|
if (IsMyPlayer(requestPlayer.actorId))
|
||||||
{
|
{
|
||||||
if (loginInitDirector != null)
|
if (loginInitDirector != null)
|
||||||
lParams = LuaUtils.CreateLuaParamList("/Chara/Player/Player_work", false, false, true, loginInitDirector, true, 0, false, timers, true);
|
lParams = LuaUtils.CreateLuaParamList("/Chara/Player/Player_work", false, false, true, loginInitDirector, true, 0, false, timers, true);
|
||||||
@ -291,69 +291,74 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
else
|
else
|
||||||
lParams = LuaUtils.CreateLuaParamList("/Chara/Player/Player_work", false, false, false, false, false, true);
|
lParams = LuaUtils.CreateLuaParamList("/Chara/Player/Player_work", false, false, false, false, false, true);
|
||||||
|
|
||||||
ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams).DebugPrintSubPacket();
|
ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams).DebugPrintSubPacket();
|
||||||
|
|
||||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BasePacket GetSpawnPackets(uint playerActorId, ushort spawnType)
|
public override List<SubPacket> GetSpawnPackets(Player requestPlayer, ushort spawnType)
|
||||||
{
|
{
|
||||||
List<SubPacket> subpackets = new List<SubPacket>();
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
subpackets.Add(CreateAddActorPacket(playerActorId, 8));
|
subpackets.Add(CreateAddActorPacket(8));
|
||||||
if (IsMyPlayer(playerActorId))
|
if (IsMyPlayer(requestPlayer.actorId))
|
||||||
subpackets.AddRange(Create0x132Packets(playerActorId));
|
subpackets.AddRange(Create0x132Packets());
|
||||||
subpackets.Add(CreateSpeedPacket(playerActorId));
|
subpackets.Add(CreateSpeedPacket());
|
||||||
subpackets.Add(CreateSpawnPositonPacket(playerActorId, spawnType));
|
subpackets.Add(CreateSpawnPositonPacket(this, spawnType));
|
||||||
subpackets.Add(CreateAppearancePacket(playerActorId));
|
subpackets.Add(CreateAppearancePacket());
|
||||||
subpackets.Add(CreateNamePacket(playerActorId));
|
subpackets.Add(CreateNamePacket());
|
||||||
subpackets.Add(_0xFPacket.BuildPacket(playerActorId, playerActorId));
|
subpackets.Add(_0xFPacket.BuildPacket(actorId));
|
||||||
subpackets.Add(CreateStatePacket(playerActorId));
|
subpackets.Add(CreateStatePacket());
|
||||||
subpackets.Add(CreateIdleAnimationPacket(playerActorId));
|
subpackets.Add(CreateIdleAnimationPacket());
|
||||||
subpackets.Add(CreateInitStatusPacket(playerActorId));
|
subpackets.Add(CreateInitStatusPacket());
|
||||||
subpackets.Add(CreateSetActorIconPacket(playerActorId));
|
subpackets.Add(CreateSetActorIconPacket());
|
||||||
subpackets.Add(CreateIsZoneingPacket(playerActorId));
|
subpackets.Add(CreateIsZoneingPacket());
|
||||||
subpackets.AddRange(CreatePlayerRelatedPackets(playerActorId));
|
subpackets.AddRange(CreatePlayerRelatedPackets(requestPlayer.actorId));
|
||||||
subpackets.Add(CreateScriptBindPacket(playerActorId));
|
subpackets.Add(CreateScriptBindPacket(requestPlayer));
|
||||||
return BasePacket.CreatePacket(subpackets, true, false);
|
return subpackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<SubPacket> CreatePlayerRelatedPackets(uint playerActorId)
|
public List<SubPacket> CreatePlayerRelatedPackets(uint requestingPlayerActorId)
|
||||||
{
|
{
|
||||||
List<SubPacket> subpackets = new List<SubPacket>();
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
|
|
||||||
if (gcCurrent != 0)
|
if (gcCurrent != 0)
|
||||||
subpackets.Add(SetGrandCompanyPacket.BuildPacket(actorId, playerActorId, gcCurrent, gcRankLimsa, gcRankGridania, gcRankUldah));
|
subpackets.Add(SetGrandCompanyPacket.BuildPacket(actorId, gcCurrent, gcRankLimsa, gcRankGridania, gcRankUldah));
|
||||||
|
|
||||||
if (currentTitle != 0)
|
if (currentTitle != 0)
|
||||||
subpackets.Add(SetPlayerTitlePacket.BuildPacket(actorId, playerActorId, currentTitle));
|
subpackets.Add(SetPlayerTitlePacket.BuildPacket(actorId, currentTitle));
|
||||||
|
|
||||||
if (currentJob != 0)
|
if (currentJob != 0)
|
||||||
subpackets.Add(SetCurrentJobPacket.BuildPacket(actorId, playerActorId, currentJob));
|
subpackets.Add(SetCurrentJobPacket.BuildPacket(actorId, currentJob));
|
||||||
|
|
||||||
if (IsMyPlayer(playerActorId))
|
if (IsMyPlayer(requestingPlayerActorId))
|
||||||
{
|
{
|
||||||
subpackets.Add(SetSpecialEventWorkPacket.BuildPacket(playerActorId, playerActorId));
|
subpackets.Add(SetSpecialEventWorkPacket.BuildPacket(actorId));
|
||||||
|
|
||||||
if (hasChocobo && chocoboName != null && !chocoboName.Equals(""))
|
if (hasChocobo && chocoboName != null && !chocoboName.Equals(""))
|
||||||
{
|
{
|
||||||
subpackets.Add(SetChocoboNamePacket.BuildPacket(actorId, playerActorId, chocoboName));
|
subpackets.Add(SetChocoboNamePacket.BuildPacket(actorId, chocoboName));
|
||||||
subpackets.Add(SetHasChocoboPacket.BuildPacket(playerActorId, hasChocobo));
|
subpackets.Add(SetHasChocoboPacket.BuildPacket(actorId, hasChocobo));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasGoobbue)
|
if (hasGoobbue)
|
||||||
subpackets.Add(SetHasGoobbuePacket.BuildPacket(playerActorId, hasGoobbue));
|
subpackets.Add(SetHasGoobbuePacket.BuildPacket(actorId, hasGoobbue));
|
||||||
|
|
||||||
subpackets.Add(SetAchievementPointsPacket.BuildPacket(playerActorId, achievementPoints));
|
subpackets.Add(SetAchievementPointsPacket.BuildPacket(actorId, achievementPoints));
|
||||||
subpackets.Add(Database.GetLatestAchievements(this));
|
subpackets.Add(Database.GetLatestAchievements(this));
|
||||||
subpackets.Add(Database.GetAchievementsPacket(this));
|
subpackets.Add(Database.GetAchievementsPacket(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mountState == 1)
|
||||||
|
subpackets.Add(SetCurrentMountChocoboPacket.BuildPacket(actorId, chocoboAppearance));
|
||||||
|
else if (mountState == 2)
|
||||||
|
subpackets.Add(SetCurrentMountGoobbuePacket.BuildPacket(actorId, 1));
|
||||||
|
|
||||||
return subpackets;
|
return subpackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BasePacket GetInitPackets(uint playerActorId)
|
public override List<SubPacket> GetInitPackets()
|
||||||
{
|
{
|
||||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("/_init", this, playerActorId);
|
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("/_init", this);
|
||||||
|
|
||||||
propPacketUtil.AddProperty("charaWork.eventSave.bazaarTax");
|
propPacketUtil.AddProperty("charaWork.eventSave.bazaarTax");
|
||||||
propPacketUtil.AddProperty("charaWork.battleSave.potencial");
|
propPacketUtil.AddProperty("charaWork.battleSave.potencial");
|
||||||
@ -498,7 +503,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
propPacketUtil.AddProperty("playerWork.birthdayDay");
|
propPacketUtil.AddProperty("playerWork.birthdayDay");
|
||||||
propPacketUtil.AddProperty("playerWork.initialTown");
|
propPacketUtil.AddProperty("playerWork.initialTown");
|
||||||
|
|
||||||
return BasePacket.CreatePacket(propPacketUtil.Done(), true, false);
|
return propPacketUtil.Done();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendSeamlessZoneInPackets()
|
public void SendSeamlessZoneInPackets()
|
||||||
@ -509,14 +514,14 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
public void SendZoneInPackets(WorldManager world, ushort spawnType)
|
public void SendZoneInPackets(WorldManager world, ushort spawnType)
|
||||||
{
|
{
|
||||||
QueuePacket(SetActorIsZoningPacket.BuildPacket(actorId, actorId, false));
|
QueuePacket(SetActorIsZoningPacket.BuildPacket(actorId, false));
|
||||||
QueuePacket(_0x10Packet.BuildPacket(actorId, 0xFF));
|
QueuePacket(_0x10Packet.BuildPacket(actorId, 0xFF));
|
||||||
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.bgmDay, 0x01));
|
QueuePacket(SetMusicPacket.BuildPacket(actorId, zone.bgmDay, 0x01));
|
||||||
QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1));
|
QueuePacket(SetWeatherPacket.BuildPacket(actorId, SetWeatherPacket.WEATHER_CLEAR, 1));
|
||||||
|
|
||||||
QueuePacket(SetMapPacket.BuildPacket(actorId, zone.regionId, zone.actorId));
|
QueuePacket(SetMapPacket.BuildPacket(actorId, zone.regionId, zone.actorId));
|
||||||
|
|
||||||
QueuePacket(GetSpawnPackets(actorId, spawnType));
|
QueuePackets(GetSpawnPackets(this, spawnType));
|
||||||
//GetSpawnPackets(actorId, spawnType).DebugPrintPacket();
|
//GetSpawnPackets(actorId, spawnType).DebugPrintPacket();
|
||||||
|
|
||||||
#region Inventory & Equipment
|
#region Inventory & Equipment
|
||||||
@ -528,14 +533,14 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
inventories[Inventory.MELDREQUEST].SendFullInventory();
|
inventories[Inventory.MELDREQUEST].SendFullInventory();
|
||||||
inventories[Inventory.LOOT].SendFullInventory();
|
inventories[Inventory.LOOT].SendFullInventory();
|
||||||
equipment.SendFullEquipment(false);
|
equipment.SendFullEquipment(false);
|
||||||
playerSession.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId), true, false);
|
playerSession.QueuePacket(InventoryEndChangePacket.BuildPacket(actorId));
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
playerSession.QueuePacket(GetInitPackets(actorId));
|
playerSession.QueuePacket(GetInitPackets());
|
||||||
|
|
||||||
BasePacket areaMasterSpawn = zone.GetSpawnPackets(actorId);
|
List<SubPacket> areaMasterSpawn = zone.GetSpawnPackets();
|
||||||
BasePacket debugSpawn = world.GetDebugActor().GetSpawnPackets(actorId);
|
List<SubPacket> debugSpawn = world.GetDebugActor().GetSpawnPackets();
|
||||||
BasePacket worldMasterSpawn = world.GetActor().GetSpawnPackets(actorId);
|
List<SubPacket> worldMasterSpawn = world.GetActor().GetSpawnPackets();
|
||||||
|
|
||||||
playerSession.QueuePacket(areaMasterSpawn);
|
playerSession.QueuePacket(areaMasterSpawn);
|
||||||
playerSession.QueuePacket(debugSpawn);
|
playerSession.QueuePacket(debugSpawn);
|
||||||
@ -556,16 +561,14 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
if (zone.GetWeatherDirector() != null)
|
if (zone.GetWeatherDirector() != null)
|
||||||
{
|
{
|
||||||
BasePacket weatherDirectorSpawn = zone.GetWeatherDirector().GetSpawnPackets(actorId);
|
playerSession.QueuePacket(zone.GetWeatherDirector().GetSpawnPackets());
|
||||||
playerSession.QueuePacket(weatherDirectorSpawn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
foreach (Director director in ownedDirectors)
|
foreach (Director director in ownedDirectors)
|
||||||
{
|
{
|
||||||
director.GetSpawnPackets(actorId).DebugPrintPacket();
|
QueuePackets(director.GetSpawnPackets());
|
||||||
QueuePacket(director.GetSpawnPackets(actorId));
|
QueuePackets(director.GetInitPackets());
|
||||||
QueuePacket(director.GetInitPackets(actorId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentContentGroup != null)
|
if (currentContentGroup != null)
|
||||||
@ -600,30 +603,24 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
return actorId == otherActorId;
|
return actorId == otherActorId;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QueuePacket(BasePacket packet)
|
public void QueuePacket(SubPacket packet)
|
||||||
{
|
{
|
||||||
playerSession.QueuePacket(packet);
|
playerSession.QueuePacket(packet);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QueuePacket(SubPacket packet)
|
|
||||||
{
|
|
||||||
playerSession.QueuePacket(packet, true, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void QueuePackets(List<SubPacket> packets)
|
public void QueuePackets(List<SubPacket> packets)
|
||||||
{
|
{
|
||||||
foreach (SubPacket subpacket in packets)
|
playerSession.QueuePacket(packets);
|
||||||
playerSession.QueuePacket(subpacket, true, false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendPacket(string path)
|
public void SendPacket(string path)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
BasePacket packet = new BasePacket(path);
|
// BasePacket packet = new BasePacket(path);
|
||||||
|
|
||||||
packet.ReplaceActorID(actorId);
|
//packet.ReplaceActorID(actorId);
|
||||||
QueuePacket(packet);
|
//QueuePacket(packet);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
@ -633,13 +630,19 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
public void BroadcastPacket(SubPacket packet, bool sendToSelf)
|
public void BroadcastPacket(SubPacket packet, bool sendToSelf)
|
||||||
{
|
{
|
||||||
|
if (sendToSelf)
|
||||||
|
{
|
||||||
|
SubPacket clonedPacket = new SubPacket(packet, actorId);
|
||||||
|
QueuePacket(clonedPacket);
|
||||||
|
}
|
||||||
|
|
||||||
foreach (Actor a in playerSession.actorInstanceList)
|
foreach (Actor a in playerSession.actorInstanceList)
|
||||||
{
|
{
|
||||||
if (a is Player)
|
if (a is Player)
|
||||||
{
|
{
|
||||||
Player p = (Player)a;
|
Player p = (Player)a;
|
||||||
|
|
||||||
if (p.Equals(this) && !sendToSelf)
|
if (p.Equals(this))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SubPacket clonedPacket = new SubPacket(packet, a.actorId);
|
SubPacket clonedPacket = new SubPacket(packet, a.actorId);
|
||||||
@ -659,14 +662,14 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
{
|
{
|
||||||
if (flag)
|
if (flag)
|
||||||
{
|
{
|
||||||
BroadcastPacket(SetActorIconPacket.BuildPacket(actorId, actorId, SetActorIconPacket.DISCONNECTING), true);
|
BroadcastPacket(SetActorIconPacket.BuildPacket(actorId, SetActorIconPacket.DISCONNECTING), true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (isGM)
|
if (isGM)
|
||||||
BroadcastPacket(SetActorIconPacket.BuildPacket(actorId, actorId, SetActorIconPacket.ISGM), true);
|
BroadcastPacket(SetActorIconPacket.BuildPacket(actorId, SetActorIconPacket.ISGM), true);
|
||||||
else
|
else
|
||||||
BroadcastPacket(SetActorIconPacket.BuildPacket(actorId, actorId, 0), true);
|
BroadcastPacket(SetActorIconPacket.BuildPacket(actorId, 0), true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -719,7 +722,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
public void SendMessage(uint logType, string sender, string message)
|
public void SendMessage(uint logType, string sender, string message)
|
||||||
{
|
{
|
||||||
QueuePacket(SendMessagePacket.BuildPacket(actorId, actorId, logType, sender, message));
|
QueuePacket(SendMessagePacket.BuildPacket(actorId, logType, sender, message));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Logout()
|
public void Logout()
|
||||||
@ -756,19 +759,18 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
QueuePacket(SetMusicPacket.BuildPacket(actorId, musicId, 1));
|
QueuePacket(SetMusicPacket.BuildPacket(actorId, musicId, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendChocoboAppearance()
|
public void SendMountAppearance()
|
||||||
{
|
{
|
||||||
BroadcastPacket(SetCurrentMountChocoboPacket.BuildPacket(actorId, chocoboAppearance), true);
|
if (mountState == 1)
|
||||||
}
|
BroadcastPacket(SetCurrentMountChocoboPacket.BuildPacket(actorId, chocoboAppearance), true);
|
||||||
|
else if (mountState == 2)
|
||||||
public void SendGoobbueAppearance()
|
BroadcastPacket(SetCurrentMountGoobbuePacket.BuildPacket(actorId, 1), true);
|
||||||
{
|
|
||||||
BroadcastPacket(SetCurrentMountGoobbuePacket.BuildPacket(actorId, 1), true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetMountState(byte mountState)
|
public void SetMountState(byte mountState)
|
||||||
{
|
{
|
||||||
this.mountState = mountState;
|
this.mountState = mountState;
|
||||||
|
SendMountAppearance();
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte GetMountState()
|
public byte GetMountState()
|
||||||
@ -778,41 +780,41 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
public void DoEmote(uint targettedActor, uint animId, uint descId)
|
public void DoEmote(uint targettedActor, uint animId, uint descId)
|
||||||
{
|
{
|
||||||
BroadcastPacket(ActorDoEmotePacket.BuildPacket(actorId, actorId, targettedActor, animId, descId), true);
|
BroadcastPacket(ActorDoEmotePacket.BuildPacket(actorId, targettedActor, animId, descId), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendGameMessage(Actor sourceActor, Actor textIdOwner, ushort textId, byte log, params object[] msgParams)
|
public void SendGameMessage(Actor sourceActor, Actor textIdOwner, ushort textId, byte log, params object[] msgParams)
|
||||||
{
|
{
|
||||||
if (msgParams == null || msgParams.Length == 0)
|
if (msgParams == null || msgParams.Length == 0)
|
||||||
{
|
{
|
||||||
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, actorId, sourceActor.actorId, textIdOwner.actorId, textId, log));
|
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, sourceActor.actorId, textIdOwner.actorId, textId, log));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, actorId, sourceActor.actorId, textIdOwner.actorId, textId, log, LuaUtils.CreateLuaParamList(msgParams)));
|
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, sourceActor.actorId, textIdOwner.actorId, textId, log, LuaUtils.CreateLuaParamList(msgParams)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendGameMessage(Actor textIdOwner, ushort textId, byte log, params object[] msgParams)
|
public void SendGameMessage(Actor textIdOwner, ushort textId, byte log, params object[] msgParams)
|
||||||
{
|
{
|
||||||
if (msgParams == null || msgParams.Length == 0)
|
if (msgParams == null || msgParams.Length == 0)
|
||||||
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, log));
|
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, log));
|
||||||
else
|
else
|
||||||
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, log, LuaUtils.CreateLuaParamList(msgParams)));
|
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, log, LuaUtils.CreateLuaParamList(msgParams)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendGameMessage(Actor textIdOwner, ushort textId, byte log, string customSender, params object[] msgParams)
|
public void SendGameMessageCustomSender(Actor textIdOwner, ushort textId, byte log, string customSender, params object[] msgParams)
|
||||||
{
|
{
|
||||||
if (msgParams == null || msgParams.Length == 0)
|
if (msgParams == null || msgParams.Length == 0)
|
||||||
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, customSender, log));
|
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, customSender, log));
|
||||||
else
|
else
|
||||||
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, customSender, log, LuaUtils.CreateLuaParamList(msgParams)));
|
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, customSender, log, LuaUtils.CreateLuaParamList(msgParams)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendGameMessage(Actor textIdOwner, ushort textId, byte log, uint displayId, params object[] msgParams)
|
public void SendGameMessageDisplayIDSender(Actor textIdOwner, ushort textId, byte log, uint displayId, params object[] msgParams)
|
||||||
{
|
{
|
||||||
if (msgParams == null || msgParams.Length == 0)
|
if (msgParams == null || msgParams.Length == 0)
|
||||||
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, displayId, log));
|
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, displayId, log));
|
||||||
else
|
else
|
||||||
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, actorId, textIdOwner.actorId, textId, displayId, log, LuaUtils.CreateLuaParamList(msgParams)));
|
QueuePacket(GameMessagePacket.BuildPacket(Server.GetWorldManager().GetActor().actorId, textIdOwner.actorId, textId, displayId, log, LuaUtils.CreateLuaParamList(msgParams)));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BroadcastWorldMessage(ushort worldMasterId, params object[] msgParams)
|
public void BroadcastWorldMessage(ushort worldMasterId, params object[] msgParams)
|
||||||
@ -847,7 +849,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
public void SendAppearance()
|
public void SendAppearance()
|
||||||
{
|
{
|
||||||
BroadcastPacket(CreateAppearancePacket(actorId), true);
|
BroadcastPacket(CreateAppearancePacket(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendCharaExpInfo()
|
public void SendCharaExpInfo()
|
||||||
@ -879,7 +881,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
charaInfo1.AddTarget();
|
charaInfo1.AddTarget();
|
||||||
|
|
||||||
QueuePacket(charaInfo1.BuildPacket(actorId, actorId));
|
QueuePacket(charaInfo1.BuildPacket(actorId));
|
||||||
}
|
}
|
||||||
else if (lastStep == 1)
|
else if (lastStep == 1)
|
||||||
{
|
{
|
||||||
@ -910,7 +912,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
charaInfo1.AddTarget();
|
charaInfo1.AddTarget();
|
||||||
|
|
||||||
QueuePacket(charaInfo1.BuildPacket(actorId, actorId));
|
QueuePacket(charaInfo1.BuildPacket(actorId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -967,7 +969,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
playerWork.restBonusExpRate = 0.0f;
|
playerWork.restBonusExpRate = 0.0f;
|
||||||
|
|
||||||
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this, actorId);
|
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("charaWork/stateForAll", this);
|
||||||
|
|
||||||
propertyBuilder.AddProperty("charaWork.parameterSave.state_mainSkill[0]");
|
propertyBuilder.AddProperty("charaWork.parameterSave.state_mainSkill[0]");
|
||||||
propertyBuilder.AddProperty("charaWork.parameterSave.state_mainSkillLevel");
|
propertyBuilder.AddProperty("charaWork.parameterSave.state_mainSkillLevel");
|
||||||
@ -988,7 +990,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
appearanceIds[slot] = 0;
|
appearanceIds[slot] = 0;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Item item = Server.GetItemGamedata(invItem.itemId);
|
ItemData item = Server.GetItemGamedata(invItem.itemId);
|
||||||
if (item is EquipmentItem)
|
if (item is EquipmentItem)
|
||||||
{
|
{
|
||||||
EquipmentItem eqItem = (EquipmentItem)item;
|
EquipmentItem eqItem = (EquipmentItem)item;
|
||||||
@ -1011,7 +1013,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
Database.SavePlayerAppearance(this);
|
Database.SavePlayerAppearance(this);
|
||||||
|
|
||||||
BroadcastPacket(CreateAppearancePacket(actorId), true);
|
BroadcastPacket(CreateAppearancePacket(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Inventory GetInventory(ushort type)
|
public Inventory GetInventory(ushort type)
|
||||||
@ -1096,9 +1098,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
public int GetFreeGuildleveSlot()
|
public int GetFreeGuildleveSlot()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < questGuildleve.Length; i++)
|
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||||
{
|
{
|
||||||
if (questGuildleve[i] == 0)
|
if (work.guildleveId[i] == 0)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1139,23 +1141,38 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
if (freeSlot == -1)
|
if (freeSlot == -1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
playerWork.questScenario[freeSlot] = id;
|
work.guildleveId[freeSlot] = (ushort)id;
|
||||||
questGuildleve[freeSlot] = id;
|
|
||||||
Database.SaveGuildleve(this, id, freeSlot);
|
Database.SaveGuildleve(this, id, freeSlot);
|
||||||
SendGuildleveClientUpdate(freeSlot);
|
SendGuildleveClientUpdate(freeSlot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void MarkGuildleve(uint id, bool abandoned, bool completed)
|
||||||
|
{
|
||||||
|
if (HasGuildleve(id))
|
||||||
|
{
|
||||||
|
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||||
|
{
|
||||||
|
if (work.guildleveId[i] == id)
|
||||||
|
{
|
||||||
|
work.guildleveChecked[i] = completed;
|
||||||
|
work.guildleveDone[i] = abandoned;
|
||||||
|
Database.MarkGuildleve(this, id, abandoned, completed);
|
||||||
|
SendGuildleveMarkClientUpdate(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void RemoveGuildleve(uint id)
|
public void RemoveGuildleve(uint id)
|
||||||
{
|
{
|
||||||
if (HasGuildleve(id))
|
if (HasGuildleve(id))
|
||||||
{
|
{
|
||||||
for (int i = 0; i < questGuildleve.Length; i++)
|
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||||
{
|
{
|
||||||
if (questGuildleve[i] != null && questGuildleve[i] == id)
|
if (work.guildleveId[i] == id)
|
||||||
{
|
{
|
||||||
Database.RemoveGuildleve(this, id);
|
Database.RemoveGuildleve(this, id);
|
||||||
questGuildleve[i] = 0;
|
work.guildleveId[i] = 0;
|
||||||
playerWork.questGuildleve[i] = 0;
|
|
||||||
SendGuildleveClientUpdate(i);
|
SendGuildleveClientUpdate(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1338,9 +1355,9 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
public bool HasGuildleve(uint id)
|
public bool HasGuildleve(uint id)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < questGuildleve.Length; i++)
|
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||||
{
|
{
|
||||||
if (questGuildleve[i] != null && questGuildleve[i] == id)
|
if (work.guildleveId[i] == id)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1393,7 +1410,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
Database.SaveNpcLS(this, npcLSId, isCalling, isExtra);
|
Database.SaveNpcLS(this, npcLSId, isCalling, isExtra);
|
||||||
|
|
||||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/npcLinkshellChat", this, actorId);
|
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/npcLinkshellChat", this);
|
||||||
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatExtra[{0}]", npcLSId));
|
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatExtra[{0}]", npcLSId));
|
||||||
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatCalling[{0}]", npcLSId));
|
propPacketUtil.AddProperty(String.Format("playerWork.npcLinkshellChatCalling[{0}]", npcLSId));
|
||||||
QueuePackets(propPacketUtil.Done());
|
QueuePackets(propPacketUtil.Done());
|
||||||
@ -1401,15 +1418,23 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
private void SendQuestClientUpdate(int slot)
|
private void SendQuestClientUpdate(int slot)
|
||||||
{
|
{
|
||||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this, actorId);
|
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this);
|
||||||
propPacketUtil.AddProperty(String.Format("playerWork.questScenario[{0}]", slot));
|
propPacketUtil.AddProperty(String.Format("playerWork.questScenario[{0}]", slot));
|
||||||
QueuePackets(propPacketUtil.Done());
|
QueuePackets(propPacketUtil.Done());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SendGuildleveClientUpdate(int slot)
|
private void SendGuildleveClientUpdate(int slot)
|
||||||
{
|
{
|
||||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("playerWork/journal", this, actorId);
|
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this);
|
||||||
propPacketUtil.AddProperty(String.Format("playerWork.questGuildleve[{0}]", slot));
|
propPacketUtil.AddProperty(String.Format("work.guildleveId[{0}]", slot));
|
||||||
|
QueuePackets(propPacketUtil.Done());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void SendGuildleveMarkClientUpdate(int slot)
|
||||||
|
{
|
||||||
|
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("work/guildleve", this);
|
||||||
|
propPacketUtil.AddProperty(String.Format("work.guildleveDone[{0}]", slot));
|
||||||
|
propPacketUtil.AddProperty(String.Format("work.guildleveChecked[{0}]", slot));
|
||||||
QueuePackets(propPacketUtil.Done());
|
QueuePackets(propPacketUtil.Done());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1424,33 +1449,37 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
if (!ownedDirectors.Contains(director))
|
if (!ownedDirectors.Contains(director))
|
||||||
{
|
{
|
||||||
ownedDirectors.Add(director);
|
ownedDirectors.Add(director);
|
||||||
director.AddChild(this);
|
director.AddMember(this);
|
||||||
|
|
||||||
if (spawnImmediatly)
|
|
||||||
{
|
|
||||||
director.GetSpawnPackets(actorId).DebugPrintPacket();
|
|
||||||
QueuePacket(director.GetSpawnPackets(actorId));
|
|
||||||
QueuePacket(director.GetInitPackets(actorId));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendDirectorPackets(Director director)
|
public void SendDirectorPackets(Director director)
|
||||||
{
|
{
|
||||||
director.GetSpawnPackets(actorId).DebugPrintPacket();
|
QueuePackets(director.GetSpawnPackets());
|
||||||
QueuePacket(director.GetSpawnPackets(actorId));
|
QueuePackets(director.GetInitPackets());
|
||||||
QueuePacket(director.GetInitPackets(actorId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveDirector(Director director)
|
public void RemoveDirector(Director director)
|
||||||
{
|
{
|
||||||
if (!ownedDirectors.Contains(director))
|
if (ownedDirectors.Contains(director))
|
||||||
{
|
{
|
||||||
|
QueuePacket(RemoveActorPacket.BuildPacket(director.actorId));
|
||||||
ownedDirectors.Remove(director);
|
ownedDirectors.Remove(director);
|
||||||
director.RemoveChild(this);
|
director.RemoveMember(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GuildleveDirector GetGuildleveDirector()
|
||||||
|
{
|
||||||
|
foreach (Director d in ownedDirectors)
|
||||||
|
{
|
||||||
|
if (d is GuildleveDirector)
|
||||||
|
return (GuildleveDirector)d;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public Director GetDirector(string directorName)
|
public Director GetDirector(string directorName)
|
||||||
{
|
{
|
||||||
foreach (Director d in ownedDirectors)
|
foreach (Director d in ownedDirectors)
|
||||||
@ -1481,15 +1510,15 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
QueuePacket(InventoryBeginChangePacket.BuildPacket(toBeExamined.actorId, actorId));
|
QueuePacket(InventoryBeginChangePacket.BuildPacket(toBeExamined.actorId));
|
||||||
toBeExamined.GetEquipment().SendCheckEquipmentToPlayer(this);
|
toBeExamined.GetEquipment().SendCheckEquipmentToPlayer(this);
|
||||||
QueuePacket(InventoryEndChangePacket.BuildPacket(toBeExamined.actorId, actorId));
|
QueuePacket(InventoryEndChangePacket.BuildPacket(toBeExamined.actorId));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendDataPacket(params object[] parameters)
|
public void SendDataPacket(params object[] parameters)
|
||||||
{
|
{
|
||||||
List<LuaParam> lParams = LuaUtils.CreateLuaParamList(parameters);
|
List<LuaParam> lParams = LuaUtils.CreateLuaParamList(parameters);
|
||||||
SubPacket spacket = InfoRequestResponsePacket.BuildPacket(actorId, actorId, lParams);
|
SubPacket spacket = InfoRequestResponsePacket.BuildPacket(actorId, lParams);
|
||||||
spacket.DebugPrintSubPacket();
|
spacket.DebugPrintSubPacket();
|
||||||
QueuePacket(spacket);
|
QueuePacket(spacket);
|
||||||
}
|
}
|
||||||
@ -1517,7 +1546,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
|
|
||||||
public void SetEventStatus(Actor actor, string conditionName, bool enabled, byte unknown)
|
public void SetEventStatus(Actor actor, string conditionName, bool enabled, byte unknown)
|
||||||
{
|
{
|
||||||
QueuePacket(packets.send.actor.events.SetEventStatus.BuildPacket(actorId, actor.actorId, enabled, unknown, conditionName));
|
QueuePacket(packets.send.actor.events.SetEventStatus.BuildPacket(actor.actorId, enabled, unknown, conditionName));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RunEventFunction(string functionName, params object[] parameters)
|
public void RunEventFunction(string functionName, params object[] parameters)
|
||||||
|
@ -18,24 +18,24 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
this.className = "Debug";
|
this.className = "Debug";
|
||||||
}
|
}
|
||||||
|
|
||||||
public override SubPacket CreateScriptBindPacket(uint playerActorId)
|
public override SubPacket CreateScriptBindPacket()
|
||||||
{
|
{
|
||||||
List<LuaParam> lParams;
|
List<LuaParam> lParams;
|
||||||
lParams = LuaUtils.CreateLuaParamList("/System/Debug.prog", false, false, false, false, true, 0xC51F, true, true);
|
lParams = LuaUtils.CreateLuaParamList("/System/Debug.prog", false, false, false, false, true, 0xC51F, true, true);
|
||||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BasePacket GetSpawnPackets(uint playerActorId)
|
public override List<SubPacket> GetSpawnPackets()
|
||||||
{
|
{
|
||||||
List<SubPacket> subpackets = new List<SubPacket>();
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
subpackets.Add(CreateAddActorPacket(playerActorId, 0));
|
subpackets.Add(CreateAddActorPacket(0));
|
||||||
subpackets.Add(CreateSpeedPacket(playerActorId));
|
subpackets.Add(CreateSpeedPacket());
|
||||||
subpackets.Add(CreateSpawnPositonPacket(playerActorId, 0x1));
|
subpackets.Add(CreateSpawnPositonPacket(0x1));
|
||||||
subpackets.Add(CreateNamePacket(playerActorId));
|
subpackets.Add(CreateNamePacket());
|
||||||
subpackets.Add(CreateStatePacket(playerActorId));
|
subpackets.Add(CreateStatePacket());
|
||||||
subpackets.Add(CreateIsZoneingPacket(playerActorId));
|
subpackets.Add(CreateIsZoneingPacket());
|
||||||
subpackets.Add(CreateScriptBindPacket(playerActorId));
|
subpackets.Add(CreateScriptBindPacket());
|
||||||
return BasePacket.CreatePacket(subpackets, true, false);
|
return subpackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,17 +15,23 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||||||
{
|
{
|
||||||
private uint directorId;
|
private uint directorId;
|
||||||
private string directorScriptPath;
|
private string directorScriptPath;
|
||||||
private List<Actor> childrenOwners = new List<Actor>();
|
private List<Actor> members = new List<Actor>();
|
||||||
private bool isCreated = false;
|
private bool isCreated = false;
|
||||||
|
private bool isDeleted = false;
|
||||||
|
private bool isDeleting = false;
|
||||||
|
|
||||||
public Director(uint id, Area zone, string directorPath)
|
private Script directorScript;
|
||||||
|
private Coroutine currentCoroutine;
|
||||||
|
|
||||||
|
public Director(uint id, Area zone, string directorPath, params object[] args)
|
||||||
: base((6 << 28 | zone.actorId << 19 | (uint)id))
|
: base((6 << 28 | zone.actorId << 19 | (uint)id))
|
||||||
{
|
{
|
||||||
directorId = id;
|
directorId = id;
|
||||||
this.zone = zone;
|
this.zone = zone;
|
||||||
|
this.zoneId = zone.actorId;
|
||||||
directorScriptPath = directorPath;
|
directorScriptPath = directorPath;
|
||||||
DoActorInit(directorScriptPath);
|
|
||||||
GenerateActorName((int)id);
|
LoadLuaScript();
|
||||||
|
|
||||||
eventConditions = new EventList();
|
eventConditions = new EventList();
|
||||||
eventConditions.noticeEventConditions = new List<EventList.NoticeEventCondition>();
|
eventConditions.noticeEventConditions = new List<EventList.NoticeEventCondition>();
|
||||||
@ -34,7 +40,7 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||||||
eventConditions.noticeEventConditions.Add(new EventList.NoticeEventCondition("reqForChild", 0x0, 0x1));
|
eventConditions.noticeEventConditions.Add(new EventList.NoticeEventCondition("reqForChild", 0x0, 0x1));
|
||||||
}
|
}
|
||||||
|
|
||||||
public override SubPacket CreateScriptBindPacket(uint playerActorId)
|
public override SubPacket CreateScriptBindPacket()
|
||||||
{
|
{
|
||||||
List<LuaParam> actualLParams = new List<LuaParam>();
|
List<LuaParam> actualLParams = new List<LuaParam>();
|
||||||
actualLParams.Insert(0, new LuaParam(2, classPath));
|
actualLParams.Insert(0, new LuaParam(2, classPath));
|
||||||
@ -48,28 +54,30 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||||||
for (int i = 1; i < lparams.Count; i++)
|
for (int i = 1; i < lparams.Count; i++)
|
||||||
actualLParams.Add(lparams[i]);
|
actualLParams.Add(lparams[i]);
|
||||||
|
|
||||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, actualLParams);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, actualLParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BasePacket GetSpawnPackets(uint playerActorId, ushort spawnType)
|
public override List<SubPacket> GetSpawnPackets(ushort spawnType = 1)
|
||||||
{
|
{
|
||||||
List<SubPacket> subpackets = new List<SubPacket>();
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
subpackets.Add(CreateAddActorPacket(playerActorId, 0));
|
subpackets.Add(CreateAddActorPacket(0));
|
||||||
subpackets.AddRange(GetEventConditionPackets(playerActorId));
|
subpackets.AddRange(GetEventConditionPackets());
|
||||||
subpackets.Add(CreateSpeedPacket(playerActorId));
|
subpackets.Add(CreateSpeedPacket());
|
||||||
subpackets.Add(CreateSpawnPositonPacket(playerActorId, 0));
|
subpackets.Add(CreateSpawnPositonPacket(0));
|
||||||
subpackets.Add(CreateNamePacket(playerActorId));
|
subpackets.Add(CreateNamePacket());
|
||||||
subpackets.Add(CreateStatePacket(playerActorId));
|
subpackets.Add(CreateStatePacket());
|
||||||
subpackets.Add(CreateIsZoneingPacket(playerActorId));
|
subpackets.Add(CreateIsZoneingPacket());
|
||||||
subpackets.Add(CreateScriptBindPacket(playerActorId));
|
subpackets.Add(CreateScriptBindPacket());
|
||||||
return BasePacket.CreatePacket(subpackets, true, false);
|
return subpackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BasePacket GetInitPackets(uint playerActorId)
|
public override List<SubPacket> GetInitPackets()
|
||||||
{
|
{
|
||||||
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
SetActorPropetyPacket initProperties = new SetActorPropetyPacket("/_init");
|
SetActorPropetyPacket initProperties = new SetActorPropetyPacket("/_init");
|
||||||
initProperties.AddTarget();
|
initProperties.AddTarget();
|
||||||
return BasePacket.CreatePacket(initProperties.BuildPacket(playerActorId, actorId), true, false);
|
subpackets.Add(initProperties.BuildPacket(actorId));
|
||||||
|
return subpackets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnTalkEvent(Player player, Npc npc)
|
public void OnTalkEvent(Player player, Npc npc)
|
||||||
@ -82,43 +90,91 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||||||
LuaEngine.GetInstance().CallLuaFunction(player, this, "onCommandEvent", false, command);
|
LuaEngine.GetInstance().CallLuaFunction(player, this, "onCommandEvent", false, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DoActorInit(string directorPath)
|
public void StartDirector(bool spawnImmediate, params object[] args)
|
||||||
{
|
{
|
||||||
List<LuaParam> lparams = LuaEngine.GetInstance().CallLuaFunctionForReturn(null, this, "init", false);
|
object[] args2 = new object[args.Length + 1];
|
||||||
|
args2[0] = this;
|
||||||
|
Array.Copy(args, 0, args2, 1, args.Length);
|
||||||
|
|
||||||
|
List<LuaParam> lparams = CallLuaScript("init", args2);
|
||||||
|
|
||||||
if (lparams.Count >= 1 && lparams[0].value is string)
|
if (lparams.Count >= 1 && lparams[0].value is string)
|
||||||
{
|
{
|
||||||
classPath = (string)lparams[0].value;
|
classPath = (string)lparams[0].value;
|
||||||
className = classPath.Substring(classPath.LastIndexOf("/") + 1);
|
className = classPath.Substring(classPath.LastIndexOf("/") + 1);
|
||||||
|
GenerateActorName((int)directorId);
|
||||||
isCreated = true;
|
isCreated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isCreated && spawnImmediate)
|
||||||
|
{
|
||||||
|
foreach (Player p in GetPlayerMembers())
|
||||||
|
{
|
||||||
|
p.QueuePackets(GetSpawnPackets());
|
||||||
|
p.QueuePackets(GetInitPackets());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this is GuildleveDirector)
|
||||||
|
((GuildleveDirector)this).LoadGuildleve();
|
||||||
|
|
||||||
|
StartCoroutine("main", this);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddChild(Actor actor)
|
public void EndDirector()
|
||||||
{
|
{
|
||||||
if (!childrenOwners.Contains(actor))
|
isDeleting = true;
|
||||||
childrenOwners.Add(actor);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RemoveChild(Actor actor)
|
if (this is GuildleveDirector)
|
||||||
{
|
((GuildleveDirector)this).EndGuildleveDirector();
|
||||||
if (childrenOwners.Contains(actor))
|
|
||||||
childrenOwners.Remove(actor);
|
|
||||||
if (childrenOwners.Count == 0)
|
|
||||||
Server.GetWorldManager().GetZone(zoneId).DeleteDirector(actorId);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RemoveChildren()
|
List<Actor> players = GetPlayerMembers();
|
||||||
{
|
foreach (Actor player in players)
|
||||||
childrenOwners.Clear();
|
((Player)player).RemoveDirector(this);
|
||||||
|
members.Clear();
|
||||||
|
isDeleted = true;
|
||||||
Server.GetWorldManager().GetZone(zoneId).DeleteDirector(actorId);
|
Server.GetWorldManager().GetZone(zoneId).DeleteDirector(actorId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void AddMember(Actor actor)
|
||||||
|
{
|
||||||
|
if (!members.Contains(actor))
|
||||||
|
members.Add(actor);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void RemoveMember(Actor actor)
|
||||||
|
{
|
||||||
|
if (members.Contains(actor))
|
||||||
|
members.Remove(actor);
|
||||||
|
if (GetPlayerMembers().Count == 0 && !isDeleting)
|
||||||
|
EndDirector();
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Actor> GetMembers()
|
||||||
|
{
|
||||||
|
return members;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Actor> GetPlayerMembers()
|
||||||
|
{
|
||||||
|
return members.FindAll(s => s is Player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Actor> GetNpcMembers()
|
||||||
|
{
|
||||||
|
return members.FindAll(s => s is Npc);
|
||||||
|
}
|
||||||
|
|
||||||
public bool IsCreated()
|
public bool IsCreated()
|
||||||
{
|
{
|
||||||
return isCreated;
|
return isCreated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool IsDeleted()
|
||||||
|
{
|
||||||
|
return isDeleted;
|
||||||
|
}
|
||||||
|
|
||||||
public void GenerateActorName(int actorNumber)
|
public void GenerateActorName(int actorNumber)
|
||||||
{
|
{
|
||||||
//Format Class Name
|
//Format Class Name
|
||||||
@ -166,5 +222,45 @@ namespace FFXIVClassic_Map_Server.actors.director
|
|||||||
return directorScriptPath;
|
return directorScriptPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LoadLuaScript()
|
||||||
|
{
|
||||||
|
string luaPath = String.Format(LuaEngine.FILEPATH_DIRECTORS, GetScriptPath());
|
||||||
|
directorScript = LuaEngine.LoadScript(luaPath);
|
||||||
|
if (directorScript == null)
|
||||||
|
Program.Log.Error("Could not find script for director {0}.", GetName());
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<LuaParam> CallLuaScript(string funcName, params object[] args)
|
||||||
|
{
|
||||||
|
if (directorScript != null)
|
||||||
|
{
|
||||||
|
if (!directorScript.Globals.Get(funcName).IsNil())
|
||||||
|
{
|
||||||
|
DynValue result = directorScript.Call(directorScript.Globals[funcName], args);
|
||||||
|
List<LuaParam> lparams = LuaUtils.CreateLuaParamList(result);
|
||||||
|
return lparams;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Program.Log.Error("Could not find script for director {0}.", GetName());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<LuaParam> StartCoroutine(string funcName, params object[] args)
|
||||||
|
{
|
||||||
|
if (directorScript != null)
|
||||||
|
{
|
||||||
|
if (!directorScript.Globals.Get(funcName).IsNil())
|
||||||
|
{
|
||||||
|
currentCoroutine = directorScript.CreateCoroutine(directorScript.Globals[funcName]).Coroutine;
|
||||||
|
DynValue value = currentCoroutine.Resume(args);
|
||||||
|
LuaEngine.GetInstance().ResolveResume(null, currentCoroutine, value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Program.Log.Error("Could not find script for director {0}.", GetName());
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
258
FFXIVClassic Map Server/actors/director/GuildleveDirector.cs
Normal file
258
FFXIVClassic Map Server/actors/director/GuildleveDirector.cs
Normal file
@ -0,0 +1,258 @@
|
|||||||
|
using FFXIVClassic.Common;
|
||||||
|
using FFXIVClassic_Map_Server.actors.area;
|
||||||
|
using FFXIVClassic_Map_Server.actors.director.Work;
|
||||||
|
using FFXIVClassic_Map_Server.actors.group;
|
||||||
|
using FFXIVClassic_Map_Server.Actors;
|
||||||
|
using FFXIVClassic_Map_Server.dataobjects;
|
||||||
|
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.director
|
||||||
|
{
|
||||||
|
class GuildleveDirector : Director
|
||||||
|
{
|
||||||
|
public uint guildleveId;
|
||||||
|
public Player guildleveOwner;
|
||||||
|
public byte selectedDifficulty;
|
||||||
|
public ContentGroup contentGroup;
|
||||||
|
|
||||||
|
public GuildleveData guildleveData;
|
||||||
|
public GuildleveWork guildleveWork = new GuildleveWork();
|
||||||
|
|
||||||
|
public bool isEnded = false;
|
||||||
|
public uint completionTime = 0;
|
||||||
|
|
||||||
|
public GuildleveDirector(uint id, Area zone, string directorPath, uint guildleveId, byte selectedDifficulty, Player guildleveOwner, params object[] args)
|
||||||
|
: base(id, zone, directorPath, args)
|
||||||
|
{
|
||||||
|
this.guildleveId = guildleveId;
|
||||||
|
this.selectedDifficulty = selectedDifficulty;
|
||||||
|
this.guildleveData = Server.GetGuildleveGamedata(guildleveId);
|
||||||
|
this.guildleveOwner = guildleveOwner;
|
||||||
|
|
||||||
|
guildleveWork.aimNum[0] = guildleveData.aimNum[0];
|
||||||
|
guildleveWork.aimNum[1] = guildleveData.aimNum[1];
|
||||||
|
guildleveWork.aimNum[2] = guildleveData.aimNum[2];
|
||||||
|
guildleveWork.aimNum[3] = guildleveData.aimNum[3];
|
||||||
|
|
||||||
|
if (guildleveWork.aimNum[0] != 0)
|
||||||
|
guildleveWork.uiState[0] = 1;
|
||||||
|
if (guildleveWork.aimNum[1] != 0)
|
||||||
|
guildleveWork.uiState[1] = 1;
|
||||||
|
if (guildleveWork.aimNum[2] != 0)
|
||||||
|
guildleveWork.uiState[2] = 1;
|
||||||
|
if (guildleveWork.aimNum[3] != 0)
|
||||||
|
guildleveWork.uiState[3] = 1;
|
||||||
|
|
||||||
|
guildleveWork.aimNumNow[0] = guildleveWork.aimNumNow[1] = guildleveWork.aimNumNow[2] = guildleveWork.aimNumNow[3] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void LoadGuildleve()
|
||||||
|
{
|
||||||
|
contentGroup = Server.GetWorldManager().CreateGLContentGroup(this, GetMembers());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void StartGuildleve()
|
||||||
|
{
|
||||||
|
foreach (Actor p in GetPlayerMembers())
|
||||||
|
{
|
||||||
|
Player player = (Player) p;
|
||||||
|
|
||||||
|
//Set music
|
||||||
|
if (guildleveData.location == 1)
|
||||||
|
player.ChangeMusic(22);
|
||||||
|
else if (guildleveData.location == 2)
|
||||||
|
player.ChangeMusic(14);
|
||||||
|
else if (guildleveData.location == 3)
|
||||||
|
player.ChangeMusic(26);
|
||||||
|
else if (guildleveData.location == 4)
|
||||||
|
player.ChangeMusic(16);
|
||||||
|
|
||||||
|
//Show Start Messages
|
||||||
|
player.SendGameMessage(Server.GetWorldManager().GetActor(), 50022, 0x20, guildleveId, selectedDifficulty);
|
||||||
|
player.SendDataPacket("attention", Server.GetWorldManager().GetActor(), "", 50022, guildleveId, selectedDifficulty);
|
||||||
|
player.SendGameMessage(Server.GetWorldManager().GetActor(), 50026, 0x20, (object)(int)guildleveData.timeLimit);
|
||||||
|
}
|
||||||
|
|
||||||
|
guildleveWork.startTime = Utils.UnixTimeStampUTC();
|
||||||
|
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/start", this);
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.startTime");
|
||||||
|
SendPacketsToPlayers(propertyBuilder.Done());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void EndGuildleve(bool wasCompleted)
|
||||||
|
{
|
||||||
|
if (isEnded)
|
||||||
|
return;
|
||||||
|
isEnded = true;
|
||||||
|
|
||||||
|
completionTime = Utils.UnixTimeStampUTC() - guildleveWork.startTime;
|
||||||
|
|
||||||
|
if (wasCompleted)
|
||||||
|
{
|
||||||
|
foreach (Actor a in GetPlayerMembers())
|
||||||
|
{
|
||||||
|
Player player = (Player)a;
|
||||||
|
player.MarkGuildleve(guildleveId, true, true);
|
||||||
|
player.PlayAnimation(0x02000002, true);
|
||||||
|
player.ChangeMusic(81);
|
||||||
|
player.SendGameMessage(Server.GetWorldManager().GetActor(), 50023, 0x20, (object)(int)guildleveId);
|
||||||
|
player.SendDataPacket("attention", Server.GetWorldManager().GetActor(), "", 50023, (object)(int)guildleveId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (Actor a in GetNpcMembers())
|
||||||
|
{
|
||||||
|
Npc npc = (Npc)a;
|
||||||
|
npc.Despawn();
|
||||||
|
RemoveMember(a);
|
||||||
|
}
|
||||||
|
|
||||||
|
guildleveWork.startTime = 0;
|
||||||
|
guildleveWork.signal = -1;
|
||||||
|
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/signal", this);
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.signal");
|
||||||
|
propertyBuilder.NewTarget("guildleveWork/start");
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.startTime");
|
||||||
|
SendPacketsToPlayers(propertyBuilder.Done());
|
||||||
|
|
||||||
|
if (wasCompleted)
|
||||||
|
{
|
||||||
|
Npc aetheryteNode = zone.SpawnActor(1200040, String.Format("{0}:warpExit", guildleveOwner.actorName), guildleveOwner.positionX, guildleveOwner.positionY, guildleveOwner.positionZ);
|
||||||
|
contentGroup.AddMember(aetheryteNode);
|
||||||
|
|
||||||
|
foreach (Actor a in GetPlayerMembers())
|
||||||
|
{
|
||||||
|
Player player = (Player)a;
|
||||||
|
player.SendGameMessage(Server.GetWorldManager().GetActor(), 50029, 0x20);
|
||||||
|
player.SendGameMessage(Server.GetWorldManager().GetActor(), 50032, 0x20);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void AbandonGuildleve()
|
||||||
|
{
|
||||||
|
foreach (Actor p in GetPlayerMembers())
|
||||||
|
{
|
||||||
|
Player player = (Player)p;
|
||||||
|
player.SendGameMessage(Server.GetWorldManager().GetActor(), 50147, 0x20, (object)guildleveId);
|
||||||
|
player.MarkGuildleve(guildleveId, true, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
EndGuildleve(false);
|
||||||
|
EndDirector();
|
||||||
|
}
|
||||||
|
|
||||||
|
//Delete ContentGroup, change music back
|
||||||
|
public void EndGuildleveDirector()
|
||||||
|
{
|
||||||
|
contentGroup.DeleteGroup();
|
||||||
|
foreach (Actor p in GetPlayerMembers())
|
||||||
|
{
|
||||||
|
Player player = (Player)p;
|
||||||
|
player.ChangeMusic(player.GetZone().bgmDay);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SyncAllInfo()
|
||||||
|
{
|
||||||
|
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this);
|
||||||
|
|
||||||
|
if (guildleveWork.aimNum[0] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.aimNum[0]");
|
||||||
|
if (guildleveWork.aimNum[1] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.aimNum[1]");
|
||||||
|
if (guildleveWork.aimNum[2] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.aimNum[2]");
|
||||||
|
if (guildleveWork.aimNum[3] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.aimNum[3]");
|
||||||
|
|
||||||
|
if (guildleveWork.aimNumNow[0] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.aimNumNow[0]");
|
||||||
|
if (guildleveWork.aimNumNow[1] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.aimNumNow[1]");
|
||||||
|
if (guildleveWork.aimNumNow[2] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.aimNumNow[2]");
|
||||||
|
if (guildleveWork.aimNumNow[3] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.aimNumNow[3]");
|
||||||
|
|
||||||
|
if (guildleveWork.uiState[0] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.uiState[0]");
|
||||||
|
if (guildleveWork.uiState[1] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.uiState[1]");
|
||||||
|
if (guildleveWork.uiState[2] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.uiState[2]");
|
||||||
|
if (guildleveWork.uiState[3] != 0)
|
||||||
|
propertyBuilder.AddProperty("guildleveWork.uiState[3]");
|
||||||
|
|
||||||
|
SendPacketsToPlayers(propertyBuilder.Done());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateAimNumNow(int index, sbyte value)
|
||||||
|
{
|
||||||
|
guildleveWork.aimNumNow[index] = value;
|
||||||
|
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this);
|
||||||
|
propertyBuilder.AddProperty(String.Format("guildleveWork.aimNumNow[{0}]", index));
|
||||||
|
SendPacketsToPlayers(propertyBuilder.Done());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateUiState(int index, sbyte value)
|
||||||
|
{
|
||||||
|
guildleveWork.uiState[index] = value;
|
||||||
|
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/infoVariable", this);
|
||||||
|
propertyBuilder.AddProperty(String.Format("guildleveWork.uiState[{0}]", index));
|
||||||
|
SendPacketsToPlayers(propertyBuilder.Done());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UpdateMarkers(int markerIndex, float x, float y, float z)
|
||||||
|
{
|
||||||
|
guildleveWork.markerX[markerIndex] = x;
|
||||||
|
guildleveWork.markerY[markerIndex] = y;
|
||||||
|
guildleveWork.markerZ[markerIndex] = z;
|
||||||
|
ActorPropertyPacketUtil propertyBuilder = new ActorPropertyPacketUtil("guildleveWork/marker", this);
|
||||||
|
propertyBuilder.AddProperty(String.Format("guildleveWork.markerX[{0}]", markerIndex));
|
||||||
|
propertyBuilder.AddProperty(String.Format("guildleveWork.markerY[{0}]", markerIndex));
|
||||||
|
propertyBuilder.AddProperty(String.Format("guildleveWork.markerZ[{0}]", markerIndex));
|
||||||
|
SendPacketsToPlayers(propertyBuilder.Done());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SendPacketsToPlayers(List<SubPacket> packets)
|
||||||
|
{
|
||||||
|
List<Actor> players = GetPlayerMembers();
|
||||||
|
foreach (Actor p in players)
|
||||||
|
{
|
||||||
|
((Player)p).QueuePackets(packets);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint GlBorderIconIDToAnimID(uint iconId)
|
||||||
|
{
|
||||||
|
return iconId - 20000;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint GlPlateIconIDToAnimID(uint iconId)
|
||||||
|
{
|
||||||
|
return iconId - 20020;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint GetGLStartAnimationFromSheet(uint border, uint plate, bool isBoost)
|
||||||
|
{
|
||||||
|
return GetGLStartAnimation(GlBorderIconIDToAnimID(border), GlPlateIconIDToAnimID(plate), isBoost);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static uint GetGLStartAnimation(uint border, uint plate, bool isBoost)
|
||||||
|
{
|
||||||
|
uint borderBits = border;
|
||||||
|
uint plateBits = plate << 7;
|
||||||
|
|
||||||
|
uint boostBits = isBoost ? (uint)0x8000 : (uint) 0;
|
||||||
|
|
||||||
|
return 0x0B000000 | boostBits | plateBits | borderBits;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.actors.director.Work
|
||||||
|
{
|
||||||
|
|
||||||
|
class GuildleveWork
|
||||||
|
{
|
||||||
|
public uint startTime = 0;
|
||||||
|
public sbyte[] aimNum = new sbyte[4];
|
||||||
|
public sbyte[] aimNumNow = new sbyte[4];
|
||||||
|
public sbyte[] uiState = new sbyte[4];
|
||||||
|
public float[] markerX = new float[3];
|
||||||
|
public float[] markerY = new float[3];
|
||||||
|
public float[] markerZ = new float[3];
|
||||||
|
public sbyte signal;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -25,7 +25,13 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||||||
if (initialMembers != null)
|
if (initialMembers != null)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < initialMembers.Length; i++)
|
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]);
|
members.Add(initialMembers[i]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.director = director;
|
this.director = director;
|
||||||
@ -38,11 +44,10 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
members.Add(actor.actorId);
|
members.Add(actor.actorId);
|
||||||
|
|
||||||
if (actor is Character)
|
if (actor is Character)
|
||||||
{
|
|
||||||
((Character)actor).SetCurrentContentGroup(this);
|
((Character)actor).SetCurrentContentGroup(this);
|
||||||
SendCurrentContentSync(actor);
|
|
||||||
}
|
|
||||||
SendGroupPacketsAll(members);
|
SendGroupPacketsAll(members);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,7 +84,7 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||||||
|
|
||||||
SubPacket test = groupWork.buildPacket(session.id, session.id);
|
SubPacket test = groupWork.buildPacket(session.id, session.id);
|
||||||
test.DebugPrintSubPacket();
|
test.DebugPrintSubPacket();
|
||||||
session.QueuePacket(test, true, false);
|
session.QueuePacket(test);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void SendGroupPackets(Session session)
|
public override void SendGroupPackets(Session session)
|
||||||
@ -87,43 +92,29 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||||||
ulong time = Utils.MilisUnixTimeStampUTC();
|
ulong time = Utils.MilisUnixTimeStampUTC();
|
||||||
List<GroupMember> members = BuildMemberList(session.id);
|
List<GroupMember> members = BuildMemberList(session.id);
|
||||||
|
|
||||||
session.QueuePacket(GroupHeaderPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
session.QueuePacket(GroupHeaderPacket.buildPacket(session.id, session.GetActor().zoneId, time, this));
|
||||||
session.QueuePacket(GroupMembersBeginPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
session.QueuePacket(GroupMembersBeginPacket.buildPacket(session.id, session.GetActor().zoneId, time, this));
|
||||||
|
|
||||||
int currentIndex = 0;
|
int currentIndex = 0;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (GetMemberCount() - currentIndex >= 64)
|
if (GetMemberCount() - currentIndex >= 64)
|
||||||
session.QueuePacket(ContentMembersX64Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
session.QueuePacket(ContentMembersX64Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex));
|
||||||
else if (GetMemberCount() - currentIndex >= 32)
|
else if (GetMemberCount() - currentIndex >= 32)
|
||||||
session.QueuePacket(ContentMembersX32Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
session.QueuePacket(ContentMembersX32Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex));
|
||||||
else if (GetMemberCount() - currentIndex >= 16)
|
else if (GetMemberCount() - currentIndex >= 16)
|
||||||
session.QueuePacket(ContentMembersX16Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
session.QueuePacket(ContentMembersX16Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex));
|
||||||
else if (GetMemberCount() - currentIndex > 0)
|
else if (GetMemberCount() - currentIndex > 0)
|
||||||
session.QueuePacket(ContentMembersX08Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex), true, false);
|
session.QueuePacket(ContentMembersX08Packet.buildPacket(session.id, session.GetActor().zoneId, time, members, ref currentIndex));
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
session.QueuePacket(GroupMembersEndPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
session.QueuePacket(GroupMembersEndPacket.buildPacket(session.id, session.GetActor().zoneId, time, this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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()
|
public override uint GetTypeId()
|
||||||
{
|
{
|
||||||
return Group.ContentGroup_SimpleContentGroup24B;
|
return Group.ContentGroup_SimpleContentGroup24B;
|
||||||
@ -135,12 +126,23 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||||||
SendGroupPacketsAll(members);
|
SendGroupPacketsAll(members);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DeleteAll()
|
public void DeleteGroup()
|
||||||
{
|
{
|
||||||
SendDeletePackets(members);
|
SendDeletePackets(members);
|
||||||
|
for (int i = 0; i < members.Count; i++)
|
||||||
|
{
|
||||||
|
Session s = Server.GetServer().GetSession(members[i]);
|
||||||
|
if (s != null)
|
||||||
|
s.GetActor().SetCurrentContentGroup(null);
|
||||||
|
Actor a = director.GetZone().FindActorInArea(members[i]);
|
||||||
|
if (a is Npc)
|
||||||
|
((Npc)a).Despawn();
|
||||||
|
members.Remove(members[i]);
|
||||||
|
i--;
|
||||||
|
}
|
||||||
|
Server.GetWorldManager().DeleteContentGroup(groupIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void CheckDestroy()
|
public void CheckDestroy()
|
||||||
{
|
{
|
||||||
bool foundSession = false;
|
bool foundSession = false;
|
||||||
@ -155,7 +157,7 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!foundSession)
|
if (!foundSession)
|
||||||
Server.GetWorldManager().DeleteContentGroup(groupIndex);
|
DeleteGroup();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
29
FFXIVClassic Map Server/actors/group/GLContentGroup.cs
Normal file
29
FFXIVClassic Map Server/actors/group/GLContentGroup.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -120,33 +120,33 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||||||
ulong time = Utils.MilisUnixTimeStampUTC();
|
ulong time = Utils.MilisUnixTimeStampUTC();
|
||||||
List<GroupMember> members = BuildMemberList(session.id);
|
List<GroupMember> members = BuildMemberList(session.id);
|
||||||
|
|
||||||
session.QueuePacket(GroupHeaderPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
session.QueuePacket(GroupHeaderPacket.buildPacket(session.id, session.GetActor().zoneId, time, this));
|
||||||
session.QueuePacket(GroupMembersBeginPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
session.QueuePacket(GroupMembersBeginPacket.buildPacket(session.id, session.GetActor().zoneId, time, this));
|
||||||
|
|
||||||
int currentIndex = 0;
|
int currentIndex = 0;
|
||||||
|
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (GetMemberCount() - currentIndex >= 64)
|
if (GetMemberCount() - currentIndex >= 64)
|
||||||
session.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));
|
||||||
else if (GetMemberCount() - currentIndex >= 32)
|
else if (GetMemberCount() - currentIndex >= 32)
|
||||||
session.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));
|
||||||
else if (GetMemberCount() - currentIndex >= 16)
|
else if (GetMemberCount() - currentIndex >= 16)
|
||||||
session.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));
|
||||||
else if (GetMemberCount() - currentIndex > 0)
|
else if (GetMemberCount() - currentIndex > 0)
|
||||||
session.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));
|
||||||
else
|
else
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
session.QueuePacket(GroupMembersEndPacket.buildPacket(session.id, session.GetActor().zoneId, time, this), true, false);
|
session.QueuePacket(GroupMembersEndPacket.buildPacket(session.id, session.GetActor().zoneId, time, this));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SendDeletePacket(Session session)
|
public void SendDeletePacket(Session session)
|
||||||
{
|
{
|
||||||
if (session != null)
|
if (session != null)
|
||||||
session.QueuePacket(DeleteGroupPacket.buildPacket(session.id, this), true, false);
|
session.QueuePacket(DeleteGroupPacket.buildPacket(session.id, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void SendInitWorkValues(Session session)
|
public virtual void SendInitWorkValues(Session session)
|
||||||
|
@ -51,7 +51,7 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||||||
groupWork.setTarget("/_init");
|
groupWork.setTarget("/_init");
|
||||||
|
|
||||||
SubPacket test = groupWork.buildPacket(session.id, session.id);
|
SubPacket test = groupWork.buildPacket(session.id, session.id);
|
||||||
session.QueuePacket(test, true, false);
|
session.QueuePacket(test);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override uint GetTypeId()
|
public override uint GetTypeId()
|
||||||
|
@ -70,7 +70,7 @@ namespace FFXIVClassic_Map_Server.actors.group
|
|||||||
|
|
||||||
SubPacket test = groupWork.buildPacket(session.id, session.id);
|
SubPacket test = groupWork.buildPacket(session.id, session.id);
|
||||||
test.DebugPrintSubPacket();
|
test.DebugPrintSubPacket();
|
||||||
session.QueuePacket(test, true, false);
|
session.QueuePacket(test);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,24 +17,24 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||||||
this.className = "WorldMaster";
|
this.className = "WorldMaster";
|
||||||
}
|
}
|
||||||
|
|
||||||
public override SubPacket CreateScriptBindPacket(uint playerActorId)
|
public override SubPacket CreateScriptBindPacket()
|
||||||
{
|
{
|
||||||
List<LuaParam> lParams;
|
List<LuaParam> lParams;
|
||||||
lParams = LuaUtils.CreateLuaParamList("/World/WorldMaster_event", false, false, false, false, false, null);
|
lParams = LuaUtils.CreateLuaParamList("/World/WorldMaster_event", false, false, false, false, false, null);
|
||||||
return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams);
|
return ActorInstantiatePacket.BuildPacket(actorId, actorName, className, lParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override BasePacket GetSpawnPackets(uint playerActorId)
|
public override List<SubPacket> GetSpawnPackets()
|
||||||
{
|
{
|
||||||
List<SubPacket> subpackets = new List<SubPacket>();
|
List<SubPacket> subpackets = new List<SubPacket>();
|
||||||
subpackets.Add(CreateAddActorPacket(playerActorId, 0));
|
subpackets.Add(CreateAddActorPacket(0));
|
||||||
subpackets.Add(CreateSpeedPacket(playerActorId));
|
subpackets.Add(CreateSpeedPacket());
|
||||||
subpackets.Add(CreateSpawnPositonPacket(playerActorId, 0x1));
|
subpackets.Add(CreateSpawnPositonPacket(0x1));
|
||||||
subpackets.Add(CreateNamePacket(playerActorId));
|
subpackets.Add(CreateNamePacket());
|
||||||
subpackets.Add(CreateStatePacket(playerActorId));
|
subpackets.Add(CreateStatePacket());
|
||||||
subpackets.Add(CreateIsZoneingPacket(playerActorId));
|
subpackets.Add(CreateIsZoneingPacket());
|
||||||
subpackets.Add(CreateScriptBindPacket(playerActorId));
|
subpackets.Add(CreateScriptBindPacket());
|
||||||
return BasePacket.CreatePacket(subpackets, true, false);
|
return subpackets;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
61
FFXIVClassic Map Server/dataobjects/GuildleveData.cs
Normal file
61
FFXIVClassic Map Server/dataobjects/GuildleveData.cs
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
using MySql.Data.MySqlClient;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace FFXIVClassic_Map_Server.dataobjects
|
||||||
|
{
|
||||||
|
class GuildleveData
|
||||||
|
{
|
||||||
|
public readonly uint id;
|
||||||
|
public readonly uint classType;
|
||||||
|
public readonly uint location;
|
||||||
|
public readonly ushort factionCreditRequired;
|
||||||
|
public readonly ushort level;
|
||||||
|
public readonly uint aetheryte;
|
||||||
|
public readonly uint plateId;
|
||||||
|
public readonly uint borderId;
|
||||||
|
public readonly uint objective;
|
||||||
|
public readonly byte timeLimit;
|
||||||
|
public readonly uint skill;
|
||||||
|
public readonly byte favorCount;
|
||||||
|
|
||||||
|
public readonly sbyte[] aimNum = new sbyte[4];
|
||||||
|
public readonly uint[] itemTarget = new uint[4];
|
||||||
|
public readonly uint[] mobTarget = new uint[4];
|
||||||
|
|
||||||
|
public GuildleveData(MySqlDataReader reader)
|
||||||
|
{
|
||||||
|
id = reader.GetUInt32("id");
|
||||||
|
classType = reader.GetUInt32("classType");
|
||||||
|
location = reader.GetUInt32("location");
|
||||||
|
factionCreditRequired = reader.GetUInt16("factionCreditRequired");
|
||||||
|
level = reader.GetUInt16("level");
|
||||||
|
aetheryte = reader.GetUInt32("aetheryte");
|
||||||
|
plateId = reader.GetUInt32("plateId");
|
||||||
|
borderId = reader.GetUInt32("borderId");
|
||||||
|
objective = reader.GetUInt32("objective");
|
||||||
|
timeLimit = reader.GetByte("timeLimit");
|
||||||
|
skill = reader.GetUInt32("skill");
|
||||||
|
favorCount = reader.GetByte("favorCount");
|
||||||
|
|
||||||
|
aimNum[0] = reader.GetSByte("aimNum1");
|
||||||
|
aimNum[1] = reader.GetSByte("aimNum2");
|
||||||
|
aimNum[2] = reader.GetSByte("aimNum3");
|
||||||
|
aimNum[3] = reader.GetSByte("aimNum4");
|
||||||
|
|
||||||
|
itemTarget[0] = reader.GetUInt32("item1");
|
||||||
|
itemTarget[1] = reader.GetUInt32("item2");
|
||||||
|
itemTarget[2] = reader.GetUInt32("item3");
|
||||||
|
itemTarget[3] = reader.GetUInt32("item4");
|
||||||
|
|
||||||
|
mobTarget[0] = reader.GetUInt32("mob1");
|
||||||
|
mobTarget[1] = reader.GetUInt32("mob2");
|
||||||
|
mobTarget[2] = reader.GetUInt32("mob3");
|
||||||
|
mobTarget[3] = reader.GetUInt32("mob4");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -30,7 +30,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
this.quantity = 1;
|
this.quantity = 1;
|
||||||
this.slot = slot;
|
this.slot = slot;
|
||||||
|
|
||||||
Item gItem = Server.GetItemGamedata(itemId);
|
ItemData gItem = Server.GetItemGamedata(itemId);
|
||||||
itemType = gItem.isExclusive ? (byte)0x3 : (byte)0x0;
|
itemType = gItem.isExclusive ? (byte)0x3 : (byte)0x0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ using System;
|
|||||||
|
|
||||||
namespace FFXIVClassic_Map_Server.dataobjects
|
namespace FFXIVClassic_Map_Server.dataobjects
|
||||||
{
|
{
|
||||||
class Item
|
class ItemData
|
||||||
{
|
{
|
||||||
//Basic
|
//Basic
|
||||||
public readonly uint catalogID;
|
public readonly uint catalogID;
|
||||||
@ -39,7 +39,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
public readonly int repairLevel;
|
public readonly int repairLevel;
|
||||||
public readonly int repairLicense;
|
public readonly int repairLicense;
|
||||||
|
|
||||||
public Item(MySqlDataReader reader)
|
public ItemData(MySqlDataReader reader)
|
||||||
{
|
{
|
||||||
catalogID = reader.GetUInt32("catalogID");
|
catalogID = reader.GetUInt32("catalogID");
|
||||||
name = reader.GetString("name");
|
name = reader.GetString("name");
|
||||||
@ -387,7 +387,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class EquipmentItem : Item
|
class EquipmentItem : ItemData
|
||||||
{
|
{
|
||||||
//graphics
|
//graphics
|
||||||
public readonly uint graphicsWeaponId;
|
public readonly uint graphicsWeaponId;
|
@ -28,17 +28,18 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
{
|
{
|
||||||
this.id = sessionId;
|
this.id = sessionId;
|
||||||
playerActor = new Player(this, sessionId);
|
playerActor = new Player(this, sessionId);
|
||||||
actorInstanceList.Add(playerActor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QueuePacket(BasePacket basePacket)
|
public void QueuePacket(List<SubPacket> packets)
|
||||||
{
|
{
|
||||||
Server.GetWorldConnection().QueuePacket(basePacket);
|
foreach (SubPacket s in packets)
|
||||||
|
QueuePacket(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void QueuePacket(SubPacket subPacket, bool isAuthed, bool isEncrypted)
|
public void QueuePacket(SubPacket subPacket)
|
||||||
{
|
{
|
||||||
Server.GetWorldConnection().QueuePacket(subPacket, isAuthed, isEncrypted);
|
subPacket.SetTargetId(id);
|
||||||
|
Server.GetWorldConnection().QueuePacket(subPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Player GetActor()
|
public Player GetActor()
|
||||||
@ -82,7 +83,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
playerActor.rotation = rot;
|
playerActor.rotation = rot;
|
||||||
playerActor.moveState = moveState;
|
playerActor.moveState = moveState;
|
||||||
|
|
||||||
GetActor().zone.UpdateActorPosition(GetActor());
|
GetActor().GetZone().UpdateActorPosition(GetActor());
|
||||||
playerActor.QueuePositionUpdate(new Vector3(x,y,z));
|
playerActor.QueuePositionUpdate(new Vector3(x,y,z));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -99,29 +100,11 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
//Remove missing actors
|
//Remove missing actors
|
||||||
for (int i = 0; i < actorInstanceList.Count; i++)
|
for (int i = 0; i < actorInstanceList.Count; i++)
|
||||||
{
|
{
|
||||||
if (list.Contains(actorInstanceList[i]) && actorInstanceList[i] is Npc)
|
|
||||||
{
|
|
||||||
Npc npc = (Npc)actorInstanceList[i];
|
|
||||||
|
|
||||||
|
|
||||||
long milliseconds = DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond;
|
|
||||||
|
|
||||||
|
|
||||||
if (npc.GetUniqueId().Equals("1") && milliseconds - lastMilis > 1000)
|
|
||||||
{
|
|
||||||
lastMilis = milliseconds;
|
|
||||||
GetActor().QueuePacket(RemoveActorPacket.BuildPacket(playerActor.actorId, actorInstanceList[i].actorId));
|
|
||||||
actorInstanceList.RemoveAt(i);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!list.Contains(actorInstanceList[i]))
|
if (!list.Contains(actorInstanceList[i]))
|
||||||
{
|
{
|
||||||
GetActor().QueuePacket(RemoveActorPacket.BuildPacket(playerActor.actorId, actorInstanceList[i].actorId));
|
QueuePacket(RemoveActorPacket.BuildPacket(actorInstanceList[i].actorId));
|
||||||
actorInstanceList.RemoveAt(i);
|
actorInstanceList.RemoveAt(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Add new actors or move
|
//Add new actors or move
|
||||||
@ -139,16 +122,14 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
if (actor is Character && ((Character)actor).isStatic)
|
if (actor is Character && ((Character)actor).isStatic)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var packet = actor.CreatePositionUpdatePacket(playerActor.actorId);
|
QueuePacket(actor.CreatePositionUpdatePacket());
|
||||||
|
|
||||||
if (packet != null)
|
|
||||||
GetActor().QueuePacket(packet);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GetActor().QueuePacket(actor.GetSpawnPackets(playerActor.actorId, 1));
|
QueuePacket(actor.GetSpawnPackets(playerActor, 1));
|
||||||
GetActor().QueuePacket(actor.GetInitPackets(playerActor.actorId));
|
|
||||||
GetActor().QueuePacket(actor.GetSetEventStatusPackets(playerActor.actorId));
|
QueuePacket(actor.GetInitPackets());
|
||||||
|
QueuePacket(actor.GetSetEventStatusPackets());
|
||||||
actorInstanceList.Add(actor);
|
actorInstanceList.Add(actor);
|
||||||
|
|
||||||
if (actor is Npc)
|
if (actor is Npc)
|
||||||
|
@ -17,14 +17,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
private BlockingCollection<SubPacket> SendPacketQueue = new BlockingCollection<SubPacket>(1000);
|
private BlockingCollection<SubPacket> SendPacketQueue = new BlockingCollection<SubPacket>(1000);
|
||||||
public int lastPartialSize = 0;
|
public int lastPartialSize = 0;
|
||||||
|
|
||||||
public void QueuePacket(BasePacket packet)
|
public void QueuePacket(SubPacket subpacket)
|
||||||
{
|
|
||||||
List<SubPacket> subPackets = packet.GetSubpackets();
|
|
||||||
foreach (SubPacket s in subPackets)
|
|
||||||
SendPacketQueue.Add(s);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void QueuePacket(SubPacket subpacket, bool isAuthed, bool isEncrypted)
|
|
||||||
{
|
{
|
||||||
SendPacketQueue.Add(subpacket);
|
SendPacketQueue.Add(subpacket);
|
||||||
}
|
}
|
||||||
@ -68,7 +61,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
|
|||||||
public void RequestZoneChange(uint sessionId, uint destinationZoneId, byte spawnType, float spawnX, float spawnY, float spawnZ, float spawnRotation)
|
public void RequestZoneChange(uint sessionId, uint destinationZoneId, byte spawnType, float spawnX, float spawnY, float spawnZ, float spawnRotation)
|
||||||
{
|
{
|
||||||
WorldRequestZoneChangePacket.BuildPacket(sessionId, destinationZoneId, spawnType, spawnX, spawnY, spawnZ, spawnRotation).DebugPrintSubPacket();
|
WorldRequestZoneChangePacket.BuildPacket(sessionId, destinationZoneId, spawnType, spawnX, spawnY, spawnZ, spawnRotation).DebugPrintSubPacket();
|
||||||
QueuePacket(WorldRequestZoneChangePacket.BuildPacket(sessionId, destinationZoneId, spawnType, spawnX, spawnY, spawnZ, spawnRotation), true, false);
|
QueuePacket(WorldRequestZoneChangePacket.BuildPacket(sessionId, destinationZoneId, spawnType, spawnX, spawnY, spawnZ, spawnRotation));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,13 +21,13 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
{
|
{
|
||||||
class LuaEngine
|
class LuaEngine
|
||||||
{
|
{
|
||||||
const string FILEPATH_PLAYER = "./scripts/player.lua";
|
public const string FILEPATH_PLAYER = "./scripts/player.lua";
|
||||||
const string FILEPATH_ZONE = "./scripts/unique/{0}/zone.lua";
|
public const string FILEPATH_ZONE = "./scripts/unique/{0}/zone.lua";
|
||||||
const string FILEPATH_CONTENT = "./scripts/content/{0}.lua";
|
public const string FILEPATH_CONTENT = "./scripts/content/{0}.lua";
|
||||||
const string FILEPATH_COMMANDS = "./scripts/commands/{0}.lua";
|
public const string FILEPATH_COMMANDS = "./scripts/commands/{0}.lua";
|
||||||
const string FILEPATH_DIRECTORS = "./scripts/directors/{0}.lua";
|
public const string FILEPATH_DIRECTORS = "./scripts/directors/{0}.lua";
|
||||||
const string FILEPATH_NPCS = "./scripts/unique/{0}/{1}/{2}.lua";
|
public const string FILEPATH_NPCS = "./scripts/unique/{0}/{1}/{2}.lua";
|
||||||
const string FILEPATH_QUEST = "./scripts/quests/{0}/{1}.lua";
|
public const string FILEPATH_QUEST = "./scripts/quests/{0}/{1}.lua";
|
||||||
|
|
||||||
private static LuaEngine mThisEngine;
|
private static LuaEngine mThisEngine;
|
||||||
private Dictionary<Coroutine, ulong> mSleepingOnTime = new Dictionary<Coroutine, ulong>();
|
private Dictionary<Coroutine, ulong> mSleepingOnTime = new Dictionary<Coroutine, ulong>();
|
||||||
@ -112,10 +112,18 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
{
|
{
|
||||||
if (mSleepingOnPlayerEvent.ContainsKey(player.actorId))
|
if (mSleepingOnPlayerEvent.ContainsKey(player.actorId))
|
||||||
{
|
{
|
||||||
Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId];
|
try
|
||||||
mSleepingOnPlayerEvent.Remove(player.actorId);
|
{
|
||||||
DynValue value = coroutine.Resume(LuaUtils.CreateLuaParamObjectList(args));
|
Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId];
|
||||||
ResolveResume(null, coroutine, value);
|
mSleepingOnPlayerEvent.Remove(player.actorId);
|
||||||
|
DynValue value = coroutine.Resume(LuaUtils.CreateLuaParamObjectList(args));
|
||||||
|
ResolveResume(null, coroutine, value);
|
||||||
|
}
|
||||||
|
catch (ScriptRuntimeException e)
|
||||||
|
{
|
||||||
|
LuaEngine.SendError(player, String.Format("OnEventUpdated: {0}", e.DecoratedMessage));
|
||||||
|
player.EndEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
player.EndEvent();
|
player.EndEvent();
|
||||||
@ -366,14 +374,22 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
{
|
{
|
||||||
Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId];
|
Coroutine coroutine = mSleepingOnPlayerEvent[player.actorId];
|
||||||
mSleepingOnPlayerEvent.Remove(player.actorId);
|
mSleepingOnPlayerEvent.Remove(player.actorId);
|
||||||
DynValue value = coroutine.Resume();
|
|
||||||
ResolveResume(null, coroutine, value);
|
try{
|
||||||
|
DynValue value = coroutine.Resume();
|
||||||
|
ResolveResume(null, coroutine, value);
|
||||||
|
}
|
||||||
|
catch (ScriptRuntimeException e)
|
||||||
|
{
|
||||||
|
LuaEngine.SendError(player, String.Format("OnEventStarted: {0}", e.DecoratedMessage));
|
||||||
|
player.EndEvent();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
CallLuaFunction(player, target, "onEventStarted", false, LuaUtils.CreateLuaParamObjectList(lparams));
|
CallLuaFunction(player, target, "onEventStarted", false, LuaUtils.CreateLuaParamObjectList(lparams));
|
||||||
}
|
}
|
||||||
|
|
||||||
private DynValue ResolveResume(Actor actor, Coroutine coroutine, DynValue value)
|
public DynValue ResolveResume(Actor actor, Coroutine coroutine, DynValue value)
|
||||||
{
|
{
|
||||||
var isPlayer = actor is Player;
|
var isPlayer = actor is Player;
|
||||||
|
|
||||||
@ -579,22 +595,22 @@ namespace FFXIVClassic_Map_Server.lua
|
|||||||
script.Globals["GetStaticActor"] = (Func<string, Actor>)Server.GetStaticActors;
|
script.Globals["GetStaticActor"] = (Func<string, Actor>)Server.GetStaticActors;
|
||||||
script.Globals["GetStaticActorById"] = (Func<uint, Actor>)Server.GetStaticActors;
|
script.Globals["GetStaticActorById"] = (Func<uint, Actor>)Server.GetStaticActors;
|
||||||
script.Globals["GetWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
script.Globals["GetWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor;
|
||||||
script.Globals["GetItemGamedata"] = (Func<uint, Item>)Server.GetItemGamedata;
|
script.Globals["GetItemGamedata"] = (Func<uint, ItemData>)Server.GetItemGamedata;
|
||||||
|
script.Globals["GetGuildleveGamedata"] = (Func<uint, GuildleveData>)Server.GetGuildleveGamedata;
|
||||||
script.Globals["GetLuaInstance"] = (Func<LuaEngine>)LuaEngine.GetInstance;
|
script.Globals["GetLuaInstance"] = (Func<LuaEngine>)LuaEngine.GetInstance;
|
||||||
|
|
||||||
script.Options.DebugPrint = s => { Program.Log.Debug(s); };
|
script.Options.DebugPrint = s => { Program.Log.Debug(s); };
|
||||||
return script;
|
return script;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void SendError(Player player, string message)
|
public static void SendError(Player player, string message)
|
||||||
{
|
{
|
||||||
message = "[LuaError] " + message;
|
message = "[LuaError] " + message;
|
||||||
if (player == null)
|
if (player == null)
|
||||||
return;
|
return;
|
||||||
List<SubPacket> SendError = new List<SubPacket>();
|
List<SubPacket> SendError = new List<SubPacket>();
|
||||||
SendError.Add(EndEventPacket.BuildPacket(player.actorId, player.currentEventOwner, player.currentEventName));
|
|
||||||
player.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", message);
|
player.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", message);
|
||||||
player.playerSession.QueuePacket(BasePacket.CreatePacket(SendError, true, false));
|
player.QueuePacket(EndEventPacket.BuildPacket(player.actorId, player.currentEventOwner, player.currentEventName));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write((UInt32)master);
|
binWriter.Write((UInt32)master);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, 0, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, 0, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write((UInt32)result);
|
binWriter.Write((UInt32)result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write(Encoding.ASCII.GetBytes(lsName), 0, Encoding.ASCII.GetByteCount(lsName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(lsName));
|
binWriter.Write(Encoding.ASCII.GetBytes(lsName), 0, Encoding.ASCII.GetByteCount(lsName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(lsName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
public static SubPacket BuildPacket(Session session)
|
public static SubPacket BuildPacket(Session session)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write(Encoding.ASCII.GetBytes(linkshellName), 0, Encoding.ASCII.GetByteCount(linkshellName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(linkshellName));
|
binWriter.Write(Encoding.ASCII.GetBytes(linkshellName), 0, Encoding.ASCII.GetByteCount(linkshellName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(linkshellName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write(Encoding.ASCII.GetBytes(lsName), 0, Encoding.ASCII.GetByteCount(lsName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(lsName));
|
binWriter.Write(Encoding.ASCII.GetBytes(lsName), 0, Encoding.ASCII.GetByteCount(lsName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(lsName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write((Byte)rank);
|
binWriter.Write((Byte)rank);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, 0, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SubPacket BuildPacket(Session session, uint actorId)
|
public static SubPacket BuildPacket(Session session, uint actorId)
|
||||||
@ -39,7 +39,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write((UInt32)actorId);
|
binWriter.Write((UInt32)actorId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write((UInt16)(isDisband ? 1 : 0));
|
binWriter.Write((UInt16)(isDisband ? 1 : 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
binWriter.Write(Encoding.ASCII.GetBytes(name), 0, Encoding.ASCII.GetByteCount(name) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(name));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SubPacket BuildPacket(Session session, ushort command, uint actorId)
|
public static SubPacket BuildPacket(Session session, ushort command, uint actorId)
|
||||||
@ -38,7 +38,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send.Group
|
|||||||
binWriter.Write((UInt32)actorId);
|
binWriter.Write((UInt32)actorId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, session.id, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send
|
|||||||
binWriter.Write((UInt16)errorCode);
|
binWriter.Write((UInt16)errorCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, 0, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send
|
|||||||
binWriter.Write((UInt32)destinationZone);
|
binWriter.Write((UInt32)destinationZone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new SubPacket(true, OPCODE, 0, session.id, data);
|
return new SubPacket(true, OPCODE, session.id, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sessionId, sessionId, data);
|
return new SubPacket(OPCODE, sessionId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x00E1;
|
public const ushort OPCODE = 0x00E1;
|
||||||
public const uint PACKET_SIZE = 0x30;
|
public const uint PACKET_SIZE = 0x30;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId, uint targettedActorId, uint animationId, uint descriptionId)
|
public static SubPacket BuildPacket(uint sourceActorId, uint targettedActorId, uint animationId, uint descriptionId)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SubPacket packet = new SubPacket(OPCODE, sourceActorId, targetActorId, data);
|
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||||
packet.DebugPrintSubPacket();
|
packet.DebugPrintSubPacket();
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x00CC;
|
public const ushort OPCODE = 0x00CC;
|
||||||
public const uint PACKET_SIZE = 0x128;
|
public const uint PACKET_SIZE = 0x128;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint sourceActorID, uint targetActorID, string objectName, string className, List<LuaParam> initParams)
|
public static SubPacket BuildPacket(uint sourceActorId, string objectName, string className, List<LuaParam> initParams)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorID, targetActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x00E3;
|
public const ushort OPCODE = 0x00E3;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, int iconCode)
|
public static SubPacket BuildPacket(uint sourceActorId, int iconCode)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, targetActorID, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,12 +9,12 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x00CA;
|
public const ushort OPCODE = 0x00CA;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint actorID, byte val)
|
public static SubPacket BuildPacket(uint sourceActorId, byte val)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE-0x20];
|
byte[] data = new byte[PACKET_SIZE-0x20];
|
||||||
data[0] = val; //Why?
|
data[0] = val; //Why?
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, actorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,27 +0,0 @@
|
|||||||
using FFXIVClassic.Common;
|
|
||||||
using System.IO;
|
|
||||||
|
|
||||||
using FFXIVClassic.Common;
|
|
||||||
|
|
||||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
|
||||||
{
|
|
||||||
class BattleAction1Packet
|
|
||||||
{
|
|
||||||
public const ushort OPCODE = 0x0139;
|
|
||||||
public const uint PACKET_SIZE = 0x58;
|
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint sourceId, uint targetId)
|
|
||||||
{
|
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
|
||||||
|
|
||||||
using (MemoryStream mem = new MemoryStream(data))
|
|
||||||
{
|
|
||||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceId, targetId, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,9 +9,9 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x0007;
|
public const ushort OPCODE = 0x0007;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID)
|
public static SubPacket BuildPacket(uint sourceActorId)
|
||||||
{
|
{
|
||||||
return new SubPacket(OPCODE, playerActorID, playerActorID, new byte[8]);
|
return new SubPacket(OPCODE, sourceActorId, new byte[8]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x00CF;
|
public const ushort OPCODE = 0x00CF;
|
||||||
public const uint PACKET_SIZE = 0x50;
|
public const uint PACKET_SIZE = 0x50;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, float x, float y, float z, float rot, ushort moveState)
|
public static SubPacket BuildPacket(uint sourceActorId, float x, float y, float z, float rot, ushort moveState)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SubPacket packet = new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -12,9 +12,9 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x00DA;
|
public const ushort OPCODE = 0x00DA;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, uint animationID)
|
public static SubPacket BuildPacket(uint sourceActorId, uint animationID)
|
||||||
{
|
{
|
||||||
return new SubPacket(OPCODE, playerActorID, targetActorID, BitConverter.GetBytes((ulong)animationID));
|
return new SubPacket(OPCODE, sourceActorId, BitConverter.GetBytes((ulong)animationID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x00D9;
|
public const ushort OPCODE = 0x00D9;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, string animName)
|
public static SubPacket BuildPacket(uint sourceActorId, string animName)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x00CB;
|
public const ushort OPCODE = 0x00CB;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint actorId)
|
public static SubPacket BuildPacket(uint sourceActorId)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -18,11 +18,11 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
{
|
{
|
||||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
||||||
{
|
{
|
||||||
binWriter.Write((UInt32)actorId);
|
binWriter.Write((UInt32)sourceActorId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, actorId, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
appearanceIDs = appearanceTable;
|
appearanceIDs = appearanceTable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket BuildPacket(uint playerActorID, uint actorID)
|
public SubPacket BuildPacket(uint sourceActorId)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SubPacket packet = new SubPacket(OPCODE, playerActorID, actorID, data);
|
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@ using System;
|
|||||||
|
|
||||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
namespace FFXIVClassic_Map_Server.packets.send.actor
|
||||||
{
|
{
|
||||||
class _0xD8Packet
|
class SetActorBGPropertiesPacket
|
||||||
{
|
{
|
||||||
public const ushort OPCODE = 0x00D8;
|
public const ushort OPCODE = 0x00D8;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, uint val1, uint val2)
|
public static SubPacket BuildPacket(uint sourceActorId, uint val1, uint val2)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -14,7 +14,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x0145;
|
public const ushort OPCODE = 0x0145;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, uint iconCode)
|
public static SubPacket BuildPacket(uint sourceActorId, uint iconCode)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,11 +7,11 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x017B;
|
public const ushort OPCODE = 0x017B;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, bool isDimmed)
|
public static SubPacket BuildPacket(uint sourceActorId, bool isDimmed)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
data[0] = (byte)(isDimmed ? 1 : 0);
|
data[0] = (byte)(isDimmed ? 1 : 0);
|
||||||
return new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x013D;
|
public const ushort OPCODE = 0x013D;
|
||||||
public const uint PACKET_SIZE = 0x48;
|
public const uint PACKET_SIZE = 0x48;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, uint displayNameID, string customName)
|
public static SubPacket BuildPacket(uint sourceActorId, uint displayNameID, string customName)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -29,7 +29,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SubPacket packet = new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort SPAWNTYPE_WARP_DUTY2 = 6;
|
public const ushort SPAWNTYPE_WARP_DUTY2 = 6;
|
||||||
public const ushort SPAWNTYPE_WARP_LIGHT = 7;
|
public const ushort SPAWNTYPE_WARP_LIGHT = 7;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint sourceActorID, uint targetActorID, uint actorId, float x, float y, float z, float rotation, ushort spawnType, bool isZoningPlayer)
|
public static SubPacket BuildPacket(uint sourceActorId, uint actorId, float x, float y, float z, float rotation, ushort spawnType, bool isZoningPlayer)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE-0x20];
|
byte[] data = new byte[PACKET_SIZE-0x20];
|
||||||
|
|
||||||
@ -41,7 +41,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorID, targetActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
string[] split = name.Split('.');
|
string[] split = name.Split('.');
|
||||||
int arrayIndex = 0;
|
int arrayIndex = 0;
|
||||||
|
|
||||||
if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork")))
|
if (!(split[0].Equals("work") || split[0].Equals("charaWork") || split[0].Equals("playerWork") || split[0].Equals("npcWork") || split[0].Equals("guildleveWork")))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Object curObj = actor;
|
Object curObj = actor;
|
||||||
@ -159,6 +159,8 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
return AddByte(id, (byte)(((bool)curObj) ? 1 : 0));
|
return AddByte(id, (byte)(((bool)curObj) ? 1 : 0));
|
||||||
else if (curObj is byte)
|
else if (curObj is byte)
|
||||||
return AddByte(id, (byte)curObj);
|
return AddByte(id, (byte)curObj);
|
||||||
|
else if (curObj is sbyte)
|
||||||
|
return AddByte(id, (byte)(sbyte)curObj);
|
||||||
else if (curObj is ushort)
|
else if (curObj is ushort)
|
||||||
return AddShort(id, (ushort)curObj);
|
return AddShort(id, (ushort)curObj);
|
||||||
else if (curObj is short)
|
else if (curObj is short)
|
||||||
@ -207,14 +209,14 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
currentTarget = newTarget;
|
currentTarget = newTarget;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SubPacket BuildPacket(uint playerActorID, uint actorID)
|
public SubPacket BuildPacket(uint sourceActorId)
|
||||||
{
|
{
|
||||||
binWriter.Seek(0, SeekOrigin.Begin);
|
binWriter.Seek(0, SeekOrigin.Begin);
|
||||||
binWriter.Write((byte)runningByteTotal);
|
binWriter.Write((byte)runningByteTotal);
|
||||||
|
|
||||||
CloseStreams();
|
CloseStreams();
|
||||||
|
|
||||||
SubPacket packet = new SubPacket(OPCODE, actorID, playerActorID, data);
|
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const float DEFAULT_RUN = 5.0f;
|
public const float DEFAULT_RUN = 5.0f;
|
||||||
public const float DEFAULT_ACTIVE = 5.0f;
|
public const float DEFAULT_ACTIVE = 5.0f;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID)
|
public static SubPacket BuildPacket(uint sourceActorId)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -40,10 +40,10 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, float stopSpeed, float walkSpeed, float runSpeed, float activeSpeed)
|
public static SubPacket BuildPacket(uint sourceActorId, float stopSpeed, float walkSpeed, float runSpeed, float activeSpeed)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -69,7 +69,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,10 +30,10 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x134;
|
public const ushort OPCODE = 0x134;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetID, uint mainState, uint subState)
|
public static SubPacket BuildPacket(uint sourceActorId, uint mainState, uint subState)
|
||||||
{
|
{
|
||||||
ulong combined = (mainState & 0xFF) | ((subState & 0xFF) << 8);
|
ulong combined = (mainState & 0xFF) | ((subState & 0xFF) << 8);
|
||||||
return new SubPacket(OPCODE, playerActorID, targetID, BitConverter.GetBytes(combined));
|
return new SubPacket(OPCODE, sourceActorId, BitConverter.GetBytes(combined));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x0179;
|
public const ushort OPCODE = 0x0179;
|
||||||
public const uint PACKET_SIZE = 0x48;
|
public const uint PACKET_SIZE = 0x48;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, ushort[] statusIds)
|
public static SubPacket BuildPacket(uint sourceActorId, ushort[] statusIds)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SubPacket packet = new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
SubPacket packet = new SubPacket(OPCODE, sourceActorId, data);
|
||||||
return packet;
|
return packet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x0177;
|
public const ushort OPCODE = 0x0177;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, ushort index, ushort statusCode)
|
public static SubPacket BuildPacket(uint sourceActorId, ushort index, ushort statusCode)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x144;
|
public const ushort OPCODE = 0x144;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetID, byte breakage, int leftChant, int rightChant, int guard, int wasteStat, int statMode, uint idleAnimationId)
|
public static SubPacket BuildPacket(uint sourceActorId, byte breakage, int leftChant, int rightChant, int guard, int wasteStat, int statMode, uint idleAnimationId)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, targetID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,9 +9,9 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x00D3;
|
public const ushort OPCODE = 0x00D3;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, uint targetID)
|
public static SubPacket BuildPacket(uint sourceActorId, uint targetID)
|
||||||
{
|
{
|
||||||
return new SubPacket(OPCODE, playerActorID, targetID, BitConverter.GetBytes((ulong)targetID));
|
return new SubPacket(OPCODE, sourceActorId, BitConverter.GetBytes((ulong)targetID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,9 +8,9 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x00DB;
|
public const ushort OPCODE = 0x00DB;
|
||||||
public const uint PACKET_SIZE = 0x28;
|
public const uint PACKET_SIZE = 0x28;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, uint targetID)
|
public static SubPacket BuildPacket(uint sourceActorId, uint targetID)
|
||||||
{
|
{
|
||||||
return new SubPacket(OPCODE, playerActorID, targetID, BitConverter.GetBytes((ulong)targetID));
|
return new SubPacket(OPCODE, sourceActorId, BitConverter.GetBytes((ulong)targetID));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x132;
|
public const ushort OPCODE = 0x132;
|
||||||
public const uint PACKET_SIZE = 0x48;
|
public const uint PACKET_SIZE = 0x48;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, ushort number, string function)
|
public static SubPacket BuildPacket(uint sourceActorId, ushort number, string function)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
using System.IO;
|
|
||||||
|
|
||||||
using FFXIVClassic.Common;
|
|
||||||
using System;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace FFXIVClassic_Map_Server.packets.send.actor
|
|
||||||
{
|
|
||||||
class _0xD9Packet
|
|
||||||
{
|
|
||||||
public const ushort OPCODE = 0x00D9;
|
|
||||||
public const uint PACKET_SIZE = 0x28;
|
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, string anim)
|
|
||||||
{
|
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
|
||||||
|
|
||||||
using (MemoryStream mem = new MemoryStream(data))
|
|
||||||
{
|
|
||||||
using (BinaryWriter binWriter = new BinaryWriter(mem))
|
|
||||||
{
|
|
||||||
binWriter.Write(Encoding.ASCII.GetBytes(anim), 0, Encoding.ASCII.GetByteCount(anim) >= 4 ? 4 : Encoding.ASCII.GetByteCount(anim));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
public const ushort OPCODE = 0x000F;
|
public const ushort OPCODE = 0x000F;
|
||||||
public const uint PACKET_SIZE = 0x38;
|
public const uint PACKET_SIZE = 0x38;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint targetActorID)
|
public static SubPacket BuildPacket(uint sourceActor)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -21,7 +21,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, targetActorID, data);
|
return new SubPacket(OPCODE, sourceActor, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorId, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
using FFXIVClassic.Common;
|
|
||||||
|
|
||||||
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
||||||
{
|
{
|
||||||
// see xtx_command
|
// see xtx_command
|
||||||
@ -47,7 +45,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorId, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorId, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorId, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
public const ushort OPCODE = 0x016C;
|
public const ushort OPCODE = 0x016C;
|
||||||
public const uint PACKET_SIZE = 0x48;
|
public const uint PACKET_SIZE = 0x48;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.EmoteEventCondition condition)
|
public static SubPacket BuildPacket(uint sourceActorId, EventList.EmoteEventCondition condition)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorID, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
public const ushort OPCODE = 0x0136;
|
public const ushort OPCODE = 0x0136;
|
||||||
public const uint PACKET_SIZE = 0x48;
|
public const uint PACKET_SIZE = 0x48;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, bool enabled, byte unknown2, string conditionName)
|
public static SubPacket BuildPacket(uint sourceActorId, bool enabled, byte unknown2, string conditionName)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -25,7 +25,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorID, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
public const ushort OPCODE = 0x016B;
|
public const ushort OPCODE = 0x016B;
|
||||||
public const uint PACKET_SIZE = 0x48;
|
public const uint PACKET_SIZE = 0x48;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.NoticeEventCondition condition)
|
public static SubPacket BuildPacket(uint sourceActorId, EventList.NoticeEventCondition condition)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorID, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
public const ushort OPCODE = 0x016F;
|
public const ushort OPCODE = 0x016F;
|
||||||
public const uint PACKET_SIZE = 0x58;
|
public const uint PACKET_SIZE = 0x58;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.PushCircleEventCondition condition)
|
public static SubPacket BuildPacket(uint sourceActorId, EventList.PushCircleEventCondition condition)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorID, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
public const ushort OPCODE = 0x0170;
|
public const ushort OPCODE = 0x0170;
|
||||||
public const uint PACKET_SIZE = 0x60;
|
public const uint PACKET_SIZE = 0x60;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.PushFanEventCondition condition)
|
public static SubPacket BuildPacket(uint sourceActorId, EventList.PushFanEventCondition condition)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
binWriter.Write((Single)condition.radius);
|
binWriter.Write((Single)condition.radius);
|
||||||
binWriter.Write((UInt32)0xbfc90fdb);
|
binWriter.Write((UInt32)0xbfc90fdb);
|
||||||
binWriter.Write((UInt32)0x3f860a92);
|
binWriter.Write((UInt32)0x3f860a92);
|
||||||
binWriter.Write((UInt32)sourceActorID); //Actor Id
|
binWriter.Write((UInt32)sourceActorId); //Actor Id
|
||||||
binWriter.Write((Single)10.0f);
|
binWriter.Write((Single)10.0f);
|
||||||
binWriter.Seek(4, SeekOrigin.Current);
|
binWriter.Seek(4, SeekOrigin.Current);
|
||||||
binWriter.Write((Byte)(condition.outwards ? 0x11 : 0x1)); //If == 0x10, Inverted Bounding Box
|
binWriter.Write((Byte)(condition.outwards ? 0x11 : 0x1)); //If == 0x10, Inverted Bounding Box
|
||||||
@ -32,8 +32,8 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName));
|
binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
new SubPacket(OPCODE, sourceActorID, playerActorID, data).DebugPrintSubPacket();
|
new SubPacket(OPCODE, sourceActorId, data).DebugPrintSubPacket();
|
||||||
return new SubPacket(OPCODE, sourceActorID, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
public const ushort OPCODE = 0x0175;
|
public const ushort OPCODE = 0x0175;
|
||||||
public const uint PACKET_SIZE = 0x60;
|
public const uint PACKET_SIZE = 0x60;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.PushBoxEventCondition condition)
|
public static SubPacket BuildPacket(uint sourceActorId, EventList.PushBoxEventCondition condition)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -31,7 +31,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorID, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
public const ushort OPCODE = 0x012E;
|
public const ushort OPCODE = 0x012E;
|
||||||
public const uint PACKET_SIZE = 0x48;
|
public const uint PACKET_SIZE = 0x48;
|
||||||
|
|
||||||
public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.TalkEventCondition condition)
|
public static SubPacket BuildPacket(uint sourceActorId, EventList.TalkEventCondition condition)
|
||||||
{
|
{
|
||||||
byte[] data = new byte[PACKET_SIZE - 0x20];
|
byte[] data = new byte[PACKET_SIZE - 0x20];
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, sourceActorID, playerActorID, data);
|
return new SubPacket(OPCODE, sourceActorId, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorID, playerActorID, data);
|
return new SubPacket(OPCODE, playerActorID, data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorId, playerActorId, data);
|
return new SubPacket(OPCODE, playerActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorId, playerActorId, data);
|
return new SubPacket(OPCODE, playerActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorId, playerActorId, data);
|
return new SubPacket(OPCODE, playerActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -36,7 +36,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SubPacket(OPCODE, playerActorId, playerActorId, data);
|
return new SubPacket(OPCODE, playerActorId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user