mirror of
https://bitbucket.org/Ioncannon/project-meteor-server.git
synced 2025-04-20 19:57:46 +00:00
Merge branch 'scripting'
This commit is contained in:
commit
a640e08fe1
172 changed files with 3576 additions and 11986 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
FFXIVClassic Map Server/bin/Debug/packets/wireshark packets/
|
||||
FFXIVClassic Map Server/bin/
|
||||
FFXIVClassic Map Server/obj/
|
||||
config.ini
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||
using MySql.Data.MySqlClient;
|
||||
using MySql.Data.MySqlClient;
|
||||
using Dapper;
|
||||
using Newtonsoft.Json;
|
||||
using System;
|
||||
|
@ -8,13 +7,21 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using FFXIVClassic_Lobby_Server.common;
|
||||
using FFXIVClassic_Map_Server.dataobjects.database;
|
||||
using FFXIVClassic_Map_Server.dataobjects.chara.npc;
|
||||
using FFXIVClassic_Map_Server.dataobjects.chara;
|
||||
using FFXIVClassic_Map_Server.utils;
|
||||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.packets.send.player;
|
||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server;
|
||||
using FFXIVClassic_Map_Server.common.EfficientHashTables;
|
||||
|
||||
namespace FFXIVClassic_Lobby_Server
|
||||
{
|
||||
|
||||
class Database
|
||||
{
|
||||
|
||||
public static uint getUserIdFromSession(String sessionId)
|
||||
{
|
||||
uint id = 0;
|
||||
|
@ -65,15 +72,15 @@ namespace FFXIVClassic_Lobby_Server
|
|||
}
|
||||
}
|
||||
|
||||
public static DBCharacter getCharacter(uint charId)
|
||||
public static List<Npc> getNpcList()
|
||||
{
|
||||
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)))
|
||||
{
|
||||
DBCharacter chara = null;
|
||||
List<Npc> npcList = null;
|
||||
try
|
||||
{
|
||||
conn.Open();
|
||||
chara = conn.Query<DBCharacter>("SELECT * FROM characters WHERE id=@CharaId", new { CharaId = charId }).SingleOrDefault();
|
||||
npcList = conn.Query<Npc>("SELECT * FROM npc_list").ToList();
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
|
@ -83,52 +90,503 @@ namespace FFXIVClassic_Lobby_Server
|
|||
conn.Dispose();
|
||||
}
|
||||
|
||||
return chara;
|
||||
return npcList;
|
||||
}
|
||||
}
|
||||
|
||||
public static DBAppearance getAppearance(uint charaId)
|
||||
public static void loadPlayerCharacter(Player player)
|
||||
{
|
||||
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)))
|
||||
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)))
|
||||
{
|
||||
DBAppearance appearance = null;
|
||||
try
|
||||
{
|
||||
conn.Open();
|
||||
appearance = conn.Query<DBAppearance>("SELECT * FROM characters_appearance WHERE characterId=@CharaId", new { CharaId = charaId }).SingleOrDefault();
|
||||
|
||||
//Load basic info
|
||||
query = @"
|
||||
SELECT
|
||||
name,
|
||||
positionX,
|
||||
positionY,
|
||||
positionZ,
|
||||
rotation,
|
||||
actorState,
|
||||
currentZoneId,
|
||||
currentClassJob,
|
||||
gcCurrent,
|
||||
gcLimsaRank,
|
||||
gcGridaniaRank,
|
||||
gcUldahRank,
|
||||
currentTitle,
|
||||
guardian,
|
||||
birthDay,
|
||||
birthMonth,
|
||||
initialTown,
|
||||
tribe,
|
||||
currentParty,
|
||||
restBonus,
|
||||
achievementPoints
|
||||
FROM characters WHERE id = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
player.displayNameId = 0xFFFFFFFF;
|
||||
player.customDisplayName = reader.GetString(0);
|
||||
player.oldPositionX = player.positionX = reader.GetFloat(1);
|
||||
player.oldPositionY = player.positionY = reader.GetFloat(2);
|
||||
player.oldPositionZ = player.positionZ = reader.GetFloat(3);
|
||||
player.oldRotation = player.rotation = reader.GetFloat(4);
|
||||
player.currentMainState = reader.GetUInt16(5);
|
||||
player.zoneId = reader.GetUInt32(6);
|
||||
player.charaWork.parameterSave.state_mainSkill[0] = reader.GetByte(7);
|
||||
player.gcCurrent = reader.GetByte(8);
|
||||
player.gcRankLimsa = reader.GetByte(9);
|
||||
player.gcRankGridania = reader.GetByte(10);
|
||||
player.gcRankUldah = reader.GetByte(11);
|
||||
player.currentTitle = reader.GetUInt32(12);
|
||||
player.playerWork.guardian = reader.GetByte(13);
|
||||
player.playerWork.birthdayDay = reader.GetByte(14);
|
||||
player.playerWork.birthdayMonth = reader.GetByte(15);
|
||||
player.playerWork.initialTown = reader.GetByte(16);
|
||||
player.playerWork.tribe = reader.GetByte(17);
|
||||
player.playerWork.restBonusExpRate = reader.GetInt32(19);
|
||||
player.achievementPoints = reader.GetUInt32(20);
|
||||
}
|
||||
}
|
||||
|
||||
player.charaWork.parameterSave.state_mainSkillLevel = 49;
|
||||
|
||||
/*
|
||||
//Get level of our classjob
|
||||
//Load appearance
|
||||
query = @"
|
||||
SELECT
|
||||
baseId
|
||||
FROM characters_appearance WHERE characterId = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
//Get level of our classjob
|
||||
//Load appearance
|
||||
query = @"
|
||||
SELECT
|
||||
hp,
|
||||
hpMax,
|
||||
mp,
|
||||
mpMax
|
||||
FROM characters_parametersave WHERE characterId = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
player.charaWork.parameterSave.hp[0] = reader.GetInt16(0);
|
||||
player.charaWork.parameterSave.hpMax[0] = reader.GetInt16(1);
|
||||
player.charaWork.parameterSave.mp = reader.GetInt16(2);
|
||||
player.charaWork.parameterSave.mpMax = reader.GetInt16(3);
|
||||
}
|
||||
}
|
||||
|
||||
//Load appearance
|
||||
query = @"
|
||||
SELECT
|
||||
baseId,
|
||||
size,
|
||||
voice,
|
||||
skinColor,
|
||||
hairStyle,
|
||||
hairColor,
|
||||
hairHighlightColor,
|
||||
eyeColor,
|
||||
characteristics,
|
||||
characteristicsColor,
|
||||
faceType,
|
||||
ears,
|
||||
faceMouth,
|
||||
faceFeatures,
|
||||
faceNose,
|
||||
faceEyeShape,
|
||||
faceIrisSize,
|
||||
faceEyebrows,
|
||||
mainHand,
|
||||
offHand,
|
||||
head,
|
||||
body,
|
||||
hands,
|
||||
legs,
|
||||
feet,
|
||||
waist,
|
||||
leftFinger,
|
||||
rightFinger,
|
||||
leftEars,
|
||||
rightEars
|
||||
FROM characters_appearance WHERE characterId = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
if (reader.GetUInt32(0) == 0xFFFFFFFF)
|
||||
player.modelId = CharacterUtils.getTribeModel(player.playerWork.tribe);
|
||||
else
|
||||
player.modelId = reader.GetUInt32(0);
|
||||
player.appearanceIds[Character.SIZE] = reader.GetByte(1);
|
||||
player.appearanceIds[Character.COLORINFO] = (uint)(reader.GetUInt16(3) | (reader.GetUInt16(5) << 10) | (reader.GetUInt16(7) << 20));
|
||||
player.appearanceIds[Character.FACEINFO] = PrimitiveConversion.ToUInt32(CharacterUtils.getFaceInfo(reader.GetByte(8), reader.GetByte(9), reader.GetByte(10), reader.GetByte(11), reader.GetByte(12), reader.GetByte(13), reader.GetByte(14), reader.GetByte(15), reader.GetByte(16), reader.GetByte(17)));
|
||||
player.appearanceIds[Character.HIGHLIGHT_HAIR] = (uint)(reader.GetUInt16(6) | reader.GetUInt16(4) << 10);
|
||||
player.appearanceIds[Character.VOICE] = reader.GetByte(2);
|
||||
player.appearanceIds[Character.WEAPON1] = reader.GetUInt32(18);
|
||||
player.appearanceIds[Character.WEAPON2] = reader.GetUInt32(19);
|
||||
player.appearanceIds[Character.HEADGEAR] = reader.GetUInt32(20);
|
||||
player.appearanceIds[Character.BODYGEAR] = reader.GetUInt32(21);
|
||||
player.appearanceIds[Character.LEGSGEAR] = reader.GetUInt32(22);
|
||||
player.appearanceIds[Character.HANDSGEAR] = reader.GetUInt32(23);
|
||||
player.appearanceIds[Character.FEETGEAR] = reader.GetUInt32(24);
|
||||
player.appearanceIds[Character.WAISTGEAR] = reader.GetUInt32(25);
|
||||
player.appearanceIds[Character.R_EAR] = reader.GetUInt32(26);
|
||||
player.appearanceIds[Character.L_EAR] = reader.GetUInt32(27);
|
||||
player.appearanceIds[Character.R_FINGER] = reader.GetUInt32(28);
|
||||
player.appearanceIds[Character.L_FINGER] = reader.GetUInt32(29);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Load Status Effects
|
||||
query = @"
|
||||
SELECT
|
||||
statusId,
|
||||
expireTime
|
||||
FROM characters_statuseffect WHERE characterId = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
int count = 0;
|
||||
while (reader.Read())
|
||||
{
|
||||
player.charaWork.status[count] = reader.GetUInt16(0);
|
||||
player.charaWork.statusShownTime[count] = reader.GetUInt32(1);
|
||||
}
|
||||
}
|
||||
|
||||
//Load Chocobo
|
||||
query = @"
|
||||
SELECT
|
||||
hasChocobo,
|
||||
hasGoobbue,
|
||||
chocoboAppearance,
|
||||
chocoboName
|
||||
FROM characters_chocobo WHERE characterId = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
player.hasChocobo = reader.GetBoolean(0);
|
||||
player.hasGoobbue = reader.GetBoolean(1);
|
||||
player.chocoboAppearance = reader.GetByte(2);
|
||||
player.chocoboName = reader.GetString(3);
|
||||
}
|
||||
}
|
||||
|
||||
//Load Timers
|
||||
query = @"
|
||||
SELECT
|
||||
thousandmaws,
|
||||
dzemaeldarkhold,
|
||||
bowlofembers_hard,
|
||||
bowlofembers,
|
||||
thornmarch,
|
||||
aurumvale,
|
||||
cutterscry,
|
||||
battle_aleport,
|
||||
battle_hyrstmill,
|
||||
battle_goldenbazaar,
|
||||
howlingeye_hard,
|
||||
howlingeye,
|
||||
castrumnovum,
|
||||
bowlofembers_extreme,
|
||||
rivenroad,
|
||||
rivenroad_hard,
|
||||
behests,
|
||||
companybehests,
|
||||
returntimer,
|
||||
skirmish
|
||||
FROM characters_timers WHERE characterId = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
if (reader.Read())
|
||||
{
|
||||
for (int i = 0; i < player.timers.Length; i++)
|
||||
player.timers[i] = reader.GetUInt32(i);
|
||||
}
|
||||
}
|
||||
|
||||
//Load Hotbar
|
||||
query = @"
|
||||
SELECT
|
||||
hotbarSlot,
|
||||
commandId,
|
||||
recastTime
|
||||
FROM characters_hotbar WHERE characterId = @charId AND classId = @classId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
cmd.Parameters.AddWithValue("@classId", player.charaWork.parameterSave.state_mainSkill[0]);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
int index = reader.GetUInt16(0);
|
||||
player.charaWork.command[index+32] = reader.GetUInt32(1);
|
||||
player.charaWork.parameterSave.commandSlot_recastTime[index] = reader.GetUInt32(2);
|
||||
}
|
||||
}
|
||||
|
||||
//Load Scenario Quests
|
||||
query = @"
|
||||
SELECT
|
||||
slot,
|
||||
questId
|
||||
FROM characters_quest_scenario WHERE characterId = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
int index = reader.GetUInt16(0);
|
||||
player.playerWork.questScenario[index] = 0xA0F00000 | reader.GetUInt32(1);
|
||||
}
|
||||
}
|
||||
|
||||
//Load Local Guildleves
|
||||
query = @"
|
||||
SELECT
|
||||
slot,
|
||||
questId,
|
||||
abandoned,
|
||||
completed
|
||||
FROM characters_quest_guildleve_local WHERE characterId = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
int index = reader.GetUInt16(0);
|
||||
player.playerWork.questGuildleve[index] = 0xA0F00000 | reader.GetUInt32(1);
|
||||
}
|
||||
}
|
||||
|
||||
//Load Regional Guildleve Quests
|
||||
query = @"
|
||||
SELECT
|
||||
slot,
|
||||
guildleveId,
|
||||
abandoned,
|
||||
completed
|
||||
FROM characters_quest_guildleve_regional WHERE characterId = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
int index = reader.GetUInt16(0);
|
||||
player.work.guildleveId[index] = reader.GetUInt16(1);
|
||||
player.work.guildleveDone[index] = reader.GetBoolean(2);
|
||||
player.work.guildleveChecked[index] = reader.GetBoolean(3);
|
||||
}
|
||||
}
|
||||
|
||||
//Load NPC Linkshell
|
||||
query = @"
|
||||
SELECT
|
||||
npcLinkshellId,
|
||||
isCalling,
|
||||
isExtra
|
||||
FROM characters_npclinkshell WHERE characterId = @charId";
|
||||
|
||||
cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
int npcLSId = reader.GetUInt16(0);
|
||||
player.playerWork.npcLinkshellChatCalling[npcLSId] = reader.GetBoolean(1);
|
||||
player.playerWork.npcLinkshellChatExtra[npcLSId] = reader.GetBoolean(2);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
}
|
||||
{ Console.WriteLine(e); }
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
|
||||
return appearance;
|
||||
}
|
||||
}
|
||||
|
||||
public static DBStats getCharacterStats(uint charaId)
|
||||
public static SubPacket getLatestAchievements(Player player)
|
||||
{
|
||||
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)))
|
||||
uint[] latestAchievements = new uint[5];
|
||||
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)))
|
||||
{
|
||||
DBStats stats = null;
|
||||
try
|
||||
{
|
||||
conn.Open();
|
||||
stats = conn.Query<DBStats>("SELECT * FROM characters_stats WHERE characterId=@CharaId", new { CharaId = charaId }).SingleOrDefault();
|
||||
|
||||
//Load Last 5 Completed
|
||||
string query = @"
|
||||
SELECT
|
||||
characters_achievements.achievementId FROM characters_achievements
|
||||
INNER JOIN gamedata_achievements ON characters_achievements.achievementId = gamedata_achievements.achievementId
|
||||
WHERE characterId = @charId AND rewardPoints <> 0 ORDER BY timeDone LIMIT 5";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
int count = 0;
|
||||
while (reader.Read())
|
||||
{
|
||||
uint id = reader.GetUInt32(0);
|
||||
latestAchievements[count++] = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{
|
||||
}
|
||||
{ Console.WriteLine(e); }
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
|
||||
return stats;
|
||||
}
|
||||
|
||||
return SetLatestAchievementsPacket.buildPacket(player.actorId, latestAchievements);
|
||||
}
|
||||
|
||||
public static SubPacket getAchievementsPacket(Player player)
|
||||
{
|
||||
SetCompletedAchievementsPacket cheevosPacket = new SetCompletedAchievementsPacket();
|
||||
|
||||
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 packetOffsetId
|
||||
FROM characters_achievements
|
||||
INNER JOIN gamedata_achievements ON characters_achievements.achievementId = gamedata_achievements.achievementId
|
||||
WHERE characterId = @charId AND timeDone IS NOT NULL";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
cmd.Parameters.AddWithValue("@charId", player.actorId);
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
uint offset = reader.GetUInt32(0);
|
||||
|
||||
if (offset < 0 || offset >= cheevosPacket.achievementFlags.Length)
|
||||
{
|
||||
Log.error("SQL Error; achievement flag offset id out of range: " + offset);
|
||||
continue;
|
||||
}
|
||||
cheevosPacket.achievementFlags[offset] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{ Console.WriteLine(e); }
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
return cheevosPacket.buildPacket(player.actorId);
|
||||
}
|
||||
|
||||
public static void loadZones(Efficient32bitHashTable<Zone> zoneList)
|
||||
{
|
||||
int count = 0;
|
||||
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
|
||||
id,
|
||||
regionId,
|
||||
zoneName,
|
||||
dayMusic,
|
||||
nightMusic,
|
||||
battleMusic,
|
||||
isInn,
|
||||
canRideChocobo,
|
||||
canStealth,
|
||||
isInstanceRaid
|
||||
FROM server_zones
|
||||
WHERE zoneName IS NOT NULL";
|
||||
|
||||
MySqlCommand cmd = new MySqlCommand(query, conn);
|
||||
|
||||
using (MySqlDataReader reader = cmd.ExecuteReader())
|
||||
{
|
||||
while (reader.Read()) {
|
||||
Zone zone = new Zone(reader.GetUInt32(0), reader.GetString(2), reader.GetUInt16(1), reader.GetUInt16(3), reader.GetUInt16(4), reader.GetUInt16(5), reader.GetBoolean(6), reader.GetBoolean(7), reader.GetBoolean(8), reader.GetBoolean(9));
|
||||
zoneList.Add(zone.actorId, zone);
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (MySqlException e)
|
||||
{ Console.WriteLine(e); }
|
||||
finally
|
||||
{
|
||||
conn.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Log.info(String.Format("Loaded {0} zones.", count));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -41,6 +41,9 @@
|
|||
<HintPath>..\packages\Dapper.1.42\lib\net45\Dapper.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="KeraLua">
|
||||
<HintPath>..\packages\NLua.1.3.2.1\lib\net45\KeraLua.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.6.9.7\lib\net45\MySql.Data.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
|
@ -49,6 +52,9 @@
|
|||
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="NLua">
|
||||
<HintPath>..\packages\NLua.1.3.2.1\lib\net45\NLua.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
|
@ -58,55 +64,65 @@
|
|||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="actors\chara\npc\NpcWork.cs" />
|
||||
<Compile Include="actors\chara\AetheryteWork.cs" />
|
||||
<Compile Include="actors\chara\Work.cs" />
|
||||
<Compile Include="actors\debug\Debug.cs" />
|
||||
<Compile Include="actors\director\WeatherDirector.cs" />
|
||||
<Compile Include="actors\judge\Judge.cs" />
|
||||
<Compile Include="actors\StaticActors.cs" />
|
||||
<Compile Include="actors\world\WorldMaster.cs" />
|
||||
<Compile Include="ClientConnection.cs" />
|
||||
<Compile Include="common\Bitfield.cs" />
|
||||
<Compile Include="common\Blowfish.cs" />
|
||||
<Compile Include="common\EfficientHashTables.cs" />
|
||||
<Compile Include="common\Log.cs" />
|
||||
<Compile Include="common\STA_INIFile.cs" />
|
||||
<Compile Include="common\Utils.cs" />
|
||||
<Compile Include="ConfigConstants.cs" />
|
||||
<Compile Include="Database.cs" />
|
||||
<Compile Include="dataobjects\Actor.cs" />
|
||||
<Compile Include="dataobjects\chara\BattleSave.cs" />
|
||||
<Compile Include="dataobjects\chara\BattleTemp.cs" />
|
||||
<Compile Include="dataobjects\chara\EventSave.cs" />
|
||||
<Compile Include="dataobjects\chara\EventTemp.cs" />
|
||||
<Compile Include="dataobjects\chara\ParameterTemp.cs" />
|
||||
<Compile Include="dataobjects\chara\PlayerActor.cs" />
|
||||
<Compile Include="dataobjects\database\DBAppearance.cs" />
|
||||
<Compile Include="dataobjects\database\DBCharacter.cs" />
|
||||
<Compile Include="dataobjects\CharaInfo.cs" />
|
||||
<Compile Include="dataobjects\chara\CharaWork.cs" />
|
||||
<Compile Include="dataobjects\chara\ParameterSave.cs" />
|
||||
<Compile Include="dataobjects\chara\PlayerWork.cs" />
|
||||
<Compile Include="dataobjects\database\DBCommands.cs" />
|
||||
<Compile Include="dataobjects\database\DBJournal.cs" />
|
||||
<Compile Include="dataobjects\database\DBPlayerData.cs" />
|
||||
<Compile Include="dataobjects\database\DBStats.cs" />
|
||||
<Compile Include="actors\Actor.cs" />
|
||||
<Compile Include="actors\chara\BattleSave.cs" />
|
||||
<Compile Include="actors\chara\BattleTemp.cs" />
|
||||
<Compile Include="actors\chara\Character.cs" />
|
||||
<Compile Include="actors\chara\EventSave.cs" />
|
||||
<Compile Include="actors\chara\EventTemp.cs" />
|
||||
<Compile Include="actors\chara\npc\Npc.cs" />
|
||||
<Compile Include="actors\chara\ParameterTemp.cs" />
|
||||
<Compile Include="actors\chara\player\Player.cs" />
|
||||
<Compile Include="actors\command\Command.cs" />
|
||||
<Compile Include="actors\chara\CharaWork.cs" />
|
||||
<Compile Include="actors\chara\ParameterSave.cs" />
|
||||
<Compile Include="actors\chara\player\PlayerWork.cs" />
|
||||
<Compile Include="dataobjects\DBWorld.cs" />
|
||||
<Compile Include="dataobjects\Item.cs" />
|
||||
<Compile Include="dataobjects\ConnectedPlayer.cs" />
|
||||
<Compile Include="dataobjects\database\DBWorld.cs" />
|
||||
<Compile Include="dataobjects\RecruitmentDetails.cs" />
|
||||
<Compile Include="dataobjects\SearchEntry.cs" />
|
||||
<Compile Include="lua\LuaEngine.cs" />
|
||||
<Compile Include="lua\LuaEvent.cs" />
|
||||
<Compile Include="lua\LuaParam.cs" />
|
||||
<Compile Include="lua\LuaPlayer.cs" />
|
||||
<Compile Include="PacketProcessor.cs" />
|
||||
<Compile Include="packets\BasePacket.cs" />
|
||||
<Compile Include="packets\receive\ChatMessagePacket.cs" />
|
||||
<Compile Include="packets\receive\events\EventUpdatePacket.cs" />
|
||||
<Compile Include="packets\receive\events\EventStartPacket.cs" />
|
||||
<Compile Include="packets\receive\HandshakePacket.cs" />
|
||||
<Compile Include="packets\receive\recruitment\RecruitmentDetailsRequestPacket.cs" />
|
||||
<Compile Include="packets\receive\recruitment\RecruitmentSearchRequestPacket.cs" />
|
||||
<Compile Include="packets\receive\recruitment\StartRecruitingRequestPacket.cs" />
|
||||
<Compile Include="packets\receive\script\CommandStartRequestPacket.cs" />
|
||||
<Compile Include="packets\receive\script\ScriptResultPacket.cs" />
|
||||
<Compile Include="packets\receive\SetTargetPacket.cs" />
|
||||
<Compile Include="packets\receive\LockTargetPacket.cs" />
|
||||
<Compile Include="packets\receive\social\AddRemoveSocialPacket.cs" />
|
||||
<Compile Include="packets\receive\social\FriendlistRequestPacket.cs" />
|
||||
<Compile Include="packets\receive\StartScriptPacket.cs" />
|
||||
<Compile Include="packets\receive\supportdesk\FaqBodyRequestPacket.cs" />
|
||||
<Compile Include="packets\receive\supportdesk\FaqListRequestPacket.cs" />
|
||||
<Compile Include="packets\receive\supportdesk\GMTicketIssuesRequestPacket.cs" />
|
||||
<Compile Include="packets\send\actor\ActorDoEmotePacket.cs" />
|
||||
<Compile Include="packets\send\actor\ActorInstantiatePacket.cs" />
|
||||
<Compile Include="packets\send\actor\DeleteAllActorsPacket.cs" />
|
||||
<Compile Include="packets\send\actor\_0x132Packet.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorIsZoningPacket.cs" />
|
||||
<Compile Include="packets\send\actor\DoBattleActionPacket.cs" />
|
||||
<Compile Include="packets\send\actor\inventory\EquipmentChangePacket.cs" />
|
||||
|
@ -119,8 +135,11 @@
|
|||
<Compile Include="packets\send\actor\inventory\EquipmentSetupPacket.cs" />
|
||||
<Compile Include="packets\send\actor\RemoveActorPacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorIconPacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorIdleAnimationPacket.cs" />
|
||||
<Compile Include="packets\send\actor\SetActorStatusPacket.cs" />
|
||||
<Compile Include="packets\send\actor\_0xFPacket.cs" />
|
||||
<Compile Include="packets\send\events\EndEventPacket.cs" />
|
||||
<Compile Include="packets\send\events\RunEventFunctionPacket.cs" />
|
||||
<Compile Include="packets\send\list\ListEntry.cs" />
|
||||
<Compile Include="packets\send\list\ListUtils.cs" />
|
||||
<Compile Include="packets\send\list\SetListPropertyPacket.cs" />
|
||||
|
@ -130,6 +149,8 @@
|
|||
<Compile Include="packets\send\list\ListStartPacket.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" />
|
||||
|
@ -162,8 +183,6 @@
|
|||
<Compile Include="packets\send\recruitment\EndRecruitmentPacket.cs" />
|
||||
<Compile Include="packets\send\recruitment\RecruiterStatePacket.cs" />
|
||||
<Compile Include="packets\send\recruitment\StartRecruitingResponse.cs" />
|
||||
<Compile Include="packets\send\script\ScriptEndPacket.cs" />
|
||||
<Compile Include="packets\send\script\ScriptStartPacket.cs" />
|
||||
<Compile Include="packets\send\SendMessagePacket.cs" />
|
||||
<Compile Include="packets\send\SetMapPacket.cs" />
|
||||
<Compile Include="packets\send\SetMusicPacket.cs" />
|
||||
|
@ -182,14 +201,18 @@
|
|||
<Compile Include="packets\send\supportdesk\FaqListResponsePacket.cs" />
|
||||
<Compile Include="packets\send\supportdesk\GMTicketPacket.cs" />
|
||||
<Compile Include="packets\send\supportdesk\GMTicketSentResponsePacket.cs" />
|
||||
<Compile Include="packets\send\_0xE2Packet.cs" />
|
||||
<Compile Include="packets\SubPacket.cs" />
|
||||
<Compile Include="packets\receive\PingPacket.cs" />
|
||||
<Compile Include="packets\receive\UpdatePlayerPositionPacket.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="ScriptParamReader.cs" />
|
||||
<Compile Include="lua\LuaUtils.cs" />
|
||||
<Compile Include="Server.cs" />
|
||||
<Compile Include="Zone.cs" />
|
||||
<Compile Include="utils\ActorPropertyPacketUtil.cs" />
|
||||
<Compile Include="utils\CharacterUtils.cs" />
|
||||
<Compile Include="utils\SQLGeneration.cs" />
|
||||
<Compile Include="actors\area\Zone.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="App.config" />
|
||||
|
@ -197,6 +220,10 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
xcopy /s /y "D:\Coding\FFXIV Related\ffxiv-classic-map-server\packages\NLua.1.3.2.1\lib\native\*.*" "$(TargetDir)"</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
@ -18,7 +18,6 @@ using FFXIVClassic_Map_Server.packets.send.Actor.inventory;
|
|||
using FFXIVClassic_Map_Server.packets.send.Actor;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using FFXIVClassic_Map_Server;
|
||||
using FFXIVClassic_Map_Server.packets.send.script;
|
||||
using FFXIVClassic_Map_Server.packets.send.player;
|
||||
using FFXIVClassic_Map_Server.dataobjects.chara;
|
||||
using FFXIVClassic_Map_Server.packets.send.supportdesk;
|
||||
|
@ -28,20 +27,38 @@ using FFXIVClassic_Map_Server.packets.receive.supportdesk;
|
|||
using FFXIVClassic_Map_Server.packets.receive.recruitment;
|
||||
using FFXIVClassic_Map_Server.packets.send.recruitment;
|
||||
using FFXIVClassic_Map_Server.packets.send.list;
|
||||
using FFXIVClassic_Map_Server.packets.receive.events;
|
||||
using FFXIVClassic_Map_Server.packets.send.events;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.dataobjects.actors;
|
||||
using FFXIVClassic_Map_Server.dataobjects.chara.npc;
|
||||
using FFXIVClassic_Map_Server.actors;
|
||||
using System.Net;
|
||||
using FFXIVClassic_Map_Server.actors.debug;
|
||||
using FFXIVClassic_Map_Server.actors.world;
|
||||
using FFXIVClassic_Map_Server.common.EfficientHashTables;
|
||||
|
||||
namespace FFXIVClassic_Lobby_Server
|
||||
{
|
||||
class PacketProcessor
|
||||
{
|
||||
LuaEngine luaEngine = new LuaEngine();
|
||||
Dictionary<uint, ConnectedPlayer> mPlayers;
|
||||
List<ClientConnection> mConnections;
|
||||
|
||||
Zone inn = new Zone();
|
||||
StaticActors mStaticActors = new StaticActors();
|
||||
|
||||
DebugProg debug = new DebugProg();
|
||||
WorldMaster worldMaster = new WorldMaster();
|
||||
|
||||
Efficient32bitHashTable<Zone> zoneList = new Efficient32bitHashTable<Zone>();
|
||||
|
||||
public PacketProcessor(Dictionary<uint, ConnectedPlayer> playerList, List<ClientConnection> connectionList)
|
||||
{
|
||||
mPlayers = playerList;
|
||||
mConnections = connectionList;
|
||||
|
||||
Database.loadZones(zoneList);
|
||||
}
|
||||
|
||||
public void processPacket(ClientConnection client, BasePacket packet)
|
||||
|
@ -116,10 +133,6 @@ namespace FFXIVClassic_Lobby_Server
|
|||
if (actorID == 0)
|
||||
break;
|
||||
|
||||
//Second connection
|
||||
if (mPlayers.ContainsKey(actorID))
|
||||
player = mPlayers[actorID];
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(reply2.data))
|
||||
{
|
||||
using (BinaryWriter binReader = new BinaryWriter(mem))
|
||||
|
@ -129,7 +142,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||
}
|
||||
}
|
||||
|
||||
if (player == null)
|
||||
if (((IPEndPoint)client.socket.LocalEndPoint).Port == 54992)
|
||||
{
|
||||
player = new ConnectedPlayer(actorID);
|
||||
mPlayers[actorID] = player;
|
||||
|
@ -177,49 +190,30 @@ namespace FFXIVClassic_Lobby_Server
|
|||
break;
|
||||
//Unknown
|
||||
case 0x0002:
|
||||
BasePacket block132 = new BasePacket("./packets/tt2/4");
|
||||
BasePacket packet196 = new BasePacket("./packets/196");
|
||||
|
||||
BasePacket reply6 = new BasePacket("./packets/login/login6_data.bin");
|
||||
BasePacket reply7 = new BasePacket("./packets/login/login7_data.bin");
|
||||
BasePacket reply8 = new BasePacket("./packets/login/login8_data.bin");
|
||||
BasePacket reply9 = new BasePacket("./packets/login/login9_zonesetup.bin");
|
||||
BasePacket reply10 = new BasePacket("./packets/login/login10.bin");
|
||||
BasePacket reply11 = new BasePacket("./packets/login/login11.bin");
|
||||
BasePacket reply12 = new BasePacket("./packets/login/login12.bin");
|
||||
player.getActor().zone = zoneList.Get(player.getActor().zoneId);
|
||||
|
||||
// BasePacket keyitems = new BasePacket("./packets/login/keyitems.bin");
|
||||
// BasePacket currancy = new BasePacket("./packets/login/currancy.bin");
|
||||
BasePacket reply9 = new BasePacket("./packets/login/login9_zonesetup.bin"); //Bed, Book created
|
||||
BasePacket reply10 = new BasePacket("./packets/login/login10.bin"); //Item Storage, Inn Door created
|
||||
BasePacket reply11 = new BasePacket("./packets/login/login11.bin"); //NPC Create ??? Final init
|
||||
|
||||
#region replaceid
|
||||
//currancy.replaceActorID(player.actorID);
|
||||
//keyitems.replaceActorID(player.actorID);
|
||||
|
||||
block132.replaceActorID(player.actorID);
|
||||
packet196.replaceActorID(player.actorID);
|
||||
reply6.replaceActorID(player.actorID);
|
||||
reply7.replaceActorID(player.actorID);
|
||||
reply8.replaceActorID(player.actorID);
|
||||
reply9.replaceActorID(player.actorID);
|
||||
reply10.replaceActorID(player.actorID);
|
||||
reply11.replaceActorID(player.actorID);
|
||||
reply12.replaceActorID(player.actorID);
|
||||
#endregion
|
||||
|
||||
client.queuePacket(SetMapPacket.buildPacket(player.actorID, 0xD1, 0xF4), true, false);
|
||||
client.queuePacket(SetMapPacket.buildPacket(player.actorID, 0xD1, 0xF4), true, false);
|
||||
// client.queuePacket(SetMapPacket.buildPacket(player.actorID, 0x68, 0xF4), true, false);
|
||||
client.queuePacket(_0x2Packet.buildPacket(player.actorID), true, false);
|
||||
client.queuePacket(SendMessagePacket.buildPacket(player.actorID, player.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", "-------- Login Message --------\nWelcome to the 1.0 Dev Server"), true, false);
|
||||
client.queuePacket(SetMusicPacket.buildPacket(player.actorID, 0x3D, 0x01), true, false);
|
||||
client.queuePacket(SetWeatherPacket.buildPacket(player.actorID, SetWeatherPacket.WEATHER_CLEAR), true, false);
|
||||
|
||||
client.queuePacket(AddActorPacket.buildPacket(player.actorID, player.actorID, 0), true, false);
|
||||
|
||||
// client.queuePacket(reply6);
|
||||
|
||||
client.queuePacket(block132);
|
||||
BasePacket actorPacket = player.getActor().createActorSpawnPackets(player.actorID);
|
||||
actorPacket.debugPrintPacket();
|
||||
BasePacket actorPacket = player.getActor().getSpawnPackets(player.actorID);
|
||||
client.queuePacket(actorPacket);
|
||||
|
||||
//Retainers
|
||||
|
@ -238,15 +232,10 @@ namespace FFXIVClassic_Lobby_Server
|
|||
BasePacket partyListPacket = BasePacket.createPacket(ListUtils.createPartyList(player.actorID, 0xF4, 1, 0x8000000000696df2, partyListEntries), true, false);
|
||||
client.queuePacket(partyListPacket);
|
||||
|
||||
//0x144 happens
|
||||
client.queuePacket(SetActorStatusAllPacket.buildPacket(player.actorID, player.actorID, new ushort[] { 23263, 23264 }), true, false);
|
||||
client.queuePacket(SetActorIconPacket.buildPacket(player.actorID, player.actorID, 0), true, false);
|
||||
client.queuePacket(SetActorIsZoningPacket.buildPacket(player.actorID, player.actorID, false), true, false);
|
||||
|
||||
#region itemsetup
|
||||
////////ITEMS////////
|
||||
client.queuePacket(InventoryBeginChangePacket.buildPacket(player.actorID), true, false);
|
||||
|
||||
#region itemsetup
|
||||
|
||||
//TEST
|
||||
List<Item> items = new List<Item>();
|
||||
|
@ -283,14 +272,14 @@ namespace FFXIVClassic_Lobby_Server
|
|||
setinvPackets.Add(beginInventory);
|
||||
setinvPackets.Add(setInventory);
|
||||
setinvPackets.Add(endInventory);
|
||||
#endregion
|
||||
|
||||
client.queuePacket(BasePacket.createPacket(setinvPackets, true, false));
|
||||
|
||||
//client.queuePacket(currancy);
|
||||
//client.queuePacket(keyitems);
|
||||
|
||||
#endregion
|
||||
|
||||
#region equipsetup
|
||||
client.queuePacket(BasePacket.createPacket(setinvPackets, true, false));
|
||||
EquipmentSetupPacket initialEqupmentPacket = new EquipmentSetupPacket();
|
||||
initialEqupmentPacket.setItem(EquipmentSetupPacket.SLOT_BODY, 5);
|
||||
initialEqupmentPacket.setItem(EquipmentSetupPacket.SLOT_HEAD, 3);
|
||||
|
@ -298,7 +287,6 @@ namespace FFXIVClassic_Lobby_Server
|
|||
initialEqupmentPacket.setItem(EquipmentSetupPacket.SLOT_UNDERGARMENT, 7);
|
||||
initialEqupmentPacket.setItem(EquipmentSetupPacket.SLOT_MAINHAND, 2);
|
||||
initialEqupmentPacket.setItem(EquipmentSetupPacket.SLOT_LEGS, 8);
|
||||
#endregion
|
||||
|
||||
//Equip Init
|
||||
client.queuePacket(InventorySetBeginPacket.buildPacket(player.actorID, 0x23, InventorySetBeginPacket.CODE_EQUIPMENT), true, false);
|
||||
|
@ -308,53 +296,26 @@ namespace FFXIVClassic_Lobby_Server
|
|||
client.queuePacket(InventoryEndChangePacket.buildPacket(player.actorID), true, false);
|
||||
////////ITEMS////////
|
||||
|
||||
client.queuePacket(SetGrandCompanyPacket.buildPacket(player.actorID, player.actorID, 0x01, 0x1B, 0x1B, 0x1B), true, false);
|
||||
client.queuePacket(SetPlayerTitlePacket.buildPacket(player.actorID, player.actorID, 0x00), true, false);
|
||||
client.queuePacket(SetCurrentJobPacket.buildPacket(player.actorID, player.actorID, 0x13), true, false);
|
||||
client.queuePacket(packet196);//client.queuePacket(_0x196Packet.buildPacket(player.actorID, player.actorID), true, false);
|
||||
client.queuePacket(SetChocoboNamePacket.buildPacket(player.actorID, player.actorID, "Boco"), true, false);
|
||||
client.queuePacket(SetHasChocoboPacket.buildPacket(player.actorID, true), true, false);
|
||||
client.queuePacket(SetHasGoobbuePacket.buildPacket(player.actorID, true), true, false);
|
||||
#endregion
|
||||
|
||||
SetCompletedAchievementsPacket cheevos = new SetCompletedAchievementsPacket();
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_BATTLE] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_CHARACTER] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_CURRENCY] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_DUNGEONS] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_EXPLORATION] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_GATHERING] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_GRAND_COMPANY] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_ITEMS] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_MATERIA] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_QUESTS] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_SEASONAL_EVENTS] = true;
|
||||
cheevos.achievementFlags[SetCompletedAchievementsPacket.CATEGORY_SYNTHESIS] = true;
|
||||
client.queuePacket(cheevos.buildPacket(player.actorID), true, false);
|
||||
|
||||
client.queuePacket(SetLatestAchievementsPacket.buildPacket(player.actorID, new uint[5]), true, false);
|
||||
client.queuePacket(SetAchievementPointsPacket.buildPacket(player.actorID, 0x00), true, false);
|
||||
|
||||
SetCutsceneBookPacket book = new SetCutsceneBookPacket();
|
||||
for (int i = 0; i < book.cutsceneFlags.Length; i++)
|
||||
book.cutsceneFlags[i] = true;
|
||||
client.queuePacket(book.buildPacket(player.actorID), true, false);
|
||||
|
||||
//client.queuePacket(SetPlayerDreamPacket.buildPacket(player.actorID, 0x0A), true, false);
|
||||
|
||||
// loadTest(client, player);
|
||||
// return;
|
||||
|
||||
BasePacket tpacket = BasePacket.createPacket(player.getActor().createInitSubpackets(player.actorID), true, false);
|
||||
BasePacket tpacket = player.getActor().getInitPackets(player.actorID);
|
||||
//tpacket.debugPrintPacket();
|
||||
client.queuePacket(tpacket);
|
||||
|
||||
client.queuePacket(reply7);
|
||||
client.queuePacket(reply8);
|
||||
player.getActor().zone.addActorToZone(player.getActor());
|
||||
|
||||
BasePacket innSpawn = player.getActor().zone.getSpawnPackets(player.actorID);
|
||||
BasePacket debugSpawn = debug.getSpawnPackets(player.actorID);
|
||||
BasePacket worldMasterSpawn = worldMaster.getSpawnPackets(player.actorID);
|
||||
innSpawn.debugPrintPacket();
|
||||
|
||||
client.queuePacket(innSpawn);
|
||||
client.queuePacket(debugSpawn);
|
||||
client.queuePacket(worldMasterSpawn);
|
||||
|
||||
client.queuePacket(reply9);
|
||||
client.queuePacket(reply10);
|
||||
// client.queuePacket(reply11);
|
||||
client.queuePacket(reply12);
|
||||
|
||||
inn.addActorToZone(player.getActor());
|
||||
client.queuePacket(reply11);
|
||||
|
||||
break;
|
||||
//Chat Received
|
||||
|
@ -373,7 +334,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||
player.updatePlayerActorPosition(posUpdate.x, posUpdate.y, posUpdate.z, posUpdate.rot, posUpdate.moveState);
|
||||
|
||||
//Update Instance
|
||||
List<BasePacket> instanceUpdatePackets = player.updateInstance(inn.getActorsAroundActor(player.getActor(), 50));
|
||||
List<BasePacket> instanceUpdatePackets = player.updateInstance(player.getActor().zone.getActorsAroundActor(player.getActor(), 50));
|
||||
foreach (BasePacket bp in instanceUpdatePackets)
|
||||
client.queuePacket(bp);
|
||||
|
||||
|
@ -391,17 +352,35 @@ namespace FFXIVClassic_Lobby_Server
|
|||
LockTargetPacket lockTarget = new LockTargetPacket(subpacket.data);
|
||||
player.getActor().currentLockedTarget = lockTarget.actorID;
|
||||
break;
|
||||
//Start Script
|
||||
//Start Event
|
||||
case 0x012D:
|
||||
subpacket.debugPrintSubPacket();
|
||||
CommandStartRequestPacket commandStart = new CommandStartRequestPacket(subpacket.data);
|
||||
EventStartPacket eventStart = new EventStartPacket(subpacket.data);
|
||||
player.eventCurrentOwner = eventStart.scriptOwnerActorID;
|
||||
player.eventCurrentStarter = eventStart.eventStarter;
|
||||
|
||||
client.queuePacket(BasePacket.createPacket(ActorDoEmotePacket.buildPacket(player.actorID, player.getActor().currentTarget, 137), true, false));
|
||||
//Is it a static actor? If not look in the player's instance
|
||||
//Actor ownerActor = findActor(player, player.eventCurrentOwner);
|
||||
|
||||
//if (ownerActor == null)
|
||||
// break;
|
||||
|
||||
//luaEngine.doEventStart(player, ownerActor, eventStart);
|
||||
|
||||
//Log.debug(String.Format("\n===Event START===\nSource Actor: 0x{0:X}\nCaller Actor: 0x{1:X}\nVal1: 0x{2:X}\nVal2: 0x{3:X}\nEvent Starter: {4}\nParams: {5}", eventStart.actorID, eventStart.scriptOwnerActorID, eventStart.val1, eventStart.val2, eventStart.eventStarter, LuaParamReader.dumpParams(eventStart.luaParams)));
|
||||
break;
|
||||
//Script Result
|
||||
//Event Result
|
||||
case 0x012E:
|
||||
subpacket.debugPrintSubPacket();
|
||||
ScriptResultPacket scriptResult = new ScriptResultPacket(subpacket.data);
|
||||
EventUpdatePacket eventUpdate = new EventUpdatePacket(subpacket.data);
|
||||
Log.debug(String.Format("\n===Event UPDATE===\nSource Actor: 0x{0:X}\nCaller Actor: 0x{1:X}\nVal1: 0x{2:X}\nVal2: 0x{3:X}\nFunction ID: 0x{4:X}\nParams: {5}", eventUpdate.actorID, eventUpdate.scriptOwnerActorID, eventUpdate.val1, eventUpdate.val2, eventUpdate.step, LuaUtils.dumpParams(eventUpdate.luaParams)));
|
||||
|
||||
/*Actor updateOwnerActor = findActor(player, player.eventCurrentOwner);
|
||||
if (updateOwnerActor == null)
|
||||
break;
|
||||
|
||||
luaEngine.doEventUpdated(player, updateOwnerActor, eventUpdate);
|
||||
*/
|
||||
break;
|
||||
case 0x012F:
|
||||
subpacket.debugPrintSubPacket();
|
||||
|
@ -521,26 +500,35 @@ namespace FFXIVClassic_Lobby_Server
|
|||
}
|
||||
}
|
||||
|
||||
public void processScriptResult(SubPacket subpacket)
|
||||
/*
|
||||
public Actor findActor(ConnectedPlayer player, uint id)
|
||||
{
|
||||
uint someId1 = 0;
|
||||
uint someId2 = 0;
|
||||
uint someId3 = 0;
|
||||
|
||||
using (MemoryStream mem = new MemoryStream(subpacket.data))
|
||||
Actor ownerActor = mStaticActors[id];
|
||||
if (ownerActor == null)
|
||||
{
|
||||
using (BinaryReader binReader = new BinaryReader(mem))
|
||||
foreach (Actor a in player.actorInstanceList)
|
||||
{
|
||||
binReader.BaseStream.Seek(0x2C, SeekOrigin.Begin);
|
||||
someId1 = binReader.ReadUInt32();
|
||||
someId2 = binReader.ReadUInt32();
|
||||
someId3 = binReader.ReadUInt32();
|
||||
if (a.actorID == player.eventCurrentOwner)
|
||||
{
|
||||
ownerActor = a;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (ownerActor == null)
|
||||
return null;
|
||||
}
|
||||
|
||||
Log.info(String.Format("ProcessScriptResult: Id1 = {0}, Id2 = {1}, Id3 = {2}", someId1, someId2, someId3));
|
||||
|
||||
|
||||
return ownerActor;
|
||||
}
|
||||
*/
|
||||
private void initNpcs()
|
||||
{
|
||||
/*
|
||||
List<Npc> npcList = Database.getNpcList();
|
||||
foreach (Npc npc in npcList)
|
||||
inn.addActorToZone(npc);
|
||||
Log.info(String.Format("Loaded {0} npcs...", npcList.Count));
|
||||
* */
|
||||
}
|
||||
|
||||
private void loadTest(ClientConnection client, ConnectedPlayer player)
|
||||
|
@ -557,5 +545,34 @@ namespace FFXIVClassic_Lobby_Server
|
|||
}
|
||||
}
|
||||
|
||||
public void doWarp(uint mapID, float x, float y, float z)
|
||||
{
|
||||
List<SubPacket> pList = new List<SubPacket>();
|
||||
|
||||
|
||||
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mPlayers)
|
||||
{
|
||||
pList.Clear();
|
||||
|
||||
entry.Value.getActor().positionX = x;
|
||||
entry.Value.getActor().positionY = y;
|
||||
entry.Value.getActor().positionZ = z;
|
||||
|
||||
pList.Add(_0xE2Packet.buildPacket(0x6c, 0xF));
|
||||
pList.Add(SetMapPacket.buildPacket(0x6c, mapID, 0));
|
||||
BasePacket packet = BasePacket.createPacket(pList, true, false);
|
||||
|
||||
BasePacket actorPacket = entry.Value.getActor().getInitPackets(entry.Value.actorID);
|
||||
|
||||
packet.replaceActorID(entry.Value.actorID);
|
||||
actorPacket.replaceActorID(entry.Value.actorID);
|
||||
|
||||
entry.Value.getConnection1().queuePacket(packet);
|
||||
entry.Value.getConnection1().queuePacket(actorPacket);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,8 +6,8 @@ using FFXIVClassic_Lobby_Server.common;
|
|||
using System.Runtime.InteropServices;
|
||||
using MySql.Data.MySqlClient;
|
||||
using System.Reflection;
|
||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||
using System.IO;
|
||||
using FFXIVClassic_Lobby_Server.dataobjects;
|
||||
|
||||
namespace FFXIVClassic_Lobby_Server
|
||||
{
|
||||
|
@ -86,6 +86,10 @@ namespace FFXIVClassic_Lobby_Server
|
|||
Log.error("Could not load packet: " + e);
|
||||
}
|
||||
}
|
||||
else if (split[0].Equals("warp"))
|
||||
{
|
||||
server.doWarp(split[1], split[2], split[3], split[4]);
|
||||
}
|
||||
else if (split[0].Equals("property"))
|
||||
{
|
||||
server.testCodePacket(Utils.MurmurHash2(split[1], 0), Convert.ToUInt32(split[2], 16), split[3]);
|
||||
|
|
|
@ -1,72 +0,0 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server
|
||||
{
|
||||
class ScriptParamReader
|
||||
{
|
||||
List<int> types = new List<int>();
|
||||
List<Object> values = new List<Object>();
|
||||
|
||||
public ScriptParamReader(BinaryReader reader)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
byte code = reader.ReadByte();
|
||||
switch (code)
|
||||
{
|
||||
case 0x0: //INT32
|
||||
types.Add(6);
|
||||
values.Add(reader.ReadUInt32());
|
||||
break;
|
||||
case 0x1: //????
|
||||
continue;
|
||||
case 0x2: //Null Termed String
|
||||
types.Add(2);
|
||||
List<byte> list = new List<byte>();
|
||||
while(true){
|
||||
byte readByte = reader.ReadByte();
|
||||
if (readByte == 0)
|
||||
break;
|
||||
list.Add(readByte);
|
||||
}
|
||||
values.Add(Encoding.ASCII.GetString(list.ToArray()));
|
||||
break;
|
||||
case 0x4: //BYTE
|
||||
types.Add(4);
|
||||
values.Add(reader.ReadByte());
|
||||
break;
|
||||
case 0x5: //NULL???
|
||||
types.Add(5);
|
||||
values.Add(new Object());
|
||||
continue;
|
||||
case 0x6: //INT32
|
||||
types.Add(6);
|
||||
values.Add(reader.ReadUInt32());
|
||||
break;
|
||||
case 0xF: //End
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int getType(int index)
|
||||
{
|
||||
return types[index];
|
||||
}
|
||||
|
||||
public Object getValue(int index)
|
||||
{
|
||||
return values[index];
|
||||
}
|
||||
|
||||
public int getCount()
|
||||
{
|
||||
return values.Count;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -226,13 +226,16 @@ namespace FFXIVClassic_Lobby_Server
|
|||
|
||||
public void testCodePacket(uint id, uint value, string target)
|
||||
{
|
||||
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket();
|
||||
changeProperty.addInt(id, value);
|
||||
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(target);
|
||||
|
||||
changeProperty.setTarget(target);
|
||||
changeProperty.addInt(id, value);
|
||||
changeProperty.addTarget();
|
||||
|
||||
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
||||
{
|
||||
SubPacket changePropertyPacket = changeProperty.buildPacket((entry.Value.actorID), (entry.Value.actorID));
|
||||
|
||||
BasePacket packet = BasePacket.createPacket(changePropertyPacket, true, false);
|
||||
packet.debugPrintPacket();
|
||||
if (entry.Value.getConnection1() != null)
|
||||
|
@ -250,7 +253,7 @@ namespace FFXIVClassic_Lobby_Server
|
|||
{
|
||||
foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList)
|
||||
{
|
||||
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket();
|
||||
SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(target);
|
||||
changeProperty.addProperty(entry.Value.getActor(), name);
|
||||
changeProperty.addProperty(entry.Value.getActor(), "charaWork.parameterSave.hpMax[0]");
|
||||
changeProperty.setTarget(target);
|
||||
|
@ -263,5 +266,13 @@ namespace FFXIVClassic_Lobby_Server
|
|||
}
|
||||
}
|
||||
|
||||
public void doWarp(String map, String x, String y, String z)
|
||||
{
|
||||
if (map.ToLower().StartsWith("0x"))
|
||||
mProcessor.doWarp(Convert.ToUInt32(map, 16), Single.Parse(x), Single.Parse(y), Single.Parse(z));
|
||||
else
|
||||
mProcessor.doWarp(Convert.ToUInt32(map), Single.Parse(x), Single.Parse(y), Single.Parse(z));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
149
FFXIVClassic Map Server/actors/Actor.cs
Normal file
149
FFXIVClassic Map Server/actors/Actor.cs
Normal file
|
@ -0,0 +1,149 @@
|
|||
using FFXIVClassic_Lobby_Server;
|
||||
using FFXIVClassic_Lobby_Server.common;
|
||||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.dataobjects.chara;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects
|
||||
{
|
||||
class Actor
|
||||
{
|
||||
public uint actorId;
|
||||
public string actorName;
|
||||
|
||||
public uint displayNameId = 0xFFFFFFFF;
|
||||
public string customDisplayName;
|
||||
|
||||
public ushort currentMainState = SetActorStatePacket.MAIN_STATE_PASSIVE;
|
||||
public ushort currentSubState = SetActorStatePacket.SUB_STATE_NONE;
|
||||
public float positionX, positionY, positionZ, rotation;
|
||||
public float oldPositionX, oldPositionY, oldPositionZ, oldRotation;
|
||||
public ushort moveState, oldMoveState;
|
||||
|
||||
public uint zoneId;
|
||||
public Zone zone = null;
|
||||
public bool isZoning = false;
|
||||
|
||||
public bool spawnedFirstTime = false;
|
||||
|
||||
public string className;
|
||||
public List<LuaParam> classParams;
|
||||
|
||||
public Actor(uint actorId)
|
||||
{
|
||||
this.actorId = actorId;
|
||||
}
|
||||
|
||||
public Actor(uint actorId, string actorName, string className, List<LuaParam> classParams)
|
||||
{
|
||||
this.actorId = actorId;
|
||||
this.actorName = actorName;
|
||||
this.className = className;
|
||||
this.classParams = classParams;
|
||||
}
|
||||
|
||||
public SubPacket createAddActorPacket(uint playerActorId)
|
||||
{
|
||||
return AddActorPacket.buildPacket(actorId, playerActorId, 0);
|
||||
}
|
||||
|
||||
public SubPacket createNamePacket(uint playerActorId)
|
||||
{
|
||||
return SetActorNamePacket.buildPacket(actorId, playerActorId, displayNameId, displayNameId == 0xFFFFFFFF ? customDisplayName : "");
|
||||
}
|
||||
|
||||
public SubPacket createSpeedPacket(uint playerActorId)
|
||||
{
|
||||
return SetActorSpeedPacket.buildPacket(actorId, playerActorId);
|
||||
}
|
||||
|
||||
public SubPacket createSpawnPositonPacket(uint playerActorId, uint spawnType)
|
||||
{
|
||||
SubPacket spawnPacket;
|
||||
if (!spawnedFirstTime && playerActorId == actorId)
|
||||
spawnPacket = SetActorPositionPacket.buildPacket(actorId, playerActorId, 0, positionX, positionY, positionZ, rotation, spawnType, false);
|
||||
else if (playerActorId == actorId)
|
||||
spawnPacket = SetActorPositionPacket.buildPacket(actorId, playerActorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, true);
|
||||
else
|
||||
spawnPacket = SetActorPositionPacket.buildPacket(actorId, playerActorId, actorId, positionX, positionY, positionZ, rotation, spawnType, false);
|
||||
|
||||
//return SetActorPositionPacket.buildPacket(actorId, playerActorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE);
|
||||
spawnedFirstTime = true;
|
||||
return spawnPacket;
|
||||
}
|
||||
|
||||
public SubPacket createPositionUpdatePacket(uint playerActorId)
|
||||
{
|
||||
return MoveActorToPositionPacket.buildPacket(actorId, playerActorId, positionX, positionY, positionZ, rotation, moveState);
|
||||
}
|
||||
|
||||
public SubPacket createStatePacket(uint playerActorID)
|
||||
{
|
||||
return SetActorStatePacket.buildPacket(actorId, playerActorID, currentMainState, currentSubState);
|
||||
}
|
||||
|
||||
public SubPacket createIsZoneingPacket(uint playerActorId)
|
||||
{
|
||||
return SetActorIsZoningPacket.buildPacket(actorId, playerActorId, false);
|
||||
}
|
||||
|
||||
public virtual SubPacket createScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, classParams);
|
||||
}
|
||||
|
||||
public virtual BasePacket getSpawnPackets(uint playerActorId)
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>();
|
||||
subpackets.Add(createAddActorPacket(playerActorId));
|
||||
subpackets.Add(createSpeedPacket(playerActorId));
|
||||
subpackets.Add(createSpawnPositonPacket(playerActorId, 0x1));
|
||||
subpackets.Add(createNamePacket(playerActorId));
|
||||
subpackets.Add(createStatePacket(playerActorId));
|
||||
subpackets.Add(createIsZoneingPacket(playerActorId));
|
||||
subpackets.Add(createScriptBindPacket(playerActorId));
|
||||
return BasePacket.createPacket(subpackets, true, false);
|
||||
}
|
||||
|
||||
public virtual BasePacket getInitPackets(uint playerActorId)
|
||||
{
|
||||
SetActorPropetyPacket initProperties = new SetActorPropetyPacket("/_init");
|
||||
initProperties.addTarget();
|
||||
return BasePacket.createPacket(initProperties.buildPacket(playerActorId, actorId), true, false);
|
||||
}
|
||||
|
||||
public override bool Equals(Object obj)
|
||||
{
|
||||
Actor actorObj = obj as Actor;
|
||||
if (actorObj == null)
|
||||
return false;
|
||||
else
|
||||
return actorId == actorObj.actorId;
|
||||
}
|
||||
|
||||
public string getName()
|
||||
{
|
||||
return actorName;
|
||||
}
|
||||
|
||||
public string getClassName()
|
||||
{
|
||||
return className;
|
||||
}
|
||||
|
||||
public List<LuaParam> getLuaParams()
|
||||
{
|
||||
return classParams;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
116
FFXIVClassic Map Server/actors/StaticActors.cs
Normal file
116
FFXIVClassic Map Server/actors/StaticActors.cs
Normal file
|
@ -0,0 +1,116 @@
|
|||
using FFXIVClassic_Map_Server.actors.judge;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.dataobjects.actors;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors
|
||||
{
|
||||
class StaticActors
|
||||
{
|
||||
private Dictionary<uint, Actor> mStaticActors = new Dictionary<uint, Actor>();
|
||||
|
||||
public StaticActors()
|
||||
{
|
||||
//Judges
|
||||
mStaticActors.Add(0xA0F5BAF1, new Judge(0x4BAF1, "JudgeMaster"));
|
||||
mStaticActors.Add(0xA0F5E201, new Judge(0x4E201, "CommonJudge"));
|
||||
mStaticActors.Add(0xA0F5E206, new Judge(0x4E206, "TutorialJudge"));
|
||||
mStaticActors.Add(0xA0F5E20D, new Judge(0x4E20D, "ChocoboJudge"));
|
||||
mStaticActors.Add(0xA0F50911, new Judge(0x50911, "DeceptionJudge"));
|
||||
|
||||
//Commands
|
||||
mStaticActors.Add(0xA0F02EE2, new Command(0xA0F02EE2, "ResetOccupiedCommand"));
|
||||
mStaticActors.Add(0xA0F02EE3, new Command(0xA0F02EE3, "CombinationManagementCommand"));
|
||||
mStaticActors.Add(0xA0F02EE4, new Command(0xA0F02EE4, "CombinationStartCommand"));
|
||||
mStaticActors.Add(0xA0F02EE5, new Command(0xA0F02EE5, "BonusPointCOmmand"));
|
||||
mStaticActors.Add(0xA0F02EE7, new Command(0xA0F02EE7, "ChangeEquipCommand"));
|
||||
mStaticActors.Add(0xA0F02EE9, new Command(0xA0F02EE9, "EquipCommand"));
|
||||
mStaticActors.Add(0xA0F02EEA, new Command(0xA0F02EEA, "EquipAbilityCommand"));
|
||||
mStaticActors.Add(0xA0F02EEB, new Command(0xA0F02EEB, "PartyTargetCommand"));
|
||||
mStaticActors.Add(0xA0F02EED, new Command(0xA0F02EED, "EquipPartsShowHideCommand"));
|
||||
mStaticActors.Add(0xA0F02EEE, new Command(0xA0F02EEE, "ChocoboRideCommand"));
|
||||
mStaticActors.Add(0xA0F02EEF, new Command(0xA0F02EEF, "ChocoboRideCommand"));
|
||||
mStaticActors.Add(0xA0F02EF0, new Command(0xA0F02EF0, "ReverseInputOperationCommand"));
|
||||
mStaticActors.Add(0xA0F02EF1, new Command(0xA0F02EF1, "ChangeJobCommand"));
|
||||
mStaticActors.Add(0xA0F05209, new Command(0xA0F05209, "ActivateCommand"));
|
||||
mStaticActors.Add(0xA0F0520A, new Command(0xA0F0520A, "ActivateCommand"));
|
||||
mStaticActors.Add(0xA0F0520D, new Command(0xA0F0520D, "CommandCancelCommand"));
|
||||
mStaticActors.Add(0xA0F0520E, new Command(0xA0F0520E, "CommandCancelCommand"));
|
||||
mStaticActors.Add(0xA0F0520F, new Command(0xA0F0520F, "ItemCommand"));
|
||||
mStaticActors.Add(0xA0F05210, new Command(0xA0F05210, "AutoAttackTargetChangeCommand"));
|
||||
mStaticActors.Add(0xA0F055FC, new Command(0xA0F055FC, "CraftCommand"));
|
||||
mStaticActors.Add(0xA0F055FD, new Command(0xA0F055FD, "CraftCommand"));
|
||||
mStaticActors.Add(0xA0F055FF, new Command(0xA0F055FF, "CraftCommand"));
|
||||
mStaticActors.Add(0xA0F05E25, new Command(0xA0F05E25, "TalkCommand"));
|
||||
mStaticActors.Add(0xA0F05E26, new Command(0xA0F05E26, "EmoteStandardCommand"));
|
||||
mStaticActors.Add(0xA0F05E28, new Command(0xA0F05E28, "ContinueCommand"));
|
||||
mStaticActors.Add(0xA0F05E29, new Command(0xA0F05E29, "LoginEventCommand"));
|
||||
mStaticActors.Add(0xA0F05E8B, new Command(0xA0F05E8B, "PartyInviteCommand"));
|
||||
mStaticActors.Add(0xA0F05E8C, new Command(0xA0F05E8C, "PartyJoinCommand"));
|
||||
mStaticActors.Add(0xA0F05E8D, new Command(0xA0F05E8D, "PartyResignCommand"));
|
||||
mStaticActors.Add(0xA0F05E8E, new Command(0xA0F05E8E, "PartyBreakupCommand"));
|
||||
mStaticActors.Add(0xA0F05E8F, new Command(0xA0F05E8F, "PartyKickCommand"));
|
||||
mStaticActors.Add(0xA0F05E90, new Command(0xA0F05E90, "PartyLeaderCommand"));
|
||||
mStaticActors.Add(0xA0F05E91, new Command(0xA0F05E91, "PartyAcceptCommand"));
|
||||
mStaticActors.Add(0xA0F05E93, new Command(0xA0F05E93, "RequestQuestJournalCommand"));
|
||||
mStaticActors.Add(0xA0F05E94, new Command(0xA0F05E94, "RequestInformationCommand"));
|
||||
mStaticActors.Add(0xA0F05E95, new Command(0xA0F05E95, "NpcLinkshellChatCommand"));
|
||||
mStaticActors.Add(0xA0F05E96, new Command(0xA0F05E96, "BazaarDealCommand"));
|
||||
mStaticActors.Add(0xA0F05E97, new Command(0xA0F05E97, "BazaarCheckCommand"));
|
||||
mStaticActors.Add(0xA0F05E98, new Command(0xA0F05E98, "BazaarUndealCommand"));
|
||||
mStaticActors.Add(0xA0F05E99, new Command(0xA0F05E99, "TradeOfferCommand"));
|
||||
mStaticActors.Add(0xA0F05E9A, new Command(0xA0F05E9A, "TradeExecuteCommand"));
|
||||
mStaticActors.Add(0xA0F05E9B, new Command(0xA0F05E9B, "LogoutCommand"));
|
||||
mStaticActors.Add(0xA0F05E9C, new Command(0xA0F05E9C, "TeleportCommand"));
|
||||
mStaticActors.Add(0xA0F05E9D, new Command(0xA0F05E9D, "ItemStuffCommand"));
|
||||
mStaticActors.Add(0xA0F05E9E, new Command(0xA0F05E9E, "ItemArrangementCommand"));
|
||||
mStaticActors.Add(0xA0F05E9F, new Command(0xA0F05E9F, "ItemMovePackageCommand"));
|
||||
mStaticActors.Add(0xA0F05EA0, new Command(0xA0F05EA0, "ItemSplitCommand"));
|
||||
mStaticActors.Add(0xA0F05EA1, new Command(0xA0F05EA1, "ItemTransferCommand"));
|
||||
mStaticActors.Add(0xA0F05EA2, new Command(0xA0F05EA2, "ItemWasteCommand"));
|
||||
mStaticActors.Add(0xA0F05EA3, new Command(0xA0F05EA3, "BazaarTradeCommand"));
|
||||
mStaticActors.Add(0xA0F05EA4, new Command(0xA0F05EA4, "WidgetOpenCommand"));
|
||||
mStaticActors.Add(0xA0F05EA5, new Command(0xA0F05EA5, "MacroCommand"));
|
||||
mStaticActors.Add(0xA0F05EA6, new Command(0xA0F05EA6, "TradeOfferCancelCommand"));
|
||||
mStaticActors.Add(0xA0F05EA7, new Command(0xA0F05EA7, "LinkshellAppointCommand"));
|
||||
mStaticActors.Add(0xA0F05EA8, new Command(0xA0F05EA8, "LinkshellInviteCommand"));
|
||||
mStaticActors.Add(0xA0F05EA9, new Command(0xA0F05EA9, "LinkshellInviteCancelCommand"));
|
||||
mStaticActors.Add(0xA0F05EAA, new Command(0xA0F05EAA, "LinkshellKickCommand"));
|
||||
mStaticActors.Add(0xA0F05EAB, new Command(0xA0F05EAB, "LinkshellResignCommand"));
|
||||
mStaticActors.Add(0xA0F05EAC, new Command(0xA0F05EAC, "LinkshellChangeCommand"));
|
||||
mStaticActors.Add(0xA0F05EAE, new Command(0xA0F05EAE, "CheckCommand"));
|
||||
mStaticActors.Add(0xA0F05EAF, new Command(0xA0F05EAF, "NetStatUserSwitchCommand"));
|
||||
mStaticActors.Add(0xA0F05EB0, new Command(0xA0F05EB0, "ItemMaterializeCommand"));
|
||||
mStaticActors.Add(0xA0F05EB1, new Command(0xA0F05EB1, "JournalCommand"));
|
||||
mStaticActors.Add(0xA0F05EB2, new Command(0xA0F05EB2, "DiceCommand"));
|
||||
mStaticActors.Add(0xA0F05EB3, new Command(0xA0F05EB3, "RepairOrderCommand"));
|
||||
mStaticActors.Add(0xA0F05EB4, new Command(0xA0F05EB4, "RepairEquipmentsCommand"));
|
||||
mStaticActors.Add(0xA0F05EED, new Command(0xA0F05EED, "PlaceDrivenCommand"));
|
||||
mStaticActors.Add(0xA0F05EEE, new Command(0xA0F05EEE, "ContentCommand"));
|
||||
mStaticActors.Add(0xA0F05EEF, new Command(0xA0F05EEF, "ConfirmGroupCommand"));
|
||||
mStaticActors.Add(0xA0F05EF0, new Command(0xA0F05EF0, "ConfirmWarpCOmmand"));
|
||||
mStaticActors.Add(0xA0F05EF1, new Command(0xA0F05EF1, "ConfirmTradeCommand"));
|
||||
mStaticActors.Add(0xA0F05EF2, new Command(0xA0F05EF2, "ConfirmRaiseCommand"));
|
||||
mStaticActors.Add(0xA0F05EF8, new Command(0xA0F05EF8, "EmoteSitCommand "));
|
||||
mStaticActors.Add(0xA0F06A0E, new Command(0xA0F06A0E, "AttackWeaponSKill"));
|
||||
mStaticActors.Add(0xA0F07339, new Command(0xA0F07339, "NegotiateCommand"));
|
||||
mStaticActors.Add(0xA0F07595, new Command(0xA0F07595, "DebugInputCommand"));
|
||||
}
|
||||
|
||||
public bool exists(uint actorId)
|
||||
{
|
||||
return mStaticActors[actorId] != null;
|
||||
}
|
||||
|
||||
public Actor getActor(uint actorId)
|
||||
{
|
||||
return mStaticActors[actorId];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
using FFXIVClassic_Lobby_Server.common;
|
||||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
@ -8,19 +11,41 @@ using System.Threading.Tasks;
|
|||
|
||||
namespace FFXIVClassic_Map_Server
|
||||
{
|
||||
class Zone
|
||||
class Zone : Actor
|
||||
{
|
||||
public uint mapId;
|
||||
public string zoneName;
|
||||
public ushort regionId;
|
||||
public bool canStealth, isInn, canRideChocobo, isInstanceRaid;
|
||||
public ushort weatherNormal, weatherCommon, weatherRare;
|
||||
public ushort bgmDay, bgmNight, bgmBattle;
|
||||
|
||||
public int boundingGridSize = 50;
|
||||
public int minX = -100, minY = -100, maxX = 100, maxY = 100;
|
||||
private int numXBlocks, numYBlocks;
|
||||
private int halfWidth, halfHeight;
|
||||
private List<Actor>[,] actorBlock;
|
||||
|
||||
public Zone()
|
||||
public Zone(uint id, string zoneName, ushort regionId, ushort bgmDay, ushort bgmNight, ushort bgmBattle, bool canStealth, bool isInn, bool canRideChocobo, bool isInstanceRaid)
|
||||
: base(id)
|
||||
{
|
||||
|
||||
this.zoneName = zoneName;
|
||||
this.regionId = regionId;
|
||||
this.canStealth = canStealth;
|
||||
this.isInn = isInn;
|
||||
this.canRideChocobo = canRideChocobo;
|
||||
this.isInstanceRaid = isInstanceRaid;
|
||||
|
||||
this.bgmDay = bgmDay;
|
||||
this.bgmNight = bgmNight;
|
||||
this.bgmBattle = bgmBattle;
|
||||
|
||||
this.displayNameId = 0;
|
||||
this.customDisplayName = "_areaMaster";
|
||||
this.actorName = String.Format("_areaMaster@{0:X5}",id<<8);
|
||||
|
||||
this.className = "ZoneMasterPrvI0";
|
||||
|
||||
numXBlocks = (maxX - minX) / boundingGridSize;
|
||||
numYBlocks = (maxY - minY) / boundingGridSize;
|
||||
actorBlock = new List<Actor>[numXBlocks, numYBlocks];
|
||||
|
@ -37,6 +62,26 @@ namespace FFXIVClassic_Map_Server
|
|||
|
||||
}
|
||||
|
||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
List<LuaParam> lParams;
|
||||
lParams = LuaUtils.createLuaParamList("/Area/Zone/ZoneMasterPrvI0", false, true, zoneName, "", 0xFFFFFFFF, false, false, canStealth, isInn, false, false, false, false, false, false);
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
|
||||
public override BasePacket getSpawnPackets(uint playerActorId)
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>();
|
||||
subpackets.Add(createAddActorPacket(playerActorId));
|
||||
subpackets.Add(createSpeedPacket(playerActorId));
|
||||
subpackets.Add(createSpawnPositonPacket(playerActorId, 0x1));
|
||||
subpackets.Add(createNamePacket(playerActorId));
|
||||
subpackets.Add(createStatePacket(playerActorId));
|
||||
subpackets.Add(createIsZoneingPacket(playerActorId));
|
||||
subpackets.Add(createScriptBindPacket(playerActorId));
|
||||
return BasePacket.createPacket(subpackets, true, false);
|
||||
}
|
||||
|
||||
#region Actor Management
|
||||
|
||||
public void addActorToZone(Actor actor)
|
28
FFXIVClassic Map Server/actors/chara/AetheryteWork.cs
Normal file
28
FFXIVClassic Map Server/actors/chara/AetheryteWork.cs
Normal file
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects.chara
|
||||
{
|
||||
class AetheryteWork
|
||||
{
|
||||
public int iconGil;
|
||||
public short guildleveId;
|
||||
public short clearTime;
|
||||
public int missionBonus;
|
||||
public int difficultyBonus;
|
||||
|
||||
public byte factionNumber;
|
||||
public int factionBonus;
|
||||
public byte factionCredit;
|
||||
|
||||
public int glRewardItem;
|
||||
public int glRewardNumber;
|
||||
public int glRewardSubItem;
|
||||
public int glRewardSubNumber;
|
||||
|
||||
public byte difficulty;
|
||||
}
|
||||
}
|
|
@ -8,11 +8,12 @@ namespace FFXIVClassic_Map_Server.dataobjects.chara
|
|||
{
|
||||
class BattleSave
|
||||
{
|
||||
public float potencial;
|
||||
public int skillLevel;
|
||||
public int skillLevelCap;
|
||||
public int[] skillPoint;
|
||||
public float potencial = 6.6f;
|
||||
public short[] skillLevel = new short[52];
|
||||
public short[] skillLevelCap = new short[52];
|
||||
public short[] skillPoint = new short[52];
|
||||
|
||||
public short physicalLevel;
|
||||
public int physicalExp;
|
||||
|
||||
public bool[] negotiationFlag= new bool[2];
|
54
FFXIVClassic Map Server/actors/chara/BattleTemp.cs
Normal file
54
FFXIVClassic Map Server/actors/chara/BattleTemp.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects.chara
|
||||
{
|
||||
class BattleTemp
|
||||
{
|
||||
public const uint NAMEPLATE_SHOWN = 0;
|
||||
public const uint TARGETABLE = 1;
|
||||
//public const uint NAMEPLATE_SHOWN2 = 2;
|
||||
public const uint NAMEPLATE_SHOWN2 = 3;
|
||||
|
||||
public const uint STAT_STRENGTH = 3;
|
||||
public const uint STAT_VITALITY = 4;
|
||||
public const uint STAT_DEXTERITY = 5;
|
||||
public const uint STAT_INTELLIGENCE = 6;
|
||||
public const uint STAT_MIND = 7;
|
||||
public const uint STAT_PIETY = 8;
|
||||
|
||||
public const uint STAT_RESISTANCE_FIRE = 9;
|
||||
public const uint STAT_RESISTANCE_ICE = 10;
|
||||
public const uint STAT_RESISTANCE_WIND = 11;
|
||||
public const uint STAT_RESISTANCE_LIGHTNING = 12;
|
||||
public const uint STAT_RESISTANCE_EARTH = 13;
|
||||
public const uint STAT_RESISTANCE_WATER = 14;
|
||||
|
||||
public const uint STAT_ATTACK = 17;
|
||||
public const uint STAT_ACCURACY = 15;
|
||||
public const uint STAT_NORMALDEFENSE = 18;
|
||||
public const uint STAT_EVASION = 16;
|
||||
public const uint STAT_ATTACK_MAGIC = 24;
|
||||
public const uint STAT_HEAL_MAGIC = 25;
|
||||
public const uint STAT_ENCHANCEMENT_MAGIC_POTENCY = 26;
|
||||
public const uint STAT_ENFEEBLING_MAGIC_POTENCY = 27;
|
||||
|
||||
public const uint STAT_MAGIC_ACCURACY = 28;
|
||||
public const uint STAT_MAGIC_EVASION = 29;
|
||||
|
||||
public const uint STAT_CRAFT_PROCESSING = 30;
|
||||
public const uint STAT_CRAFT_MAGIC_PROCESSING = 31;
|
||||
public const uint STAT_CRAFT_PROCESS_CONTROL = 32;
|
||||
|
||||
public const uint STAT_HARVEST_POTENCY = 33;
|
||||
public const uint STAT_HARVEST_LIMIT = 34;
|
||||
public const uint STAT_HARVEST_RATE = 35;
|
||||
|
||||
public float[] castGauge_speed = { 1.0f, 0.25f};
|
||||
public bool[] timingCommandFlag = new bool[4];
|
||||
public ushort[] generalParameter = new ushort[35];
|
||||
}
|
||||
}
|
38
FFXIVClassic Map Server/actors/chara/CharaWork.cs
Normal file
38
FFXIVClassic Map Server/actors/chara/CharaWork.cs
Normal file
|
@ -0,0 +1,38 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects.chara
|
||||
{
|
||||
class CharaWork
|
||||
{
|
||||
public uint PROPERTY_NAMEPLATE_VISIBLE = 1;
|
||||
public uint PROPERTY_NAMEPLATE_VISIBLE2 = 5;
|
||||
|
||||
public ParameterSave parameterSave = new ParameterSave();
|
||||
public ParameterTemp parameterTemp = new ParameterTemp();
|
||||
public BattleSave battleSave = new BattleSave();
|
||||
public BattleTemp battleTemp = new BattleTemp();
|
||||
public EventSave eventSave = new EventSave();
|
||||
public EventTemp eventTemp = new EventTemp();
|
||||
|
||||
public bool gameParameter = false;
|
||||
|
||||
|
||||
public byte[] property = new byte[32];
|
||||
|
||||
public ushort[] status = new ushort[20];
|
||||
public uint[] statusShownTime = new uint[20];
|
||||
|
||||
public uint[] command = new uint[64]; //ACTORS
|
||||
public byte[] commandCategory = new byte[64];
|
||||
public byte commandBorder = 0x20;
|
||||
public bool[] commandAcquired = new bool[4096];
|
||||
public bool[] additionalCommandAcquired = new bool[36];
|
||||
|
||||
public uint currentContentGroup;
|
||||
public uint depictionJudge = 0xa0f50911;
|
||||
}
|
||||
}
|
83
FFXIVClassic Map Server/actors/chara/Character.cs
Normal file
83
FFXIVClassic Map Server/actors/chara/Character.cs
Normal file
|
@ -0,0 +1,83 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.actors.chara;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects.chara
|
||||
{
|
||||
class Character:Actor
|
||||
{
|
||||
public const int SIZE = 0;
|
||||
public const int COLORINFO = 1;
|
||||
public const int FACEINFO = 2;
|
||||
public const int HIGHLIGHT_HAIR = 3;
|
||||
public const int VOICE = 4;
|
||||
public const int WEAPON1 = 5;
|
||||
public const int WEAPON2 = 6;
|
||||
public const int WEAPON3 = 7;
|
||||
public const int UNKNOWN1 = 8;
|
||||
public const int UNKNOWN2 = 9;
|
||||
public const int UNKNOWN3 = 10;
|
||||
public const int UNKNOWN4 = 11;
|
||||
public const int HEADGEAR = 12;
|
||||
public const int BODYGEAR = 13;
|
||||
public const int LEGSGEAR = 14;
|
||||
public const int HANDSGEAR = 15;
|
||||
public const int FEETGEAR = 16;
|
||||
public const int WAISTGEAR = 17;
|
||||
public const int UNKNOWN5 = 18;
|
||||
public const int R_EAR = 19;
|
||||
public const int L_EAR = 20;
|
||||
public const int UNKNOWN6 = 21;
|
||||
public const int UNKNOWN7 = 22;
|
||||
public const int R_FINGER = 23;
|
||||
public const int L_FINGER = 24;
|
||||
|
||||
public uint modelId;
|
||||
public uint[] appearanceIds = new uint[0x1D];
|
||||
|
||||
public uint animationId = 0;
|
||||
|
||||
public uint currentTarget = 0xC0000000;
|
||||
public uint currentLockedTarget = 0xC0000000;
|
||||
|
||||
public uint currentActorIcon = 0;
|
||||
|
||||
public Work work = new Work();
|
||||
public CharaWork charaWork = new CharaWork();
|
||||
|
||||
public Character(uint actorID) : base(actorID)
|
||||
{
|
||||
//Init timer array to "notimer"
|
||||
for (int i = 0; i < charaWork.statusShownTime.Length; i++)
|
||||
charaWork.statusShownTime[i] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
public SubPacket createAppearancePacket(uint playerActorId)
|
||||
{
|
||||
SetActorAppearancePacket setappearance = new SetActorAppearancePacket(modelId, appearanceIds);
|
||||
return setappearance.buildPacket(actorId, playerActorId);
|
||||
}
|
||||
|
||||
public SubPacket createInitStatusPacket(uint playerActorId)
|
||||
{
|
||||
return (SetActorStatusAllPacket.buildPacket(actorId, playerActorId, charaWork.status));
|
||||
}
|
||||
|
||||
public SubPacket createSetActorIconPacket(uint playerActorId)
|
||||
{
|
||||
return SetActorIconPacket.buildPacket(actorId, playerActorId, currentActorIcon);
|
||||
}
|
||||
|
||||
public SubPacket createIdleAnimationPacket(uint playerActorId)
|
||||
{
|
||||
return SetActorIdleAnimationPacket.buildPacket(actorId, playerActorId, animationId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.dataobjects.chara
|
|||
class EventSave
|
||||
{
|
||||
public bool bazaar;
|
||||
public float bazaarTax;
|
||||
public int repairType;
|
||||
public byte bazaarTax;
|
||||
public byte repairType;
|
||||
}
|
||||
}
|
37
FFXIVClassic Map Server/actors/chara/ParameterSave.cs
Normal file
37
FFXIVClassic Map Server/actors/chara/ParameterSave.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects.chara
|
||||
{
|
||||
class ParameterSave
|
||||
{
|
||||
public short[] hp = new short[8];
|
||||
public short[] hpMax = new short[8];
|
||||
public short mp;
|
||||
public short mpMax;
|
||||
|
||||
public byte[] state_mainSkill = new byte[4];
|
||||
public ushort state_mainSkillLevel;
|
||||
|
||||
public byte[] state_boostPointForSkill = new byte[4];
|
||||
|
||||
public uint[] commandSlot_recastTime = new uint[40];
|
||||
public bool[] commandSlot_compatibility = new bool[40];
|
||||
|
||||
public ushort[] giftCommandSlot_commandId = new ushort[10];
|
||||
|
||||
public ushort[] constanceCommandSlot_commandId = new ushort[10];
|
||||
|
||||
public byte abilityCostPoint_used;
|
||||
public byte abilityCostPoint_max;
|
||||
|
||||
public byte giftCostPoint_used;
|
||||
public byte giftCostPoint_max;
|
||||
|
||||
public byte constanceCostPoint_used;
|
||||
public byte constanceCostPoint_max;
|
||||
}
|
||||
}
|
23
FFXIVClassic Map Server/actors/chara/ParameterTemp.cs
Normal file
23
FFXIVClassic Map Server/actors/chara/ParameterTemp.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects.chara
|
||||
{
|
||||
class ParameterTemp
|
||||
{
|
||||
public short tp = 0;
|
||||
|
||||
public int targetInformation = 0;
|
||||
|
||||
public ushort[] maxCommandRecastTime = new ushort[40];
|
||||
|
||||
public float[] forceControl_float_forClientSelf = { 1.0f, 1.0f, 0.0f, 0.0f};
|
||||
public short[] forceControl_int16_forClientSelf = { -1, -1 };
|
||||
|
||||
public byte[] otherClassAbilityCount = new byte[2];
|
||||
public byte[] giftCount = new byte[2];
|
||||
}
|
||||
}
|
19
FFXIVClassic Map Server/actors/chara/Work.cs
Normal file
19
FFXIVClassic Map Server/actors/chara/Work.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.chara
|
||||
{
|
||||
class Work
|
||||
{
|
||||
public ushort[] guildleveId = new ushort[16];
|
||||
public bool[] guildleveDone = new bool[16];
|
||||
public bool[] guildleveChecked = new bool[16];
|
||||
|
||||
public bool betacheck = false;
|
||||
|
||||
public bool[] event_achieve_aetheryte = new bool[512];
|
||||
}
|
||||
}
|
54
FFXIVClassic Map Server/actors/chara/npc/Npc.cs
Normal file
54
FFXIVClassic Map Server/actors/chara/npc/Npc.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
using FFXIVClassic_Lobby_Server;
|
||||
using FFXIVClassic_Lobby_Server.common;
|
||||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects.chara.npc
|
||||
{
|
||||
class Npc : Character
|
||||
{
|
||||
public Npc(uint id, string actorName, uint displayNameId, string customDisplayName, float positionX, float positionY, float positionZ, float rotation, uint animationId, string className, byte[] initParams)
|
||||
: base(id)
|
||||
{
|
||||
this.actorName = actorName;
|
||||
this.displayNameId = displayNameId;
|
||||
this.customDisplayName = customDisplayName;
|
||||
this.positionX = positionX;
|
||||
this.positionY = positionY;
|
||||
this.positionZ = positionZ;
|
||||
this.rotation = rotation;
|
||||
this.animationId = animationId;
|
||||
this.className = className;
|
||||
|
||||
if (initParams.Length != 0)
|
||||
this.classParams = LuaUtils.readLuaParams(initParams);
|
||||
|
||||
}
|
||||
|
||||
public override BasePacket getInitPackets(uint playerActorId)
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>();
|
||||
subpackets.Add(createAddActorPacket(playerActorId));
|
||||
subpackets.Add(createSpeedPacket(playerActorId));
|
||||
subpackets.Add(createSpawnPositonPacket(playerActorId, 0x1));
|
||||
subpackets.Add(createAppearancePacket(playerActorId));
|
||||
subpackets.Add(createNamePacket(playerActorId));
|
||||
subpackets.Add(_0xFPacket.buildPacket(playerActorId, playerActorId));
|
||||
subpackets.Add(createStatePacket(playerActorId));
|
||||
subpackets.Add(createIdleAnimationPacket(playerActorId));
|
||||
subpackets.Add(createInitStatusPacket(playerActorId));
|
||||
subpackets.Add(createSetActorIconPacket(playerActorId));
|
||||
subpackets.Add(createIsZoneingPacket(playerActorId));
|
||||
subpackets.Add(createScriptBindPacket(playerActorId));
|
||||
|
||||
return BasePacket.createPacket(subpackets, true, false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
16
FFXIVClassic Map Server/actors/chara/npc/NpcWork.cs
Normal file
16
FFXIVClassic Map Server/actors/chara/npc/NpcWork.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects.chara
|
||||
{
|
||||
class NpcWork
|
||||
{
|
||||
public short pushCommand;
|
||||
public int pushCommandSub;
|
||||
public byte pushCommandPriority;
|
||||
public byte hateType;
|
||||
}
|
||||
}
|
367
FFXIVClassic Map Server/actors/chara/player/Player.cs
Normal file
367
FFXIVClassic Map Server/actors/chara/player/Player.cs
Normal file
|
@ -0,0 +1,367 @@
|
|||
using FFXIVClassic_Lobby_Server;
|
||||
using FFXIVClassic_Lobby_Server.common;
|
||||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using FFXIVClassic_Map_Server.packets.send.player;
|
||||
using FFXIVClassic_Map_Server.utils;
|
||||
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.chara
|
||||
{
|
||||
class Player : Character
|
||||
{
|
||||
|
||||
public const int TIMER_TOTORAK = 0;
|
||||
public const int TIMER_DZEMAEL = 1;
|
||||
public const int TIMER_BOWL_OF_EMBERS_HARD = 2;
|
||||
public const int TIMER_BOWL_OF_EMBERS = 3;
|
||||
public const int TIMER_THORNMARCH = 4;
|
||||
public const int TIMER_AURUMVALE = 5;
|
||||
public const int TIMER_CUTTERSCRY = 6;
|
||||
public const int TIMER_BATTLE_ALEPORT = 7;
|
||||
public const int TIMER_BATTLE_HYRSTMILL = 8;
|
||||
public const int TIMER_BATTLE_GOLDENBAZAAR = 9;
|
||||
public const int TIMER_HOWLING_EYE_HARD = 10;
|
||||
public const int TIMER_HOWLING_EYE = 11;
|
||||
public const int TIMER_CASTRUM_TOWER = 12;
|
||||
public const int TIMER_BOWL_OF_EMBERS_EXTREME = 13;
|
||||
public const int TIMER_RIVENROAD = 14;
|
||||
public const int TIMER_RIVENROAD_HARD = 15;
|
||||
public const int TIMER_BEHEST = 16;
|
||||
public const int TIMER_COMPANYBEHEST = 17;
|
||||
public const int TIMER_RETURN = 18;
|
||||
public const int TIMER_SKIRMISH = 19;
|
||||
|
||||
public uint[] timers = new uint[20];
|
||||
|
||||
public ushort currentJob;
|
||||
|
||||
public uint currentTitle;
|
||||
|
||||
public byte gcCurrent;
|
||||
public byte gcRankLimsa;
|
||||
public byte gcRankGridania;
|
||||
public byte gcRankUldah;
|
||||
|
||||
public bool hasChocobo;
|
||||
public bool hasGoobbue;
|
||||
public byte chocoboAppearance;
|
||||
public string chocoboName;
|
||||
|
||||
public uint achievementPoints;
|
||||
|
||||
public PlayerWork playerWork = new PlayerWork();
|
||||
|
||||
public Player(uint actorID) : base(actorID)
|
||||
{
|
||||
actorName = String.Format("_pc{0:00000000}", actorID);
|
||||
className = "Player";
|
||||
currentSubState = SetActorStatePacket.SUB_STATE_PLAYER;
|
||||
|
||||
charaWork.property[0] = 1;
|
||||
charaWork.property[1] = 1;
|
||||
charaWork.property[2] = 1;
|
||||
charaWork.property[4] = 1;
|
||||
|
||||
charaWork.command[0] = 0xA0F00000 | 21001;
|
||||
charaWork.command[1] = 0xA0F00000 | 21002;
|
||||
charaWork.command[2] = 0xA0F00000 | 12003;
|
||||
charaWork.command[3] = 0xA0F00000 | 12004;
|
||||
charaWork.command[4] = 0xA0F00000 | 21005;
|
||||
charaWork.command[5] = 0xA0F00000 | 21006;
|
||||
charaWork.command[6] = 0xA0F00000 | 21007;
|
||||
charaWork.command[7] = 0xA0F00000 | 12009;
|
||||
charaWork.command[8] = 0xA0F00000 | 12010;
|
||||
charaWork.command[9] = 0xA0F00000 | 12005;
|
||||
charaWork.command[10] = 0xA0F00000 | 12007;
|
||||
charaWork.command[11] = 0xA0F00000 | 12011;
|
||||
charaWork.command[12] = 0xA0F00000 | 22012;
|
||||
charaWork.command[13] = 0xA0F00000 | 22013;
|
||||
charaWork.command[14] = 0xA0F00000 | 29497;
|
||||
charaWork.command[15] = 0xA0F00000 | 22015;
|
||||
|
||||
charaWork.command[32] = 0xA0F00000 | 27155;
|
||||
//charaWork.command[33] = 0xA0F00000 | 27150;
|
||||
charaWork.command[34] = 0xA0F00000 | 27300;
|
||||
|
||||
charaWork.commandAcquired[27150 - 26000] = true;
|
||||
|
||||
playerWork.questScenarioComplete[110001 - 110001] = true;
|
||||
playerWork.questGuildleveComplete[120050 - 120001] = true;
|
||||
|
||||
for (int i = 0; i < charaWork.additionalCommandAcquired.Length; i++ )
|
||||
charaWork.additionalCommandAcquired[i] = true;
|
||||
|
||||
for (int i = 0; i < charaWork.commandCategory.Length; i++)
|
||||
charaWork.commandCategory[i] = 1;
|
||||
|
||||
charaWork.battleTemp.generalParameter[3] = 1;
|
||||
|
||||
|
||||
charaWork.eventSave.bazaarTax = 5;
|
||||
charaWork.battleSave.potencial = 6.6f;
|
||||
|
||||
charaWork.commandBorder = 0x20;
|
||||
|
||||
Database.loadPlayerCharacter(this);
|
||||
}
|
||||
|
||||
public List<SubPacket> create0x132Packets(uint playerActorId)
|
||||
{
|
||||
List<SubPacket> packets = new List<SubPacket>();
|
||||
packets.Add(_0x132Packet.buildPacket(playerActorId, 0xB, "commandForced"));
|
||||
packets.Add(_0x132Packet.buildPacket(playerActorId, 0xA, "commandDefault"));
|
||||
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x6, "commandWeak"));
|
||||
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x4, "commandContent"));
|
||||
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x6, "commandJudgeMode"));
|
||||
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x100, "commandRequest"));
|
||||
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x100, "widgetCreate"));
|
||||
packets.Add(_0x132Packet.buildPacket(playerActorId, 0x100, "macroRequest"));
|
||||
return packets;
|
||||
}
|
||||
|
||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
List<LuaParam> lParams;
|
||||
if (isMyPlayer(playerActorId))
|
||||
{
|
||||
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, false, true, 0, false, timers, true);
|
||||
}
|
||||
else
|
||||
lParams = LuaUtils.createLuaParamList("/Chara/Player/Player_work", false, false, false, false, false, true);
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
|
||||
public override BasePacket getSpawnPackets(uint playerActorId)
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>();
|
||||
subpackets.Add(createAddActorPacket(playerActorId));
|
||||
if (isMyPlayer(playerActorId))
|
||||
subpackets.AddRange(create0x132Packets(playerActorId));
|
||||
subpackets.Add(createSpeedPacket(playerActorId));
|
||||
subpackets.Add(createSpawnPositonPacket(playerActorId, 0x1));
|
||||
subpackets.Add(createAppearancePacket(playerActorId));
|
||||
subpackets.Add(createNamePacket(playerActorId));
|
||||
subpackets.Add(_0xFPacket.buildPacket(playerActorId, playerActorId));
|
||||
subpackets.Add(createStatePacket(playerActorId));
|
||||
subpackets.Add(createIdleAnimationPacket(playerActorId));
|
||||
subpackets.Add(createInitStatusPacket(playerActorId));
|
||||
subpackets.Add(createSetActorIconPacket(playerActorId));
|
||||
subpackets.Add(createIsZoneingPacket(playerActorId));
|
||||
subpackets.AddRange(createPlayerRelatedPackets(playerActorId));
|
||||
subpackets.Add(createScriptBindPacket(playerActorId));
|
||||
return BasePacket.createPacket(subpackets, true, false);
|
||||
}
|
||||
|
||||
public List<SubPacket> createPlayerRelatedPackets(uint playerActorId)
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>();
|
||||
|
||||
if (gcCurrent != 0)
|
||||
subpackets.Add(SetGrandCompanyPacket.buildPacket(actorId, playerActorId, gcCurrent, gcRankLimsa, gcRankGridania, gcRankUldah));
|
||||
|
||||
if (currentTitle != 0)
|
||||
subpackets.Add(SetPlayerTitlePacket.buildPacket(actorId, playerActorId, currentTitle));
|
||||
|
||||
if (currentJob != 0)
|
||||
subpackets.Add(SetCurrentJobPacket.buildPacket(actorId, playerActorId, currentJob));
|
||||
|
||||
if (isMyPlayer(playerActorId))
|
||||
{
|
||||
subpackets.Add(_0x196Packet.buildPacket(playerActorId, playerActorId));
|
||||
|
||||
if (hasChocobo && chocoboName != null && !chocoboName.Equals(""))
|
||||
{
|
||||
subpackets.Add(SetChocoboNamePacket.buildPacket(actorId, playerActorId, chocoboName));
|
||||
subpackets.Add(SetHasChocoboPacket.buildPacket(playerActorId, hasChocobo));
|
||||
}
|
||||
|
||||
if (hasGoobbue)
|
||||
subpackets.Add(SetHasGoobbuePacket.buildPacket(playerActorId, hasGoobbue));
|
||||
|
||||
subpackets.Add(SetAchievementPointsPacket.buildPacket(playerActorId, achievementPoints));
|
||||
subpackets.Add(Database.getLatestAchievements(this));
|
||||
subpackets.Add(Database.getAchievementsPacket(this));
|
||||
|
||||
/*
|
||||
if (isInn)
|
||||
{
|
||||
SetCutsceneBookPacket book = new SetCutsceneBookPacket();
|
||||
for (int i = 0; i < book.cutsceneFlags.Length; i++)
|
||||
book.cutsceneFlags[i] = true;
|
||||
client.queuePacket(book.buildPacket(player.actorID), true, false);
|
||||
|
||||
//
|
||||
//subpackets.Add(SetPlayerDreamPacket.buildPacket(playerActorId, );
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
return subpackets;
|
||||
}
|
||||
|
||||
public override BasePacket getInitPackets(uint playerActorId)
|
||||
{
|
||||
ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("/_init", this, playerActorId);
|
||||
|
||||
propPacketUtil.addProperty("charaWork.eventSave.bazaarTax");
|
||||
propPacketUtil.addProperty("charaWork.battleSave.potencial");
|
||||
|
||||
//Properties
|
||||
for (int i = 0; i < charaWork.property.Length; i++)
|
||||
{
|
||||
if (charaWork.property[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.property[{0}]", i));
|
||||
}
|
||||
|
||||
//Parameters
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.hp[0]");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.hpMax[0]");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.mp");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.mpMax");
|
||||
propPacketUtil.addProperty("charaWork.parameterTemp.tp");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[0]");
|
||||
propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkillLevel");
|
||||
|
||||
//Status Times
|
||||
for (int i = 0; i < charaWork.statusShownTime.Length; i++)
|
||||
{
|
||||
if (charaWork.statusShownTime[i] != 0xFFFFFFFF)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.statusShownTime[{0}]", i));
|
||||
}
|
||||
|
||||
//General Parameters
|
||||
for (int i = 3; i < charaWork.battleTemp.generalParameter.Length; i++)
|
||||
{
|
||||
if (charaWork.battleTemp.generalParameter[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.battleTemp.generalParameter[{0}]", i));
|
||||
}
|
||||
|
||||
propPacketUtil.addProperty("charaWork.battleTemp.castGauge_speed[0]");
|
||||
propPacketUtil.addProperty("charaWork.battleTemp.castGauge_speed[1]");
|
||||
|
||||
//Battle Save Skillpoint
|
||||
|
||||
//Commands
|
||||
propPacketUtil.addProperty("charaWork.commandBorder");
|
||||
|
||||
|
||||
for (int i = 0; i < charaWork.command.Length; i++)
|
||||
{
|
||||
if (charaWork.command[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.command[{0}]", i));
|
||||
}
|
||||
|
||||
/*
|
||||
for (int i = 0; i < charaWork.commandCategory.Length; i++)
|
||||
{
|
||||
charaWork.commandCategory[i] = 1;
|
||||
if (charaWork.commandCategory[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.commandCategory[{0}]", i));
|
||||
}
|
||||
|
||||
for (int i = 0; i < charaWork.commandAcquired.Length; i++)
|
||||
{
|
||||
if (charaWork.commandAcquired[i] != false)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.commandAcquired[{0}]", i));
|
||||
}
|
||||
*/
|
||||
|
||||
for (int i = 0; i < charaWork.additionalCommandAcquired.Length; i++)
|
||||
{
|
||||
if (charaWork.additionalCommandAcquired[i] != false)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.additionalCommandAcquired[{0}]", i));
|
||||
}
|
||||
|
||||
for (int i = 0; i < charaWork.parameterSave.commandSlot_compatibility.Length; i++)
|
||||
{
|
||||
charaWork.parameterSave.commandSlot_compatibility[i] = true;
|
||||
if (charaWork.parameterSave.commandSlot_compatibility[i])
|
||||
propPacketUtil.addProperty(String.Format("charaWork.parameterSave.commandSlot_compatibility[{0}]", i));
|
||||
}
|
||||
|
||||
/*
|
||||
for (int i = 0; i < charaWork.parameterSave.commandSlot_recastTime.Length; i++)
|
||||
{
|
||||
if (charaWork.parameterSave.commandSlot_recastTime[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("charaWork.parameterSave.commandSlot_recastTime[{0}]", i));
|
||||
}
|
||||
*/
|
||||
|
||||
//System
|
||||
propPacketUtil.addProperty("charaWork.parameterTemp.forceControl_float_forClientSelf[0]");
|
||||
propPacketUtil.addProperty("charaWork.parameterTemp.forceControl_float_forClientSelf[1]");
|
||||
propPacketUtil.addProperty("charaWork.parameterTemp.forceControl_int16_forClientSelf[0]");
|
||||
propPacketUtil.addProperty("charaWork.parameterTemp.forceControl_int16_forClientSelf[1]");
|
||||
|
||||
charaWork.parameterTemp.otherClassAbilityCount[0] = 4;
|
||||
charaWork.parameterTemp.otherClassAbilityCount[1] = 5;
|
||||
charaWork.parameterTemp.giftCount[1] = 5;
|
||||
|
||||
propPacketUtil.addProperty("charaWork.parameterTemp.otherClassAbilityCount[0]");
|
||||
propPacketUtil.addProperty("charaWork.parameterTemp.otherClassAbilityCount[1]");
|
||||
propPacketUtil.addProperty("charaWork.parameterTemp.giftCount[1]");
|
||||
|
||||
propPacketUtil.addProperty("charaWork.depictionJudge");
|
||||
|
||||
//Scenario
|
||||
for (int i = 0; i < playerWork.questScenario.Length; i++)
|
||||
{
|
||||
if (playerWork.questScenario[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("playerWork.questScenario[{0}]", i));
|
||||
}
|
||||
|
||||
//Guildleve - Local
|
||||
for (int i = 0; i < playerWork.questGuildleve.Length; i++)
|
||||
{
|
||||
if (playerWork.questGuildleve[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("playerWork.questGuildleve[{0}]", i));
|
||||
}
|
||||
|
||||
//Guildleve - Regional
|
||||
for (int i = 0; i < work.guildleveId.Length; i++)
|
||||
{
|
||||
if (work.guildleveId[i] != 0)
|
||||
propPacketUtil.addProperty(String.Format("work.guildleveId[{0}]", i));
|
||||
if (work.guildleveDone[i] != false)
|
||||
propPacketUtil.addProperty(String.Format("work.guildleveDone[{0}]", i));
|
||||
if (work.guildleveChecked[i] != false)
|
||||
propPacketUtil.addProperty(String.Format("work.guildleveChecked[{0}]", i));
|
||||
}
|
||||
|
||||
//NPC Linkshell
|
||||
for (int i = 0; i < playerWork.npcLinkshellChatCalling.Length; i++)
|
||||
{
|
||||
if (playerWork.npcLinkshellChatCalling[i] != false)
|
||||
propPacketUtil.addProperty(String.Format("playerWork.npcLinkshellChatCalling[{0}]", i));
|
||||
if (playerWork.npcLinkshellChatExtra[i] != false)
|
||||
propPacketUtil.addProperty(String.Format("playerWork.npcLinkshellChatExtra[{0}]", i));
|
||||
}
|
||||
|
||||
propPacketUtil.addProperty("playerWork.restBonusExpRate");
|
||||
|
||||
//Profile
|
||||
propPacketUtil.addProperty("playerWork.tribe");
|
||||
propPacketUtil.addProperty("playerWork.guardian");
|
||||
propPacketUtil.addProperty("playerWork.birthdayMonth");
|
||||
propPacketUtil.addProperty("playerWork.birthdayDay");
|
||||
propPacketUtil.addProperty("playerWork.initialTown");
|
||||
|
||||
return propPacketUtil.done();
|
||||
}
|
||||
|
||||
public bool isMyPlayer(uint otherActorId)
|
||||
{
|
||||
return actorId == otherActorId;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
51
FFXIVClassic Map Server/actors/chara/player/PlayerWork.cs
Normal file
51
FFXIVClassic Map Server/actors/chara/player/PlayerWork.cs
Normal file
|
@ -0,0 +1,51 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects.chara
|
||||
{
|
||||
class PlayerWork
|
||||
{
|
||||
public byte tribe;
|
||||
public byte guardian;
|
||||
public byte birthdayMonth;
|
||||
public byte birthdayDay;
|
||||
public byte initialTown;
|
||||
|
||||
public float restBonusExpRate = 1.5f;
|
||||
|
||||
public uint[] questScenario = new uint[16];
|
||||
public uint[] questGuildleve = new uint[8];
|
||||
|
||||
public bool[] questScenarioComplete = new bool[2048];
|
||||
public bool[] questGuildleveComplete = new bool[2048];
|
||||
|
||||
public bool isContentsCommand;
|
||||
|
||||
public int castCommandClient;
|
||||
public int castEndClient;
|
||||
|
||||
public int[] comboNextCommandId = new int[2];
|
||||
public float comboCostBonusRate;
|
||||
|
||||
public bool isRemainBonusPoint;
|
||||
|
||||
public bool[] npcLinkshellChatCalling = new bool[64];
|
||||
public bool[] npcLinkshellChatExtra = new bool[64];
|
||||
|
||||
public int variableCommandConfirmWarp;
|
||||
public string variableCommandConfirmWarpSender;
|
||||
public int variableCommandConfirmWarpSenderByID;
|
||||
public byte variableCommandConfirmWarpSenderSex;
|
||||
public int variableCommandConfirmWarpPlace;
|
||||
|
||||
public int variableCommandConfirmRaise;
|
||||
public string variableCommandConfirmRaiseSender;
|
||||
public int variableCommandConfirmRaiseSenderByID;
|
||||
public byte variableCommandConfirmRaiseSenderSex;
|
||||
public int variableCommandConfirmRaisePlace;
|
||||
|
||||
}
|
||||
}
|
18
FFXIVClassic Map Server/actors/command/Command.cs
Normal file
18
FFXIVClassic Map Server/actors/command/Command.cs
Normal file
|
@ -0,0 +1,18 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.dataobjects.actors
|
||||
{
|
||||
class Command : Actor
|
||||
{
|
||||
|
||||
public Command(uint actorID, string name) : base(actorID)
|
||||
{
|
||||
actorName = name;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
47
FFXIVClassic Map Server/actors/debug/Debug.cs
Normal file
47
FFXIVClassic Map Server/actors/debug/Debug.cs
Normal file
|
@ -0,0 +1,47 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.debug
|
||||
{
|
||||
class DebugProg : Actor
|
||||
{
|
||||
|
||||
public DebugProg()
|
||||
: base(0x5FF80002)
|
||||
{
|
||||
this.displayNameId = 0;
|
||||
this.customDisplayName = "debug";
|
||||
|
||||
this.actorName = "debug";
|
||||
this.className = "Debug";
|
||||
}
|
||||
|
||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
List<LuaParam> lParams;
|
||||
lParams = LuaUtils.createLuaParamList("/System/Debug.prog", false, false, false, false, true, 0xC51F, true, true);
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
|
||||
public override BasePacket getSpawnPackets(uint playerActorId)
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>();
|
||||
subpackets.Add(createAddActorPacket(playerActorId));
|
||||
subpackets.Add(createSpeedPacket(playerActorId));
|
||||
subpackets.Add(createSpawnPositonPacket(playerActorId, 0x1));
|
||||
subpackets.Add(createNamePacket(playerActorId));
|
||||
subpackets.Add(createStatePacket(playerActorId));
|
||||
subpackets.Add(createIsZoneingPacket(playerActorId));
|
||||
subpackets.Add(createScriptBindPacket(playerActorId));
|
||||
return BasePacket.createPacket(subpackets, true, false);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
49
FFXIVClassic Map Server/actors/director/WeatherDirector.cs
Normal file
49
FFXIVClassic Map Server/actors/director/WeatherDirector.cs
Normal file
|
@ -0,0 +1,49 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.director
|
||||
{
|
||||
class WeatherDirector : Actor
|
||||
{
|
||||
private uint weatherId;
|
||||
|
||||
public WeatherDirector(uint weatherId, Zone zone)
|
||||
: base(0x5FF80002)
|
||||
{
|
||||
this.weatherId = weatherId;
|
||||
|
||||
this.displayNameId = 0;
|
||||
this.customDisplayName = String.Format("weatherDire_{0}", zone.zoneName, zone.actorId);
|
||||
|
||||
this.actorName = String.Format("weatherDire_{0}@{0:04x}", zone.zoneName, zone.actorId);
|
||||
this.className = "Debug";
|
||||
}
|
||||
|
||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
List<LuaParam> lParams;
|
||||
lParams = LuaUtils.createLuaParamList("/Director/Weather/WeatherDirector", false, false, false, false, weatherId);
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
|
||||
public override BasePacket getSpawnPackets(uint playerActorId)
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>();
|
||||
subpackets.Add(createAddActorPacket(playerActorId));
|
||||
subpackets.Add(createSpeedPacket(playerActorId));
|
||||
subpackets.Add(createSpawnPositonPacket(playerActorId, 0x1));
|
||||
subpackets.Add(createNamePacket(playerActorId));
|
||||
subpackets.Add(createStatePacket(playerActorId));
|
||||
subpackets.Add(createIsZoneingPacket(playerActorId));
|
||||
subpackets.Add(createScriptBindPacket(playerActorId));
|
||||
return BasePacket.createPacket(subpackets, true, false);
|
||||
}
|
||||
}
|
||||
}
|
17
FFXIVClassic Map Server/actors/judge/Judge.cs
Normal file
17
FFXIVClassic Map Server/actors/judge/Judge.cs
Normal file
|
@ -0,0 +1,17 @@
|
|||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.judge
|
||||
{
|
||||
class Judge : Actor
|
||||
{
|
||||
public Judge(uint actorID, string name) : base(actorID)
|
||||
{
|
||||
actorName = name;
|
||||
}
|
||||
}
|
||||
}
|
44
FFXIVClassic Map Server/actors/world/WorldMaster.cs
Normal file
44
FFXIVClassic Map Server/actors/world/WorldMaster.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
using FFXIVClassic_Lobby_Server.packets;
|
||||
using FFXIVClassic_Map_Server.dataobjects;
|
||||
using FFXIVClassic_Map_Server.lua;
|
||||
using FFXIVClassic_Map_Server.packets.send.actor;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FFXIVClassic_Map_Server.actors.world
|
||||
{
|
||||
class WorldMaster : Actor
|
||||
{
|
||||
public WorldMaster() : base(0x5FF80001)
|
||||
{
|
||||
this.displayNameId = 0;
|
||||
this.customDisplayName = "worldMaster";
|
||||
|
||||
this.actorName = "worldMaster";
|
||||
this.className = "WorldMaster";
|
||||
}
|
||||
|
||||
public override SubPacket createScriptBindPacket(uint playerActorId)
|
||||
{
|
||||
List<LuaParam> lParams;
|
||||
lParams = LuaUtils.createLuaParamList("/World/WorldMaster_event", false, false, false, false, false, null);
|
||||
return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);
|
||||
}
|
||||
|
||||
public override BasePacket getSpawnPackets(uint playerActorId)
|
||||
{
|
||||
List<SubPacket> subpackets = new List<SubPacket>();
|
||||
subpackets.Add(createAddActorPacket(playerActorId));
|
||||
subpackets.Add(createSpeedPacket(playerActorId));
|
||||
subpackets.Add(createSpawnPositonPacket(playerActorId, 0x1));
|
||||
subpackets.Add(createNamePacket(playerActorId));
|
||||
subpackets.Add(createStatePacket(playerActorId));
|
||||
subpackets.Add(createIsZoneingPacket(playerActorId));
|
||||
subpackets.Add(createScriptBindPacket(playerActorId));
|
||||
return BasePacket.createPacket(subpackets, true, false);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,274 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<doc>
|
||||
<assembly>
|
||||
<name>Cyotek.Collections.Generic.CircularBuffer</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="T:Cyotek.Collections.Generic.CircularBuffer`1">
|
||||
<summary>
|
||||
Represents a first-in, first-out collection of objects using a fixed buffer and automatic overwrite support.
|
||||
</summary>
|
||||
<typeparam name="T">Specifies the type of elements in the buffer.</typeparam>
|
||||
<remarks>
|
||||
<para>The capacity of a <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> is the number of elements the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> can
|
||||
hold. If an attempt is made to put more items in the buffer than available capacity, items at the start of the buffer are
|
||||
automatically overwritten. This behavior can be modified via the <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite"/> property.</para>
|
||||
<para>CircularBuffer{T} accepts <c>null</c> as a valid value for reference types and allows duplicate elements.</para>
|
||||
<para>The <see cref="M:Cyotek.Collections.Generic.CircularBuffer`1.Get"/> methods will remove the items that are returned from the CircularBuffer{T}. To view the contents of the CircularBuffer{T} without removing items, use the <see cref="M:Cyotek.Collections.Generic.CircularBuffer`1.Peek"/> or <see cref="M:Cyotek.Collections.Generic.CircularBuffer`1.PeekLast"/> methods.</para>
|
||||
</remarks>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.#ctor(System.Int32)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> class that is empty and has the specified initial capacity and default overwrite behavior.
|
||||
</summary>
|
||||
<param name="capacity">The maximum capcity of the buffer.</param>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.#ctor(System.Int32,System.Boolean)">
|
||||
<summary>
|
||||
Initializes a new instance of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> class that is empty and has the specified initial capacity and overwrite behavior.
|
||||
</summary>
|
||||
<param name="capacity">The maximum capcity of the buffer.</param>
|
||||
<param name="allowOverwrite">If set to <c>true</c> the buffer will automatically overwrite the oldest items when full.</param>
|
||||
<exception cref="T:System.ArgumentException">Thown if the <paramref name="capacity"/> is less than zero.</exception>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Clear">
|
||||
<summary>
|
||||
Removes all items from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Contains(`0)">
|
||||
<summary>
|
||||
Determines whether the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> contains a specific value.
|
||||
</summary>
|
||||
<param name="item">The object to locate in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</param>
|
||||
<returns><c>true</c> if <paramref name="item"/> is found in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>; otherwise, <c>false</c>.</returns>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.CopyTo(`0[])">
|
||||
<summary>
|
||||
Copies the entire <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to a compatible one-dimensional array, starting at the beginning of the target array.
|
||||
</summary>
|
||||
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.CopyTo(`0[],System.Int32)">
|
||||
<summary>
|
||||
Copies the entire <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to a compatible one-dimensional array, starting at the specified index of the target array.
|
||||
</summary>
|
||||
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
|
||||
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.CopyTo(System.Int32,`0[],System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Copies a range of elements from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to a compatible one-dimensional array, starting at the specified index of the target array.
|
||||
</summary>
|
||||
<param name="index">The zero-based index in the source <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> at which copying begins.</param>
|
||||
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
|
||||
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
|
||||
<param name="count">The number of elements to copy.</param>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Get(System.Int32)">
|
||||
<summary>
|
||||
Removes and returns the specified number of objects from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
|
||||
</summary>
|
||||
<param name="count">The number of elements to remove and return from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</param>
|
||||
<returns>The objects that are removed from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Get(`0[])">
|
||||
<summary>
|
||||
Copies and removes the specified number elements from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to a compatible one-dimensional array, starting at the beginning of the target array.
|
||||
</summary>
|
||||
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
|
||||
<returns>The actual number of elements copied into <paramref name="array"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Get(`0[],System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Copies and removes the specified number elements from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to a compatible one-dimensional array, starting at the specified index of the target array.
|
||||
</summary>
|
||||
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
|
||||
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
|
||||
<param name="count">The number of elements to copy.</param>
|
||||
<returns>The actual number of elements copied into <paramref name="array"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Get">
|
||||
<summary>
|
||||
Removes and returns the object at the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
|
||||
</summary>
|
||||
<returns>The object that is removed from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
|
||||
<exception cref="T:System.InvalidOperationException">Thrown if the buffer is empty.</exception>
|
||||
<remarks>This method is similar to the <see cref="M:Cyotek.Collections.Generic.CircularBuffer`1.Peek"/> method, but <c>Peek</c> does not modify the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</remarks>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.GetEnumerator">
|
||||
<summary>
|
||||
Returns an enumerator that iterates through the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Collections.Generic.IEnumerator`1"/> for the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Peek">
|
||||
<summary>
|
||||
Returns the object at the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> without removing it.
|
||||
</summary>
|
||||
<returns>The object at the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
|
||||
<exception cref="T:System.InvalidOperationException">Thrown if the buffer is empty.</exception>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Peek(System.Int32)">
|
||||
<summary>
|
||||
Returns the specified number of objects from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
|
||||
</summary>
|
||||
<param name="count">The number of elements to return from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</param>
|
||||
<returns>The objects that from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
|
||||
<exception cref="T:System.InvalidOperationException">Thrown if the buffer is empty.</exception>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.PeekLast">
|
||||
<summary>
|
||||
Returns the object at the end of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> without removing it.
|
||||
</summary>
|
||||
<returns>The object at the end of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
|
||||
<exception cref="T:System.InvalidOperationException">Thrown if the buffer is empty.</exception>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Put(`0[])">
|
||||
<summary>
|
||||
Copies an entire compatible one-dimensional array to the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
|
||||
</summary>
|
||||
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the source of the elements copied to <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
|
||||
<exception cref="T:System.InvalidOperationException">Thrown if buffer does not have sufficient capacity to put in new items.</exception>
|
||||
<remarks>If <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.Size"/> plus the size of <paramref name="array"/> exceeds the capacity of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> and the <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite"/> property is <c>true</c>, the oldest items in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> are overwritten with <paramref name="array"/>.</remarks>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Put(`0[],System.Int32,System.Int32)">
|
||||
<summary>
|
||||
Copies a range of elements from a compatible one-dimensional array to the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
|
||||
</summary>
|
||||
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the source of the elements copied to <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
|
||||
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
|
||||
<param name="count">The number of elements to copy.</param>
|
||||
<exception cref="T:System.InvalidOperationException">Thrown if buffer does not have sufficient capacity to put in new items.</exception>
|
||||
<remarks>If <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.Size"/> plus <paramref name="count"/> exceeds the capacity of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> and the <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite"/> property is <c>true</c>, the oldest items in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> are overwritten with <paramref name="array"/>.</remarks>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Put(`0)">
|
||||
<summary>
|
||||
Adds an object to the end of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
|
||||
</summary>
|
||||
<param name="item">The object to add to the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>. The value can be <c>null</c> for reference types.</param>
|
||||
<exception cref="T:System.InvalidOperationException">Thrown if buffer does not have sufficient capacity to put in new items.</exception>
|
||||
<remarks>If <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.Size"/> already equals the capacity and the <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite"/> property is <c>true</c>, the oldest item in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> is overwritten with <paramref name="item"/>.</remarks>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.Skip(System.Int32)">
|
||||
<summary>
|
||||
Increments the starting index of the data buffer in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
|
||||
</summary>
|
||||
<param name="count">The number of elements to increment the data buffer start index by.</param>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.ToArray">
|
||||
<summary>
|
||||
Copies the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> elements to a new array.
|
||||
</summary>
|
||||
<returns>A new array containing elements copied from the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</returns>
|
||||
<remarks>The <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> is not modified. The order of the elements in the new array is the same as the order of the elements from the beginning of the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> to its end.</remarks>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#ICollection#CopyTo(System.Array,System.Int32)">
|
||||
<summary>
|
||||
Copies the elements of the <see cref="T:System.Collections.ICollection"/> to an <see cref="T:System.Array"/>, starting at a particular <see cref="T:System.Array"/> index.
|
||||
</summary>
|
||||
<param name="array">The one-dimensional <see cref="T:System.Array"/> that is the destination of the elements copied from <see cref="T:System.Collections.ICollection"/>. The <see cref="T:System.Array"/> must have zero-based indexing.</param>
|
||||
<param name="arrayIndex">The zero-based index in <paramref name="array"/> at which copying begins.</param>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#Generic#ICollection{T}#Add(`0)">
|
||||
<summary>
|
||||
Adds an item to the <see cref="T:System.Collections.Generic.ICollection`1" />.
|
||||
</summary>
|
||||
<param name="item">The object to add to the <see cref="T:System.Collections.Generic.ICollection`1" />.</param>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#Generic#ICollection{T}#Remove(`0)">
|
||||
<summary>
|
||||
Removes the first occurrence of a specific object from the <see cref="T:System.Collections.Generic.ICollection`1"/>.
|
||||
</summary>
|
||||
<param name="item">The object to remove from the <see cref="T:System.Collections.Generic.ICollection`1"/>.</param>
|
||||
<returns><c>true</c> if <paramref name="item"/> was successfully removed from the <see cref="T:System.Collections.Generic.ICollection`1"/>; otherwise, <c>false</c>. This method also returns <c>false</c> if <paramref name="item"/> is not found in the original <see cref="T:System.Collections.Generic.ICollection`1"/>.</returns>
|
||||
<exception cref="T:System.NotSupportedException">Cannot remove items from collection.</exception>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#Generic#IEnumerable{T}#GetEnumerator">
|
||||
<summary>
|
||||
Returns an enumerator that iterates through the collection.
|
||||
</summary>
|
||||
<returns>A <see cref="T:System.Collections.Generic.IEnumerator`1" /> that can be used to iterate through the collection.</returns>
|
||||
</member>
|
||||
<member name="M:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#IEnumerable#GetEnumerator">
|
||||
<summary>
|
||||
Returns an enumerator that iterates through a collection.
|
||||
</summary>
|
||||
<returns>An <see cref="T:System.Collections.IEnumerator" /> object that can be used to iterate through the collection.</returns>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite">
|
||||
<summary>
|
||||
Gets or sets a value indicating whether the buffer will automatically overwrite the oldest items in the buffer when the maximum capacity is reached.
|
||||
</summary>
|
||||
<value><c>true</c> if the oldest items in the buffer are automatically overwritten when the buffer is full; otherwise, <c>false</c>.</value>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.Capacity">
|
||||
<summary>
|
||||
Gets or sets the total number of elements the internal data structure can hold.
|
||||
</summary>
|
||||
<value>The total number of elements that the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/> can contain.</value>
|
||||
<exception cref="T:System.ArgumentOutOfRangeException">Thrown if the specified new capacity is smaller than the current contents of the buffer.</exception>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.Head">
|
||||
<summary>
|
||||
Gets the index of the beginning of the buffer data.
|
||||
</summary>
|
||||
<value>The index of the first element in the buffer.</value>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.IsEmpty">
|
||||
<summary>
|
||||
Gets a value indicating whether the buffer is empty.
|
||||
</summary>
|
||||
<value><c>true</c> if buffer is empty; otherwise, <c>false</c>.</value>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.IsFull">
|
||||
<summary>
|
||||
Gets a value indicating whether the buffer is full.
|
||||
</summary>
|
||||
<value><c>true</c> if the buffer is full; otherwise, <c>false</c>.</value>
|
||||
<remarks>The <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.IsFull"/> property always returns <c>false</c> if the <see cref="P:Cyotek.Collections.Generic.CircularBuffer`1.AllowOverwrite"/> property is set to <c>true</c>.</remarks>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.Size">
|
||||
<summary>
|
||||
Gets the number of elements contained in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.
|
||||
</summary>
|
||||
<value>The number of elements contained in the <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>.</value>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.Tail">
|
||||
<summary>
|
||||
Gets the index of the end of the buffer data.
|
||||
</summary>
|
||||
<value>The index of the last element in the buffer.</value>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#ICollection#Count">
|
||||
<summary>
|
||||
Gets the number of elements contained in the <see cref="T:System.Collections.ICollection"/>.
|
||||
</summary>
|
||||
<value>The number of elements actually contained in the <see cref="T:System.Collections.ICollection"/>.</value>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#ICollection#IsSynchronized">
|
||||
<summary>
|
||||
Gets a value indicating whether access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread safe).
|
||||
</summary>
|
||||
<value><c>true</c> if access to the <see cref="T:System.Collections.ICollection"/> is synchronized (thread safe); otherwise, <c>false</c>. In the default implementation of <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>, this property always returns <c>false</c>.</value>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#ICollection#SyncRoot">
|
||||
<summary>
|
||||
Gets an object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/>.
|
||||
</summary>
|
||||
<value>An object that can be used to synchronize access to the <see cref="T:System.Collections.ICollection"/></value>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#Generic#ICollection{T}#Count">
|
||||
<summary>
|
||||
Gets the number of elements contained in the <see cref="T:System.Collections.Generic.ICollection`1"/>.
|
||||
</summary>
|
||||
<value>The number of elements actually contained in the <see cref="T:System.Collections.Generic.ICollection`1"/>.</value>
|
||||
</member>
|
||||
<member name="P:Cyotek.Collections.Generic.CircularBuffer`1.System#Collections#Generic#ICollection{T}#IsReadOnly">
|
||||
<summary>
|
||||
Gets a value indicating whether the <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only.
|
||||
</summary>
|
||||
<value><c>true</c> if the <see cref="T:System.Collections.Generic.ICollection`1"/> is read-only; otherwise, <c>false</c>. In the default implementation of <see cref="T:Cyotek.Collections.Generic.CircularBuffer`1"/>, this property always returns <c>false</c>.</value>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
File diff suppressed because it is too large
Load diff
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="MySql.Data.MySqlClient" />
|
||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
</DbProviderFactories>
|
||||
</system.data></configuration>
|
|
@ -1,11 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
|
||||
</startup>
|
||||
<system.data>
|
||||
<DbProviderFactories>
|
||||
<remove invariant="MySql.Data.MySqlClient" />
|
||||
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.7.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
|
||||
</DbProviderFactories>
|
||||
</system.data></configuration>
|
File diff suppressed because it is too large
Load diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue