mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-08-03 08:11:50 +02:00
Merge branch 'develop' of https://bitbucket.org/Ioncannon/ffxiv-classic-server into ai
# Conflicts: # FFXIVClassic Map Server/Database.cs # FFXIVClassic Map Server/WorldManager.cs # FFXIVClassic Map Server/actors/area/Area.cs # FFXIVClassic Map Server/actors/chara/player/Player.cs
This commit is contained in:
commit
6f5a480cbd
68 changed files with 907 additions and 281 deletions
|
@ -10,6 +10,7 @@ using FFXIVClassic_Map_Server.packets.send.player;
|
|||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.Actors;
|
||||
using FFXIVClassic_Map_Server.actors.chara.player;
|
||||
using FFXIVClassic_Map_Server.packets.receive.supportdesk;
|
||||
using FFXIVClassic_Map_Server.actors.chara.ai;
|
||||
|
||||
namespace FFXIVClassic_Map_Server
|
||||
|
@ -30,10 +31,10 @@ namespace FFXIVClassic_Map_Server
|
|||
cmd.Parameters.AddWithValue("@sessionId", sessionId);
|
||||
using (MySqlDataReader Reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (Reader.Read())
|
||||
{
|
||||
id = Reader.GetUInt32("userId");
|
||||
}
|
||||
while (Reader.Read())
|
||||
{
|
||||
id = Reader.GetUInt32("userId");
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MySqlException e)
|
||||
|
@ -43,10 +44,10 @@ namespace FFXIVClassic_Map_Server
|
|||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
return id;
|
||||
}
|
||||
}
|
||||
|
||||
public static List<Npc> GetNpcList()
|
||||
{
|
||||
|
@ -123,7 +124,7 @@ namespace FFXIVClassic_Map_Server
|
|||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
|
||||
|
||||
return gamedataItems;
|
||||
}
|
||||
}
|
||||
|
@ -263,7 +264,7 @@ namespace FFXIVClassic_Map_Server
|
|||
|
||||
public static void SavePlayerPosition(Player player)
|
||||
{
|
||||
string query;
|
||||
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)))
|
||||
|
@ -285,7 +286,7 @@ namespace FFXIVClassic_Map_Server
|
|||
currentPrivateAreaType = @privateAreaType
|
||||
WHERE id = @charaId
|
||||
";
|
||||
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charaId", player.actorId);
|
||||
cmd.Parameters.AddWithValue("@x", player.positionX);
|
||||
|
@ -638,9 +639,9 @@ namespace FFXIVClassic_Map_Server
|
|||
}
|
||||
|
||||
public static void LoadPlayerCharacter(Player player)
|
||||
{
|
||||
{
|
||||
string query;
|
||||
MySqlCommand cmd;
|
||||
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)))
|
||||
{
|
||||
|
@ -725,7 +726,7 @@ namespace FFXIVClassic_Map_Server
|
|||
player.zone = Server.GetWorldManager().GetZone(player.zoneId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Get class levels
|
||||
query = @"
|
||||
SELECT
|
||||
|
@ -758,7 +759,7 @@ namespace FFXIVClassic_Map_Server
|
|||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
player.charaWork.battleSave.skillLevel[Player.CLASSID_PUG-1] = reader.GetInt16("pug");
|
||||
player.charaWork.battleSave.skillLevel[Player.CLASSID_PUG - 1] = reader.GetInt16("pug");
|
||||
player.charaWork.battleSave.skillLevel[Player.CLASSID_GLA - 1] = reader.GetInt16("gla");
|
||||
player.charaWork.battleSave.skillLevel[Player.CLASSID_MRD - 1] = reader.GetInt16("mrd");
|
||||
player.charaWork.battleSave.skillLevel[Player.CLASSID_ARC - 1] = reader.GetInt16("arc");
|
||||
|
@ -807,7 +808,7 @@ namespace FFXIVClassic_Map_Server
|
|||
player.charaWork.parameterSave.state_mainSkillLevel = player.charaWork.battleSave.skillLevel[reader.GetByte(4) - 1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//Load appearance
|
||||
query = @"
|
||||
SELECT
|
||||
|
@ -987,7 +988,7 @@ namespace FFXIVClassic_Map_Server
|
|||
questFlags,
|
||||
currentPhase
|
||||
FROM characters_quest_scenario WHERE characterId = @charId";
|
||||
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
|
@ -1076,7 +1077,7 @@ namespace FFXIVClassic_Map_Server
|
|||
{
|
||||
int npcLSId = reader.GetUInt16(0);
|
||||
player.playerWork.npcLinkshellChatCalling[npcLSId] = reader.GetBoolean(1);
|
||||
player.playerWork.npcLinkshellChatExtra[npcLSId] = reader.GetBoolean(2);
|
||||
player.playerWork.npcLinkshellChatExtra[npcLSId] = reader.GetBoolean(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1128,7 +1129,7 @@ namespace FFXIVClassic_Map_Server
|
|||
{
|
||||
ushort equipSlot = reader.GetUInt16(0);
|
||||
ulong uniqueItemId = reader.GetUInt16(1);
|
||||
InventoryItem item = player.GetInventory(Inventory.NORMAL).GetItemById(uniqueItemId);
|
||||
InventoryItem item = player.GetInventory(Inventory.NORMAL).GetItemByUniqueId(uniqueItemId);
|
||||
equipment[equipSlot] = item;
|
||||
}
|
||||
}
|
||||
|
@ -1395,7 +1396,7 @@ namespace FFXIVClassic_Map_Server
|
|||
cmd.Parameters.AddWithValue("@type", type);
|
||||
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
uint uniqueId = reader.GetUInt32(0);
|
||||
|
@ -1442,7 +1443,7 @@ namespace FFXIVClassic_Map_Server
|
|||
{
|
||||
conn.Open();
|
||||
|
||||
|
||||
|
||||
|
||||
string query = @"
|
||||
INSERT INTO server_items
|
||||
|
@ -1460,7 +1461,7 @@ namespace FFXIVClassic_Map_Server
|
|||
";
|
||||
|
||||
MySqlCommand cmd2 = new MySqlCommand(query2, conn);
|
||||
|
||||
|
||||
cmd.Parameters.AddWithValue("@itemId", itemId);
|
||||
cmd.Parameters.AddWithValue("@quality", quality);
|
||||
cmd.Parameters.AddWithValue("@itemType", itemType);
|
||||
|
@ -1496,12 +1497,12 @@ namespace FFXIVClassic_Map_Server
|
|||
{
|
||||
conn.Open();
|
||||
|
||||
string query = @"
|
||||
string query = @"
|
||||
UPDATE characters_inventory
|
||||
SET quantity = @quantity
|
||||
WHERE characterId = @charId AND slot = @slot AND inventoryType = @type;
|
||||
";
|
||||
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
cmd.Parameters.AddWithValue("@quantity", quantity);
|
||||
|
@ -1541,7 +1542,7 @@ namespace FFXIVClassic_Map_Server
|
|||
|
||||
DELETE FROM server_items
|
||||
WHERE id = @serverItemId;
|
||||
";
|
||||
";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
|
@ -1611,7 +1612,7 @@ namespace FFXIVClassic_Map_Server
|
|||
try
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
|
||||
//Load Last 5 Completed
|
||||
string query = @"
|
||||
SELECT
|
||||
|
@ -1626,7 +1627,7 @@ namespace FFXIVClassic_Map_Server
|
|||
int count = 0;
|
||||
while (reader.Read())
|
||||
{
|
||||
uint id = reader.GetUInt32(0);
|
||||
uint id = reader.GetUInt32(0);
|
||||
latestAchievements[count++] = id;
|
||||
}
|
||||
}
|
||||
|
@ -1653,7 +1654,7 @@ namespace FFXIVClassic_Map_Server
|
|||
try
|
||||
{
|
||||
conn.Open();
|
||||
|
||||
|
||||
string query = @"
|
||||
SELECT packetOffsetId
|
||||
FROM characters_achievements
|
||||
|
@ -1665,7 +1666,7 @@ namespace FFXIVClassic_Map_Server
|
|||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
{
|
||||
uint offset = reader.GetUInt32(0);
|
||||
|
||||
if (offset < 0 || offset >= cheevosPacket.achievementFlags.Length)
|
||||
|
@ -1673,7 +1674,7 @@ namespace FFXIVClassic_Map_Server
|
|||
Program.Log.Error("SQL Error; achievement flag offset id out of range: " + offset);
|
||||
continue;
|
||||
}
|
||||
cheevosPacket.achievementFlags[offset] = true;
|
||||
cheevosPacket.achievementFlags[offset] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1689,7 +1690,6 @@ namespace FFXIVClassic_Map_Server
|
|||
|
||||
return cheevosPacket.BuildPacket(player.actorId);
|
||||
}
|
||||
|
||||
public static bool CreateLinkshell(Player player, string lsName, ushort lsCrest)
|
||||
{
|
||||
bool success = false;
|
||||
|
@ -1710,7 +1710,7 @@ namespace FFXIVClassic_Map_Server
|
|||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@lsName", lsName);
|
||||
cmd.Parameters.AddWithValue("@master", player.actorId);
|
||||
cmd.Parameters.AddWithValue("@crest", lsCrest);
|
||||
cmd.Parameters.AddWithValue("@crest", lsCrest);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
success = true;
|
||||
|
@ -1767,6 +1767,314 @@ namespace FFXIVClassic_Map_Server
|
|||
}
|
||||
}
|
||||
|
||||
public static bool SaveSupportTicket(GMSupportTicketPacket gmTicket, string playerName)
|
||||
{
|
||||
string query;
|
||||
MySqlCommand cmd;
|
||||
bool wasError = false;
|
||||
|
||||
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 = @"
|
||||
INSERT INTO supportdesk_tickets
|
||||
(name, title, body, langCode)
|
||||
VALUES
|
||||
(@name, @title, @body, @langCode)";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@name", playerName);
|
||||
cmd.Parameters.AddWithValue("@title", gmTicket.ticketTitle);
|
||||
cmd.Parameters.AddWithValue("@body", gmTicket.ticketBody);
|
||||
cmd.Parameters.AddWithValue("@langCode", gmTicket.langCode);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
Program.Log.Error(e.ToString());
|
||||
wasError = true;
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
return wasError;
|
||||
}
|
||||
|
||||
public static bool isTicketOpen(string playerName)
|
||||
{
|
||||
bool isOpen = false;
|
||||
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();
|
||||
|
||||
string query = @"
|
||||
SELECT
|
||||
isOpen
|
||||
FROM supportdesk_tickets
|
||||
WHERE name = @name
|
||||
";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
|
||||
cmd.Parameters.AddWithValue("@name", playerName);
|
||||
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
isOpen = reader.GetBoolean(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
Program.Log.Error(e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
return isOpen;
|
||||
}
|
||||
|
||||
public static void closeTicket(string playerName)
|
||||
{
|
||||
bool isOpen = false;
|
||||
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();
|
||||
|
||||
string query = @"
|
||||
UPDATE
|
||||
supportdesk_tickets
|
||||
SET isOpen = 0
|
||||
WHERE name = @name
|
||||
";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@name", playerName);
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
Program.Log.Error(e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static string[] getFAQNames(uint langCode = 1)
|
||||
{
|
||||
string[] faqs = null;
|
||||
List<string> raw = new List<string>();
|
||||
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();
|
||||
|
||||
string query = @"
|
||||
SELECT
|
||||
title
|
||||
FROM supportdesk_faqs
|
||||
WHERE languageCode = @langCode
|
||||
ORDER BY slot
|
||||
";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
|
||||
cmd.Parameters.AddWithValue("@langCode", langCode);
|
||||
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
string label = reader.GetString(0);
|
||||
raw.Add(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
Program.Log.Error(e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
faqs = raw.ToArray();
|
||||
}
|
||||
}
|
||||
return faqs;
|
||||
}
|
||||
|
||||
public static string getFAQBody(uint slot, uint langCode = 1)
|
||||
{
|
||||
string body = string.Empty;
|
||||
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();
|
||||
|
||||
string query = @"
|
||||
SELECT
|
||||
body
|
||||
FROM supportdesk_faqs
|
||||
WHERE slot=@slot and languageCode=@langCode";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@slot", slot);
|
||||
cmd.Parameters.AddWithValue("@langCode", langCode);
|
||||
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
body = reader.GetString(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
Program.Log.Error(e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
}
|
||||
return body;
|
||||
}
|
||||
|
||||
public static string[] getIssues(uint lanCode = 1)
|
||||
{
|
||||
string[] issues = null;
|
||||
List<string> raw = new List<string>();
|
||||
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();
|
||||
|
||||
string query = @"
|
||||
SELECT
|
||||
title
|
||||
FROM supportdesk_issues
|
||||
ORDER BY slot";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
string label = reader.GetString(0);
|
||||
raw.Add(label);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
Program.Log.Error(e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
issues = raw.ToArray();
|
||||
}
|
||||
}
|
||||
return issues;
|
||||
}
|
||||
|
||||
public static void IssuePlayerChocobo(Player player, byte appearanceId, string name)
|
||||
{
|
||||
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 = @"
|
||||
INSERT INTO characters_chocobo
|
||||
(characterId, hasChocobo, chocoboAppearance, chocoboName)
|
||||
VALUES
|
||||
(@characterId, @hasChocobo, @chocoboAppearance, @chocoboName)
|
||||
ON DUPLICATE KEY UPDATE
|
||||
hasChocobo=@hasChocobo, chocoboAppearance=@chocoboAppearance, chocoboName=@chocoboName";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@characterId", player.actorId);
|
||||
cmd.Parameters.AddWithValue("@hasChocobo", 1);
|
||||
cmd.Parameters.AddWithValue("@chocoboAppearance", appearanceId);
|
||||
cmd.Parameters.AddWithValue("@chocoboName", name);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
Program.Log.Error(e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ChangePlayerChocoboAppearance(Player player, byte appearanceId)
|
||||
{
|
||||
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_chocobo
|
||||
SET
|
||||
chocoboAppearance=@chocoboAppearance
|
||||
WHERE
|
||||
characterId = @characterId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@characterId", player.actorId);
|
||||
cmd.Parameters.AddWithValue("@chocoboAppearance", appearanceId);
|
||||
|
||||
cmd.ExecuteNonQuery();
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
Program.Log.Error(e.ToString());
|
||||
}
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Dictionary<uint, StatusEffect> LoadGlobalStatusEffectList()
|
||||
{
|
||||
var effects = new Dictionary<uint, StatusEffect>();
|
||||
|
@ -1902,6 +2210,7 @@ namespace FFXIVClassic_Map_Server
|
|||
return abilities;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\Microsoft.Net.Compilers.2.0.0-beta3\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.0.0-beta3\build\Microsoft.Net.Compilers.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="..\packages\Microsoft.Net.Compilers.2.0.0-beta3\build\Microsoft.Net.Compilers.props" Condition="Exists('..\packages\Microsoft.Net.Compilers.2.0.0-beta3\build\Microsoft.Net.Compilers.props') AND '$(OS)' == 'Windows_NT'" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props') AND '$(OS)' == 'Windows_NT'" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
|
@ -251,19 +251,19 @@
|
|||
<Compile Include="packets\send\groups\ContentMembersX64Packet.cs" />
|
||||
<Compile Include="packets\send\groups\GroupMembersX64Packet.cs" />
|
||||
<Compile Include="packets\send\groups\SynchGroupWorkValuesPacket.cs" />
|
||||
<Compile Include="packets\send\player\InfoRequestResponsePacket.cs" />
|
||||
<Compile Include="packets\send\player\GenericDataPacket.cs" />
|
||||
<Compile Include="packets\send\player\SendAchievementRatePacket.cs" />
|
||||
<Compile Include="packets\send\player\SetCurrentJobPacket.cs" />
|
||||
<Compile Include="packets\send\player\SetCurrentMountGoobbuePacket.cs" />
|
||||
<Compile Include="packets\send\player\SetCurrentMountChocoboPacket.cs" />
|
||||
<Compile Include="packets\send\player\SetGrandCompanyPacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorNamePacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorPropetyPacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorSpeedPacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorStatePacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorTargetAnimatedPacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorTargetPacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorStatusAllPacket.cs" />
|
||||
<Compile Include="packets\send\Actor\SetActorNamePacket.cs" />
|
||||
<Compile Include="packets\send\Actor\SetActorPropetyPacket.cs" />
|
||||
<Compile Include="packets\send\Actor\SetActorSpeedPacket.cs" />
|
||||
<Compile Include="packets\send\Actor\SetActorStatePacket.cs" />
|
||||
<Compile Include="packets\send\Actor\SetActorTargetAnimatedPacket.cs" />
|
||||
<Compile Include="packets\send\Actor\SetActorTargetPacket.cs" />
|
||||
<Compile Include="packets\send\Actor\SetActorStatusAllPacket.cs" />
|
||||
<Compile Include="packets\send\login\0x2Packet.cs" />
|
||||
<Compile Include="packets\send\actor\AddActorPacket.cs" />
|
||||
<Compile Include="packets\send\actor\MoveActorToPositionPacket.cs" />
|
||||
|
|
|
@ -347,3 +347,4 @@ namespace FFXIVClassic_Map_Server
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,10 @@ namespace FFXIVClassic_Map_Server
|
|||
#endif
|
||||
bool startServer = true;
|
||||
|
||||
Program.Log.Info("---------FFXIV 1.0 Map Server---------");
|
||||
Log.Info("==================================");
|
||||
Log.Info("FFXIV Classic Map Server");
|
||||
Log.Info("Version: 0.1");
|
||||
Log.Info("==================================");
|
||||
|
||||
//Load Config
|
||||
ConfigConstants.Load();
|
||||
|
|
|
@ -1139,7 +1139,6 @@ namespace FFXIVClassic_Map_Server
|
|||
else
|
||||
return null;
|
||||
}
|
||||
|
||||
public void LoadStatusEffects()
|
||||
{
|
||||
effectList = Database.LoadGlobalStatusEffectList();
|
||||
|
@ -1163,5 +1162,4 @@ namespace FFXIVClassic_Map_Server
|
|||
return abilityList.TryGetValue((ushort)id, out ability) ? ability.Clone() : null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using FFXIVClassic_Map_Server;
|
||||
using FFXIVClassic.Common;
|
||||
|
||||
using FFXIVClassic_Map_Server.actors.area;
|
||||
using FFXIVClassic_Map_Server.actors.chara.npc;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
|
|
|
@ -75,10 +75,10 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
|||
zone.pathCalls++;
|
||||
zone.pathCallTime += sw.ElapsedMilliseconds;
|
||||
|
||||
if (path.Count == 1)
|
||||
Program.Log.Info($"mypos: {owner.positionX} {owner.positionY} {owner.positionZ} | targetPos: {x} {y} {z} | step {stepSize} | maxPath {maxPath} | polyRadius {polyRadius}");
|
||||
//if (path.Count == 1)
|
||||
// Program.Log.Info($"mypos: {owner.positionX} {owner.positionY} {owner.positionZ} | targetPos: {x} {y} {z} | step {stepSize} | maxPath {maxPath} | polyRadius {polyRadius}");
|
||||
|
||||
Program.Log.Error("[{0}][{1}] Created {2} points in {3} milliseconds", owner.actorId, owner.actorName, path.Count, sw.ElapsedMilliseconds);
|
||||
//Program.Log.Error("[{0}][{1}] Created {2} points in {3} milliseconds", owner.actorId, owner.actorName, path.Count, sw.ElapsedMilliseconds);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.ai
|
|||
{
|
||||
path.Remove(point);
|
||||
owner.OnPath(point);
|
||||
Program.Log.Error($"{owner.actorName} arrived at point {point.X} {point.Y} {point.Z}");
|
||||
//Program.Log.Error($"{owner.actorName} arrived at point {point.X} {point.Y} {point.Z}");
|
||||
}
|
||||
|
||||
if (path.Count == 0 && owner.target != null)
|
||||
|
|
|
@ -53,8 +53,8 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
|
||||
LoadNpcAppearance(actorClass.actorClassId);
|
||||
|
||||
this.classPath = actorClass.classPath;
|
||||
className = classPath.Substring(classPath.LastIndexOf("/")+1);
|
||||
className = actorClass.classPath.Substring(actorClass.classPath.LastIndexOf("/") + 1);
|
||||
this.classPath = String.Format("{0}/{1}", actorClass.classPath.Substring(0, actorClass.classPath.LastIndexOf('/')).ToLower(), className);
|
||||
|
||||
charaWork.battleSave.potencial = 1.0f;
|
||||
|
||||
|
|
|
@ -46,14 +46,24 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||
return null;
|
||||
}
|
||||
|
||||
public InventoryItem GetItemById(ulong itemId)
|
||||
public InventoryItem GetItemByUniqueId(ulong uniqueItemId)
|
||||
{
|
||||
foreach (InventoryItem item in list)
|
||||
{
|
||||
if (item.uniqueId == itemId)
|
||||
{
|
||||
if (item.uniqueId == uniqueItemId)
|
||||
return item;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public InventoryItem GetItemByCatelogId(ulong catelogId)
|
||||
{
|
||||
foreach (InventoryItem item in list)
|
||||
{
|
||||
if (item.itemId == catelogId)
|
||||
return item;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public void RefreshItem(InventoryItem item)
|
||||
|
@ -262,7 +272,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||
owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId));
|
||||
}
|
||||
|
||||
public void RemoveItem(ulong itemDBId)
|
||||
public void RemoveItemByUniqueId(ulong itemDBId)
|
||||
{
|
||||
ushort slot = 0;
|
||||
InventoryItem toDelete = null;
|
||||
|
@ -304,7 +314,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player
|
|||
|
||||
}
|
||||
|
||||
public void RemoveItem(ushort slot)
|
||||
public void RemoveItemAtSlot(ushort slot)
|
||||
{
|
||||
if (slot >= list.Count)
|
||||
return;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FFXIVClassic.Common;
|
||||
|
||||
using FFXIVClassic_Map_Server.actors.chara.player;
|
||||
using FFXIVClassic_Map_Server.actors.director;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
|
@ -8,6 +7,9 @@ using FFXIVClassic_Map_Server.lua;
|
|||
using FFXIVClassic_Map_Server.packets.send;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using FFXIVClassic_Map_Server.packets.send.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor.inventory;
|
||||
using FFXIVClassic_Map_Server.packets.send.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.player;
|
||||
using FFXIVClassic_Map_Server.utils;
|
||||
using System;
|
||||
|
@ -330,6 +332,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
subpackets.Add(SetHasGoobbuePacket.BuildPacket(actorId, hasGoobbue));
|
||||
|
||||
subpackets.Add(SetAchievementPointsPacket.BuildPacket(actorId, achievementPoints));
|
||||
|
||||
subpackets.Add(Database.GetLatestAchievements(this));
|
||||
subpackets.Add(Database.GetAchievementsPacket(this));
|
||||
}
|
||||
|
@ -541,6 +544,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
playerSession.QueuePacket(worldMasterSpawn);
|
||||
|
||||
//Inn Packets (Dream, Cutscenes, Armoire)
|
||||
|
||||
if (zone.isInn)
|
||||
{
|
||||
SetCutsceneBookPacket cutsceneBookPacket = new SetCutsceneBookPacket();
|
||||
|
@ -567,7 +571,6 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
|
||||
if (currentContentGroup != null)
|
||||
currentContentGroup.SendGroupPackets(playerSession);
|
||||
|
||||
}
|
||||
|
||||
private void SendRemoveInventoryPackets(List<ushort> slots)
|
||||
|
@ -598,6 +601,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
|
||||
public void QueuePacket(SubPacket packet)
|
||||
|
||||
{
|
||||
playerSession.QueuePacket(packet);
|
||||
}
|
||||
|
@ -1006,6 +1010,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
else
|
||||
{
|
||||
ItemData item = Server.GetItemGamedata(invItem.itemId);
|
||||
|
||||
if (item is EquipmentItem)
|
||||
{
|
||||
EquipmentItem eqItem = (EquipmentItem)item;
|
||||
|
@ -1040,7 +1045,6 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
}
|
||||
|
||||
Database.SavePlayerAppearance(this);
|
||||
|
||||
BroadcastPacket(CreateAppearancePacket(), true);
|
||||
}
|
||||
|
||||
|
@ -1052,6 +1056,14 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
return null;
|
||||
}
|
||||
|
||||
public int GetCurrentGil()
|
||||
{
|
||||
if (GetInventory(Inventory.CURRENCY).HasItem(1000001))
|
||||
return GetInventory(Inventory.CURRENCY).GetItemByCatelogId(1000001).quantity;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
public Actor GetActorInInstance(uint actorId)
|
||||
{
|
||||
foreach (Actor a in playerSession.actorInstanceList)
|
||||
|
@ -1565,7 +1577,7 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
public void SendDataPacket(params object[] parameters)
|
||||
{
|
||||
List<LuaParam> lParams = LuaUtils.CreateLuaParamList(parameters);
|
||||
SubPacket spacket = InfoRequestResponsePacket.BuildPacket(actorId, lParams);
|
||||
SubPacket spacket = GenericDataPacket.BuildPacket(actorId, lParams);
|
||||
spacket.DebugPrintSubPacket();
|
||||
QueuePacket(spacket);
|
||||
}
|
||||
|
@ -1719,6 +1731,19 @@ namespace FFXIVClassic_Map_Server.Actors
|
|||
LuaEngine.GetInstance().CallLuaFunction(this, this, "OnUpdate", true, delta);
|
||||
}
|
||||
|
||||
public void IssueChocobo(byte appearanceId, string nameResponse)
|
||||
{
|
||||
Database.IssuePlayerChocobo(this, appearanceId, nameResponse);
|
||||
hasChocobo = true;
|
||||
chocoboAppearance = appearanceId;
|
||||
chocoboName = nameResponse;
|
||||
}
|
||||
|
||||
public void ChangeChocoboAppearance(byte appearanceId)
|
||||
{
|
||||
Database.ChangePlayerChocoboAppearance(this, appearanceId);
|
||||
chocoboAppearance = appearanceId;
|
||||
}
|
||||
public override void Update(DateTime tick)
|
||||
{
|
||||
aiContainer.Update(tick);
|
||||
|
|
|
@ -6,7 +6,7 @@ using FFXIVClassic.Common;
|
|||
|
||||
namespace FFXIVClassic_Map_Server.packets.send.player
|
||||
{
|
||||
class InfoRequestResponsePacket
|
||||
class GenericDataPacket
|
||||
{
|
||||
public const ushort OPCODE = 0x0133;
|
||||
public const uint PACKET_SIZE = 0xE0;
|
Loading…
Add table
Add a link
Reference in a new issue