diff --git a/FFXIVClassic Common Class Lib/FFXIVClassic Common Class Lib.csproj b/FFXIVClassic Common Class Lib/FFXIVClassic Common Class Lib.csproj
index a3fe065d..8c708e5f 100644
--- a/FFXIVClassic Common Class Lib/FFXIVClassic Common Class Lib.csproj
+++ b/FFXIVClassic Common Class Lib/FFXIVClassic Common Class Lib.csproj
@@ -24,6 +24,7 @@
4
false
false
+ true
pdbonly
diff --git a/FFXIVClassic Map Server/CommandProcessor.cs b/FFXIVClassic Map Server/CommandProcessor.cs
index 7b0b1359..50985884 100644
--- a/FFXIVClassic Map Server/CommandProcessor.cs
+++ b/FFXIVClassic Map Server/CommandProcessor.cs
@@ -35,25 +35,6 @@ namespace FFXIVClassic_Map_Server
mConnectedPlayerList = playerList;
}
- public void SendPacket(ConnectedPlayer client, string path)
- {
- BasePacket packet = new BasePacket(path);
-
- if (client != null)
- {
- packet.ReplaceActorID(client.actorID);
- client.QueuePacket(packet);
- }
- else
- {
- foreach (KeyValuePair entry in mConnectedPlayerList)
- {
- packet.ReplaceActorID(entry.Value.actorID);
- entry.Value.QueuePacket(packet);
- }
- }
- }
-
public void ChangeProperty(uint id, uint value, string target)
{
SetActorPropetyPacket ChangeProperty = new SetActorPropetyPacket(target);
@@ -87,7 +68,7 @@ namespace FFXIVClassic_Map_Server
internal bool DoCommand(string input, ConnectedPlayer client)
{
- if (!input.Any())
+ if (!input.Any() || input.Equals(""))
return false;
input.Trim();
@@ -102,7 +83,7 @@ namespace FFXIVClassic_Map_Server
split = split.Select(temp => temp.ToLower()).ToArray(); // Ignore case on commands
- var cmd = split?.ElementAt(0);
+ var cmd = split[0];
if (cmd.Any())
{
@@ -138,6 +119,8 @@ namespace FFXIVClassic_Map_Server
if (split.Length >= 1)
{
+ // TODO: reloadzones
+
#region !reloaditems
if (split[0].Equals("reloaditems"))
{
@@ -151,24 +134,6 @@ namespace FFXIVClassic_Map_Server
}
#endregion
- #region !sendpacket
- else if (split[0].Equals("sendpacket"))
- {
- if (split.Length < 2)
- return false;
-
- try
- {
- SendPacket(client, "./packets/" + split[1]);
- return true;
- }
- catch (Exception e)
- {
- Program.Log.Error("Could not load packet: " + e);
- }
- }
- #endregion
-
#region !property
else if (split[0].Equals("property"))
{
diff --git a/FFXIVClassic Map Server/Database.cs b/FFXIVClassic Map Server/Database.cs
index 55e1b9fd..823e8b13 100644
--- a/FFXIVClassic Map Server/Database.cs
+++ b/FFXIVClassic Map Server/Database.cs
@@ -419,6 +419,8 @@ namespace FFXIVClassic_Map_Server
player.oldRotation = player.rotation = reader.GetFloat(4);
player.currentMainState = reader.GetUInt16(5);
player.zoneId = reader.GetUInt32(6);
+ player.isZoning = true;
+ player.zone = Server.GetWorldManager().GetZone(player.zoneId);
player.gcCurrent = reader.GetByte(7);
player.gcRankLimsa = reader.GetByte(8);
player.gcRankGridania = reader.GetByte(9);
diff --git a/FFXIVClassic Map Server/PacketProcessor.cs b/FFXIVClassic Map Server/PacketProcessor.cs
index 09b203aa..e1a7719c 100644
--- a/FFXIVClassic Map Server/PacketProcessor.cs
+++ b/FFXIVClassic Map Server/PacketProcessor.cs
@@ -112,7 +112,7 @@ namespace FFXIVClassic_Map_Server
if (packet.header.connectionType == BasePacket.TYPE_ZONE)
{
- while (!mPlayers.ContainsKey(client.owner))
+ while (mPlayers != null && !mPlayers.ContainsKey(client.owner))
{ }
player = mPlayers[client.owner];
}
@@ -127,9 +127,9 @@ namespace FFXIVClassic_Map_Server
player.SetConnection(packet.header.connectionType, client);
if (packet.header.connectionType == BasePacket.TYPE_ZONE)
- Program.Log.Debug("Got {0} connection for ActorID {1} @ {2}.", "zone", actorID, client.GetAddress());
+ Program.Log.Info("Got {0} connection for ActorID {1} @ {2}.", "zone", actorID, client.GetAddress());
else if (packet.header.connectionType == BasePacket.TYPE_CHAT)
- Program.Log.Debug("Got {0} connection for ActorID {1} @ {2}.", "chat", actorID, client.GetAddress());
+ Program.Log.Info("Got {0} connection for ActorID {1} @ {2}.", "chat", actorID, client.GetAddress());
//Create player actor
reply1.DebugPrintPacket();
@@ -139,12 +139,14 @@ namespace FFXIVClassic_Map_Server
}
else if (subpacket.header.type == 0x07)
{
- BasePacket init = Login0x7ResponsePacket.BuildPacket(BitConverter.ToUInt32(packet.data, 0x10), Utils.UnixTimeStampUTC());
+ BasePacket init = Login0x7ResponsePacket.BuildPacket(BitConverter.ToUInt32(packet.data, 0x10), Utils.UnixTimeStampUTC(), 0x08);
//client.QueuePacket(init);
}
else if (subpacket.header.type == 0x08)
- {
- //Response, client's current [actorID][time]
+ {
+ //Response, client's current [actorID][time]
+ //BasePacket init = Login0x7ResponsePacket.BuildPacket(BitConverter.ToUInt32(packet.data, 0x10), Utils.UnixTimeStampUTC(), 0x07);
+ //client.QueuePacket(init);
packet.DebugPrintPacket();
}
else if (subpacket.header.type == 0x03)
@@ -154,7 +156,7 @@ namespace FFXIVClassic_Map_Server
if(mPlayers.ContainsKey(client.owner))
player = mPlayers[client.owner];
- if (player == null)
+ if (player == null || !player.IsClientConnectionsReady())
return;
//Normal Game Opcode
diff --git a/FFXIVClassic Map Server/Program.cs b/FFXIVClassic Map Server/Program.cs
index bb0020b6..a8bba8eb 100644
--- a/FFXIVClassic Map Server/Program.cs
+++ b/FFXIVClassic Map Server/Program.cs
@@ -70,7 +70,7 @@ namespace FFXIVClassic_Map_Server
{
String input = Console.ReadLine();
Log.Info("[Console Input] " + input);
- cp.DoCommand(input, null);
+ cp.DoCommand(input, null);
}
}
diff --git a/FFXIVClassic Map Server/actors/chara/player/Player.cs b/FFXIVClassic Map Server/actors/chara/player/Player.cs
index 190b5156..fe3213e3 100644
--- a/FFXIVClassic Map Server/actors/chara/player/Player.cs
+++ b/FFXIVClassic Map Server/actors/chara/player/Player.cs
@@ -601,6 +601,21 @@ namespace FFXIVClassic_Map_Server.Actors
playerSession.QueuePacket(subpacket, true, false);
}
+ public void SendPacket(string path)
+ {
+ try
+ {
+ BasePacket packet = new BasePacket(path);
+
+ packet.ReplaceActorID(actorId);
+ QueuePacket(packet);
+ }
+ catch (Exception e)
+ {
+ this.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "[SendPacket]", "Unable to send packet.");
+ }
+ }
+
public void BroadcastPacket(SubPacket packet, bool sendToSelf)
{
if (sendToSelf)
@@ -749,26 +764,6 @@ namespace FFXIVClassic_Map_Server.Actors
//zone.BroadcastPacketAroundActor(this, worldMasterMessage);
}
- public void ChangeProperty(uint id, uint value, string target)
- {
- SetActorPropetyPacket ChangeProperty = new SetActorPropetyPacket(target);
-
- ChangeProperty.SetTarget(target);
- ChangeProperty.AddInt(id, value);
- ChangeProperty.AddTarget();
-
- /*foreach (KeyValuePair entry in mConnectedPlayerList)
- {
- SubPacket ChangePropertyPacket = ChangeProperty.BuildPacket((entry.Value.actorID), (entry.Value.actorID));
-
- BasePacket packet = BasePacket.CreatePacket(ChangePropertyPacket, true, false);
- packet.DebugPrintPacket();
-
- entry.Value.QueuePacket(packet);
- }
- */
- }
-
public void GraphicChange(uint slot, uint graphicId)
{
appearanceIds[slot] = graphicId;
diff --git a/FFXIVClassic Map Server/dataobjects/ConnectedPlayer.cs b/FFXIVClassic Map Server/dataobjects/ConnectedPlayer.cs
index f5eef9a4..19caa56e 100644
--- a/FFXIVClassic Map Server/dataobjects/ConnectedPlayer.cs
+++ b/FFXIVClassic Map Server/dataobjects/ConnectedPlayer.cs
@@ -70,8 +70,8 @@ namespace FFXIVClassic_Map_Server.dataobjects
}
public void QueuePacket(SubPacket subPacket, bool isAuthed, bool isEncrypted)
- {
- zoneConnection.QueuePacket(subPacket, isAuthed, isEncrypted);
+ {
+ zoneConnection.QueuePacket(subPacket, isAuthed, isEncrypted);
}
public Player GetActor()
@@ -97,7 +97,7 @@ namespace FFXIVClassic_Map_Server.dataobjects
}
public void UpdatePlayerActorPosition(float x, float y, float z, float rot, ushort moveState)
- {
+ {
playerActor.oldPositionX = playerActor.positionX;
playerActor.oldPositionY = playerActor.positionY;
playerActor.oldPositionZ = playerActor.positionZ;
diff --git a/FFXIVClassic Map Server/packets/send/login/0x7ResponsePacket.cs b/FFXIVClassic Map Server/packets/send/login/0x7ResponsePacket.cs
index 133fffb5..63d207f9 100644
--- a/FFXIVClassic Map Server/packets/send/login/0x7ResponsePacket.cs
+++ b/FFXIVClassic Map Server/packets/send/login/0x7ResponsePacket.cs
@@ -5,7 +5,7 @@ namespace FFXIVClassic_Map_Server.packets.send.login
{
class Login0x7ResponsePacket
{
- public static BasePacket BuildPacket(uint actorID, uint time)
+ public static BasePacket BuildPacket(uint actorID, uint time, uint type)
{
byte[] data = new byte[0x18];
@@ -16,7 +16,7 @@ namespace FFXIVClassic_Map_Server.packets.send.login
try
{
binWriter.Write((short)0x18);
- binWriter.Write((short)0x8);
+ binWriter.Write((short)type);
binWriter.Write((uint)0);
binWriter.Write((uint)0);
binWriter.Write((uint)0xFFFFFD7F);
diff --git a/data/scripts/commands/gm/property.lua b/data/scripts/commands/gm/property.lua
deleted file mode 100644
index 576478bb..00000000
--- a/data/scripts/commands/gm/property.lua
+++ /dev/null
@@ -1,9 +0,0 @@
-properties = {
- permissions = 0,
- parameters = "",
- description = "",
-}
-
-function onTrigger(player)
-
-end;
\ No newline at end of file
diff --git a/data/scripts/commands/gm/sendpacket.lua b/data/scripts/commands/gm/sendpacket.lua
new file mode 100644
index 00000000..d506c3b4
--- /dev/null
+++ b/data/scripts/commands/gm/sendpacket.lua
@@ -0,0 +1,24 @@
+properties = {
+ permissions = 0,
+ parameters = "ssss",
+ description = " ",
+}
+
+function onTrigger(player, argc, path, name, lastName)
+ local sender = "[sendpacket ]";
+ lastName = lastName or "";
+ path = "./packets/"..path;
+
+ if name then
+ if lastName then
+ player = GetWorldManager():GetPCInWorld(name.." "..lastName) or nil;
+ else
+ player = GetWorldManager():GetPCInWorld(name) or nil;
+ end;
+ end;
+
+ value = tonumber(value) or 0;
+ if player and argc > 0 then
+ player:SendPacket(path)
+ end;
+end;
\ No newline at end of file
diff --git a/data/scripts/commands/gm/speed.lua b/data/scripts/commands/gm/speed.lua
new file mode 100644
index 00000000..90cf537a
--- /dev/null
+++ b/data/scripts/commands/gm/speed.lua
@@ -0,0 +1,13 @@
+properties = {
+ permissions = 0,
+ parameters = "sss",
+ description = " speed",
+}
+
+function onTrigger(player, argc, stop, walk, run)
+ stop = tonumber(stop) or 0;
+ walk = tonumber(walk) or 2;
+ run = tonumber(run) or 5;
+
+ player:ChangeSpeed(stop, walk, run);
+end;
\ No newline at end of file