From 2b81660dce1396fee713eb0250d4eb518961f1d6 Mon Sep 17 00:00:00 2001 From: Tahir Akhlaq Date: Wed, 15 Jun 2016 04:20:24 +0100 Subject: [PATCH] accidentally mass replaced "target", fixed now --- FFXIVClassic Lobby Server/NLog.config | 14 +- FFXIVClassic Lobby Server/NLog.xsd | 348 ++++----- FFXIVClassic Lobby Server/Server.cs | 2 +- FFXIVClassic Lobby Server/packages.config | 14 +- .../packets/SubPacket.cs | 4 +- FFXIVClassic Map Server/NLog.config | 14 +- FFXIVClassic Map Server/NLog.xsd | 348 ++++----- FFXIVClassic Map Server/Server.cs | 2 +- FFXIVClassic Map Server/actors/Actor.cs | 704 +++++++++--------- FFXIVClassic Map Server/packages.config | 16 +- 10 files changed, 733 insertions(+), 733 deletions(-) diff --git a/FFXIVClassic Lobby Server/NLog.config b/FFXIVClassic Lobby Server/NLog.config index 535cf7e4..c152c074 100644 --- a/FFXIVClassic Lobby Server/NLog.config +++ b/FFXIVClassic Lobby Server/NLog.config @@ -16,22 +16,22 @@ See https://github.com/nlog/nlog/wiki/Configuration-file for information on customizing logging rules and outputs. --> - + - - - + + + diff --git a/FFXIVClassic Lobby Server/NLog.xsd b/FFXIVClassic Lobby Server/NLog.xsd index 63ded8c9..395075c9 100644 --- a/FFXIVClassic Lobby Server/NLog.xsd +++ b/FFXIVClassic Lobby Server/NLog.xsd @@ -1,12 +1,12 @@  - + - + @@ -51,17 +51,17 @@ - + - - - - - + + + + + - Make all tarGets within this section asynchronous (Creates additional threads but the calling thread isn't blocked by any tarGet writes). + Make all targets within this section asynchronous (Creates additional threads but the calling thread isn't blocked by any target writes). @@ -78,7 +78,7 @@ - Prefix for tarGets/layout renderers/filters/conditions loaded from this assembly. + Prefix for targets/layout renderers/filters/conditions loaded from this assembly. @@ -121,9 +121,9 @@ Level that this rule matches. - + - Comma separated list of tarGet names. + Comma separated list of target names. @@ -195,39 +195,39 @@ - + - - + + - + - + - - - - - - + + + + + + - + - + - - - - - - + + + + + + @@ -247,7 +247,7 @@ - + @@ -255,7 +255,7 @@ - Name of the tarGet. + Name of the target. @@ -273,17 +273,17 @@ - + - + - Name of the tarGet. + Name of the target. @@ -291,7 +291,7 @@ Number of log events that should be processed in a batch by the lazy writer thread. - + Action to be taken when the lazy writer thread request queue count exceeds the set limit. @@ -309,7 +309,7 @@ - + @@ -318,13 +318,13 @@ - + - Name of the tarGet. + Name of the target. @@ -332,7 +332,7 @@ - + @@ -341,7 +341,7 @@ - Name of the tarGet. + Name of the target. @@ -364,15 +364,15 @@ - + - - + + @@ -380,7 +380,7 @@ - + @@ -389,7 +389,7 @@ - Name of the tarGet. + Name of the target. @@ -412,12 +412,12 @@ Indicates whether to append newline at the end of log message. - + Action that should be taken if the will be more connections than . - + Action that should be taken if the message is larger than maxMessageSize. @@ -485,21 +485,21 @@ - + - + - + @@ -517,21 +517,21 @@ - + - - + + - Name of the tarGet. + Name of the target. @@ -567,7 +567,7 @@ - + @@ -588,37 +588,37 @@ - + - - + + Condition that must be met in order to set the specified foreground and background color. - + Background color. - + Foreground color. - + - - + + @@ -645,12 +645,12 @@ Compile the ? This can improve the performance, but at the costs of more memory usage. If false, the Regex Cache is used. - + Background color. - + Foreground color. @@ -658,7 +658,7 @@ - + @@ -669,7 +669,7 @@ - Name of the tarGet. + Name of the target. @@ -702,7 +702,7 @@ - + @@ -715,15 +715,15 @@ - - + + - + - Name of the tarGet. + Name of the target. @@ -796,12 +796,12 @@ - + - + @@ -811,7 +811,7 @@ - Connection string to run the command against. If not provided, connection string from the tarGet is used. + Connection string to run the command against. If not provided, connection string from the target is used. @@ -825,7 +825,7 @@ - + @@ -861,7 +861,7 @@ - + @@ -870,7 +870,7 @@ - Name of the tarGet. + Name of the target. @@ -893,14 +893,14 @@ - + - Name of the tarGet. + Name of the target. @@ -913,7 +913,7 @@ - + @@ -922,13 +922,13 @@ - + - Name of the tarGet. + Name of the target. @@ -961,7 +961,7 @@ Value to be used as the event Source. - + Action to take if the message is larger than the option. @@ -979,7 +979,7 @@ - + @@ -988,19 +988,19 @@ - + - Name of the tarGet. + Name of the target. - Indicates whether to return to the first tarGet after any successful write. + Indicates whether to return to the first target after any successful write. @@ -1008,7 +1008,7 @@ - + @@ -1016,9 +1016,9 @@ - + - + @@ -1029,7 +1029,7 @@ - + @@ -1045,7 +1045,7 @@ - Name of the tarGet. + Name of the target. @@ -1073,7 +1073,7 @@ Line ending mode. - + Way file archives are numbered. @@ -1083,7 +1083,7 @@ Name of the file to be used for an archive. - + Indicates whether to automatically archive log files every time the specified time passes. @@ -1138,7 +1138,7 @@ Indicates whether to enable log file(s) to be deleted. - + File attributes (Windows only). @@ -1175,7 +1175,7 @@ - Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File tarGet is writing to many files (such as splitting by level or by logger). + Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). @@ -1206,7 +1206,7 @@ - + @@ -1214,7 +1214,7 @@ - + @@ -1224,7 +1224,7 @@ - + @@ -1246,19 +1246,19 @@ - + - Name of the tarGet. + Name of the target. - Condition expression. Log events who meet this condition will be forwarded to the wrapped tarGet. + Condition expression. Log events who meet this condition will be forwarded to the wrapped target. @@ -1266,20 +1266,20 @@ - + - - - + + + - Name of the tarGet. + Name of the target. @@ -1287,17 +1287,17 @@ Windows Domain name to change context to. - + Required impersonation level. - + Type of the logon provider. - + Logon Type. @@ -1320,7 +1320,7 @@ - + @@ -1328,12 +1328,12 @@ - + - + @@ -1345,7 +1345,7 @@ - + @@ -1353,12 +1353,12 @@ - + - Name of the tarGet. + Name of the target. @@ -1394,7 +1394,7 @@ - + @@ -1418,7 +1418,7 @@ - + @@ -1437,7 +1437,7 @@ - + @@ -1448,7 +1448,7 @@ - Name of the tarGet. + Name of the target. @@ -1531,7 +1531,7 @@ SMTP Server to be used for sending. - + SMTP Authentication mode. @@ -1574,7 +1574,7 @@ - + @@ -1590,14 +1590,14 @@ - + - Name of the tarGet. + Name of the target. @@ -1610,7 +1610,7 @@ - + @@ -1624,7 +1624,7 @@ - Name of the tarGet. + Name of the target. @@ -1672,16 +1672,16 @@ - + - + - Name of the tarGet. + Name of the target. @@ -1699,15 +1699,15 @@ - + - - + + @@ -1716,7 +1716,7 @@ - Name of the tarGet. + Name of the target. @@ -1739,12 +1739,12 @@ Indicates whether to append newline at the end of log message. - + Action that should be taken if the will be more connections than . - + Action that should be taken if the message is larger than maxMessageSize. @@ -1779,15 +1779,15 @@ - + - - + + @@ -1795,7 +1795,7 @@ - + @@ -1804,7 +1804,7 @@ - Name of the tarGet. + Name of the target. @@ -1827,12 +1827,12 @@ Indicates whether to append newline at the end of log message. - + Action that should be taken if the will be more connections than . - + Action that should be taken if the message is larger than maxMessageSize. @@ -1902,7 +1902,7 @@ - + @@ -1910,7 +1910,7 @@ - Name of the tarGet. + Name of the target. @@ -1928,14 +1928,14 @@ - + - Name of the tarGet. + Name of the target. @@ -1948,7 +1948,7 @@ - + @@ -1961,7 +1961,7 @@ - Name of the tarGet. + Name of the target. @@ -2036,15 +2036,15 @@ - + - + - Name of the tarGet. + Name of the target. @@ -2055,7 +2055,7 @@ - + @@ -2073,13 +2073,13 @@ - + - Name of the tarGet. + Name of the target. @@ -2087,14 +2087,14 @@ - + - Name of the tarGet. + Name of the target. @@ -2107,7 +2107,7 @@ - + @@ -2115,12 +2115,12 @@ - Name of the tarGet. + Name of the target. - Number of retries that should be attempted on the wrapped tarGet in case of a failure. + Number of retries that should be attempted on the wrapped target in case of a failure. @@ -2133,13 +2133,13 @@ - + - Name of the tarGet. + Name of the target. @@ -2147,13 +2147,13 @@ - + - Name of the tarGet. + Name of the target. @@ -2161,14 +2161,14 @@ - + - Name of the tarGet. + Name of the target. @@ -2181,20 +2181,20 @@ - + - + - + - Name of the tarGet. + Name of the target. @@ -2217,7 +2217,7 @@ Web service namespace. Only used with Soap. - + Protocol to be used when calling web service. @@ -2230,7 +2230,7 @@ - + diff --git a/FFXIVClassic Lobby Server/Server.cs b/FFXIVClassic Lobby Server/Server.cs index 98563bdb..20b08be8 100644 --- a/FFXIVClassic Lobby Server/Server.cs +++ b/FFXIVClassic Lobby Server/Server.cs @@ -213,7 +213,7 @@ namespace FFXIVClassic_Lobby_Server { BasePacket newPacket = null; - //Too small to even Get length + //Too small to even get length if (bytesRead <= offset) return null; diff --git a/FFXIVClassic Lobby Server/packages.config b/FFXIVClassic Lobby Server/packages.config index cd0d69ec..5a3427bf 100644 --- a/FFXIVClassic Lobby Server/packages.config +++ b/FFXIVClassic Lobby Server/packages.config @@ -1,10 +1,10 @@  - - - - - - - + + + + + + + \ No newline at end of file diff --git a/FFXIVClassic Lobby Server/packets/SubPacket.cs b/FFXIVClassic Lobby Server/packets/SubPacket.cs index 43b54a2a..f30393b8 100644 --- a/FFXIVClassic Lobby Server/packets/SubPacket.cs +++ b/FFXIVClassic Lobby Server/packets/SubPacket.cs @@ -90,14 +90,14 @@ namespace FFXIVClassic_Lobby_Server.packets header.subpacketSize = (ushort)(SUBPACKET_SIZE + GAMEMESSAGE_SIZE + data.Length); } - public SubPacket(SubPacket original, uint newTarGetId) + public SubPacket(SubPacket original, uint newTargetId) { this.header = new SubPacketHeader(); this.gameMessage = original.gameMessage; header.subpacketSize = original.header.subpacketSize; header.type = original.header.type; header.sourceId = original.header.sourceId; - header.targetId = newTarGetId; + header.targetId = newTargetId; data = original.data; } diff --git a/FFXIVClassic Map Server/NLog.config b/FFXIVClassic Map Server/NLog.config index 603cb587..1d8fb2f4 100644 --- a/FFXIVClassic Map Server/NLog.config +++ b/FFXIVClassic Map Server/NLog.config @@ -16,22 +16,22 @@ See https://github.com/nlog/nlog/wiki/Configuration-file for information on customizing logging rules and outputs. --> - + - - - + + + diff --git a/FFXIVClassic Map Server/NLog.xsd b/FFXIVClassic Map Server/NLog.xsd index 63ded8c9..395075c9 100644 --- a/FFXIVClassic Map Server/NLog.xsd +++ b/FFXIVClassic Map Server/NLog.xsd @@ -1,12 +1,12 @@  - + - + @@ -51,17 +51,17 @@ - + - - - - - + + + + + - Make all tarGets within this section asynchronous (Creates additional threads but the calling thread isn't blocked by any tarGet writes). + Make all targets within this section asynchronous (Creates additional threads but the calling thread isn't blocked by any target writes). @@ -78,7 +78,7 @@ - Prefix for tarGets/layout renderers/filters/conditions loaded from this assembly. + Prefix for targets/layout renderers/filters/conditions loaded from this assembly. @@ -121,9 +121,9 @@ Level that this rule matches. - + - Comma separated list of tarGet names. + Comma separated list of target names. @@ -195,39 +195,39 @@ - + - - + + - + - + - - - - - - + + + + + + - + - + - - - - - - + + + + + + @@ -247,7 +247,7 @@ - + @@ -255,7 +255,7 @@ - Name of the tarGet. + Name of the target. @@ -273,17 +273,17 @@ - + - + - Name of the tarGet. + Name of the target. @@ -291,7 +291,7 @@ Number of log events that should be processed in a batch by the lazy writer thread. - + Action to be taken when the lazy writer thread request queue count exceeds the set limit. @@ -309,7 +309,7 @@ - + @@ -318,13 +318,13 @@ - + - Name of the tarGet. + Name of the target. @@ -332,7 +332,7 @@ - + @@ -341,7 +341,7 @@ - Name of the tarGet. + Name of the target. @@ -364,15 +364,15 @@ - + - - + + @@ -380,7 +380,7 @@ - + @@ -389,7 +389,7 @@ - Name of the tarGet. + Name of the target. @@ -412,12 +412,12 @@ Indicates whether to append newline at the end of log message. - + Action that should be taken if the will be more connections than . - + Action that should be taken if the message is larger than maxMessageSize. @@ -485,21 +485,21 @@ - + - + - + @@ -517,21 +517,21 @@ - + - - + + - Name of the tarGet. + Name of the target. @@ -567,7 +567,7 @@ - + @@ -588,37 +588,37 @@ - + - - + + Condition that must be met in order to set the specified foreground and background color. - + Background color. - + Foreground color. - + - - + + @@ -645,12 +645,12 @@ Compile the ? This can improve the performance, but at the costs of more memory usage. If false, the Regex Cache is used. - + Background color. - + Foreground color. @@ -658,7 +658,7 @@ - + @@ -669,7 +669,7 @@ - Name of the tarGet. + Name of the target. @@ -702,7 +702,7 @@ - + @@ -715,15 +715,15 @@ - - + + - + - Name of the tarGet. + Name of the target. @@ -796,12 +796,12 @@ - + - + @@ -811,7 +811,7 @@ - Connection string to run the command against. If not provided, connection string from the tarGet is used. + Connection string to run the command against. If not provided, connection string from the target is used. @@ -825,7 +825,7 @@ - + @@ -861,7 +861,7 @@ - + @@ -870,7 +870,7 @@ - Name of the tarGet. + Name of the target. @@ -893,14 +893,14 @@ - + - Name of the tarGet. + Name of the target. @@ -913,7 +913,7 @@ - + @@ -922,13 +922,13 @@ - + - Name of the tarGet. + Name of the target. @@ -961,7 +961,7 @@ Value to be used as the event Source. - + Action to take if the message is larger than the option. @@ -979,7 +979,7 @@ - + @@ -988,19 +988,19 @@ - + - Name of the tarGet. + Name of the target. - Indicates whether to return to the first tarGet after any successful write. + Indicates whether to return to the first target after any successful write. @@ -1008,7 +1008,7 @@ - + @@ -1016,9 +1016,9 @@ - + - + @@ -1029,7 +1029,7 @@ - + @@ -1045,7 +1045,7 @@ - Name of the tarGet. + Name of the target. @@ -1073,7 +1073,7 @@ Line ending mode. - + Way file archives are numbered. @@ -1083,7 +1083,7 @@ Name of the file to be used for an archive. - + Indicates whether to automatically archive log files every time the specified time passes. @@ -1138,7 +1138,7 @@ Indicates whether to enable log file(s) to be deleted. - + File attributes (Windows only). @@ -1175,7 +1175,7 @@ - Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File tarGet is writing to many files (such as splitting by level or by logger). + Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger). @@ -1206,7 +1206,7 @@ - + @@ -1214,7 +1214,7 @@ - + @@ -1224,7 +1224,7 @@ - + @@ -1246,19 +1246,19 @@ - + - Name of the tarGet. + Name of the target. - Condition expression. Log events who meet this condition will be forwarded to the wrapped tarGet. + Condition expression. Log events who meet this condition will be forwarded to the wrapped target. @@ -1266,20 +1266,20 @@ - + - - - + + + - Name of the tarGet. + Name of the target. @@ -1287,17 +1287,17 @@ Windows Domain name to change context to. - + Required impersonation level. - + Type of the logon provider. - + Logon Type. @@ -1320,7 +1320,7 @@ - + @@ -1328,12 +1328,12 @@ - + - + @@ -1345,7 +1345,7 @@ - + @@ -1353,12 +1353,12 @@ - + - Name of the tarGet. + Name of the target. @@ -1394,7 +1394,7 @@ - + @@ -1418,7 +1418,7 @@ - + @@ -1437,7 +1437,7 @@ - + @@ -1448,7 +1448,7 @@ - Name of the tarGet. + Name of the target. @@ -1531,7 +1531,7 @@ SMTP Server to be used for sending. - + SMTP Authentication mode. @@ -1574,7 +1574,7 @@ - + @@ -1590,14 +1590,14 @@ - + - Name of the tarGet. + Name of the target. @@ -1610,7 +1610,7 @@ - + @@ -1624,7 +1624,7 @@ - Name of the tarGet. + Name of the target. @@ -1672,16 +1672,16 @@ - + - + - Name of the tarGet. + Name of the target. @@ -1699,15 +1699,15 @@ - + - - + + @@ -1716,7 +1716,7 @@ - Name of the tarGet. + Name of the target. @@ -1739,12 +1739,12 @@ Indicates whether to append newline at the end of log message. - + Action that should be taken if the will be more connections than . - + Action that should be taken if the message is larger than maxMessageSize. @@ -1779,15 +1779,15 @@ - + - - + + @@ -1795,7 +1795,7 @@ - + @@ -1804,7 +1804,7 @@ - Name of the tarGet. + Name of the target. @@ -1827,12 +1827,12 @@ Indicates whether to append newline at the end of log message. - + Action that should be taken if the will be more connections than . - + Action that should be taken if the message is larger than maxMessageSize. @@ -1902,7 +1902,7 @@ - + @@ -1910,7 +1910,7 @@ - Name of the tarGet. + Name of the target. @@ -1928,14 +1928,14 @@ - + - Name of the tarGet. + Name of the target. @@ -1948,7 +1948,7 @@ - + @@ -1961,7 +1961,7 @@ - Name of the tarGet. + Name of the target. @@ -2036,15 +2036,15 @@ - + - + - Name of the tarGet. + Name of the target. @@ -2055,7 +2055,7 @@ - + @@ -2073,13 +2073,13 @@ - + - Name of the tarGet. + Name of the target. @@ -2087,14 +2087,14 @@ - + - Name of the tarGet. + Name of the target. @@ -2107,7 +2107,7 @@ - + @@ -2115,12 +2115,12 @@ - Name of the tarGet. + Name of the target. - Number of retries that should be attempted on the wrapped tarGet in case of a failure. + Number of retries that should be attempted on the wrapped target in case of a failure. @@ -2133,13 +2133,13 @@ - + - Name of the tarGet. + Name of the target. @@ -2147,13 +2147,13 @@ - + - Name of the tarGet. + Name of the target. @@ -2161,14 +2161,14 @@ - + - Name of the tarGet. + Name of the target. @@ -2181,20 +2181,20 @@ - + - + - + - Name of the tarGet. + Name of the target. @@ -2217,7 +2217,7 @@ Web service namespace. Only used with Soap. - + Protocol to be used when calling web service. @@ -2230,7 +2230,7 @@ - + diff --git a/FFXIVClassic Map Server/Server.cs b/FFXIVClassic Map Server/Server.cs index 1d8b6061..f5005496 100644 --- a/FFXIVClassic Map Server/Server.cs +++ b/FFXIVClassic Map Server/Server.cs @@ -296,7 +296,7 @@ namespace FFXIVClassic_Map_Server { BasePacket newPacket = null; - //Too small to even Get length + //Too small to even get length if (bytesRead <= offset) return null; diff --git a/FFXIVClassic Map Server/actors/Actor.cs b/FFXIVClassic Map Server/actors/Actor.cs index c323d980..5db8a9dd 100644 --- a/FFXIVClassic Map Server/actors/Actor.cs +++ b/FFXIVClassic Map Server/actors/Actor.cs @@ -1,354 +1,354 @@ -using FFXIVClassic_Map_Server.packets; -using FFXIVClassic_Map_Server.actors; -using FFXIVClassic_Map_Server.lua; -using FFXIVClassic_Map_Server.packets.send.actor; -using FFXIVClassic_Map_Server.packets.send.actor.events; -using FFXIVClassic.Common; -using System; -using System.Collections.Generic; +using FFXIVClassic_Map_Server.packets; +using FFXIVClassic_Map_Server.actors; +using FFXIVClassic_Map_Server.lua; +using FFXIVClassic_Map_Server.packets.send.actor; +using FFXIVClassic_Map_Server.packets.send.actor.events; +using FFXIVClassic.Common; +using System; +using System.Collections.Generic; using FFXIVClassic_Map_Server.actors.area; -namespace FFXIVClassic_Map_Server.Actors -{ - 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 float[] moveSpeeds = new float[5]; - - public uint zoneId; - public Area zone = null; - public bool isZoning = false; - - public bool spawnedFirstTime = false; - - public string classPath; - public string className; - public List classParams; - - public EventList eventConditions; - - public Actor(uint actorId) - { - this.actorId = actorId; - } - - public Actor(uint actorId, string actorName, string className, List classParams) - { - this.actorId = actorId; - this.actorName = actorName; - this.className = className; - this.classParams = classParams; - - this.moveSpeeds[0] = SetActorSpeedPacket.DEFAULT_STOP; - this.moveSpeeds[1] = SetActorSpeedPacket.DEFAULT_WALK; - this.moveSpeeds[2] = SetActorSpeedPacket.DEFAULT_RUN; - this.moveSpeeds[3] = SetActorSpeedPacket.DEFAULT_RUN; - } - - public SubPacket CreateAddActorPacket(uint playerActorId, byte val) - { - return AddActorPacket.BuildPacket(actorId, playerActorId, val); - } - - public SubPacket CreateNamePacket(uint playerActorId) - { - return SetActorNamePacket.BuildPacket(actorId, playerActorId, displayNameId, displayNameId == 0xFFFFFFFF | displayNameId == 0x0 ? 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, 0x1, false); - else if (playerActorId == actorId) - spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, true); - else - { - if (this is Player) - spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, 0, positionX, positionY, positionZ, rotation, spawnType, false); - 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 CreateSpawnTeleportPacket(uint playerActorId, uint spawnType) - { - SubPacket spawnPacket; - - spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, false); - - //return SetActorPositionPacket.BuildPacket(actorId, playerActorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE); - - spawnPacket.DebugPrintSubPacket(); - - 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 List GetEventConditionPackets(uint playerActorId) - { - List subpackets = new List(); - - //Return empty list - if (eventConditions == null) - return subpackets; - - if (eventConditions.talkEventConditions != null) - { - foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions) - subpackets.Add(SetTalkEventCondition.BuildPacket(playerActorId, actorId, condition)); - } - - if (eventConditions.noticeEventConditions != null) - { - foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions) - subpackets.Add(SetNoticeEventCondition.BuildPacket(playerActorId, actorId, condition)); - } - - if (eventConditions.emoteEventConditions != null) - { - foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions) - subpackets.Add(SetEmoteEventCondition.BuildPacket(playerActorId, actorId, condition)); - } - - if (eventConditions.pushWithCircleEventConditions != null) - { - foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions) - subpackets.Add(SetPushEventConditionWithCircle.BuildPacket(playerActorId, actorId, condition)); - } - - if (eventConditions.pushWithFanEventConditions != null) - { - foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions) - subpackets.Add(SetPushEventConditionWithFan.BuildPacket(playerActorId, actorId, condition)); - } - - if (eventConditions.pushWithBoxEventConditions != null) - { - foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions) - subpackets.Add(SetPushEventConditionWithTriggerBox.BuildPacket(playerActorId, actorId, condition)); - } - - return subpackets; - } - - public BasePacket GetSetEventStatusPackets(uint playerActorId) - { - List subpackets = new List(); - - //Return empty list - if (eventConditions == null) - return BasePacket.CreatePacket(subpackets, true, false); - - if (eventConditions.talkEventConditions != null) - { - foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions) - subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 1, condition.conditionName)); - } - - if (eventConditions.noticeEventConditions != null) - { - foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions) - subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 1, condition.conditionName)); - } - - if (eventConditions.emoteEventConditions != null) - { - foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions) - subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 3, condition.conditionName)); - } - - if (eventConditions.pushWithCircleEventConditions != null) - { - foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions) - subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 2, condition.conditionName)); - } - - if (eventConditions.pushWithFanEventConditions != null) - { - foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions) - subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 2, condition.conditionName)); - } - - if (eventConditions.pushWithBoxEventConditions != null) - { - foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions) - subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 2, condition.conditionName)); - } - - return BasePacket.CreatePacket(subpackets, true, false); - } - - 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) - { - return GetSpawnPackets(playerActorId, 0x1); - } - - public virtual BasePacket GetSpawnPackets(uint playerActorId, uint spawnType) - { - List subpackets = new List(); - subpackets.Add(CreateAddActorPacket(playerActorId, 8)); - subpackets.AddRange(GetEventConditionPackets(playerActorId)); - subpackets.Add(CreateSpeedPacket(playerActorId)); - subpackets.Add(CreateSpawnPositonPacket(playerActorId, spawnType)); - 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.AddByte(0xE14B0CA8, 1); - initProperties.AddByte(0x2138FD71, 1); - initProperties.AddByte(0xFBFBCFB1, 1); - 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 ushort GetState() - { - return currentMainState; - } - - public List GetLuaParams() - { - return classParams; - } - - public void ChangeState(ushort newState) - { - currentMainState = newState; - SubPacket ChangeStatePacket = SetActorStatePacket.BuildPacket(actorId, actorId, newState, currentSubState); - SubPacket battleActionPacket = BattleAction1Packet.BuildPacket(actorId, actorId); - zone.BroadcastPacketAroundActor(this, ChangeStatePacket); - zone.BroadcastPacketAroundActor(this, battleActionPacket); - } - - public void ChangeSpeed(int type, float value) - { - moveSpeeds[type] = value; - SubPacket ChangeSpeedPacket = SetActorSpeedPacket.BuildPacket(actorId, actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2]); - zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket); - } - - public void ChangeSpeed(float speedStop, float speedWalk, float speedRun) - { - moveSpeeds[0] = speedStop; - moveSpeeds[1] = speedWalk; - moveSpeeds[2] = speedRun; - moveSpeeds[3] = speedRun; - SubPacket ChangeSpeedPacket = SetActorSpeedPacket.BuildPacket(actorId, actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2]); - zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket); - } - - public void generateActorName(int actorNumber) - { - //Format Class Name - string className = this.className.Replace("Populace", "Ppl") - .Replace("Monster", "Mon") - .Replace("Crowd", "Crd") - .Replace("MapObj", "Map") - .Replace("Object", "Obj") - .Replace("Retainer", "Rtn") - .Replace("Standard", "Std"); - className = Char.ToLowerInvariant(className[0]) + className.Substring(1); - - //Format Zone Name - string zoneName = zone.zoneName.Replace("Field", "Fld") - .Replace("Dungeon", "Dgn") - .Replace("Town", "Twn") - .Replace("Battle", "Btl") - .Replace("Test", "Tes") - .Replace("Event", "Evt") - .Replace("Ship", "Shp") - .Replace("Office", "Ofc"); - if (zone is PrivateArea) - { - //Check if "normal" - zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P"; - } - zoneName = Char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1); - - try - { - className = className.Substring(0, 20 - zoneName.Length); - } - catch (ArgumentOutOfRangeException e) - {} - - //Convert actor number to base 63 - string classNumber = Utils.ToStringBase63(actorNumber); - - //Get stuff after @ - uint zoneId = zone.actorId; - uint privLevel = 0; - if (zone is PrivateArea) - privLevel = ((PrivateArea)zone).GetPrivateAreaLevel(); - - actorName = String.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel); - } - - } -} - +namespace FFXIVClassic_Map_Server.Actors +{ + 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 float[] moveSpeeds = new float[5]; + + public uint zoneId; + public Area zone = null; + public bool isZoning = false; + + public bool spawnedFirstTime = false; + + public string classPath; + public string className; + public List classParams; + + public EventList eventConditions; + + public Actor(uint actorId) + { + this.actorId = actorId; + } + + public Actor(uint actorId, string actorName, string className, List classParams) + { + this.actorId = actorId; + this.actorName = actorName; + this.className = className; + this.classParams = classParams; + + this.moveSpeeds[0] = SetActorSpeedPacket.DEFAULT_STOP; + this.moveSpeeds[1] = SetActorSpeedPacket.DEFAULT_WALK; + this.moveSpeeds[2] = SetActorSpeedPacket.DEFAULT_RUN; + this.moveSpeeds[3] = SetActorSpeedPacket.DEFAULT_RUN; + } + + public SubPacket CreateAddActorPacket(uint playerActorId, byte val) + { + return AddActorPacket.BuildPacket(actorId, playerActorId, val); + } + + public SubPacket CreateNamePacket(uint playerActorId) + { + return SetActorNamePacket.BuildPacket(actorId, playerActorId, displayNameId, displayNameId == 0xFFFFFFFF | displayNameId == 0x0 ? 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, 0x1, false); + else if (playerActorId == actorId) + spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, true); + else + { + if (this is Player) + spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, 0, positionX, positionY, positionZ, rotation, spawnType, false); + 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 CreateSpawnTeleportPacket(uint playerActorId, uint spawnType) + { + SubPacket spawnPacket; + + spawnPacket = SetActorPositionPacket.BuildPacket(actorId, playerActorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, false); + + //return SetActorPositionPacket.BuildPacket(actorId, playerActorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE); + + spawnPacket.DebugPrintSubPacket(); + + 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 List GetEventConditionPackets(uint playerActorId) + { + List subpackets = new List(); + + //Return empty list + if (eventConditions == null) + return subpackets; + + if (eventConditions.talkEventConditions != null) + { + foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions) + subpackets.Add(SetTalkEventCondition.BuildPacket(playerActorId, actorId, condition)); + } + + if (eventConditions.noticeEventConditions != null) + { + foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions) + subpackets.Add(SetNoticeEventCondition.BuildPacket(playerActorId, actorId, condition)); + } + + if (eventConditions.emoteEventConditions != null) + { + foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions) + subpackets.Add(SetEmoteEventCondition.BuildPacket(playerActorId, actorId, condition)); + } + + if (eventConditions.pushWithCircleEventConditions != null) + { + foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions) + subpackets.Add(SetPushEventConditionWithCircle.BuildPacket(playerActorId, actorId, condition)); + } + + if (eventConditions.pushWithFanEventConditions != null) + { + foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions) + subpackets.Add(SetPushEventConditionWithFan.BuildPacket(playerActorId, actorId, condition)); + } + + if (eventConditions.pushWithBoxEventConditions != null) + { + foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions) + subpackets.Add(SetPushEventConditionWithTriggerBox.BuildPacket(playerActorId, actorId, condition)); + } + + return subpackets; + } + + public BasePacket GetSetEventStatusPackets(uint playerActorId) + { + List subpackets = new List(); + + //Return empty list + if (eventConditions == null) + return BasePacket.CreatePacket(subpackets, true, false); + + if (eventConditions.talkEventConditions != null) + { + foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions) + subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 1, condition.conditionName)); + } + + if (eventConditions.noticeEventConditions != null) + { + foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions) + subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 1, condition.conditionName)); + } + + if (eventConditions.emoteEventConditions != null) + { + foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions) + subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 3, condition.conditionName)); + } + + if (eventConditions.pushWithCircleEventConditions != null) + { + foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions) + subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 2, condition.conditionName)); + } + + if (eventConditions.pushWithFanEventConditions != null) + { + foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions) + subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 2, condition.conditionName)); + } + + if (eventConditions.pushWithBoxEventConditions != null) + { + foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions) + subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 2, condition.conditionName)); + } + + return BasePacket.CreatePacket(subpackets, true, false); + } + + 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) + { + return GetSpawnPackets(playerActorId, 0x1); + } + + public virtual BasePacket GetSpawnPackets(uint playerActorId, uint spawnType) + { + List subpackets = new List(); + subpackets.Add(CreateAddActorPacket(playerActorId, 8)); + subpackets.AddRange(GetEventConditionPackets(playerActorId)); + subpackets.Add(CreateSpeedPacket(playerActorId)); + subpackets.Add(CreateSpawnPositonPacket(playerActorId, spawnType)); + 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.AddByte(0xE14B0CA8, 1); + initProperties.AddByte(0x2138FD71, 1); + initProperties.AddByte(0xFBFBCFB1, 1); + 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 ushort GetState() + { + return currentMainState; + } + + public List GetLuaParams() + { + return classParams; + } + + public void ChangeState(ushort newState) + { + currentMainState = newState; + SubPacket ChangeStatePacket = SetActorStatePacket.BuildPacket(actorId, actorId, newState, currentSubState); + SubPacket battleActionPacket = BattleAction1Packet.BuildPacket(actorId, actorId); + zone.BroadcastPacketAroundActor(this, ChangeStatePacket); + zone.BroadcastPacketAroundActor(this, battleActionPacket); + } + + public void ChangeSpeed(int type, float value) + { + moveSpeeds[type] = value; + SubPacket ChangeSpeedPacket = SetActorSpeedPacket.BuildPacket(actorId, actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2]); + zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket); + } + + public void ChangeSpeed(float speedStop, float speedWalk, float speedRun) + { + moveSpeeds[0] = speedStop; + moveSpeeds[1] = speedWalk; + moveSpeeds[2] = speedRun; + moveSpeeds[3] = speedRun; + SubPacket ChangeSpeedPacket = SetActorSpeedPacket.BuildPacket(actorId, actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2]); + zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket); + } + + public void generateActorName(int actorNumber) + { + //Format Class Name + string className = this.className.Replace("Populace", "Ppl") + .Replace("Monster", "Mon") + .Replace("Crowd", "Crd") + .Replace("MapObj", "Map") + .Replace("Object", "Obj") + .Replace("Retainer", "Rtn") + .Replace("Standard", "Std"); + className = Char.ToLowerInvariant(className[0]) + className.Substring(1); + + //Format Zone Name + string zoneName = zone.zoneName.Replace("Field", "Fld") + .Replace("Dungeon", "Dgn") + .Replace("Town", "Twn") + .Replace("Battle", "Btl") + .Replace("Test", "Tes") + .Replace("Event", "Evt") + .Replace("Ship", "Shp") + .Replace("Office", "Ofc"); + if (zone is PrivateArea) + { + //Check if "normal" + zoneName = zoneName.Remove(zoneName.Length - 1, 1) + "P"; + } + zoneName = Char.ToLowerInvariant(zoneName[0]) + zoneName.Substring(1); + + try + { + className = className.Substring(0, 20 - zoneName.Length); + } + catch (ArgumentOutOfRangeException e) + {} + + //Convert actor number to base 63 + string classNumber = Utils.ToStringBase63(actorNumber); + + //Get stuff after @ + uint zoneId = zone.actorId; + uint privLevel = 0; + if (zone is PrivateArea) + privLevel = ((PrivateArea)zone).GetPrivateAreaLevel(); + + actorName = String.Format("{0}_{1}_{2}@{3:X3}{4:X2}", className, zoneName, classNumber, zoneId, privLevel); + } + + } +} + diff --git a/FFXIVClassic Map Server/packages.config b/FFXIVClassic Map Server/packages.config index 4d7799bb..6d8ab227 100644 --- a/FFXIVClassic Map Server/packages.config +++ b/FFXIVClassic Map Server/packages.config @@ -1,11 +1,11 @@  - - - - - - - - + + + + + + + + \ No newline at end of file