mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	mass replaced all methods to pascal case
This commit is contained in:
		| @@ -13,33 +13,33 @@ namespace FFXIVClassic_Map_Server | ||||
|         public Blowfish blowfish; | ||||
|         public Socket socket; | ||||
|         public byte[] buffer; | ||||
|         private BlockingCollection<BasePacket> sendPacketQueue = new BlockingCollection<BasePacket>(1000); | ||||
|         private BlockingCollection<BasePacket> SendPacketQueue = new BlockingCollection<BasePacket>(1000); | ||||
|         public int lastPartialSize = 0; | ||||
|  | ||||
|         //Instance Stuff | ||||
|         public uint owner = 0; | ||||
|         public int connType = 0; | ||||
|  | ||||
|         public void queuePacket(BasePacket packet) | ||||
|         public void QueuePacket(BasePacket packet) | ||||
|         { | ||||
|             sendPacketQueue.Add(packet); | ||||
|             SendPacketQueue.Add(packet); | ||||
|         } | ||||
|  | ||||
|         public void queuePacket(SubPacket subpacket, bool isAuthed, bool isEncrypted) | ||||
|         public void QueuePacket(SubPacket subpacket, bool isAuthed, bool isEncrypted) | ||||
|         { | ||||
|             sendPacketQueue.Add(BasePacket.createPacket(subpacket, isAuthed, isEncrypted)); | ||||
|             SendPacketQueue.Add(BasePacket.CreatePacket(subpacket, isAuthed, isEncrypted)); | ||||
|         } | ||||
|  | ||||
|         public void flushQueuedSendPackets() | ||||
|         public void FlushQueuedSendPackets() | ||||
|         { | ||||
|             if (!socket.Connected) | ||||
|                 return; | ||||
|  | ||||
|             while (sendPacketQueue.Count > 0) | ||||
|             while (SendPacketQueue.Count > 0) | ||||
|             { | ||||
|                 BasePacket packet = sendPacketQueue.Take();                 | ||||
|                 BasePacket packet = SendPacketQueue.Take();                 | ||||
|  | ||||
|                 byte[] packetBytes = packet.getPacketBytes(); | ||||
|                 byte[] packetBytes = packet.GetPacketBytes(); | ||||
|  | ||||
|                 try | ||||
|                 { | ||||
| @@ -50,17 +50,17 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public String getAddress() | ||||
|         public String GetAddress() | ||||
|         { | ||||
|             return String.Format("{0}:{1}", (socket.RemoteEndPoint as IPEndPoint).Address, (socket.RemoteEndPoint as IPEndPoint).Port); | ||||
|         } | ||||
|  | ||||
|         public bool isConnected() | ||||
|         public bool IsConnected() | ||||
|         { | ||||
|             return (socket.Poll(1, SelectMode.SelectRead) && socket.Available == 0); | ||||
|         } | ||||
|  | ||||
|         public void disconnect() | ||||
|         public void Disconnect() | ||||
|         { | ||||
|             if (socket.Connected) | ||||
|                 socket.Disconnect(false); | ||||
|   | ||||
| @@ -26,45 +26,45 @@ namespace FFXIVClassic_Map_Server | ||||
|             mConnectedPlayerList = playerList; | ||||
|         } | ||||
|  | ||||
|         public void sendPacket(ConnectedPlayer client, string path) | ||||
|         public void SendPacket(ConnectedPlayer client, string path) | ||||
|         { | ||||
|             BasePacket packet = new BasePacket(path); | ||||
|  | ||||
|             if (client != null) | ||||
|             { | ||||
|                 packet.replaceActorID(client.actorID); | ||||
|                 client.queuePacket(packet); | ||||
|                 packet.ReplaceActorID(client.actorID); | ||||
|                 client.QueuePacket(packet); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     packet.replaceActorID(entry.Value.actorID); | ||||
|                     entry.Value.queuePacket(packet); | ||||
|                     packet.ReplaceActorID(entry.Value.actorID); | ||||
|                     entry.Value.QueuePacket(packet); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public void changeProperty(uint id, uint value, string target) | ||||
|         public void ChangeProperty(uint id, uint value, string target) | ||||
|         { | ||||
|             SetActorPropetyPacket changeProperty = new SetActorPropetyPacket(target); | ||||
|             SetActorPropetyPacket ChangeProperty = new SetActorPropetyPacket(target); | ||||
|  | ||||
|             changeProperty.setTarget(target); | ||||
|             changeProperty.addInt(id, value); | ||||
|             changeProperty.addTarget(); | ||||
|             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)); | ||||
|                 SubPacket ChangePropertyPacket = ChangeProperty.BuildPacket((entry.Value.actorID), (entry.Value.actorID)); | ||||
|  | ||||
|                 BasePacket packet = BasePacket.createPacket(changePropertyPacket, true, false); | ||||
|                 packet.debugPrintPacket(); | ||||
|                 BasePacket packet = BasePacket.CreatePacket(ChangePropertyPacket, true, false); | ||||
|                 packet.DebugPrintPacket(); | ||||
|  | ||||
|                 entry.Value.queuePacket(packet); | ||||
|                 entry.Value.QueuePacket(packet); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public void doMusic(ConnectedPlayer client, string music) | ||||
|         public void DoMusic(ConnectedPlayer client, string music) | ||||
|         { | ||||
|             ushort musicId; | ||||
|  | ||||
| @@ -74,13 +74,13 @@ namespace FFXIVClassic_Map_Server | ||||
|                 musicId = Convert.ToUInt16(music); | ||||
|  | ||||
|             if (client != null) | ||||
|                 client.queuePacket(BasePacket.createPacket(SetMusicPacket.buildPacket(client.actorID, musicId, 1), true, false)); | ||||
|                 client.QueuePacket(BasePacket.CreatePacket(SetMusicPacket.BuildPacket(client.actorID, musicId, 1), true, false)); | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     BasePacket musicPacket = BasePacket.createPacket(SetMusicPacket.buildPacket(entry.Value.actorID, musicId, 1), true, false); | ||||
|                     entry.Value.queuePacket(musicPacket); | ||||
|                     BasePacket musicPacket = BasePacket.CreatePacket(SetMusicPacket.BuildPacket(entry.Value.actorID, musicId, 1), true, false); | ||||
|                     entry.Value.QueuePacket(musicPacket); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
| @@ -90,228 +90,228 @@ namespace FFXIVClassic_Map_Server | ||||
|         /// </summary> | ||||
|         /// <param name="client">The current player</param> | ||||
|         /// <param name="id">Predefined list: <ffxiv_database>\server_zones_spawnlocations</param> | ||||
|         public void doWarp(ConnectedPlayer client, uint id) | ||||
|         public void DoWarp(ConnectedPlayer client, uint id) | ||||
|         { | ||||
|             WorldManager worldManager = Server.GetWorldManager(); | ||||
|             FFXIVClassic_Map_Server.WorldManager.ZoneEntrance ze = worldManager.getZoneEntrance(id); | ||||
|             FFXIVClassic_Map_Server.WorldManager.ZoneEntrance ze = worldManager.GetZoneEntrance(id); | ||||
|  | ||||
|             if (ze == null) | ||||
|                 return; | ||||
|  | ||||
|             if (client != null) | ||||
|                 worldManager.DoZoneChange(client.getActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation); | ||||
|                 worldManager.DoZoneChange(client.GetActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation); | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     worldManager.DoZoneChange(entry.Value.getActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation); | ||||
|                     worldManager.DoZoneChange(entry.Value.GetActor(), ze.zoneId, ze.privateAreaName, ze.spawnType, ze.spawnX, ze.spawnY, ze.spawnZ, ze.spawnRotation); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public void doWarp(ConnectedPlayer client, uint zoneId, string privateArea, byte spawnType, float x, float y, float z, float r) | ||||
|         public void DoWarp(ConnectedPlayer client, uint zoneId, string privateArea, byte spawnType, float x, float y, float z, float r) | ||||
|         { | ||||
|             WorldManager worldManager = Server.GetWorldManager(); | ||||
|             if (worldManager.GetZone(zoneId) == null) | ||||
|             { | ||||
|                 if (client != null) | ||||
|                     client.queuePacket(BasePacket.createPacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", "Zone does not exist or setting isn't valid."), true, false)); | ||||
|                 Program.Log.Error("Zone does not exist or setting isn't valid."); | ||||
|                     client.QueuePacket(BasePacket.CreatePacket(SendMessagePacket.BuildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", "Zone Does not exist or setting isn't valid."), true, false)); | ||||
|                 Program.Log.Error("Zone Does not exist or setting isn't valid."); | ||||
|             } | ||||
|  | ||||
|             if (client != null) | ||||
|                 worldManager.DoZoneChange(client.getActor(), zoneId, privateArea, spawnType, x, y, z, r); | ||||
|                 worldManager.DoZoneChange(client.GetActor(), zoneId, privateArea, spawnType, x, y, z, r); | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     worldManager.DoZoneChange(entry.Value.getActor(), zoneId, privateArea, spawnType, x, y, z, r); | ||||
|                     worldManager.DoZoneChange(entry.Value.GetActor(), zoneId, privateArea, spawnType, x, y, z, r); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public void printPos(ConnectedPlayer client) | ||||
|         public void PrintPos(ConnectedPlayer client) | ||||
|         { | ||||
|             if (client != null) | ||||
|             { | ||||
|                 Player p = client.getActor(); | ||||
|                 client.queuePacket(BasePacket.createPacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", String.Format("{0}\'s position: ZoneID: {1}, X: {2}, Y: {3}, Z: {4}, Rotation: {5}", p.customDisplayName, p.zoneId, p.positionX, p.positionY, p.positionZ, p.rotation)), true, false)); | ||||
|                 Player p = client.GetActor(); | ||||
|                 client.QueuePacket(BasePacket.CreatePacket(SendMessagePacket.BuildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", String.Format("{0}\'s position: ZoneID: {1}, X: {2}, Y: {3}, Z: {4}, Rotation: {5}", p.customDisplayName, p.zoneId, p.positionX, p.positionY, p.positionZ, p.rotation)), true, false)); | ||||
|             } | ||||
|             else | ||||
|             {  | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     Player p = entry.Value.getActor(); | ||||
|                     Player p = entry.Value.GetActor(); | ||||
|                     Program.Log.Info("{0}\'s position: ZoneID: {1}, X: {2}, Y: {3}, Z: {4}, Rotation: {5}", p.customDisplayName, p.zoneId, p.positionX, p.positionY, p.positionZ, p.rotation); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void setGraphic(ConnectedPlayer client, uint slot, uint wId, uint eId, uint vId, uint cId) | ||||
|         private void SetGraphic(ConnectedPlayer client, uint slot, uint wId, uint eId, uint vId, uint cId) | ||||
|         { | ||||
|             if (client != null) | ||||
|             { | ||||
|                 Player p = client.getActor(); | ||||
|                 p.graphicChange(slot, wId, eId, vId, cId); | ||||
|                 p.sendAppearance(); | ||||
|                 Player p = client.GetActor(); | ||||
|                 p.GraphicChange(slot, wId, eId, vId, cId); | ||||
|                 p.SendAppearance(); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     Player p = entry.Value.getActor(); | ||||
|                     p.graphicChange(slot, wId, eId, vId, cId); | ||||
|                     p.sendAppearance(); | ||||
|                     Player p = entry.Value.GetActor(); | ||||
|                     p.GraphicChange(slot, wId, eId, vId, cId); | ||||
|                     p.SendAppearance(); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void giveItem(ConnectedPlayer client, uint itemId, int quantity) | ||||
|         private void GiveItem(ConnectedPlayer client, uint itemId, int quantity) | ||||
|         { | ||||
|             if (client != null) | ||||
|             { | ||||
|                 Player p = client.getActor(); | ||||
|                 p.getInventory(Inventory.NORMAL).addItem(itemId, quantity); | ||||
|                 Player p = client.GetActor(); | ||||
|                 p.GetInventory(Inventory.NORMAL).AddItem(itemId, quantity); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     Player p = entry.Value.getActor(); | ||||
|                     p.getInventory(Inventory.NORMAL).addItem(itemId, quantity); | ||||
|                     Player p = entry.Value.GetActor(); | ||||
|                     p.GetInventory(Inventory.NORMAL).AddItem(itemId, quantity); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void giveItem(ConnectedPlayer client, uint itemId, int quantity, ushort type) | ||||
|         private void GiveItem(ConnectedPlayer client, uint itemId, int quantity, ushort type) | ||||
|         { | ||||
|             if (client != null) | ||||
|             { | ||||
|                 Player p = client.getActor(); | ||||
|                 Player p = client.GetActor(); | ||||
|  | ||||
|                 if (p.getInventory(type) != null) | ||||
|                     p.getInventory(type).addItem(itemId, quantity); | ||||
|                 if (p.GetInventory(type) != null) | ||||
|                     p.GetInventory(type).AddItem(itemId, quantity); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     Player p = entry.Value.getActor(); | ||||
|                     Player p = entry.Value.GetActor(); | ||||
|  | ||||
|                     if (p.getInventory(type) != null) | ||||
|                         p.getInventory(type).addItem(itemId, quantity); | ||||
|                     if (p.GetInventory(type) != null) | ||||
|                         p.GetInventory(type).AddItem(itemId, quantity); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void removeItem(ConnectedPlayer client, uint itemId, int quantity) | ||||
|         private void RemoveItem(ConnectedPlayer client, uint itemId, int quantity) | ||||
|         { | ||||
|             if (client != null) | ||||
|             { | ||||
|                 Player p = client.getActor(); | ||||
|                 p.getInventory(Inventory.NORMAL).removeItem(itemId, quantity); | ||||
|                 Player p = client.GetActor(); | ||||
|                 p.GetInventory(Inventory.NORMAL).RemoveItem(itemId, quantity); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     Player p = entry.Value.getActor(); | ||||
|                     p.getInventory(Inventory.NORMAL).removeItem(itemId, quantity); | ||||
|                     Player p = entry.Value.GetActor(); | ||||
|                     p.GetInventory(Inventory.NORMAL).RemoveItem(itemId, quantity); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void removeItem(ConnectedPlayer client, uint itemId, int quantity, ushort type) | ||||
|         private void RemoveItem(ConnectedPlayer client, uint itemId, int quantity, ushort type) | ||||
|         { | ||||
|             if (client != null) | ||||
|             { | ||||
|                 Player p = client.getActor(); | ||||
|                 Player p = client.GetActor(); | ||||
|  | ||||
|                 if (p.getInventory(type) != null) | ||||
|                     p.getInventory(type).removeItem(itemId, quantity); | ||||
|                 if (p.GetInventory(type) != null) | ||||
|                     p.GetInventory(type).RemoveItem(itemId, quantity); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     Player p = entry.Value.getActor(); | ||||
|                     Player p = entry.Value.GetActor(); | ||||
|  | ||||
|                     if (p.getInventory(type) != null) | ||||
|                         p.getInventory(type).removeItem(itemId, quantity); | ||||
|                     if (p.GetInventory(type) != null) | ||||
|                         p.GetInventory(type).RemoveItem(itemId, quantity); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void giveCurrency(ConnectedPlayer client, uint itemId, int quantity) | ||||
|         private void GiveCurrency(ConnectedPlayer client, uint itemId, int quantity) | ||||
|         { | ||||
|             if (client != null) | ||||
|             { | ||||
|                 Player p = client.getActor(); | ||||
|                 p.getInventory(Inventory.CURRENCY).addItem(itemId, quantity); | ||||
|                 Player p = client.GetActor(); | ||||
|                 p.GetInventory(Inventory.CURRENCY).AddItem(itemId, quantity); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     Player p = entry.Value.getActor(); | ||||
|                     p.getInventory(Inventory.CURRENCY).addItem(itemId, quantity); | ||||
|                     Player p = entry.Value.GetActor(); | ||||
|                     p.GetInventory(Inventory.CURRENCY).AddItem(itemId, quantity); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         // TODO:  make removeCurrency() remove all quantity of a currency if quantity_to_remove > quantity_in_inventory instead of silently failing | ||||
|         private void removeCurrency(ConnectedPlayer client, uint itemId, int quantity) | ||||
|         // TODO:  make RemoveCurrency() remove all quantity of a currency if quantity_to_remove > quantity_in_inventory instead of silently failing | ||||
|         private void RemoveCurrency(ConnectedPlayer client, uint itemId, int quantity) | ||||
|         { | ||||
|             if (client != null) | ||||
|             { | ||||
|                 Player p = client.getActor(); | ||||
|                 p.getInventory(Inventory.CURRENCY).removeItem(itemId, quantity); | ||||
|                 Player p = client.GetActor(); | ||||
|                 p.GetInventory(Inventory.CURRENCY).RemoveItem(itemId, quantity); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     Player p = entry.Value.getActor(); | ||||
|                     p.getInventory(Inventory.CURRENCY).removeItem(itemId, quantity); | ||||
|                     Player p = entry.Value.GetActor(); | ||||
|                     p.GetInventory(Inventory.CURRENCY).RemoveItem(itemId, quantity); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void giveKeyItem(ConnectedPlayer client, uint itemId) | ||||
|         private void GiveKeyItem(ConnectedPlayer client, uint itemId) | ||||
|         { | ||||
|             if (client != null) | ||||
|             { | ||||
|                 Player p = client.getActor(); | ||||
|                 p.getInventory(Inventory.KEYITEMS).addItem(itemId, 1); | ||||
|                 Player p = client.GetActor(); | ||||
|                 p.GetInventory(Inventory.KEYITEMS).AddItem(itemId, 1); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     Player p = entry.Value.getActor(); | ||||
|                     p.getInventory(Inventory.KEYITEMS).addItem(itemId, 1); | ||||
|                     Player p = entry.Value.GetActor(); | ||||
|                     p.GetInventory(Inventory.KEYITEMS).AddItem(itemId, 1); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void removeKeyItem(ConnectedPlayer client, uint itemId) | ||||
|         private void RemoveKeyItem(ConnectedPlayer client, uint itemId) | ||||
|         { | ||||
|             if (client != null) | ||||
|             { | ||||
|                 Player p = client.getActor(); | ||||
|                 p.getInventory(Inventory.KEYITEMS).removeItem(itemId, 1); | ||||
|                 Player p = client.GetActor(); | ||||
|                 p.GetInventory(Inventory.KEYITEMS).RemoveItem(itemId, 1); | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     Player p = entry.Value.getActor(); | ||||
|                     p.getInventory(Inventory.KEYITEMS).removeItem(itemId, 1); | ||||
|                     Player p = entry.Value.GetActor(); | ||||
|                     p.GetInventory(Inventory.KEYITEMS).RemoveItem(itemId, 1); | ||||
|                 } | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private void parseWarp(ConnectedPlayer client, string[] split) | ||||
|         private void ParseWarp(ConnectedPlayer client, string[] split) | ||||
|         { | ||||
|             float x = 0, y = 0, z = 0, r = 0.0f; | ||||
|             uint zoneId = 0; | ||||
| @@ -331,7 +331,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                 catch{return;} | ||||
|                 #endregion | ||||
|  | ||||
|                 doWarp(client, zoneId); | ||||
|                 DoWarp(client, zoneId); | ||||
|             } | ||||
|             else if (split.Length == 4) | ||||
|             { | ||||
| @@ -343,7 +343,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                     if (String.IsNullOrEmpty(split[1])) | ||||
|                         split[1] = "0"; | ||||
|  | ||||
|                     try { x = Single.Parse(split[1]) + client.getActor().positionX; } | ||||
|                     try { x = Single.Parse(split[1]) + client.GetActor().positionX; } | ||||
|                     catch{return;} | ||||
|  | ||||
|                     split[1] = x.ToString(); | ||||
| @@ -355,7 +355,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                     if (String.IsNullOrEmpty(split[2])) | ||||
|                         split[2] = "0"; | ||||
|  | ||||
|                     try { y = Single.Parse(split[2]) + client.getActor().positionY; } | ||||
|                     try { y = Single.Parse(split[2]) + client.GetActor().positionY; } | ||||
|                     catch{return;} | ||||
|  | ||||
|                     split[2] = y.ToString(); | ||||
| @@ -367,7 +367,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                     if (String.IsNullOrEmpty(split[3])) | ||||
|                         split[3] = "0"; | ||||
|  | ||||
|                     try { z = Single.Parse(split[3]) + client.getActor().positionZ; } | ||||
|                     try { z = Single.Parse(split[3]) + client.GetActor().positionZ; } | ||||
|                     catch{return;} | ||||
|  | ||||
|                     split[3] = z.ToString(); | ||||
| @@ -381,12 +381,12 @@ namespace FFXIVClassic_Map_Server | ||||
|                 } | ||||
|                 catch{return;} | ||||
|  | ||||
|                 zoneId = client.getActor().zoneId; | ||||
|                 r = client.getActor().rotation; | ||||
|                 zoneId = client.GetActor().zoneId; | ||||
|                 r = client.GetActor().rotation; | ||||
|                 #endregion | ||||
|  | ||||
|                 sendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, y, z)); | ||||
|                 doWarp(client, zoneId, privatearea, 0x00, x, y, z, r); | ||||
|                 SendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, y, z)); | ||||
|                 DoWarp(client, zoneId, privatearea, 0x00, x, y, z, r); | ||||
|             } | ||||
|             else if (split.Length == 5) | ||||
|             { | ||||
| @@ -411,8 +411,8 @@ namespace FFXIVClassic_Map_Server | ||||
|                 } | ||||
|                 #endregion | ||||
|  | ||||
|                 sendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, y, z)); | ||||
|                 doWarp(client, zoneId, privatearea, 0x2, x, y, z, r); | ||||
|                 SendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, y, z)); | ||||
|                 DoWarp(client, zoneId, privatearea, 0x2, x, y, z, r); | ||||
|             } | ||||
|             else if (split.Length == 6) | ||||
|             { | ||||
| @@ -439,20 +439,20 @@ namespace FFXIVClassic_Map_Server | ||||
|                 privatearea = split[2]; | ||||
|                 #endregion | ||||
|  | ||||
|                 sendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, y, z)); | ||||
|                 doWarp(client, zoneId, privatearea, 0x2, x, y, z, r); | ||||
|                 SendMessage(client, String.Format("Warping to: ZoneID: {0} X: {1}, Y: {2}, Z: {3}", zoneId, x, y, z)); | ||||
|                 DoWarp(client, zoneId, privatearea, 0x2, x, y, z, r); | ||||
|             } | ||||
|             else | ||||
|                 return; // catch any invalid warps here | ||||
|         } | ||||
|  | ||||
|         private void doWeather(ConnectedPlayer client, string weatherID, string value) | ||||
|         private void DoWeather(ConnectedPlayer client, string weatherID, string value) | ||||
|         { | ||||
|             ushort weather = Convert.ToUInt16(weatherID); | ||||
|  | ||||
|             if (client != null) | ||||
|             { | ||||
|                 client.queuePacket(BasePacket.createPacket(SetWeatherPacket.buildPacket(client.actorID, weather, Convert.ToUInt16(value)), true, false)); | ||||
|                 client.QueuePacket(BasePacket.CreatePacket(SetWeatherPacket.BuildPacket(client.actorID, weather, Convert.ToUInt16(value)), true, false)); | ||||
|             } | ||||
|  | ||||
|             /* | ||||
| @@ -461,15 +461,15 @@ namespace FFXIVClassic_Map_Server | ||||
|             uint currentZoneID; | ||||
|             if (client != null) | ||||
|             { | ||||
|                 currentZoneID = client.getActor().zoneId; | ||||
|                 currentZoneID = client.GetActor().zoneId; | ||||
|  | ||||
|                 foreach (KeyValuePair<uint, ConnectedPlayer> entry in mConnectedPlayerList) | ||||
|                 { | ||||
|                     // Change the weather for everyone in the same zone | ||||
|                     if (currentZoneID == entry.Value.getActor().zoneId) | ||||
|                     if (currentZoneID == entry.Value.GetActor().zoneId) | ||||
|                     { | ||||
|                         BasePacket weatherPacket = BasePacket.createPacket(SetWeatherPacket.buildPacket(entry.Value.actorID, weather), true, false); | ||||
|                         entry.Value.queuePacket(weatherPacket); | ||||
|                         BasePacket weatherPacket = BasePacket.CreatePacket(SetWeatherPacket.BuildPacket(entry.Value.actorID, weather), true, false); | ||||
|                         entry.Value.QueuePacket(weatherPacket); | ||||
|                     }                     | ||||
|                 } | ||||
|             } | ||||
| @@ -482,13 +482,13 @@ namespace FFXIVClassic_Map_Server | ||||
|         /// </summary> | ||||
|         /// <param name="client"></param> | ||||
|         /// <param name="message"></param> | ||||
|         private void sendMessage(ConnectedPlayer client, String message) | ||||
|         private void SendMessage(ConnectedPlayer client, String message) | ||||
|         { | ||||
|             if (client != null) | ||||
|                client.getActor().queuePacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", message)); | ||||
|                client.GetActor().QueuePacket(SendMessagePacket.BuildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", message)); | ||||
|         } | ||||
|  | ||||
|         internal bool doCommand(string input, ConnectedPlayer client) | ||||
|         internal bool DoCommand(string input, ConnectedPlayer client) | ||||
|         { | ||||
|             input.Trim(); | ||||
|             if (input.StartsWith("!")) | ||||
| @@ -499,7 +499,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             split = split.Where(temp => temp != "").ToArray(); // strips extra whitespace from commands | ||||
|  | ||||
|             // Debug | ||||
|             //sendMessage(client, string.Join(",", split)); | ||||
|             //SendMessage(client, string.Join(",", split)); | ||||
|              | ||||
|             if (split.Length >= 1) | ||||
|             { | ||||
| @@ -508,41 +508,41 @@ namespace FFXIVClassic_Map_Server | ||||
|                 { | ||||
|                     if (split.Length == 1) | ||||
|                     { | ||||
|                         sendMessage(client, Resources.CPhelp); | ||||
|                         SendMessage(client, Resources.CPhelp); | ||||
|                     } | ||||
|                     if (split.Length == 2) | ||||
|                     { | ||||
|                         if (split[1].Equals("mypos")) | ||||
|                             sendMessage(client, Resources.CPmypos); | ||||
|                             SendMessage(client, Resources.CPmypos); | ||||
|                         else if (split[1].Equals("music")) | ||||
|                             sendMessage(client, Resources.CPmusic); | ||||
|                             SendMessage(client, Resources.CPmusic); | ||||
|                         else if (split[1].Equals("warp")) | ||||
|                             sendMessage(client, Resources.CPwarp); | ||||
|                             SendMessage(client, Resources.CPwarp); | ||||
|                         else if (split[1].Equals("givecurrency")) | ||||
|                             sendMessage(client, Resources.CPgivecurrency); | ||||
|                             SendMessage(client, Resources.CPgivecurrency); | ||||
|                         else if (split[1].Equals("giveitem")) | ||||
|                             sendMessage(client, Resources.CPgiveitem); | ||||
|                             SendMessage(client, Resources.CPgiveitem); | ||||
|                         else if (split[1].Equals("givekeyitem")) | ||||
|                             sendMessage(client, Resources.CPgivekeyitem); | ||||
|                             SendMessage(client, Resources.CPgivekeyitem); | ||||
|                         else if (split[1].Equals("removecurrency")) | ||||
|                             sendMessage(client, Resources.CPremovecurrency); | ||||
|                             SendMessage(client, Resources.CPremovecurrency); | ||||
|                         else if (split[1].Equals("removeitem")) | ||||
|                             sendMessage(client, Resources.CPremoveitem); | ||||
|                             SendMessage(client, Resources.CPremoveitem); | ||||
|                         else if (split[1].Equals("removekeyitem")) | ||||
|                             sendMessage(client, Resources.CPremovekeyitem); | ||||
|                             SendMessage(client, Resources.CPremovekeyitem); | ||||
|                         else if (split[1].Equals("reloaditems")) | ||||
|                             sendMessage(client, Resources.CPreloaditems); | ||||
|                             SendMessage(client, Resources.CPreloaditems); | ||||
|                         else if (split[1].Equals("reloadzones")) | ||||
|                             sendMessage(client, Resources.CPreloadzones); | ||||
|                             SendMessage(client, Resources.CPreloadzones); | ||||
|                         /* | ||||
|                         else if (split[1].Equals("property")) | ||||
|                             sendMessage(client, Resources.CPproperty); | ||||
|                             SendMessage(client, Resources.CPproperty); | ||||
|                         else if (split[1].Equals("property2")) | ||||
|                             sendMessage(client, Resources.CPproperty2); | ||||
|                             SendMessage(client, Resources.CPproperty2); | ||||
|                         else if (split[1].Equals("sendpacket")) | ||||
|                              sendMessage(client, Resources.CPsendpacket); | ||||
|                              SendMessage(client, Resources.CPsendpacket); | ||||
|                         else if (split[1].Equals("setgraphic")) | ||||
|                                sendMessage(client, Resources.CPsetgraphic); | ||||
|                                SendMessage(client, Resources.CPsetgraphic); | ||||
|                         */ | ||||
|                      } | ||||
|                     if (split.Length == 3) | ||||
| @@ -550,7 +550,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                         if(split[1].Equals("test")) | ||||
|                         { | ||||
|                             if (split[2].Equals("weather")) | ||||
|                                 sendMessage(client, Resources.CPtestweather); | ||||
|                                 SendMessage(client, Resources.CPtestweather); | ||||
|                         } | ||||
|                     } | ||||
|  | ||||
| @@ -564,7 +564,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                     if (split.Length == 1) | ||||
|                     { | ||||
|                         // catch invalid commands | ||||
|                         sendMessage(client, Resources.CPhelp); | ||||
|                         SendMessage(client, Resources.CPhelp); | ||||
|                     } | ||||
|                     else if (split.Length >= 2) | ||||
|                     { | ||||
| @@ -573,12 +573,12 @@ namespace FFXIVClassic_Map_Server | ||||
|                         { | ||||
|                             try | ||||
|                             { | ||||
|                                 doWeather(client, split[2], split[3]); | ||||
|                                 DoWeather(client, split[2], split[3]); | ||||
|                                 return true; | ||||
|                             } | ||||
|                             catch (Exception e) | ||||
|                             { | ||||
|                                 Program.Log.Error("Could not change weather: " + e); | ||||
|                                 Program.Log.Error("Could not Change weather: " + e); | ||||
|                             } | ||||
|                         } | ||||
|                         #endregion | ||||
| @@ -592,7 +592,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                 { | ||||
|                     try | ||||
|                     { | ||||
|                         printPos(client); | ||||
|                         PrintPos(client); | ||||
|                         return true; | ||||
|                     } | ||||
|                     catch (Exception e) | ||||
| @@ -607,13 +607,13 @@ namespace FFXIVClassic_Map_Server | ||||
|                 { | ||||
|                     if (client != null) | ||||
|                     { | ||||
|                         Program.Log.Info("Got request to reset zone: {0}", client.getActor().zoneId); | ||||
|                         client.getActor().zone.clear(); | ||||
|                         client.getActor().zone.addActorToZone(client.getActor()); | ||||
|                         client.getActor().sendInstanceUpdate(); | ||||
|                         client.queuePacket(BasePacket.createPacket(SendMessagePacket.buildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", String.Format("Reseting zone {0}...", client.getActor().zoneId)), true, false)); | ||||
|                         Program.Log.Info("Got request to reset zone: {0}", client.GetActor().zoneId); | ||||
|                         client.GetActor().zone.Clear(); | ||||
|                         client.GetActor().zone.AddActorToZone(client.GetActor()); | ||||
|                         client.GetActor().SendInstanceUpdate(); | ||||
|                         client.QueuePacket(BasePacket.CreatePacket(SendMessagePacket.BuildPacket(client.actorID, client.actorID, SendMessagePacket.MESSAGE_TYPE_GENERAL_INFO, "", String.Format("Reseting zone {0}...", client.GetActor().zoneId)), true, false)); | ||||
|                     } | ||||
|                     Server.GetWorldManager().reloadZone(client.getActor().zoneId); | ||||
|                     Server.GetWorldManager().ReloadZone(client.GetActor().zoneId); | ||||
|                     return true; | ||||
|                 } | ||||
|                 #endregion | ||||
| @@ -622,11 +622,11 @@ namespace FFXIVClassic_Map_Server | ||||
|                 else if (split[0].Equals("reloaditems")) | ||||
|                 { | ||||
|                     Program.Log.Info("Got request to reload item gamedata"); | ||||
|                     sendMessage(client, "Reloading Item Gamedata..."); | ||||
|                     SendMessage(client, "Reloading Item Gamedata..."); | ||||
|                     gamedataItems.Clear(); | ||||
|                     gamedataItems = Database.getItemGamedata(); | ||||
|                     gamedataItems = Database.GetItemGamedata(); | ||||
|                     Program.Log.Info("Loaded {0} items.", gamedataItems.Count); | ||||
|                     sendMessage(client, String.Format("Loaded {0} items.", gamedataItems.Count)); | ||||
|                     SendMessage(client, String.Format("Loaded {0} items.", gamedataItems.Count)); | ||||
|                     return true; | ||||
|                 } | ||||
|                 #endregion | ||||
| @@ -639,7 +639,7 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|                     try | ||||
|                     { | ||||
|                         sendPacket(client, "./packets/" + split[1]); | ||||
|                         SendPacket(client, "./packets/" + split[1]); | ||||
|                         return true; | ||||
|                     } | ||||
|                     catch (Exception e) | ||||
| @@ -655,7 +655,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                     try | ||||
|                     { | ||||
|                         if (split.Length == 6) | ||||
|                             setGraphic(client, UInt32.Parse(split[1]), UInt32.Parse(split[2]), UInt32.Parse(split[3]), UInt32.Parse(split[4]), UInt32.Parse(split[5])); | ||||
|                             SetGraphic(client, UInt32.Parse(split[1]), UInt32.Parse(split[2]), UInt32.Parse(split[3]), UInt32.Parse(split[4]), UInt32.Parse(split[5])); | ||||
|                         return true; | ||||
|                     } | ||||
|                     catch (Exception e) | ||||
| @@ -671,11 +671,11 @@ namespace FFXIVClassic_Map_Server | ||||
|                     try | ||||
|                     { | ||||
|                         if (split.Length == 2) | ||||
|                             giveItem(client, UInt32.Parse(split[1]), 1); | ||||
|                             GiveItem(client, UInt32.Parse(split[1]), 1); | ||||
|                         else if (split.Length == 3) | ||||
|                             giveItem(client, UInt32.Parse(split[1]), Int32.Parse(split[2])); | ||||
|                             GiveItem(client, UInt32.Parse(split[1]), Int32.Parse(split[2])); | ||||
|                         else if (split.Length == 4) | ||||
|                             giveItem(client, UInt32.Parse(split[1]), Int32.Parse(split[2]), UInt16.Parse(split[3])); | ||||
|                             GiveItem(client, UInt32.Parse(split[1]), Int32.Parse(split[2]), UInt16.Parse(split[3])); | ||||
|                         return true; | ||||
|                     } | ||||
|                     catch (Exception e) | ||||
| @@ -694,11 +694,11 @@ namespace FFXIVClassic_Map_Server | ||||
|                     try | ||||
|                     { | ||||
|                         if (split.Length == 2) | ||||
|                             removeItem(client, UInt32.Parse(split[1]), 1); | ||||
|                             RemoveItem(client, UInt32.Parse(split[1]), 1); | ||||
|                         else if (split.Length == 3) | ||||
|                             removeItem(client, UInt32.Parse(split[1]), Int32.Parse(split[2])); | ||||
|                             RemoveItem(client, UInt32.Parse(split[1]), Int32.Parse(split[2])); | ||||
|                         else if (split.Length == 4) | ||||
|                             removeItem(client, UInt32.Parse(split[1]), Int32.Parse(split[2]), UInt16.Parse(split[3])); | ||||
|                             RemoveItem(client, UInt32.Parse(split[1]), Int32.Parse(split[2]), UInt16.Parse(split[3])); | ||||
|                         return true; | ||||
|                     } | ||||
|                     catch (Exception e) | ||||
| @@ -714,7 +714,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                     try | ||||
|                     { | ||||
|                         if (split.Length == 2) | ||||
|                             giveKeyItem(client, UInt32.Parse(split[1])); | ||||
|                             GiveKeyItem(client, UInt32.Parse(split[1])); | ||||
|                     } | ||||
|                     catch (Exception e) | ||||
|                     { | ||||
| @@ -732,7 +732,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                     try | ||||
|                     { | ||||
|                         if (split.Length == 2) | ||||
|                             removeKeyItem(client, UInt32.Parse(split[1])); | ||||
|                             RemoveKeyItem(client, UInt32.Parse(split[1])); | ||||
|                         return true; | ||||
|                     } | ||||
|                     catch (Exception e) | ||||
| @@ -748,9 +748,9 @@ namespace FFXIVClassic_Map_Server | ||||
|                     try | ||||
|                     { | ||||
|                         if (split.Length == 2) | ||||
|                             giveCurrency(client, ITEM_GIL, Int32.Parse(split[1])); | ||||
|                             GiveCurrency(client, ITEM_GIL, Int32.Parse(split[1])); | ||||
|                         else if (split.Length == 3) | ||||
|                             giveCurrency(client, UInt32.Parse(split[1]), Int32.Parse(split[2])); | ||||
|                             GiveCurrency(client, UInt32.Parse(split[1]), Int32.Parse(split[2])); | ||||
|                     } | ||||
|                     catch (Exception e) | ||||
|                     { | ||||
| @@ -768,9 +768,9 @@ namespace FFXIVClassic_Map_Server | ||||
|                     try | ||||
|                     { | ||||
|                         if (split.Length == 2) | ||||
|                             removeCurrency(client, ITEM_GIL, Int32.Parse(split[1])); | ||||
|                             RemoveCurrency(client, ITEM_GIL, Int32.Parse(split[1])); | ||||
|                         else if (split.Length == 3) | ||||
|                             removeCurrency(client, UInt32.Parse(split[1]), Int32.Parse(split[2])); | ||||
|                             RemoveCurrency(client, UInt32.Parse(split[1]), Int32.Parse(split[2])); | ||||
|                         return true; | ||||
|                     } | ||||
|                     catch (Exception e) | ||||
| @@ -788,12 +788,12 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|                     try | ||||
|                     { | ||||
|                         doMusic(client, split[1]); | ||||
|                         DoMusic(client, split[1]); | ||||
|                         return true; | ||||
|                     } | ||||
|                     catch (Exception e) | ||||
|                     { | ||||
|                         Program.Log.Error("Could not change music: " + e); | ||||
|                         Program.Log.Error("Could not Change music: " + e); | ||||
|                     } | ||||
|                 } | ||||
|                 #endregion | ||||
| @@ -801,7 +801,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                 #region !warp | ||||
|                 else if (split[0].Equals("warp")) | ||||
|                 { | ||||
|                     parseWarp(client, split); | ||||
|                     ParseWarp(client, split); | ||||
|                     return true; | ||||
|                 } | ||||
|                 #endregion | ||||
| @@ -811,7 +811,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                 { | ||||
|                     if (split.Length == 4) | ||||
|                     { | ||||
|                         changeProperty(Utils.MurmurHash2(split[1], 0), Convert.ToUInt32(split[2], 16), split[3]); | ||||
|                         ChangeProperty(Utils.MurmurHash2(split[1], 0), Convert.ToUInt32(split[2], 16), split[3]); | ||||
|                     } | ||||
|                     return true; | ||||
|                 } | ||||
| @@ -822,7 +822,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                 { | ||||
|                     if (split.Length == 4) | ||||
|                     { | ||||
|                         changeProperty(Convert.ToUInt32(split[1], 16), Convert.ToUInt32(split[2], 16), split[3]); | ||||
|                         ChangeProperty(Convert.ToUInt32(split[1], 16), Convert.ToUInt32(split[2], 16), split[3]); | ||||
|                     } | ||||
|                     return true; | ||||
|                 } | ||||
|   | ||||
| @@ -17,7 +17,7 @@ namespace FFXIVClassic_Map_Server | ||||
|         public static String DATABASE_USERNAME; | ||||
|         public static String DATABASE_PASSWORD; | ||||
|  | ||||
|         public static bool load() | ||||
|         public static bool Load() | ||||
|         { | ||||
|             Console.Write("Loading map_config.ini file... "); | ||||
|  | ||||
|   | ||||
| @@ -17,7 +17,7 @@ namespace FFXIVClassic_Map_Server | ||||
|     class Database | ||||
|     { | ||||
|  | ||||
|         public static uint getUserIdFromSession(String sessionId) | ||||
|         public static uint GetUserIdFromSession(String sessionId) | ||||
|         { | ||||
|             uint id = 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))) | ||||
| @@ -47,7 +47,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             return id; | ||||
|         } | ||||
|       | ||||
|         public static DBWorld getServer(uint serverId) | ||||
|         public static DBWorld GetServer(uint serverId) | ||||
|         { | ||||
|             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))) | ||||
|             { | ||||
| @@ -70,7 +70,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         }     | ||||
|  | ||||
|         public static List<Npc> getNpcList() | ||||
|         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))) | ||||
|             { | ||||
| @@ -93,7 +93,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static Dictionary<uint, Item> getItemGamedata() | ||||
|         public static Dictionary<uint, Item> GetItemGamedata() | ||||
|         { | ||||
|             using (var conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) | ||||
|             { | ||||
| @@ -149,7 +149,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static void savePlayerAppearance(Player player) | ||||
|         public static void SavePlayerAppearance(Player player) | ||||
|         { | ||||
|             string query; | ||||
|             MySqlCommand cmd; | ||||
| @@ -205,7 +205,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static void savePlayerCurrentClass(Player player) | ||||
|         public static void SavePlayerCurrentClass(Player player) | ||||
|         { | ||||
|             string query; | ||||
|             MySqlCommand cmd; | ||||
| @@ -241,7 +241,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static void savePlayerPosition(Player player) | ||||
|         public static void SavePlayerPosition(Player player) | ||||
|         { | ||||
|             string query;             | ||||
|             MySqlCommand cmd; | ||||
| @@ -283,7 +283,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static void savePlayerPlayTime(Player player) | ||||
|         public static void SavePlayerPlayTime(Player player) | ||||
|         { | ||||
|             string query; | ||||
|             MySqlCommand cmd; | ||||
| @@ -302,7 +302,7 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|                     cmd = new MySqlCommand(query, conn); | ||||
|                     cmd.Parameters.AddWithValue("@charaId", player.actorId); | ||||
|                     cmd.Parameters.AddWithValue("@playtime", player.getPlayTime(true)); | ||||
|                     cmd.Parameters.AddWithValue("@playtime", player.GetPlayTime(true)); | ||||
|  | ||||
|                     cmd.ExecuteNonQuery(); | ||||
|                 } | ||||
| @@ -317,19 +317,19 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static void saveQuest(Player player, Quest quest) | ||||
|         public static void SaveQuest(Player player, Quest quest) | ||||
|         { | ||||
|             int slot = player.getQuestSlot(quest.actorId); | ||||
|             int slot = player.GetQuestSlot(quest.actorId); | ||||
|             if (slot == -1) | ||||
|             { | ||||
|                 Program.Log.Error("Tried saving quest player didn't have: Player: {0:x}, QuestId: {0:x}", player.actorId, quest.actorId); | ||||
|                 return; | ||||
|             } | ||||
|             else | ||||
|                 saveQuest(player, quest, slot); | ||||
|                 SaveQuest(player, quest, slot); | ||||
|         } | ||||
|  | ||||
|         public static void saveQuest(Player player, Quest quest, int slot) | ||||
|         public static void SaveQuest(Player player, Quest quest, int slot) | ||||
|         { | ||||
|             string query; | ||||
|             MySqlCommand cmd; | ||||
| @@ -369,7 +369,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static void loadPlayerCharacter(Player player) | ||||
|         public static void LoadPlayerCharacter(Player player) | ||||
|         {             | ||||
|             string query; | ||||
|             MySqlCommand cmd;             | ||||
| @@ -560,12 +560,12 @@ namespace FFXIVClassic_Map_Server | ||||
|                         if (reader.Read()) | ||||
|                         { | ||||
|                             if (reader.GetUInt32(0) == 0xFFFFFFFF) | ||||
|                                 player.modelId = CharacterUtils.getTribeModel(player.playerWork.tribe); | ||||
|                                 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.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.MAINHAND] = reader.GetUInt32(18); | ||||
| @@ -712,7 +712,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                             else | ||||
|                                 questFlags = 0; | ||||
|  | ||||
|                             string questName = Server.getStaticActors(player.playerWork.questScenario[index]).actorName; | ||||
|                             string questName = Server.GetStaticActors(player.playerWork.questScenario[index]).actorName; | ||||
|                             player.questScenario[index] = new Quest(player, player.playerWork.questScenario[index], questName, questData, questFlags); | ||||
|                         } | ||||
|                     } | ||||
| @@ -779,14 +779,14 @@ namespace FFXIVClassic_Map_Server | ||||
|                         } | ||||
|                     } | ||||
|  | ||||
|                     player.getInventory(Inventory.NORMAL).initList(getInventory(player, 0, Inventory.NORMAL)); | ||||
|                     player.getInventory(Inventory.KEYITEMS).initList(getInventory(player, 0, Inventory.KEYITEMS)); | ||||
|                     player.getInventory(Inventory.CURRENCY).initList(getInventory(player, 0, Inventory.CURRENCY)); | ||||
|                     player.getInventory(Inventory.BAZAAR).initList(getInventory(player, 0, Inventory.BAZAAR)); | ||||
|                     player.getInventory(Inventory.MELDREQUEST).initList(getInventory(player, 0, Inventory.MELDREQUEST)); | ||||
|                     player.getInventory(Inventory.LOOT).initList(getInventory(player, 0, Inventory.LOOT)); | ||||
|                     player.GetInventory(Inventory.NORMAL).InitList(GetInventory(player, 0, Inventory.NORMAL)); | ||||
|                     player.GetInventory(Inventory.KEYITEMS).InitList(GetInventory(player, 0, Inventory.KEYITEMS)); | ||||
|                     player.GetInventory(Inventory.CURRENCY).InitList(GetInventory(player, 0, Inventory.CURRENCY)); | ||||
|                     player.GetInventory(Inventory.BAZAAR).InitList(GetInventory(player, 0, Inventory.BAZAAR)); | ||||
|                     player.GetInventory(Inventory.MELDREQUEST).InitList(GetInventory(player, 0, Inventory.MELDREQUEST)); | ||||
|                     player.GetInventory(Inventory.LOOT).InitList(GetInventory(player, 0, Inventory.LOOT)); | ||||
|  | ||||
|                     player.getEquipment().SetEquipment(getEquipment(player, player.charaWork.parameterSave.state_mainSkill[0])); | ||||
|                     player.GetEquipment().SetEquipment(GetEquipment(player, player.charaWork.parameterSave.state_mainSkill[0])); | ||||
|                 } | ||||
|                 catch (MySqlException e) | ||||
|                 { | ||||
| @@ -800,9 +800,9 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public static InventoryItem[] getEquipment(Player player, ushort classId) | ||||
|         public static InventoryItem[] GetEquipment(Player player, ushort classId) | ||||
|         { | ||||
|             InventoryItem[] equipment = new InventoryItem[player.getEquipment().GetCapacity()]; | ||||
|             InventoryItem[] equipment = new InventoryItem[player.GetEquipment().GetCapacity()]; | ||||
|  | ||||
|             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))) | ||||
|             { | ||||
| @@ -827,7 +827,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                         { | ||||
|                             ushort equipSlot = reader.GetUInt16(0); | ||||
|                             ulong uniqueItemId = reader.GetUInt16(1); | ||||
|                             InventoryItem item = player.getInventory(Inventory.NORMAL).getItemById(uniqueItemId); | ||||
|                             InventoryItem item = player.GetInventory(Inventory.NORMAL).GetItemById(uniqueItemId); | ||||
|                             equipment[equipSlot] = item; | ||||
|                         } | ||||
|                     } | ||||
| @@ -845,7 +845,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             return equipment; | ||||
|         } | ||||
|  | ||||
|         public static void equipItem(Player player, ushort equipSlot, ulong uniqueItemId) | ||||
|         public static void EquipItem(Player player, ushort equipSlot, ulong uniqueItemId) | ||||
|         { | ||||
|  | ||||
|             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))) | ||||
| @@ -882,7 +882,7 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public static void unequipItem(Player player, ushort equipSlot) | ||||
|         public static void UnequipItem(Player player, ushort equipSlot) | ||||
|         { | ||||
|  | ||||
|             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))) | ||||
| @@ -915,7 +915,7 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public static List<InventoryItem> getInventory(Player player, uint slotOffset, uint type) | ||||
|         public static List<InventoryItem> GetInventory(Player player, uint slotOffset, uint type) | ||||
|         { | ||||
|             List<InventoryItem> items = new List<InventoryItem>(); | ||||
|  | ||||
| @@ -987,7 +987,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             return items; | ||||
|         } | ||||
|  | ||||
|         public static InventoryItem addItem(Player player, uint itemId, int quantity, byte quality, byte itemType, int durability, ushort type) | ||||
|         public static InventoryItem AddItem(Player player, uint itemId, int quantity, byte quality, byte itemType, int durability, ushort type) | ||||
|         { | ||||
|             InventoryItem insertedItem = null; | ||||
|  | ||||
| @@ -1028,7 +1028,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                     cmd.ExecuteNonQuery(); | ||||
|                     cmd2.ExecuteNonQuery(); | ||||
|  | ||||
|                     insertedItem = new InventoryItem((uint)cmd.LastInsertedId, itemId, quantity, (ushort)player.getInventory(type).getNextEmptySlot(), itemType, quality, durability, 0, 0, 0, 0, 0, 0); | ||||
|                     insertedItem = new InventoryItem((uint)cmd.LastInsertedId, itemId, quantity, (ushort)player.GetInventory(type).GetNextEmptySlot(), itemType, quality, durability, 0, 0, 0, 0, 0, 0); | ||||
|                 } | ||||
|                 catch (MySqlException e) | ||||
|                 { | ||||
| @@ -1043,7 +1043,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             return insertedItem; | ||||
|         } | ||||
|  | ||||
|         public static void setQuantity(Player player, uint slot, ushort type, int quantity) | ||||
|         public static void SetQuantity(Player player, uint slot, ushort type, int quantity) | ||||
|         { | ||||
|             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))) | ||||
|             { | ||||
| @@ -1077,7 +1077,7 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public static void removeItem(Player player, ulong serverItemId, ushort type) | ||||
|         public static void RemoveItem(Player player, ulong serverItemId, ushort type) | ||||
|         { | ||||
|             using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}; Allow User Variables=True", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) | ||||
|             { | ||||
| @@ -1117,7 +1117,7 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public static void removeItem(Player player, ushort slot, ushort type) | ||||
|         public static void RemoveItem(Player player, ushort slot, ushort type) | ||||
|         { | ||||
|             using (MySqlConnection conn = new MySqlConnection(String.Format("Server={0}; Port={1}; Database={2}; UID={3}; Password={4}; Allow User Variables=True", ConfigConstants.DATABASE_HOST, ConfigConstants.DATABASE_PORT, ConfigConstants.DATABASE_NAME, ConfigConstants.DATABASE_USERNAME, ConfigConstants.DATABASE_PASSWORD))) | ||||
|             { | ||||
| @@ -1158,7 +1158,7 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public static SubPacket getLatestAchievements(Player player) | ||||
|         public static SubPacket GetLatestAchievements(Player player) | ||||
|         { | ||||
|             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))) | ||||
| @@ -1196,10 +1196,10 @@ namespace FFXIVClassic_Map_Server | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             return SetLatestAchievementsPacket.buildPacket(player.actorId, latestAchievements); | ||||
|             return SetLatestAchievementsPacket.BuildPacket(player.actorId, latestAchievements); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket getAchievementsPacket(Player player) | ||||
|         public static SubPacket GetAchievementsPacket(Player player) | ||||
|         { | ||||
|             SetCompletedAchievementsPacket cheevosPacket = new SetCompletedAchievementsPacket(); | ||||
|  | ||||
| @@ -1242,7 +1242,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             return cheevosPacket.buildPacket(player.actorId); | ||||
|             return cheevosPacket.BuildPacket(player.actorId); | ||||
|         } | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -36,17 +36,17 @@ namespace FFXIVClassic_Map_Server | ||||
|             cp = new CommandProcessor(playerList); | ||||
|         }      | ||||
|  | ||||
|         public void processPacket(ClientConnection client, BasePacket packet) | ||||
|         public void ProcessPacket(ClientConnection client, BasePacket packet) | ||||
|         {                       | ||||
|             if (packet.header.isCompressed == 0x01)                        | ||||
|                 BasePacket.decryptPacket(client.blowfish, ref packet); | ||||
|                 BasePacket.DecryptPacket(client.blowfish, ref packet); | ||||
|  | ||||
|             List<SubPacket> subPackets = packet.getSubpackets(); | ||||
|             List<SubPacket> subPackets = packet.GetSubpackets(); | ||||
|             foreach (SubPacket subpacket in subPackets) | ||||
|             { | ||||
|                 if (subpacket.header.type == 0x01) | ||||
|                 {                  | ||||
|                     packet.debugPrintPacket(); | ||||
|                     packet.DebugPrintPacket(); | ||||
|                     byte[] reply1Data = { | ||||
|                                             0x01, 0x00, 0x00, 0x00, 0x28, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | ||||
|                                             0x18, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0xFD, 0xFF, 0xFF, | ||||
| @@ -117,35 +117,35 @@ namespace FFXIVClassic_Map_Server | ||||
|                         player = mPlayers[client.owner]; | ||||
|                     } | ||||
|  | ||||
|                     //Create connected player if not created | ||||
|                     //Create connected player if not Created | ||||
|                     if (player == null) | ||||
|                     {  | ||||
|                         player = new ConnectedPlayer(actorID); | ||||
|                         mPlayers[actorID] = player; | ||||
|                     } | ||||
|                      | ||||
|                     player.setConnection(packet.header.connectionType, client); | ||||
|                     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.Debug("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.Debug("Got {0} connection for ActorID {1} @ {2}.", "chat", actorID, client.GetAddress()); | ||||
|  | ||||
|                     //Create player actor | ||||
|                     reply1.debugPrintPacket(); | ||||
|                     client.queuePacket(reply1); | ||||
|                     client.queuePacket(reply2); | ||||
|                     reply1.DebugPrintPacket(); | ||||
|                     client.QueuePacket(reply1); | ||||
|                     client.QueuePacket(reply2); | ||||
|                     break; | ||||
|                 } | ||||
|                 else if (subpacket.header.type == 0x07) | ||||
|                 { | ||||
|                     BasePacket init = Login0x7ResponsePacket.buildPacket(BitConverter.ToUInt32(packet.data, 0x10), Utils.UnixTimeStampUTC()); | ||||
|                     //client.queuePacket(init); | ||||
|                     BasePacket init = Login0x7ResponsePacket.BuildPacket(BitConverter.ToUInt32(packet.data, 0x10), Utils.UnixTimeStampUTC()); | ||||
|                     //client.QueuePacket(init); | ||||
|                 } | ||||
|                 else if (subpacket.header.type == 0x08) | ||||
|                 { | ||||
|                     //Response, client's current [actorID][time] | ||||
|                     packet.debugPrintPacket(); | ||||
|                     packet.DebugPrintPacket(); | ||||
|                 } | ||||
|                 else if (subpacket.header.type == 0x03) | ||||
|                 { | ||||
| @@ -162,18 +162,18 @@ namespace FFXIVClassic_Map_Server | ||||
|                     { | ||||
|                         //Ping | ||||
|                         case 0x0001: | ||||
|                             //subpacket.debugPrintSubPacket(); | ||||
|                             //subpacket.DebugPrintSubPacket(); | ||||
|                             PingPacket pingPacket = new PingPacket(subpacket.data); | ||||
|                             client.queuePacket(BasePacket.createPacket(PongPacket.buildPacket(player.actorID, pingPacket.time), true, false)); | ||||
|                             player.ping(); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(PongPacket.BuildPacket(player.actorID, pingPacket.time), true, false)); | ||||
|                             player.Ping(); | ||||
|                             break; | ||||
|                         //Unknown | ||||
|                         case 0x0002: | ||||
|  | ||||
|                             subpacket.debugPrintSubPacket(); | ||||
|                             client.queuePacket(_0x2Packet.buildPacket(player.actorID), true, false); | ||||
|                             subpacket.DebugPrintSubPacket(); | ||||
|                             client.QueuePacket(_0x2Packet.BuildPacket(player.actorID), true, false); | ||||
|  | ||||
|                             Server.GetWorldManager().DoLogin(player.getActor()); | ||||
|                             Server.GetWorldManager().DoLogin(player.GetActor()); | ||||
|  | ||||
|  | ||||
|                             break; | ||||
| @@ -181,15 +181,15 @@ namespace FFXIVClassic_Map_Server | ||||
|                         case 0x0003: | ||||
|                             ChatMessagePacket chatMessage = new ChatMessagePacket(subpacket.data); | ||||
|                             Program.Log.Info("Got type-{5} message: {0} @ {1}, {2}, {3}, Rot: {4}", chatMessage.message, chatMessage.posX, chatMessage.posY, chatMessage.posZ, chatMessage.posRot, chatMessage.logType); | ||||
|                             subpacket.debugPrintSubPacket(); | ||||
|                             subpacket.DebugPrintSubPacket(); | ||||
|  | ||||
|                             if (chatMessage.message.StartsWith("!")) | ||||
|                             { | ||||
|                                 if (cp.doCommand(chatMessage.message, player)) | ||||
|                                 if (cp.DoCommand(chatMessage.message, player)) | ||||
|                                     continue; | ||||
|                             }                            | ||||
|  | ||||
|                             player.getActor().broadcastPacket(SendMessagePacket.buildPacket(player.actorID, player.actorID, chatMessage.logType, player.getActor().customDisplayName, chatMessage.message), false); | ||||
|                             player.GetActor().BroadcastPacket(SendMessagePacket.BuildPacket(player.actorID, player.actorID, chatMessage.logType, player.GetActor().customDisplayName, chatMessage.message), false); | ||||
|  | ||||
|                             break; | ||||
|                         //Langauge Code | ||||
| @@ -199,37 +199,37 @@ namespace FFXIVClassic_Map_Server | ||||
|                             break; | ||||
|                         //Unknown - Happens a lot at login, then once every time player zones | ||||
|                         case 0x0007: | ||||
|                             //subpacket.debugPrintSubPacket(); | ||||
|                             //subpacket.DebugPrintSubPacket(); | ||||
|                             _0x07Packet unknown07 = new _0x07Packet(subpacket.data); | ||||
|                             break; | ||||
|                         //Update Position | ||||
|                         case 0x00CA: | ||||
|                             //Update Position | ||||
|                             //subpacket.debugPrintSubPacket(); | ||||
|                             //subpacket.DebugPrintSubPacket(); | ||||
|                             UpdatePlayerPositionPacket posUpdate = new UpdatePlayerPositionPacket(subpacket.data); | ||||
|                             player.updatePlayerActorPosition(posUpdate.x, posUpdate.y, posUpdate.z, posUpdate.rot, posUpdate.moveState); | ||||
|                             player.getActor().sendInstanceUpdate(); | ||||
|                             player.UpdatePlayerActorPosition(posUpdate.x, posUpdate.y, posUpdate.z, posUpdate.rot, posUpdate.moveState); | ||||
|                             player.GetActor().SendInstanceUpdate(); | ||||
|  | ||||
|                             if (player.getActor().isInZoneChange()) | ||||
|                                 player.getActor().setZoneChanging(false); | ||||
|                             if (player.GetActor().IsInZoneChange()) | ||||
|                                 player.GetActor().SetZoneChanging(false); | ||||
|  | ||||
|                             break; | ||||
|                         //Set Target  | ||||
|                         case 0x00CD: | ||||
|                             //subpacket.debugPrintSubPacket(); | ||||
|                             //subpacket.DebugPrintSubPacket(); | ||||
|  | ||||
|                             SetTargetPacket setTarget = new SetTargetPacket(subpacket.data); | ||||
|                             player.getActor().currentTarget = setTarget.actorID; | ||||
|                             player.getActor().broadcastPacket(SetActorTargetAnimatedPacket.buildPacket(player.actorID, player.actorID, setTarget.actorID), true); | ||||
|                             player.GetActor().currentTarget = setTarget.actorID; | ||||
|                             player.GetActor().BroadcastPacket(SetActorTargetAnimatedPacket.BuildPacket(player.actorID, player.actorID, setTarget.actorID), true); | ||||
|                             break; | ||||
|                         //Lock Target | ||||
|                         case 0x00CC: | ||||
|                             LockTargetPacket lockTarget = new LockTargetPacket(subpacket.data); | ||||
|                             player.getActor().currentLockedTarget = lockTarget.actorID; | ||||
|                             player.GetActor().currentLockedTarget = lockTarget.actorID; | ||||
|                             break; | ||||
|                         //Start Event | ||||
|                         case 0x012D: | ||||
|                             subpacket.debugPrintSubPacket(); | ||||
|                             subpacket.DebugPrintSubPacket(); | ||||
|                             EventStartPacket eventStart = new EventStartPacket(subpacket.data); | ||||
|  | ||||
|                             /* | ||||
| @@ -245,83 +245,83 @@ namespace FFXIVClassic_Map_Server | ||||
|                             } | ||||
|                             */ | ||||
|  | ||||
|                             Actor ownerActor = Server.getStaticActors(eventStart.scriptOwnerActorID); | ||||
|                             Actor ownerActor = Server.GetStaticActors(eventStart.scriptOwnerActorID); | ||||
|                             if (ownerActor != null && ownerActor is Command) | ||||
|                             { | ||||
|                                 player.getActor().currentCommand = eventStart.scriptOwnerActorID; | ||||
|                                 player.getActor().currentCommandName = eventStart.triggerName; | ||||
|                                 player.GetActor().currentCommand = eventStart.scriptOwnerActorID; | ||||
|                                 player.GetActor().currentCommandName = eventStart.triggerName; | ||||
|                             } | ||||
|                             else | ||||
|                             { | ||||
|                                 player.getActor().currentEventOwner = eventStart.scriptOwnerActorID; | ||||
|                                 player.getActor().currentEventName = eventStart.triggerName; | ||||
|                                 player.GetActor().currentEventOwner = eventStart.scriptOwnerActorID; | ||||
|                                 player.GetActor().currentEventName = eventStart.triggerName; | ||||
|                             } | ||||
|  | ||||
|                             if (ownerActor == null) | ||||
|                             { | ||||
|                                 //Is it a instance actor? | ||||
|                                 ownerActor = Server.GetWorldManager().GetActorInWorld(player.getActor().currentEventOwner); | ||||
|                                 ownerActor = Server.GetWorldManager().GetActorInWorld(player.GetActor().currentEventOwner); | ||||
|                                 if (ownerActor == null) | ||||
|                                 { | ||||
|                                     //Is it a Director? | ||||
|                                     if (player.getActor().currentDirector != null && player.getActor().currentEventOwner == player.getActor().currentDirector.actorId) | ||||
|                                         ownerActor = player.getActor().currentDirector; | ||||
|                                     if (player.GetActor().currentDirector != null && player.GetActor().currentEventOwner == player.GetActor().currentDirector.actorId) | ||||
|                                         ownerActor = player.GetActor().currentDirector; | ||||
|                                     else | ||||
|                                     { | ||||
|                                         Program.Log.Debug("\n===Event START===\nCould not find actor 0x{0:X} for event started by caller: 0x{1:X}\nEvent Starter: {2}\nParams: {3}", eventStart.actorID, eventStart.scriptOwnerActorID, eventStart.triggerName, LuaUtils.dumpParams(eventStart.luaParams)); | ||||
|                                         Program.Log.Debug("\n===Event START===\nCould not find actor 0x{0:X} for event started by caller: 0x{1:X}\nEvent Starter: {2}\nParams: {3}", eventStart.actorID, eventStart.scriptOwnerActorID, eventStart.triggerName, LuaUtils.DumpParams(eventStart.luaParams)); | ||||
|                                         break; | ||||
|                                     } | ||||
|                                 }                                     | ||||
|                             } | ||||
|                              | ||||
|                             LuaEngine.doActorOnEventStarted(player.getActor(), ownerActor, eventStart); | ||||
|                             LuaEngine.DoActorOnEventStarted(player.GetActor(), ownerActor, eventStart); | ||||
|  | ||||
|                             Program.Log.Debug("\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.triggerName, LuaUtils.dumpParams(eventStart.luaParams)); | ||||
|                             Program.Log.Debug("\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.triggerName, LuaUtils.DumpParams(eventStart.luaParams)); | ||||
|                             break; | ||||
|                         //Unknown, happens at npc spawn and cutscene play???? | ||||
|                         case 0x00CE: | ||||
|                             break; | ||||
|                         //Event Result | ||||
|                         case 0x012E: | ||||
|                             subpacket.debugPrintSubPacket(); | ||||
|                             subpacket.DebugPrintSubPacket(); | ||||
|                             EventUpdatePacket eventUpdate = new EventUpdatePacket(subpacket.data); | ||||
|                             Program.Log.Debug("\n===Event UPDATE===\nSource Actor: 0x{0:X}\nCaller Actor: 0x{1:X}\nVal1: 0x{2:X}\nVal2: 0x{3:X}\nStep: 0x{4:X}\nParams: {5}", eventUpdate.actorID, eventUpdate.scriptOwnerActorID, eventUpdate.val1, eventUpdate.val2, eventUpdate.step, LuaUtils.dumpParams(eventUpdate.luaParams)); | ||||
|                             Program.Log.Debug("\n===Event UPDATE===\nSource Actor: 0x{0:X}\nCaller Actor: 0x{1:X}\nVal1: 0x{2:X}\nVal2: 0x{3:X}\nStep: 0x{4:X}\nParams: {5}", eventUpdate.actorID, eventUpdate.scriptOwnerActorID, eventUpdate.val1, eventUpdate.val2, eventUpdate.step, LuaUtils.DumpParams(eventUpdate.luaParams)); | ||||
|  | ||||
|                             //Is it a static actor? If not look in the player's instance | ||||
|                             Actor updateOwnerActor = Server.getStaticActors(player.getActor().currentEventOwner); | ||||
|                             Actor updateOwnerActor = Server.GetStaticActors(player.GetActor().currentEventOwner); | ||||
|                             if (updateOwnerActor == null) | ||||
|                             { | ||||
|                                 updateOwnerActor = Server.GetWorldManager().GetActorInWorld(player.getActor().currentEventOwner); | ||||
|                                 updateOwnerActor = Server.GetWorldManager().GetActorInWorld(player.GetActor().currentEventOwner); | ||||
|  | ||||
|                                 if (player.getActor().currentDirector != null && player.getActor().currentEventOwner == player.getActor().currentDirector.actorId) | ||||
|                                     updateOwnerActor = player.getActor().currentDirector; | ||||
|                                 if (player.GetActor().currentDirector != null && player.GetActor().currentEventOwner == player.GetActor().currentDirector.actorId) | ||||
|                                     updateOwnerActor = player.GetActor().currentDirector; | ||||
|  | ||||
|                                 if (updateOwnerActor == null) | ||||
|                                     break; | ||||
|                             } | ||||
|  | ||||
|                             LuaEngine.doActorOnEventUpdated(player.getActor(), updateOwnerActor, eventUpdate); | ||||
|                             LuaEngine.DoActorOnEventUpdated(player.GetActor(), updateOwnerActor, eventUpdate); | ||||
|                              | ||||
|                             break; | ||||
|                         case 0x012F: | ||||
|                             subpacket.debugPrintSubPacket(); | ||||
|                             subpacket.DebugPrintSubPacket(); | ||||
|                             ParameterDataRequestPacket paramRequest = new ParameterDataRequestPacket(subpacket.data); | ||||
|                             if (paramRequest.paramName.Equals("charaWork/exp")) | ||||
|                                 player.getActor().sendCharaExpInfo(); | ||||
|                                 player.GetActor().SendCharaExpInfo(); | ||||
|                             break; | ||||
|                         /* RECRUITMENT */ | ||||
|                         //Start Recruiting | ||||
|                         case 0x01C3: | ||||
|                             StartRecruitingRequestPacket recruitRequestPacket = new StartRecruitingRequestPacket(subpacket.data); | ||||
|                             client.queuePacket(BasePacket.createPacket(StartRecruitingResponse.buildPacket(player.actorID, true), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(StartRecruitingResponse.BuildPacket(player.actorID, true), true, false)); | ||||
|                             break; | ||||
|                         //End Recruiting | ||||
|                         case 0x01C4: | ||||
|                             client.queuePacket(BasePacket.createPacket(EndRecruitmentPacket.buildPacket(player.actorID), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(EndRecruitmentPacket.BuildPacket(player.actorID), true, false)); | ||||
|                             break; | ||||
|                         //Party Window Opened, Request State | ||||
|                         case 0x01C5: | ||||
|                             client.queuePacket(BasePacket.createPacket(RecruiterStatePacket.buildPacket(player.actorID, true, true, 1), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(RecruiterStatePacket.BuildPacket(player.actorID, true, true, 1), true, false)); | ||||
|                             break; | ||||
|                         //Search Recruiting | ||||
|                         case 0x01C7: | ||||
| @@ -335,84 +335,84 @@ namespace FFXIVClassic_Map_Server | ||||
|                             details.purposeId = 2; | ||||
|                             details.locationId = 1; | ||||
|                             details.subTaskId = 1; | ||||
|                             details.comment = "This is a test details packet sent by the server. No implementation has been created yet..."; | ||||
|                             details.comment = "This is a test details packet sent by the server. No implementation has been Created yet..."; | ||||
|                             details.num[0] = 1; | ||||
|                             client.queuePacket(BasePacket.createPacket(CurrentRecruitmentDetailsPacket.buildPacket(player.actorID, details), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(CurrentRecruitmentDetailsPacket.BuildPacket(player.actorID, details), true, false)); | ||||
|                             break; | ||||
|                         //Accepted Recruiting | ||||
|                         case 0x01C6: | ||||
|                             subpacket.debugPrintSubPacket(); | ||||
|                             subpacket.DebugPrintSubPacket(); | ||||
|                             break; | ||||
|                         /* SOCIAL STUFF */ | ||||
|                         case 0x01C9: | ||||
|                             AddRemoveSocialPacket addBlackList = new AddRemoveSocialPacket(subpacket.data); | ||||
|                             client.queuePacket(BasePacket.createPacket(BlacklistAddedPacket.buildPacket(player.actorID, true, addBlackList.name), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(BlacklistAddedPacket.BuildPacket(player.actorID, true, addBlackList.name), true, false)); | ||||
|                             break; | ||||
|                         case 0x01CA: | ||||
|                             AddRemoveSocialPacket removeBlackList = new AddRemoveSocialPacket(subpacket.data); | ||||
|                             client.queuePacket(BasePacket.createPacket(BlacklistRemovedPacket.buildPacket(player.actorID, true, removeBlackList.name), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(BlacklistRemovedPacket.BuildPacket(player.actorID, true, removeBlackList.name), true, false)); | ||||
|                             break; | ||||
|                         case 0x01CB: | ||||
|                             int offset1 = 0; | ||||
|                             client.queuePacket(BasePacket.createPacket(SendBlacklistPacket.buildPacket(player.actorID, new String[] { "Test" }, ref offset1), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(SendBlacklistPacket.BuildPacket(player.actorID, new String[] { "Test" }, ref offset1), true, false)); | ||||
|                             break; | ||||
|                         case 0x01CC: | ||||
|                             AddRemoveSocialPacket addFriendList = new AddRemoveSocialPacket(subpacket.data); | ||||
|                             client.queuePacket(BasePacket.createPacket(FriendlistAddedPacket.buildPacket(player.actorID, true, (uint)addFriendList.name.GetHashCode(), true, addFriendList.name), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(FriendlistAddedPacket.BuildPacket(player.actorID, true, (uint)addFriendList.name.GetHashCode(), true, addFriendList.name), true, false)); | ||||
|                             break; | ||||
|                         case 0x01CD: | ||||
|                             AddRemoveSocialPacket removeFriendList = new AddRemoveSocialPacket(subpacket.data); | ||||
|                             client.queuePacket(BasePacket.createPacket(FriendlistRemovedPacket.buildPacket(player.actorID, true, removeFriendList.name), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(FriendlistRemovedPacket.BuildPacket(player.actorID, true, removeFriendList.name), true, false)); | ||||
|                             break; | ||||
|                         case 0x01CE: | ||||
|                             int offset2 = 0; | ||||
|                             client.queuePacket(BasePacket.createPacket(SendFriendlistPacket.buildPacket(player.actorID, new Tuple<long, string>[] { new Tuple<long, string>(01, "Test2") }, ref offset2), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(SendFriendlistPacket.BuildPacket(player.actorID, new Tuple<long, string>[] { new Tuple<long, string>(01, "Test2") }, ref offset2), true, false)); | ||||
|                             break; | ||||
|                         case 0x01CF: | ||||
|                             client.queuePacket(BasePacket.createPacket(FriendStatusPacket.buildPacket(player.actorID, null), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(FriendStatusPacket.BuildPacket(player.actorID, null), true, false)); | ||||
|                             break; | ||||
|                         /* SUPPORT DESK STUFF */ | ||||
|                         //Request for FAQ/Info List | ||||
|                         case 0x01D0: | ||||
|                             FaqListRequestPacket faqRequest = new FaqListRequestPacket(subpacket.data); | ||||
|                             client.queuePacket(BasePacket.createPacket(FaqListResponsePacket.buildPacket(player.actorID, new string[] { "Testing FAQ1", "Coded style!" }), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(FaqListResponsePacket.BuildPacket(player.actorID, new string[] { "Testing FAQ1", "Coded style!" }), true, false)); | ||||
|                             break; | ||||
|                         //Request for body of a faq/info selection | ||||
|                         case 0x01D1: | ||||
|                             FaqBodyRequestPacket faqBodyRequest = new FaqBodyRequestPacket(subpacket.data); | ||||
|                             client.queuePacket(BasePacket.createPacket(FaqBodyResponsePacket.buildPacket(player.actorID, "HERE IS A GIANT BODY. Nothing else to say!"), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(FaqBodyResponsePacket.BuildPacket(player.actorID, "HERE IS A GIANT BODY. Nothing else to say!"), true, false)); | ||||
|                             break; | ||||
|                         //Request issue list | ||||
|                         case 0x01D2: | ||||
|                             GMTicketIssuesRequestPacket issuesRequest = new GMTicketIssuesRequestPacket(subpacket.data); | ||||
|                             client.queuePacket(BasePacket.createPacket(IssueListResponsePacket.buildPacket(player.actorID, new string[] { "Test1", "Test2", "Test3", "Test4", "Test5" }), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(IssueListResponsePacket.BuildPacket(player.actorID, new string[] { "Test1", "Test2", "Test3", "Test4", "Test5" }), true, false)); | ||||
|                             break; | ||||
|                         //Request if GM ticket exists | ||||
|                         case 0x01D3: | ||||
|                             client.queuePacket(BasePacket.createPacket(StartGMTicketPacket.buildPacket(player.actorID, false), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(StartGMTicketPacket.BuildPacket(player.actorID, false), true, false)); | ||||
|                             break; | ||||
|                         //Request for GM response message | ||||
|                         case 0x01D4: | ||||
|                             client.queuePacket(BasePacket.createPacket(GMTicketPacket.buildPacket(player.actorID, "This is a GM Ticket Title", "This is a GM Ticket Body."), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(GMTicketPacket.BuildPacket(player.actorID, "This is a GM Ticket Title", "This is a GM Ticket Body."), true, false)); | ||||
|                             break; | ||||
|                         //GM Ticket Sent | ||||
|                         case 0x01D5: | ||||
|                             GMSupportTicketPacket gmTicket = new GMSupportTicketPacket(subpacket.data); | ||||
|                             Program.Log.Info("Got GM Ticket: \n" + gmTicket.ticketTitle + "\n" + gmTicket.ticketBody); | ||||
|                             client.queuePacket(BasePacket.createPacket(GMTicketSentResponsePacket.buildPacket(player.actorID, true), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(GMTicketSentResponsePacket.BuildPacket(player.actorID, true), true, false)); | ||||
|                             break; | ||||
|                         //Request to end ticket | ||||
|                         case 0x01D6: | ||||
|                             client.queuePacket(BasePacket.createPacket(EndGMTicketPacket.buildPacket(player.actorID), true, false)); | ||||
|                             client.QueuePacket(BasePacket.CreatePacket(EndGMTicketPacket.BuildPacket(player.actorID), true, false)); | ||||
|                             break; | ||||
|                         default: | ||||
|                             Program.Log.Debug("Unknown command 0x{0:X} received.", subpacket.gameMessage.opcode); | ||||
|                             subpacket.debugPrintSubPacket(); | ||||
|                             subpacket.DebugPrintSubPacket(); | ||||
|                             break; | ||||
|                     } | ||||
|                 } | ||||
|                 else | ||||
|                     packet.debugPrintPacket(); | ||||
|                     packet.DebugPrintPacket(); | ||||
|             } | ||||
|         }         | ||||
|  | ||||
|   | ||||
| @@ -26,11 +26,11 @@ namespace FFXIVClassic_Map_Server | ||||
|             bool startServer = true; | ||||
|  | ||||
|             //Load Config | ||||
|             if (!ConfigConstants.load()) | ||||
|                 startServer = false; | ||||
|  | ||||
|             // set up logging | ||||
|  | ||||
|             if (!ConfigConstants.Load()) | ||||
|                 startServer = false; | ||||
|  | ||||
|             // set up logging | ||||
|  | ||||
|             Log = LogManager.GetCurrentClassLogger(); | ||||
|  | ||||
|             Program.Log.Info("---------FFXIV 1.0 Map Server---------");             | ||||
| @@ -58,7 +58,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|  | ||||
|             //Check World ID | ||||
|             DBWorld thisWorld = Database.getServer(ConfigConstants.DATABASE_WORLDID); | ||||
|             DBWorld thisWorld = Database.GetServer(ConfigConstants.DATABASE_WORLDID); | ||||
|             if (thisWorld != null) | ||||
|                 Program.Log.Info("Successfully pulled world info from DB. Server name is {0}.", thisWorld.name); | ||||
|             else | ||||
| @@ -68,14 +68,14 @@ namespace FFXIVClassic_Map_Server | ||||
|             if (startServer) | ||||
|             { | ||||
|                 Server server = new Server(); | ||||
|                 CommandProcessor cp = new CommandProcessor(server.getConnectedPlayerList()); | ||||
|                 server.startServer(); | ||||
|                 CommandProcessor cp = new CommandProcessor(server.GetConnectedPlayerList()); | ||||
|                 server.StartServer(); | ||||
|  | ||||
|                 while (startServer) | ||||
|                 { | ||||
|                     String input = Console.ReadLine(); | ||||
|                     Log.Info("[Console Input] " + input); | ||||
|                     cp.doCommand(input, null);   | ||||
|                     cp.DoCommand(input, null);   | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|   | ||||
| @@ -129,7 +129,7 @@ namespace FFXIVClassic_Map_Server.Properties { | ||||
|         /// <summary> | ||||
|         ///   Looks up a localized string similar to Prints out your current location | ||||
|         /// | ||||
|         ///*Note: The X/Y/Z coordinates do not correspond to the coordinates listed in the in-game map, they are based on the underlying game data. | ||||
|         ///*Note: The X/Y/Z coordinates Do not correspond to the coordinates listed in the in-game map, they are based on the underlying game data. | ||||
|         /// </summary> | ||||
|         public static string CPmypos { | ||||
|             get { | ||||
| @@ -226,7 +226,7 @@ namespace FFXIVClassic_Map_Server.Properties { | ||||
|         /// <summary> | ||||
|         ///   Looks up a localized string similar to Overrides the currently displayed character equipment in a specific slot | ||||
|         /// | ||||
|         ///*Note: Similar to Glamours in FFXIV:ARR, the overridden graphics are purely cosmetic, they do not affect the underlying stats of whatever is equipped on that slot | ||||
|         ///*Note: Similar to Glamours in FFXIV:ARR, the overridden graphics are purely cosmetic, they Do not affect the underlying stats of whatever is equipped on that slot | ||||
|         /// | ||||
|         ///*Syntax:	sendpacket <slot> <wid> <eid> <vid> <cid> | ||||
|         ///<w/e/v/c id> are as defined in the client game data. | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|      | ||||
|     The primary goals of this format is to allow a simple XML format  | ||||
|     that is mostly human readable. The generation and parsing of the  | ||||
|     various data types are done through the TypeConverter classes  | ||||
|     various data types are Done through the TypeConverter classes  | ||||
|     associated with the data types. | ||||
|      | ||||
|     Example: | ||||
| @@ -33,7 +33,7 @@ | ||||
|     Each data row contains a name, and value. The row also contains a  | ||||
|     type or mimetype. Type corresponds to a .NET class that support  | ||||
|     text/value conversion through the TypeConverter architecture.  | ||||
|     Classes that don't support this are serialized and stored with the  | ||||
|     Classes that Don't support this are serialized and stored with the  | ||||
|     mimetype set. | ||||
|      | ||||
|     The mimetype is used for serialized objects, and tells the  | ||||
| @@ -156,7 +156,7 @@ Test: test weather</value> | ||||
|   <data name="CPmypos" xml:space="preserve"> | ||||
|     <value>Prints out your current location | ||||
|  | ||||
| *Note: The X/Y/Z coordinates do not correspond to the coordinates listed in the in-game map, they are based on the underlying game data</value> | ||||
| *Note: The X/Y/Z coordinates Do not correspond to the coordinates listed in the in-game map, they are based on the underlying game data</value> | ||||
|   </data> | ||||
|   <data name="CPproperty" xml:space="preserve"> | ||||
|     <value>*Syntax:	property <value 1> <value 2> <value 3></value> | ||||
| @@ -199,7 +199,7 @@ Test: test weather</value> | ||||
|   <data name="CPsetgraphic" xml:space="preserve"> | ||||
|     <value>Overrides the currently displayed character equipment in a specific slot | ||||
|  | ||||
| *Note: Similar to Glamours in FFXIV:ARR, the overridden graphics are purely cosmetic, they do not affect the underlying stats of whatever is equipped on that slot | ||||
| *Note: Similar to Glamours in FFXIV:ARR, the overridden graphics are purely cosmetic, they Do not affect the underlying stats of whatever is equipped on that slot | ||||
|  | ||||
| *Syntax:	sendpacket <slot> <wid> <eid> <vid> <cid> | ||||
| <w/e/v/c id> are as defined in the client game data</value> | ||||
|   | ||||
| @@ -38,7 +38,7 @@ namespace FFXIVClassic_Map_Server | ||||
|         private Thread mConnectionHealthThread; | ||||
|         private bool killHealthThread = false; | ||||
|  | ||||
|         private void connectionHealth() | ||||
|         private void ConnectionHealth() | ||||
|         { | ||||
|             Program.Log.Info("Connection Health thread started; it will run every {0} seconds.", HEALTH_THREAD_SLEEP_TIME); | ||||
|             while (!killHealthThread) | ||||
| @@ -48,12 +48,12 @@ namespace FFXIVClassic_Map_Server | ||||
|                     List<ConnectedPlayer> dcedPlayers = new List<ConnectedPlayer>(); | ||||
|                     foreach (ConnectedPlayer cp in mConnectedPlayerList.Values) | ||||
|                     { | ||||
|                         if (cp.checkIfDCing()) | ||||
|                         if (cp.CheckIfDCing()) | ||||
|                             dcedPlayers.Add(cp); | ||||
|                     } | ||||
|  | ||||
|                     foreach (ConnectedPlayer cp in dcedPlayers) | ||||
|                         cp.getActor().cleanupAndSave(); | ||||
|                         cp.GetActor().CleanupAndSave(); | ||||
|                 } | ||||
|                 Thread.Sleep(HEALTH_THREAD_SLEEP_TIME * 1000); | ||||
|             } | ||||
| @@ -64,20 +64,20 @@ namespace FFXIVClassic_Map_Server | ||||
|             mSelf = this; | ||||
|         } | ||||
|  | ||||
|         public static Server getServer() | ||||
|         public static Server GetServer() | ||||
|         { | ||||
|             return mSelf; | ||||
|         } | ||||
|  | ||||
|         public bool startServer() | ||||
|         public bool StartServer() | ||||
|         { | ||||
|             mConnectionHealthThread = new Thread(new ThreadStart(connectionHealth)); | ||||
|             mConnectionHealthThread = new Thread(new ThreadStart(ConnectionHealth)); | ||||
|             mConnectionHealthThread.Name = "MapThread:Health"; | ||||
|             //mConnectionHealthThread.Start(); | ||||
|  | ||||
|             mStaticActors = new StaticActors(STATIC_ACTORS_PATH); | ||||
|  | ||||
|             gamedataItems = Database.getItemGamedata(); | ||||
|             gamedataItems = Database.GetItemGamedata(); | ||||
|             Program.Log.Info("Loaded {0} items.", gamedataItems.Count); | ||||
|  | ||||
|             mWorldManager = new WorldManager(this); | ||||
| @@ -93,7 +93,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|             catch (Exception e) | ||||
|             { | ||||
|                 throw new ApplicationException("Could not create socket, check to make sure not duplicating port", e); | ||||
|                 throw new ApplicationException("Could not Create socket, check to make sure not duplicating port", e); | ||||
|             } | ||||
|             try | ||||
|             { | ||||
| @@ -106,7 +106,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|             try | ||||
|             { | ||||
|                 mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket); | ||||
|                 mServerSocket.BeginAccept(new AsyncCallback(AcceptCallback), mServerSocket); | ||||
|             } | ||||
|             catch (Exception e) | ||||
|             { | ||||
| @@ -124,7 +124,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         public void removePlayer(Player player) | ||||
|         public void RemovePlayer(Player player) | ||||
|         { | ||||
|             lock (mConnectedPlayerList) | ||||
|             { | ||||
| @@ -134,7 +134,7 @@ namespace FFXIVClassic_Map_Server | ||||
|         } | ||||
|  | ||||
|         #region Socket Handling | ||||
|         private void acceptCallback(IAsyncResult result) | ||||
|         private void AcceptCallback(IAsyncResult result) | ||||
|         { | ||||
|             ClientConnection conn = null; | ||||
|             Socket socket = (System.Net.Sockets.Socket)result.AsyncState; | ||||
| @@ -153,9 +153,9 @@ namespace FFXIVClassic_Map_Server | ||||
|  | ||||
|                 Program.Log.Info("Connection {0}:{1} has connected.", (conn.socket.RemoteEndPoint as IPEndPoint).Address, (conn.socket.RemoteEndPoint as IPEndPoint).Port); | ||||
|                 //Queue recieving of data from the connection | ||||
|                 conn.socket.BeginReceive(conn.buffer, 0, conn.buffer.Length, SocketFlags.None, new AsyncCallback(receiveCallback), conn); | ||||
|                 conn.socket.BeginReceive(conn.buffer, 0, conn.buffer.Length, SocketFlags.None, new AsyncCallback(ReceiveCallback), conn); | ||||
|                 //Queue the accept of the next incomming connection | ||||
|                 mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket); | ||||
|                 mServerSocket.BeginAccept(new AsyncCallback(AcceptCallback), mServerSocket); | ||||
|             } | ||||
|             catch (SocketException) | ||||
|             { | ||||
| @@ -167,7 +167,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                         mConnectionList.Remove(conn); | ||||
|                     } | ||||
|                 } | ||||
|                 mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket); | ||||
|                 mServerSocket.BeginAccept(new AsyncCallback(AcceptCallback), mServerSocket); | ||||
|             } | ||||
|             catch (Exception) | ||||
|             { | ||||
| @@ -178,21 +178,21 @@ namespace FFXIVClassic_Map_Server | ||||
|                         mConnectionList.Remove(conn); | ||||
|                     } | ||||
|                 } | ||||
|                 mServerSocket.BeginAccept(new AsyncCallback(acceptCallback), mServerSocket); | ||||
|                 mServerSocket.BeginAccept(new AsyncCallback(AcceptCallback), mServerSocket); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static Actor getStaticActors(uint id) | ||||
|         public static Actor GetStaticActors(uint id) | ||||
|         { | ||||
|             return mStaticActors.getActor(id); | ||||
|             return mStaticActors.GetActor(id); | ||||
|         } | ||||
|  | ||||
|         public static Actor getStaticActors(string name) | ||||
|         public static Actor GetStaticActors(string name) | ||||
|         { | ||||
|             return mStaticActors.findStaticActor(name); | ||||
|             return mStaticActors.FindStaticActor(name); | ||||
|         } | ||||
|  | ||||
|         public static Item getItemGamedata(uint id) | ||||
|         public static Item GetItemGamedata(uint id) | ||||
|         { | ||||
|             if (gamedataItems.ContainsKey(id)) | ||||
|                 return gamedataItems[id]; | ||||
| @@ -204,7 +204,7 @@ namespace FFXIVClassic_Map_Server | ||||
|         /// Receive Callback. Reads in incoming data, converting them to base packets. Base packets are sent to be parsed. If not enough data at the end to build a basepacket, move to the beginning and prepend. | ||||
|         /// </summary> | ||||
|         /// <param name="result"></param> | ||||
|         private void receiveCallback(IAsyncResult result) | ||||
|         private void ReceiveCallback(IAsyncResult result) | ||||
|         { | ||||
|             ClientConnection conn = (ClientConnection)result.AsyncState; | ||||
|  | ||||
| @@ -218,7 +218,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                     mConnectionList.Remove(conn); | ||||
|                 } | ||||
|                 if (conn.connType == BasePacket.TYPE_ZONE) | ||||
|                     Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.getAddress() : "User " + conn.owner); | ||||
|                     Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.GetAddress() : "User " + conn.owner); | ||||
|                 return; | ||||
|             } | ||||
|  | ||||
| @@ -235,13 +235,13 @@ namespace FFXIVClassic_Map_Server | ||||
|                     //Build packets until can no longer or out of data | ||||
|                     while (true) | ||||
|                     { | ||||
|                         BasePacket basePacket = buildPacket(ref offset, conn.buffer, bytesRead); | ||||
|                         BasePacket basePacket = BuildPacket(ref offset, conn.buffer, bytesRead); | ||||
|  | ||||
|                         //If can't build packet, break, else process another | ||||
|                         if (basePacket == null) | ||||
|                             break; | ||||
|                         else | ||||
|                             mProcessor.processPacket(conn, basePacket); | ||||
|                             mProcessor.ProcessPacket(conn, basePacket); | ||||
|                     } | ||||
|  | ||||
|                     //Not all bytes consumed, transfer leftover to beginning | ||||
| @@ -251,18 +251,18 @@ namespace FFXIVClassic_Map_Server | ||||
|                     conn.lastPartialSize = bytesRead - offset; | ||||
|  | ||||
|                     //Build any queued subpackets into basepackets and send | ||||
|                     conn.flushQueuedSendPackets(); | ||||
|                     conn.FlushQueuedSendPackets(); | ||||
|  | ||||
|                     if (offset < bytesRead) | ||||
|                         //Need offset since not all bytes consumed | ||||
|                         conn.socket.BeginReceive(conn.buffer, bytesRead - offset, conn.buffer.Length - (bytesRead - offset), SocketFlags.None, new AsyncCallback(receiveCallback), conn); | ||||
|                         conn.socket.BeginReceive(conn.buffer, bytesRead - offset, conn.buffer.Length - (bytesRead - offset), SocketFlags.None, new AsyncCallback(ReceiveCallback), conn); | ||||
|                     else | ||||
|                         //All bytes consumed, full buffer available | ||||
|                         conn.socket.BeginReceive(conn.buffer, 0, conn.buffer.Length, SocketFlags.None, new AsyncCallback(receiveCallback), conn); | ||||
|                         conn.socket.BeginReceive(conn.buffer, 0, conn.buffer.Length, SocketFlags.None, new AsyncCallback(ReceiveCallback), conn); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.getAddress() : "User " + conn.owner); | ||||
|                     Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.GetAddress() : "User " + conn.owner); | ||||
|  | ||||
|                     lock (mConnectionList) | ||||
|                     { | ||||
| @@ -274,7 +274,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             { | ||||
|                 if (conn.socket != null) | ||||
|                 { | ||||
|                     Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.getAddress() : "User " + conn.owner); | ||||
|                     Program.Log.Info("{0} has disconnected.", conn.owner == 0 ? conn.GetAddress() : "User " + conn.owner); | ||||
|  | ||||
|                     lock (mConnectionList) | ||||
|                     { | ||||
| @@ -290,7 +290,7 @@ namespace FFXIVClassic_Map_Server | ||||
|         /// <param name="offset">Current offset in buffer.</param> | ||||
|         /// <param name="buffer">Incoming buffer.</param> | ||||
|         /// <returns>Returns either a BasePacket or null if not enough data.</returns> | ||||
|         public BasePacket buildPacket(ref int offset, byte[] buffer, int bytesRead) | ||||
|         public BasePacket BuildPacket(ref int offset, byte[] buffer, int bytesRead) | ||||
|         { | ||||
|             BasePacket newPacket = null; | ||||
|  | ||||
| @@ -327,7 +327,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             return mWorldManager; | ||||
|         } | ||||
|  | ||||
|         public Dictionary<uint, ConnectedPlayer> getConnectedPlayerList() | ||||
|         public Dictionary<uint, ConnectedPlayer> GetConnectedPlayerList() | ||||
|         { | ||||
|             return mConnectedPlayerList; | ||||
|         } | ||||
|   | ||||
| @@ -106,7 +106,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                             { | ||||
|                                 Zone parent = zoneList[parentZoneId]; | ||||
|                                 PrivateArea privArea = new PrivateArea(parent, reader.GetUInt32("id"), reader.GetString("className"), reader.GetString("privateAreaName"), reader.GetUInt16("dayMusic"), reader.GetUInt16("nightMusic"), reader.GetUInt16("battleMusic")); | ||||
|                                 parent.addPrivateArea(privArea); | ||||
|                                 parent.AddPrivateArea(privArea); | ||||
|                             } | ||||
|                             else | ||||
|                                 continue; | ||||
| @@ -224,7 +224,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                             if (!reader.IsDBNull(12)) | ||||
|                             { | ||||
|                                 string eventConditions = reader.GetString(12); | ||||
|                                 npc.loadEventConditions(eventConditions); | ||||
|                                 npc.LoadEventConditions(eventConditions); | ||||
|                             } | ||||
|  | ||||
|                             if (!zoneList.ContainsKey(npc.zoneId)) | ||||
| @@ -233,7 +233,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                             if (zone == null) | ||||
|                                 continue; | ||||
|                             npc.zone = zone; | ||||
|                             zone.addActorToZone(npc); | ||||
|                             zone.AddActorToZone(npc); | ||||
|                             count++; | ||||
|  | ||||
|                         } | ||||
| @@ -297,7 +297,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                             if (!reader.IsDBNull(12)) | ||||
|                             { | ||||
|                                 string eventConditions = reader.GetString(12); | ||||
|                                 npc.loadEventConditions(eventConditions); | ||||
|                                 npc.LoadEventConditions(eventConditions); | ||||
|                             } | ||||
|  | ||||
|                             if (!zoneList.ContainsKey(npc.zoneId)) | ||||
| @@ -306,7 +306,7 @@ namespace FFXIVClassic_Map_Server | ||||
|                             if (zone == null) | ||||
|                                 continue; | ||||
|                             npc.zone = zone; | ||||
|                             zone.addActorToZone(npc); | ||||
|                             zone.AddActorToZone(npc); | ||||
|                             count++; | ||||
|  | ||||
|                         } | ||||
| @@ -326,7 +326,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             Program.Log.Info("Loaded {0} npc(s).", count); | ||||
|         } | ||||
|  | ||||
|         //Moves the actor to the new zone if exists. No packets are sent nor position changed. | ||||
|         //Moves the actor to the new zone if exists. No packets are sent nor position Changed. | ||||
|         public void DoSeamlessZoneChange(Player player, uint destinationZoneId) | ||||
|         { | ||||
|             Area oldZone; | ||||
| @@ -334,19 +334,19 @@ namespace FFXIVClassic_Map_Server | ||||
|             if (player.zone != null) | ||||
|             { | ||||
|                 oldZone = player.zone; | ||||
|                 oldZone.removeActorFromZone(player); | ||||
|                 oldZone.RemoveActorFromZone(player); | ||||
|             } | ||||
|  | ||||
|             //Add player to new zone and update | ||||
|             Zone newZone = GetZone(destinationZoneId); | ||||
|  | ||||
|             //This server does not contain that zoneId | ||||
|             //This server Does not contain that zoneId | ||||
|             if (newZone == null) | ||||
|                 return; | ||||
|  | ||||
|             newZone.addActorToZone(player); | ||||
|             newZone.AddActorToZone(player); | ||||
|  | ||||
|             LuaEngine.onZoneIn(player); | ||||
|             LuaEngine.OnZoneIn(player); | ||||
|         } | ||||
|  | ||||
|         //Moves actor to new zone, and sends packets to spawn at the given zone entrance | ||||
| @@ -371,7 +371,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             if (player.zone != null) | ||||
|             { | ||||
|                 oldZone = player.zone; | ||||
|                 oldZone.removeActorFromZone(player); | ||||
|                 oldZone.RemoveActorFromZone(player); | ||||
|             } | ||||
|  | ||||
|             //Add player to new zone and update | ||||
| @@ -380,12 +380,12 @@ namespace FFXIVClassic_Map_Server | ||||
|             if (destinationPrivateArea == null) | ||||
|                 newArea = GetZone(destinationZoneId); | ||||
|             else | ||||
|                 newArea = GetZone(destinationZoneId).getPrivateArea(destinationPrivateArea, 0); | ||||
|             //This server does not contain that zoneId | ||||
|                 newArea = GetZone(destinationZoneId).GetPrivateArea(destinationPrivateArea, 0); | ||||
|             //This server Does not contain that zoneId | ||||
|             if (newArea == null) | ||||
|                 return; | ||||
|  | ||||
|             newArea.addActorToZone(player); | ||||
|             newArea.AddActorToZone(player); | ||||
|  | ||||
|             //Update player actor's properties | ||||
|             player.zoneId = newArea.actorId; | ||||
| @@ -396,13 +396,13 @@ namespace FFXIVClassic_Map_Server | ||||
|             player.rotation = spawnRotation; | ||||
|  | ||||
|             //Send packets | ||||
|             player.playerSession.queuePacket(DeleteAllActorsPacket.buildPacket(player.actorId), true, false); | ||||
|             player.playerSession.queuePacket(_0xE2Packet.buildPacket(player.actorId, 0x0), true, false); | ||||
|             player.sendZoneInPackets(this, spawnType); | ||||
|             player.playerSession.clearInstance(); | ||||
|             player.sendInstanceUpdate(); | ||||
|             player.playerSession.QueuePacket(DeleteAllActorsPacket.BuildPacket(player.actorId), true, false); | ||||
|             player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x0), true, false); | ||||
|             player.SendZoneInPackets(this, spawnType); | ||||
|             player.playerSession.ClearInstance(); | ||||
|             player.SendInstanceUpdate(); | ||||
|  | ||||
|             LuaEngine.onZoneIn(player); | ||||
|             LuaEngine.OnZoneIn(player); | ||||
|         } | ||||
|  | ||||
|         //Moves actor within zone to spawn position | ||||
| @@ -428,8 +428,8 @@ namespace FFXIVClassic_Map_Server | ||||
|             //Remove player from currentZone if transfer else it's login | ||||
|             if (player.zone != null) | ||||
|             { | ||||
|                 player.zone.removeActorFromZone(player); | ||||
|                 player.zone.addActorToZone(player); | ||||
|                 player.zone.RemoveActorFromZone(player); | ||||
|                 player.zone.AddActorToZone(player); | ||||
|  | ||||
|                 //Update player actor's properties; | ||||
|                 player.positionX = spawnX; | ||||
| @@ -438,9 +438,9 @@ namespace FFXIVClassic_Map_Server | ||||
|                 player.rotation = spawnRotation; | ||||
|  | ||||
|                 //Send packets | ||||
|                 player.playerSession.queuePacket(_0xE2Packet.buildPacket(player.actorId, 0x0), true, false); | ||||
|                 player.playerSession.queuePacket(player.createSpawnTeleportPacket(player.actorId, spawnType), true, false); | ||||
|                 player.sendInstanceUpdate(); | ||||
|                 player.playerSession.QueuePacket(_0xE2Packet.BuildPacket(player.actorId, 0x0), true, false); | ||||
|                 player.playerSession.QueuePacket(player.CreateSpawnTeleportPacket(player.actorId, spawnType), true, false); | ||||
|                 player.SendInstanceUpdate(); | ||||
|  | ||||
|             }             | ||||
|         } | ||||
| @@ -451,31 +451,31 @@ namespace FFXIVClassic_Map_Server | ||||
|             //Add player to new zone and update | ||||
|             Zone zone = GetZone(player.zoneId); | ||||
|  | ||||
|             //This server does not contain that zoneId | ||||
|             //This server Does not contain that zoneId | ||||
|             if (zone == null) | ||||
|                 return; | ||||
|  | ||||
|             //Set the current zone and add player | ||||
|             //Set the current zone and Add player | ||||
|             player.zone = zone; | ||||
|  | ||||
|             LuaEngine.onBeginLogin(player); | ||||
|             LuaEngine.OnBeginLogin(player); | ||||
|              | ||||
|             zone.addActorToZone(player); | ||||
|             zone.AddActorToZone(player); | ||||
|              | ||||
|             //Send packets             | ||||
|             player.sendZoneInPackets(this, 0x1); | ||||
|             player.SendZoneInPackets(this, 0x1); | ||||
|  | ||||
|             LuaEngine.onLogin(player); | ||||
|             LuaEngine.onZoneIn(player); | ||||
|             LuaEngine.OnLogin(player); | ||||
|             LuaEngine.OnZoneIn(player); | ||||
|         } | ||||
|  | ||||
|         public void reloadZone(uint zoneId) | ||||
|         public void ReloadZone(uint zoneId) | ||||
|         { | ||||
|             if (!zoneList.ContainsKey(zoneId)) | ||||
|                 return; | ||||
|  | ||||
|             Zone zone = zoneList[zoneId]; | ||||
|             //zone.clear(); | ||||
|             //zone.Clear(); | ||||
|             LoadNPCs(zone.actorId); | ||||
|  | ||||
|         } | ||||
| @@ -552,7 +552,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public ZoneEntrance getZoneEntrance(uint entranceId) | ||||
|         public ZoneEntrance GetZoneEntrance(uint entranceId) | ||||
|         { | ||||
|             if (zoneEntranceList.ContainsKey(entranceId)) | ||||
|                 return zoneEntranceList[entranceId]; | ||||
|   | ||||
| @@ -52,66 +52,66 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             this.moveSpeeds[3] = SetActorSpeedPacket.DEFAULT_RUN; | ||||
|         } | ||||
|  | ||||
|         public SubPacket createAddActorPacket(uint playerActorId, byte val) | ||||
|         public SubPacket CreateAddActorPacket(uint playerActorId, byte val) | ||||
|         { | ||||
|             return AddActorPacket.buildPacket(actorId, playerActorId, val); | ||||
|             return AddActorPacket.BuildPacket(actorId, playerActorId, val); | ||||
|         }  | ||||
|  | ||||
|         public SubPacket createNamePacket(uint playerActorId) | ||||
|         public SubPacket CreateNamePacket(uint playerActorId) | ||||
|         { | ||||
|             return SetActorNamePacket.buildPacket(actorId, playerActorId, displayNameId, displayNameId == 0xFFFFFFFF | displayNameId == 0x0 ? customDisplayName : ""); | ||||
|             return SetActorNamePacket.BuildPacket(actorId, playerActorId, displayNameId, displayNameId == 0xFFFFFFFF | displayNameId == 0x0 ? customDisplayName : ""); | ||||
|         }         | ||||
|  | ||||
|         public SubPacket createSpeedPacket(uint playerActorId) | ||||
|         public SubPacket CreateSpeedPacket(uint playerActorId) | ||||
|         { | ||||
|             return SetActorSpeedPacket.buildPacket(actorId, playerActorId); | ||||
|             return SetActorSpeedPacket.BuildPacket(actorId, playerActorId); | ||||
|         } | ||||
|  | ||||
|         public SubPacket createSpawnPositonPacket(uint playerActorId, uint spawnType) | ||||
|         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); | ||||
|                 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); | ||||
|                 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); | ||||
|                     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); | ||||
|                     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); | ||||
|             //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) | ||||
|         public SubPacket CreateSpawnTeleportPacket(uint playerActorId, uint spawnType) | ||||
|         { | ||||
|             SubPacket spawnPacket; | ||||
|  | ||||
|                 spawnPacket = SetActorPositionPacket.buildPacket(actorId, playerActorId, 0xFFFFFFFF, positionX, positionY, positionZ, rotation, spawnType, false); | ||||
|                 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); | ||||
|             //return SetActorPositionPacket.BuildPacket(actorId, playerActorId, -211.895477f, 190.000000f, 29.651011f, 2.674819f, SetActorPositionPacket.SPAWNTYPE_PLAYERWAKE); | ||||
|              | ||||
|             spawnPacket.debugPrintSubPacket(); | ||||
|             spawnPacket.DebugPrintSubPacket(); | ||||
|  | ||||
|             return spawnPacket; | ||||
|         } | ||||
|  | ||||
|         public SubPacket createPositionUpdatePacket(uint playerActorId) | ||||
|         public SubPacket CreatePositionUpdatePacket(uint playerActorId) | ||||
|         { | ||||
|             return MoveActorToPositionPacket.buildPacket(actorId, playerActorId, positionX, positionY, positionZ, rotation, moveState); | ||||
|             return MoveActorToPositionPacket.BuildPacket(actorId, playerActorId, positionX, positionY, positionZ, rotation, moveState); | ||||
|         } | ||||
|  | ||||
|         public SubPacket createStatePacket(uint playerActorID) | ||||
|         public SubPacket CreateStatePacket(uint playerActorID) | ||||
|         { | ||||
|             return SetActorStatePacket.buildPacket(actorId, playerActorID, currentMainState, currentSubState); | ||||
|             return SetActorStatePacket.BuildPacket(actorId, playerActorID, currentMainState, currentSubState); | ||||
|         } | ||||
|  | ||||
|         public List<SubPacket> getEventConditionPackets(uint playerActorId) | ||||
|         public List<SubPacket> GetEventConditionPackets(uint playerActorId) | ||||
|         { | ||||
|             List<SubPacket> subpackets = new List<SubPacket>(); | ||||
|  | ||||
| @@ -122,126 +122,126 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             if (eventConditions.talkEventConditions != null) | ||||
|             { | ||||
|                 foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions)                 | ||||
|                     subpackets.Add(SetTalkEventCondition.buildPacket(playerActorId, actorId, condition));                 | ||||
|                     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)); | ||||
|                     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)); | ||||
|                     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)); | ||||
|                     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)); | ||||
|                     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)); | ||||
|                     subpackets.Add(SetPushEventConditionWithTriggerBox.BuildPacket(playerActorId, actorId, condition)); | ||||
|             } | ||||
|  | ||||
|             return subpackets; | ||||
|         } | ||||
|  | ||||
|         public BasePacket getSetEventStatusPackets(uint playerActorId) | ||||
|         public BasePacket GetSetEventStatusPackets(uint playerActorId) | ||||
|         { | ||||
|             List<SubPacket> subpackets = new List<SubPacket>(); | ||||
|  | ||||
|             //Return empty list | ||||
|             if (eventConditions == null) | ||||
|                 return BasePacket.createPacket(subpackets, true, false); | ||||
|                 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));  | ||||
|                     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)); | ||||
|                     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)); | ||||
|                     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)); | ||||
|                     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)); | ||||
|                     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)); | ||||
|                     subpackets.Add(SetEventStatus.BuildPacket(playerActorId, actorId, true, 2, condition.conditionName)); | ||||
|             } | ||||
|  | ||||
|             return BasePacket.createPacket(subpackets, true, false); | ||||
|             return BasePacket.CreatePacket(subpackets, true, false); | ||||
|         } | ||||
|  | ||||
|         public SubPacket createIsZoneingPacket(uint playerActorId) | ||||
|         public SubPacket CreateIsZoneingPacket(uint playerActorId) | ||||
|         { | ||||
|             return SetActorIsZoningPacket.buildPacket(actorId, playerActorId, false); | ||||
|             return SetActorIsZoningPacket.BuildPacket(actorId, playerActorId, false); | ||||
|         } | ||||
|  | ||||
|         public virtual SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         public virtual SubPacket CreateScriptBindPacket(uint playerActorId) | ||||
|         { | ||||
|             return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, classParams); | ||||
|             return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, classParams); | ||||
|         } | ||||
|  | ||||
|         public virtual BasePacket getSpawnPackets(uint playerActorId) | ||||
|         public virtual BasePacket GetSpawnPackets(uint playerActorId) | ||||
|         {             | ||||
|             return getSpawnPackets(playerActorId, 0x1); | ||||
|             return GetSpawnPackets(playerActorId, 0x1); | ||||
|         } | ||||
|  | ||||
|         public virtual BasePacket getSpawnPackets(uint playerActorId, uint spawnType) | ||||
|         public virtual BasePacket GetSpawnPackets(uint playerActorId, uint spawnType) | ||||
|         { | ||||
|             List<SubPacket> subpackets = new List<SubPacket>(); | ||||
|             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); | ||||
|             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) | ||||
|         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); | ||||
|             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) | ||||
| @@ -253,50 +253,50 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|                 return actorId == actorObj.actorId; | ||||
|         } | ||||
|  | ||||
|         public string getName() | ||||
|         public string GetName() | ||||
|         { | ||||
|             return actorName; | ||||
|         } | ||||
|  | ||||
|         public string getClassName() | ||||
|         public string GetClassName() | ||||
|         { | ||||
|             return className; | ||||
|         } | ||||
|  | ||||
|         public ushort getState() | ||||
|         public ushort GetState() | ||||
|         { | ||||
|             return currentMainState; | ||||
|         } | ||||
|  | ||||
|         public List<LuaParam> getLuaParams() | ||||
|         public List<LuaParam> GetLuaParams() | ||||
|         { | ||||
|             return classParams; | ||||
|         } | ||||
|  | ||||
|         public void changeState(ushort newState) | ||||
|         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); | ||||
|             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) | ||||
|         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); | ||||
|             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) | ||||
|         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); | ||||
|             SubPacket ChangeSpeedPacket = SetActorSpeedPacket.BuildPacket(actorId, actorId, moveSpeeds[0], moveSpeeds[1], moveSpeeds[2]); | ||||
|             zone.BroadcastPacketAroundActor(this, ChangeSpeedPacket); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|   | ||||
| @@ -18,7 +18,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             if (data[0] == 's' && data[1] == 'a' && data[2] == 'n' && data[3] == 'e') | ||||
|                 data = DecryptStaticActorsFile(data); | ||||
|                  | ||||
|             loadStaticActors(data); | ||||
|             LoadStaticActors(data); | ||||
|         } | ||||
|  | ||||
|         private byte[] DecryptStaticActorsFile(byte[] encoded) | ||||
| @@ -50,7 +50,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             return decoded; | ||||
|         } | ||||
|  | ||||
|         private bool loadStaticActors(byte[] data)  | ||||
|         private bool LoadStaticActors(byte[] data)  | ||||
|         { | ||||
|             try | ||||
|             { | ||||
| @@ -61,7 +61,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|  | ||||
|                         while (binReader.BaseStream.Position != binReader.BaseStream.Length) | ||||
|                         { | ||||
|                             uint id = Utils.swapEndian(binReader.ReadUInt32()) | 0xA0F00000; | ||||
|                             uint id = Utils.SwapEndian(binReader.ReadUInt32()) | 0xA0F00000; | ||||
|  | ||||
|                             List<byte> list = new List<byte>(); | ||||
|                             byte readByte; | ||||
| @@ -96,12 +96,12 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         public bool exists(uint actorId) | ||||
|         public bool Exists(uint actorId) | ||||
|         { | ||||
|             return mStaticActors[actorId] != null; | ||||
|         } | ||||
|  | ||||
|         public Actor findStaticActor(string name) | ||||
|         public Actor FindStaticActor(string name) | ||||
|         { | ||||
|             foreach (Actor a in mStaticActors.Values) | ||||
|             { | ||||
| @@ -112,7 +112,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             return null; | ||||
|         } | ||||
|  | ||||
|         public Actor getActor(uint actorId) | ||||
|         public Actor GetActor(uint actorId) | ||||
|         { | ||||
|             if (mStaticActors.ContainsKey(actorId)) | ||||
|                 return mStaticActors[actorId]; | ||||
|   | ||||
| @@ -65,29 +65,29 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|              | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         public override SubPacket CreateScriptBindPacket(uint playerActorId) | ||||
|         { | ||||
|             List<LuaParam> lParams; | ||||
|             lParams = LuaUtils.createLuaParamList(classPath, false, true, zoneName, "/Area/Zone/ZoneDefault", -1, (byte)1, true, false, false, false, false, false, false, false); | ||||
|             return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, "ZoneDefault", lParams); | ||||
|             lParams = LuaUtils.CreateLuaParamList(classPath, false, true, zoneName, "/Area/Zone/ZoneDefault", -1, (byte)1, true, false, false, false, false, false, false, false); | ||||
|             return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, "ZoneDefault", lParams); | ||||
|         } | ||||
|  | ||||
|         public override BasePacket getSpawnPackets(uint playerActorId) | ||||
|         public override BasePacket GetSpawnPackets(uint playerActorId) | ||||
|         { | ||||
|             List<SubPacket> subpackets = new List<SubPacket>(); | ||||
|             subpackets.Add(createAddActorPacket(playerActorId, 0));             | ||||
|             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); | ||||
|             subpackets.Add(CreateAddActorPacket(playerActorId, 0));             | ||||
|             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) | ||||
|         public void AddActorToZone(Actor actor) | ||||
|         { | ||||
|             if (!mActorList.ContainsKey(actor.actorId)) | ||||
|                 mActorList.Add(actor.actorId, actor); | ||||
| @@ -112,7 +112,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|                 mActorBlock[gridX, gridY].Add(actor); | ||||
|         } | ||||
|  | ||||
|         public void removeActorFromZone(Actor actor) | ||||
|         public void RemoveActorFromZone(Actor actor) | ||||
|         { | ||||
|             mActorList.Remove(actor.actorId); | ||||
|  | ||||
| @@ -136,7 +136,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|                 mActorBlock[gridX, gridY].Remove(actor); | ||||
|         } | ||||
|  | ||||
|         public void updateActorPosition(Actor actor) | ||||
|         public void UpdateActorPosition(Actor actor) | ||||
|         { | ||||
|             int gridX = (int)actor.positionX / boundingGridSize; | ||||
|             int gridY = (int)actor.positionZ / boundingGridSize; | ||||
| @@ -181,7 +181,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public List<Actor> getActorsAroundPoint(float x, float y, int checkDistance) | ||||
|         public List<Actor> GetActorsAroundPoint(float x, float y, int checkDistance) | ||||
|         { | ||||
|             checkDistance /= boundingGridSize; | ||||
|  | ||||
| @@ -224,7 +224,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             return result; | ||||
|         } | ||||
|  | ||||
|         public List<Actor> getActorsAroundActor(Actor actor, int checkDistance) | ||||
|         public List<Actor> GetActorsAroundActor(Actor actor, int checkDistance) | ||||
|         { | ||||
|             checkDistance /= boundingGridSize; | ||||
|  | ||||
| @@ -296,7 +296,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             return (Player)mActorList[id]; | ||||
|         } | ||||
|  | ||||
|         public void clear() | ||||
|         public void Clear() | ||||
|         { | ||||
|             //Clear All | ||||
|             mActorList.Clear(); | ||||
| @@ -309,12 +309,12 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public void broadcastPacketAroundActor(Actor actor, SubPacket packet) | ||||
|         public void BroadcastPacketAroundActor(Actor actor, SubPacket packet) | ||||
|         { | ||||
|             if (isIsolated) | ||||
|                 return; | ||||
|  | ||||
|             List<Actor> aroundActor = getActorsAroundActor(actor, 50); | ||||
|             List<Actor> aroundActor = GetActorsAroundActor(actor, 50); | ||||
|             foreach (Actor a in aroundActor) | ||||
|             {                 | ||||
|                 if (a is Player) | ||||
| @@ -324,7 +324,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|  | ||||
|                     SubPacket clonedPacket = new SubPacket(packet, actor.actorId); | ||||
|                     Player p = (Player)a;                         | ||||
|                     p.queuePacket(clonedPacket); | ||||
|                     p.QueuePacket(clonedPacket); | ||||
|                 } | ||||
|             }             | ||||
|         } | ||||
|   | ||||
| @@ -18,17 +18,17 @@ namespace FFXIVClassic_Map_Server.actors.area | ||||
|             this.privateAreaName = privateAreaName; | ||||
|         } | ||||
|  | ||||
|         public string getPrivateAreaName() | ||||
|         public string GetPrivateAreaName() | ||||
|         { | ||||
|             return privateAreaName; | ||||
|         } | ||||
|  | ||||
|         public Zone getParentZone() | ||||
|         public Zone GetParentZone() | ||||
|         { | ||||
|             return parentZone; | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         public override SubPacket CreateScriptBindPacket(uint playerActorId) | ||||
|         { | ||||
|             List<LuaParam> lParams; | ||||
|  | ||||
| @@ -37,9 +37,9 @@ namespace FFXIVClassic_Map_Server.actors.area | ||||
|             if (className.ToLower().Contains("content")) | ||||
|                 path = "Content/" + className; | ||||
|  | ||||
|             lParams = LuaUtils.createLuaParamList("/Area/PrivateArea/" + path, false, true, zoneName, privateAreaName, 0x9E, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, false, false, false); | ||||
|             ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams).debugPrintSubPacket(); | ||||
|             return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|             lParams = LuaUtils.CreateLuaParamList("/Area/PrivateArea/" + path, false, true, zoneName, privateAreaName, 0x9E, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, false, false, false); | ||||
|             ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams).DebugPrintSubPacket(); | ||||
|             return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|         } | ||||
|          | ||||
|     } | ||||
|   | ||||
| @@ -16,18 +16,18 @@ namespace FFXIVClassic_Map_Server.actors.area | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public void addPrivateArea(PrivateArea pa) | ||||
|         public void AddPrivateArea(PrivateArea pa) | ||||
|         { | ||||
|             if (privateAreas.ContainsKey(pa.getPrivateAreaName())) | ||||
|                 privateAreas[pa.getPrivateAreaName()][0] = pa; | ||||
|             if (privateAreas.ContainsKey(pa.GetPrivateAreaName())) | ||||
|                 privateAreas[pa.GetPrivateAreaName()][0] = pa; | ||||
|             else | ||||
|             { | ||||
|                 privateAreas[pa.getPrivateAreaName()] = new Dictionary<uint, PrivateArea>(); | ||||
|                 privateAreas[pa.getPrivateAreaName()][0] = pa; | ||||
|                 privateAreas[pa.GetPrivateAreaName()] = new Dictionary<uint, PrivateArea>(); | ||||
|                 privateAreas[pa.GetPrivateAreaName()][0] = pa; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public PrivateArea getPrivateArea(string type, uint number) | ||||
|         public PrivateArea GetPrivateArea(string type, uint number) | ||||
|         { | ||||
|             if (privateAreas.ContainsKey(type)) | ||||
|             { | ||||
| @@ -41,13 +41,13 @@ namespace FFXIVClassic_Map_Server.actors.area | ||||
|                 return null; | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         public override SubPacket CreateScriptBindPacket(uint playerActorId) | ||||
|         { | ||||
|             bool isEntranceDesion = false; | ||||
|  | ||||
|             List<LuaParam> lParams; | ||||
|             lParams = LuaUtils.createLuaParamList("/Area/Zone/" + className, false, true, zoneName, "", -1, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, true, isInstanceRaid, isEntranceDesion); | ||||
|             return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams);         | ||||
|             lParams = LuaUtils.CreateLuaParamList("/Area/Zone/" + className, false, true, zoneName, "", -1, canRideChocobo ? (byte)1 : (byte)0, canStealth, isInn, false, false, false, true, isInstanceRaid, isEntranceDesion); | ||||
|             return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams);         | ||||
|         } | ||||
|  | ||||
|     } | ||||
|   | ||||
| @@ -55,30 +55,30 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|                 charaWork.statusShownTime[i] = 0xFFFFFFFF; | ||||
|         } | ||||
|  | ||||
|         public SubPacket createAppearancePacket(uint playerActorId) | ||||
|         public SubPacket CreateAppearancePacket(uint playerActorId) | ||||
|         { | ||||
|             SetActorAppearancePacket setappearance = new SetActorAppearancePacket(modelId, appearanceIds); | ||||
|             return setappearance.buildPacket(actorId, playerActorId); | ||||
|             return setappearance.BuildPacket(actorId, playerActorId); | ||||
|         } | ||||
|  | ||||
|         public SubPacket createInitStatusPacket(uint playerActorId) | ||||
|         public SubPacket CreateInitStatusPacket(uint playerActorId) | ||||
|         { | ||||
|             return (SetActorStatusAllPacket.buildPacket(actorId, playerActorId, charaWork.status));                       | ||||
|             return (SetActorStatusAllPacket.BuildPacket(actorId, playerActorId, charaWork.status));                       | ||||
|         } | ||||
|  | ||||
|         public SubPacket createSetActorIconPacket(uint playerActorId) | ||||
|         public SubPacket CreateSetActorIconPacket(uint playerActorId) | ||||
|         { | ||||
|             return SetActorIconPacket.buildPacket(actorId, playerActorId, currentActorIcon); | ||||
|             return SetActorIconPacket.BuildPacket(actorId, playerActorId, currentActorIcon); | ||||
|         } | ||||
|  | ||||
|         public SubPacket createIdleAnimationPacket(uint playerActorId) | ||||
|         public SubPacket CreateIdleAnimationPacket(uint playerActorId) | ||||
|         { | ||||
|             return SetActorIdleAnimationPacket.buildPacket(actorId, playerActorId, animationId); | ||||
|             return SetActorIdleAnimationPacket.BuildPacket(actorId, playerActorId, animationId); | ||||
|         } | ||||
|  | ||||
|         public void setQuestGraphic(Player player, int graphicNum) | ||||
|         public void SetQuestGraphic(Player player, int graphicNum) | ||||
|         { | ||||
|             player.queuePacket(SetActorQuestGraphicPacket.buildPacket(player.actorId, actorId, graphicNum)); | ||||
|             player.QueuePacket(SetActorQuestGraphicPacket.BuildPacket(player.actorId, actorId, graphicNum)); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|   | ||||
| @@ -35,7 +35,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|  | ||||
|             this.zoneId = zoneId; | ||||
|  | ||||
|             loadNpcTemplate(id); | ||||
|             LoadNpcTemplate(id); | ||||
|  | ||||
|             charaWork.battleSave.potencial = 1.0f; | ||||
|  | ||||
| @@ -58,47 +58,47 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             charaWork.property[4] = 1; | ||||
|         } | ||||
|  | ||||
|         public SubPacket createAddActorPacket(uint playerActorId) | ||||
|         public SubPacket CreateAddActorPacket(uint playerActorId) | ||||
|         { | ||||
|             return AddActorPacket.buildPacket(actorId, playerActorId, 8); | ||||
|             return AddActorPacket.BuildPacket(actorId, playerActorId, 8); | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         public override SubPacket CreateScriptBindPacket(uint playerActorId) | ||||
|         { | ||||
|             List<LuaParam> lParams; | ||||
|  | ||||
|             Player player = Server.GetWorldManager().GetPCInWorld(playerActorId); | ||||
|             lParams = LuaEngine.doActorInstantiate(player, this); | ||||
|             lParams = LuaEngine.DoActorInstantiate(player, this); | ||||
|  | ||||
|             if (lParams == null) | ||||
|             { | ||||
|                 className = "PopulaceStandard"; | ||||
|                 lParams = LuaUtils.createLuaParamList("/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, 0xF47F6, false, false, 0, 1, "TEST"); | ||||
|                 lParams = LuaUtils.CreateLuaParamList("/Chara/Npc/Populace/PopulaceStandard", false, false, false, false, false, 0xF47F6, false, false, 0, 1, "TEST"); | ||||
|             } | ||||
|  | ||||
|             return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|             return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|         } | ||||
|  | ||||
|         public override BasePacket getSpawnPackets(uint playerActorId, uint spawnType) | ||||
|         public override BasePacket GetSpawnPackets(uint playerActorId, uint spawnType) | ||||
|         { | ||||
|             List<SubPacket> subpackets = new List<SubPacket>(); | ||||
|             subpackets.Add(createAddActorPacket(playerActorId)); | ||||
|             subpackets.AddRange(getEventConditionPackets(playerActorId)); | ||||
|             subpackets.Add(createSpeedPacket(playerActorId));             | ||||
|             subpackets.Add(createSpawnPositonPacket(playerActorId, 0x0));             | ||||
|             subpackets.Add(createAppearancePacket(playerActorId)); | ||||
|             subpackets.Add(createNamePacket(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));             | ||||
|             subpackets.Add(CreateAddActorPacket(playerActorId)); | ||||
|             subpackets.AddRange(GetEventConditionPackets(playerActorId)); | ||||
|             subpackets.Add(CreateSpeedPacket(playerActorId));             | ||||
|             subpackets.Add(CreateSpawnPositonPacket(playerActorId, 0x0));             | ||||
|             subpackets.Add(CreateAppearancePacket(playerActorId)); | ||||
|             subpackets.Add(CreateNamePacket(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); | ||||
|             return BasePacket.CreatePacket(subpackets, true, false); | ||||
|         } | ||||
|  | ||||
|         public override BasePacket getInitPackets(uint playerActorId) | ||||
|         public override BasePacket GetInitPackets(uint playerActorId) | ||||
|         { | ||||
|             ActorPropertyPacketUtil propPacketUtil = new ActorPropertyPacketUtil("/_init", this, playerActorId); | ||||
|  | ||||
| @@ -106,52 +106,52 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             for (int i = 0; i < charaWork.property.Length; i++) | ||||
|             { | ||||
|                 if (charaWork.property[i] != 0) | ||||
|                     propPacketUtil.addProperty(String.Format("charaWork.property[{0}]", i)); | ||||
|                     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.hp[0]"); | ||||
|             propPacketUtil.AddProperty("charaWork.parameterSave.hpMax[0]"); | ||||
|             propPacketUtil.AddProperty("charaWork.parameterSave.mp"); | ||||
|             propPacketUtil.AddProperty("charaWork.parameterSave.mpMax"); | ||||
|             propPacketUtil.AddProperty("charaWork.parameterTemp.tp"); | ||||
|  | ||||
|             if (charaWork.parameterSave.state_mainSkill[0] != 0) | ||||
|                 propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[0]"); | ||||
|                 propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkill[0]"); | ||||
|             if (charaWork.parameterSave.state_mainSkill[1] != 0) | ||||
|                 propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[1]"); | ||||
|                 propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkill[1]"); | ||||
|             if (charaWork.parameterSave.state_mainSkill[2] != 0) | ||||
|                 propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[2]"); | ||||
|                 propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkill[2]"); | ||||
|             if (charaWork.parameterSave.state_mainSkill[3] != 0) | ||||
|                 propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkill[3]"); | ||||
|                 propPacketUtil.AddProperty("charaWork.parameterSave.state_mainSkill[3]"); | ||||
|  | ||||
|             propPacketUtil.addProperty("charaWork.parameterSave.state_mainSkillLevel"); | ||||
|             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)); | ||||
|                     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(String.Format("charaWork.battleTemp.generalParameter[{0}]", i)); | ||||
|             } | ||||
|  | ||||
|             propPacketUtil.addProperty("npcWork.hateType"); | ||||
|             propPacketUtil.AddProperty("npcWork.hateType"); | ||||
|  | ||||
|             return BasePacket.createPacket(propPacketUtil.done(), true, false); | ||||
|             return BasePacket.CreatePacket(propPacketUtil.Done(), true, false); | ||||
|         } | ||||
|  | ||||
|         public uint getActorClassId() | ||||
|         public uint GetActorClassId() | ||||
|         { | ||||
|             return actorClassId; | ||||
|         } | ||||
|  | ||||
|         public void loadNpcTemplate(uint id) | ||||
|         public void LoadNpcTemplate(uint id) | ||||
|         { | ||||
|             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))) | ||||
|             { | ||||
| @@ -216,7 +216,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|                             modelId = reader.GetUInt32(0); | ||||
|                             appearanceIds[Character.SIZE] = reader.GetUInt32(1); | ||||
|                             appearanceIds[Character.COLORINFO] = (uint)(reader.GetUInt32(16) | (reader.GetUInt32(15) << 10) | (reader.GetUInt32(17) << 20)); //17 - Skin Color, 16 - Hair Color, 18 - Eye Color | ||||
|                             appearanceIds[Character.FACEINFO] = PrimitiveConversion.ToUInt32(CharacterUtils.getFaceInfo(reader.GetByte(6), reader.GetByte(7), reader.GetByte(5), reader.GetByte(14), reader.GetByte(13), reader.GetByte(12), reader.GetByte(11), reader.GetByte(10), reader.GetByte(9), reader.GetByte(8))); | ||||
|                             appearanceIds[Character.FACEINFO] = PrimitiveConversion.ToUInt32(CharacterUtils.GetFaceInfo(reader.GetByte(6), reader.GetByte(7), reader.GetByte(5), reader.GetByte(14), reader.GetByte(13), reader.GetByte(12), reader.GetByte(11), reader.GetByte(10), reader.GetByte(9), reader.GetByte(8))); | ||||
|                             appearanceIds[Character.HIGHLIGHT_HAIR] = (uint)(reader.GetUInt32(3) | reader.GetUInt32(2) << 10); //5- Hair Highlight, 4 - Hair Style | ||||
|                             appearanceIds[Character.VOICE] = reader.GetUInt32(17); | ||||
|                             appearanceIds[Character.MAINHAND] = reader.GetUInt32(19); | ||||
| @@ -247,7 +247,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public void loadEventConditions(string eventConditions) | ||||
|         public void LoadEventConditions(string eventConditions) | ||||
|         { | ||||
|             EventList conditions = JsonConvert.DeserializeObject<EventList>(eventConditions); | ||||
|             this.eventConditions = conditions; | ||||
|   | ||||
| @@ -64,40 +64,40 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             toPlayer.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, toPlayer.actorId, 0x23, Inventory.EQUIPMENT_OTHERPLAYER)); | ||||
|             toPlayer.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, toPlayer.actorId, 0x23, Inventory.EQUIPMENT_OTHERPLAYER)); | ||||
|             int currentIndex = 0; | ||||
|  | ||||
|             while (true) | ||||
|             { | ||||
|                 if (items.Count - currentIndex >= 16) | ||||
|                     toPlayer.queuePacket(InventoryListX16Packet.buildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex)); | ||||
|                     toPlayer.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex)); | ||||
|                 else if (items.Count - currentIndex > 1) | ||||
|                     toPlayer.queuePacket(InventoryListX08Packet.buildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex)); | ||||
|                     toPlayer.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, toPlayer.actorId, items, ref currentIndex)); | ||||
|                 else if (items.Count - currentIndex == 1) | ||||
|                 { | ||||
|                     toPlayer.queuePacket(InventoryListX01Packet.buildPacket(owner.actorId, toPlayer.actorId, items[currentIndex])); | ||||
|                     toPlayer.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, toPlayer.actorId, items[currentIndex])); | ||||
|                     currentIndex++; | ||||
|                 } | ||||
|                 else | ||||
|                     break; | ||||
|             } | ||||
|             toPlayer.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId, toPlayer.actorId)); | ||||
|             toPlayer.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId, toPlayer.actorId)); | ||||
|         } | ||||
|  | ||||
|         public void SendFullEquipment(bool doClear) | ||||
|         public void SendFullEquipment(bool DoClear) | ||||
|         { | ||||
|             List<ushort> slotsToUpdate = new List<ushort>(); | ||||
|             for (ushort i = 0; i < list.Length; i++) | ||||
|             { | ||||
|                 if (list[i] == null && doClear) | ||||
|                 if (list[i] == null && DoClear) | ||||
|                     slotsToUpdate.Add(0); | ||||
|                 else if (list[i] != null) | ||||
|                     slotsToUpdate.Add(i); | ||||
|             } | ||||
|  | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             SendEquipmentPackets(slotsToUpdate); | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId));       | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId));       | ||||
|         } | ||||
|  | ||||
|         public void SetEquipment(ushort[] slots, ushort[] itemSlots) | ||||
| @@ -107,18 +107,18 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|  | ||||
|             for (int i = 0; i < slots.Length; i++) | ||||
|             { | ||||
|                 InventoryItem item = normalInventory.getItemBySlot(itemSlots[i]); | ||||
|                 InventoryItem item = normalInventory.GetItemBySlot(itemSlots[i]); | ||||
|  | ||||
|                 if (item == null) | ||||
|                     continue; | ||||
|  | ||||
|                 Database.equipItem(owner, slots[i], item.uniqueId); | ||||
|                 list[slots[i]] = normalInventory.getItemBySlot(itemSlots[i]); | ||||
|                 Database.EquipItem(owner, slots[i], item.uniqueId); | ||||
|                 list[slots[i]] = normalInventory.GetItemBySlot(itemSlots[i]); | ||||
|             } | ||||
|  | ||||
|             owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); | ||||
|             SendFullEquipment(false); | ||||
|             owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); | ||||
|         } | ||||
|  | ||||
|         public void SetEquipment(InventoryItem[] toEquip) | ||||
| @@ -134,7 +134,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|  | ||||
|         public void Equip(ushort slot, ushort invSlot) | ||||
|         { | ||||
|             InventoryItem item = normalInventory.getItemBySlot(invSlot); | ||||
|             InventoryItem item = normalInventory.GetItemBySlot(invSlot); | ||||
|  | ||||
|             if (item == null) | ||||
|                 return; | ||||
| @@ -148,20 +148,20 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|                 return; | ||||
|  | ||||
|             if (writeToDB) | ||||
|                 Database.equipItem(owner, slot, item.uniqueId); | ||||
|                 Database.EquipItem(owner, slot, item.uniqueId); | ||||
|  | ||||
|             owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); | ||||
|  | ||||
|             if (list[slot] != null)             | ||||
|                 normalInventory.RefreshItem(list[slot], item);             | ||||
|             else | ||||
|                 normalInventory.RefreshItem(item); | ||||
|  | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             SendEquipmentPackets(slot, item); | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|  | ||||
|             owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); | ||||
|  | ||||
|             list[slot] = item; | ||||
|         } | ||||
| @@ -177,17 +177,17 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|                 return; | ||||
|  | ||||
|             if (writeToDB) | ||||
|                 Database.unequipItem(owner, slot); | ||||
|                 Database.UnequipItem(owner, slot); | ||||
|  | ||||
|             owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); | ||||
|  | ||||
|             normalInventory.RefreshItem(list[slot]); | ||||
|  | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             SendEquipmentPackets(slot, null); | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|  | ||||
|             owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); | ||||
|  | ||||
|             list[slot] = null; | ||||
|         } | ||||
| @@ -195,9 +195,9 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|         private void SendEquipmentPackets(ushort equipSlot, InventoryItem item) | ||||
|         { | ||||
|             if (item == null) | ||||
|                 owner.queuePacket(InventoryRemoveX01Packet.buildPacket(owner.actorId, equipSlot)); | ||||
|                 owner.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, equipSlot)); | ||||
|             else | ||||
|                 owner.queuePacket(EquipmentListX01Packet.buildPacket(owner.actorId, equipSlot, item.slot)); | ||||
|                 owner.QueuePacket(EquipmentListX01Packet.BuildPacket(owner.actorId, equipSlot, item.slot)); | ||||
|         } | ||||
|  | ||||
|         private void SendEquipmentPackets(List<ushort> slotsToUpdate) | ||||
| @@ -208,16 +208,16 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|             while (true) | ||||
|             { | ||||
|                 if (slotsToUpdate.Count - currentIndex >= 64) | ||||
|                     owner.queuePacket(EquipmentListX64Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); | ||||
|                     owner.QueuePacket(EquipmentListX64Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); | ||||
|                 else if (slotsToUpdate.Count - currentIndex >= 32) | ||||
|                     owner.queuePacket(EquipmentListX32Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); | ||||
|                     owner.QueuePacket(EquipmentListX32Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); | ||||
|                 else if (slotsToUpdate.Count - currentIndex >= 16) | ||||
|                     owner.queuePacket(EquipmentListX16Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); | ||||
|                     owner.QueuePacket(EquipmentListX16Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); | ||||
|                 else if (slotsToUpdate.Count - currentIndex > 1) | ||||
|                     owner.queuePacket(EquipmentListX08Packet.buildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); | ||||
|                     owner.QueuePacket(EquipmentListX08Packet.BuildPacket(owner.actorId, list, slotsToUpdate, ref currentIndex)); | ||||
|                 else if (slotsToUpdate.Count - currentIndex == 1) | ||||
|                 { | ||||
|                     owner.queuePacket(EquipmentListX01Packet.buildPacket(owner.actorId, slotsToUpdate[currentIndex], list[slotsToUpdate[currentIndex]].slot)); | ||||
|                     owner.QueuePacket(EquipmentListX01Packet.BuildPacket(owner.actorId, slotsToUpdate[currentIndex], list[slotsToUpdate[currentIndex]].slot)); | ||||
|                     currentIndex++; | ||||
|                 } | ||||
|                 else | ||||
|   | ||||
| @@ -33,12 +33,12 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|         } | ||||
|  | ||||
|         #region Inventory Management | ||||
|         public void initList(List<InventoryItem> itemsFromDB) | ||||
|         public void InitList(List<InventoryItem> itemsFromDB) | ||||
|         { | ||||
|             list = itemsFromDB; | ||||
|         } | ||||
|  | ||||
|         public InventoryItem getItemBySlot(ushort slot) | ||||
|         public InventoryItem GetItemBySlot(ushort slot) | ||||
|         { | ||||
|             if (slot < list.Count) | ||||
|                 return list[slot]; | ||||
| @@ -46,7 +46,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|                 return null; | ||||
|         } | ||||
|  | ||||
|         public InventoryItem getItemById(ulong itemId) | ||||
|         public InventoryItem GetItemById(ulong itemId) | ||||
|         { | ||||
|             foreach (InventoryItem item in list) | ||||
|             { | ||||
| @@ -58,41 +58,41 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|  | ||||
|         public void RefreshItem(InventoryItem item) | ||||
|         { | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             sendInventoryPackets(item); | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             SendInventoryPackets(item); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|         } | ||||
|  | ||||
|         public void RefreshItem(params InventoryItem[] items) | ||||
|         { | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             sendInventoryPackets(items.ToList()); | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             SendInventoryPackets(items.ToList()); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|         } | ||||
|  | ||||
|         public void RefreshItem(List<InventoryItem> items) | ||||
|         { | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             sendInventoryPackets(items); | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             SendInventoryPackets(items); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|         } | ||||
|  | ||||
|         public void addItem(uint itemId) | ||||
|         public void AddItem(uint itemId) | ||||
|         { | ||||
|             addItem(itemId, 1, 1); | ||||
|             AddItem(itemId, 1, 1); | ||||
|         } | ||||
|  | ||||
|         public void addItem(uint itemId, int quantity) | ||||
|         public void AddItem(uint itemId, int quantity) | ||||
|         { | ||||
|             addItem(itemId, quantity, 1); | ||||
|             AddItem(itemId, quantity, 1); | ||||
|         } | ||||
|  | ||||
|         public void addItem(uint itemId, int quantity, byte quality) | ||||
|         public void AddItem(uint itemId, int quantity, byte quality) | ||||
|         { | ||||
|             if (!isSpaceForAdd(itemId, quantity)) | ||||
|             if (!IsSpaceForAdd(itemId, quantity)) | ||||
|                 return; | ||||
|  | ||||
|             Item gItem = Server.getItemGamedata(itemId); | ||||
|             Item gItem = Server.GetItemGamedata(itemId); | ||||
|             List<ushort> slotsToUpdate = new List<ushort>(); | ||||
|             List<SubPacket> addItemPackets = new List<SubPacket>(); | ||||
|  | ||||
| @@ -121,73 +121,73 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|          //       return ITEMERROR_FULL; | ||||
|  | ||||
|             //Update lists and db | ||||
|             owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|  | ||||
|             //These had their quantities changed | ||||
|             //These had their quantities Changed | ||||
|             foreach (ushort slot in slotsToUpdate) | ||||
|             { | ||||
|                 Database.setQuantity(owner, slot, inventoryCode, list[slot].quantity); | ||||
|                 Database.SetQuantity(owner, slot, inventoryCode, list[slot].quantity); | ||||
|  | ||||
|                 if (inventoryCode != CURRENCY && inventoryCode != KEYITEMS) | ||||
|                     sendInventoryPackets(list[slot]); | ||||
|                     SendInventoryPackets(list[slot]); | ||||
|             } | ||||
|  | ||||
|             //New item that spilled over | ||||
|             while (quantityCount > 0) | ||||
|             { | ||||
|                 InventoryItem addedItem = Database.addItem(owner, itemId, Math.Min(quantityCount, gItem.maxStack), quality, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability, inventoryCode); | ||||
|                 InventoryItem addedItem = Database.AddItem(owner, itemId, Math.Min(quantityCount, gItem.maxStack), quality, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability, inventoryCode); | ||||
|  | ||||
|                  | ||||
|                 list.Add(addedItem); | ||||
|  | ||||
|                 if (inventoryCode != CURRENCY && inventoryCode != KEYITEMS) | ||||
|                     sendInventoryPackets(addedItem); | ||||
|                     SendInventoryPackets(addedItem); | ||||
|  | ||||
|                 quantityCount -= gItem.maxStack; | ||||
|             } | ||||
|  | ||||
|             if (inventoryCode == CURRENCY || inventoryCode == KEYITEMS) | ||||
|                 sendFullInventory(); | ||||
|                 SendFullInventory(); | ||||
|  | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); | ||||
|         } | ||||
|  | ||||
|         public void addItem(uint[] itemId) | ||||
|         public void AddItem(uint[] itemId) | ||||
|         { | ||||
|             if (!isSpaceForAdd(itemId[0], itemId.Length)) | ||||
|             if (!IsSpaceForAdd(itemId[0], itemId.Length)) | ||||
|                 return; | ||||
|  | ||||
|             //Update lists and db | ||||
|             owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|  | ||||
|             int startPos = list.Count; | ||||
|  | ||||
|             //New item that spilled over | ||||
|             for (int i = 0; i < itemId.Length; i++) | ||||
|             { | ||||
|                 Item gItem = Server.getItemGamedata(itemId[i]); | ||||
|                 InventoryItem addedItem = Database.addItem(owner, itemId[i], 1, (byte)1, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability, inventoryCode); | ||||
|                 Item gItem = Server.GetItemGamedata(itemId[i]); | ||||
|                 InventoryItem addedItem = Database.AddItem(owner, itemId[i], 1, (byte)1, gItem.isExclusive ? (byte)0x3 : (byte)0x0, gItem.durability, inventoryCode); | ||||
|                 list.Add(addedItem); | ||||
|             } | ||||
|  | ||||
|             sendInventoryPackets(startPos); | ||||
|             SendInventoryPackets(startPos); | ||||
|  | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); | ||||
|         } | ||||
|  | ||||
|         public void removeItem(uint itemId, int quantity) | ||||
|         public void RemoveItem(uint itemId, int quantity) | ||||
|         { | ||||
|             if (!hasItem(itemId, quantity)) | ||||
|             if (!HasItem(itemId, quantity)) | ||||
|                 return; | ||||
|  | ||||
|             List<ushort> slotsToUpdate = new List<ushort>(); | ||||
|             List<InventoryItem> itemsToRemove = new List<InventoryItem>(); | ||||
|             List<ushort> slotsToRemove = new List<ushort>(); | ||||
|             List<SubPacket> addItemPackets = new List<SubPacket>(); | ||||
|             List<SubPacket> AddItemPackets = new List<SubPacket>(); | ||||
|  | ||||
|             //Remove as we go along | ||||
|             int quantityCount = quantity; | ||||
| @@ -220,13 +220,13 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|  | ||||
|             for (int i = 0; i < slotsToUpdate.Count; i++) | ||||
|             { | ||||
|                 Database.setQuantity(owner, slotsToUpdate[i], inventoryCode, list[slotsToUpdate[i]].quantity); | ||||
|                 Database.SetQuantity(owner, slotsToUpdate[i], inventoryCode, list[slotsToUpdate[i]].quantity); | ||||
|             } | ||||
|  | ||||
|             int oldListSize = list.Count; | ||||
|             for (int i = 0; i < itemsToRemove.Count; i++) | ||||
|             { | ||||
|                 Database.removeItem(owner, itemsToRemove[i].uniqueId, inventoryCode); | ||||
|                 Database.RemoveItem(owner, itemsToRemove[i].uniqueId, inventoryCode); | ||||
|                 list.Remove(itemsToRemove[i]); | ||||
|             } | ||||
|  | ||||
| @@ -241,21 +241,21 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|                     slotsToRemove.Add((ushort)i); | ||||
|             } | ||||
|  | ||||
|             owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|  | ||||
|             sendInventoryPackets(lowestSlot); | ||||
|             sendInventoryRemovePackets(slotsToRemove); | ||||
|             SendInventoryPackets(lowestSlot); | ||||
|             SendInventoryRemovePackets(slotsToRemove); | ||||
|  | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|  | ||||
|             if (inventoryCode == NORMAL) | ||||
|                 owner.getEquipment().SendFullEquipment(false); | ||||
|                 owner.GetEquipment().SendFullEquipment(false); | ||||
|  | ||||
|             owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); | ||||
|         } | ||||
|  | ||||
|         public void removeItem(ulong itemDBId) | ||||
|         public void RemoveItem(ulong itemDBId) | ||||
|         { | ||||
|             ushort slot = 0; | ||||
|             InventoryItem toDelete = null; | ||||
| @@ -274,104 +274,104 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|  | ||||
|             int oldListSize = list.Count; | ||||
|             list.RemoveAt(slot); | ||||
|             Database.removeItem(owner, itemDBId, inventoryCode); | ||||
|             Database.RemoveItem(owner, itemDBId, inventoryCode); | ||||
|  | ||||
|             //Realign slots | ||||
|             for (int i = slot; i < list.Count; i++) | ||||
|                 list[i].slot = (ushort)i; | ||||
|             | ||||
|             owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|  | ||||
|             sendInventoryPackets(slot); | ||||
|             sendInventoryRemovePackets(slot); | ||||
|             SendInventoryPackets(slot); | ||||
|             SendInventoryRemovePackets(slot); | ||||
|             if (slot != oldListSize - 1) | ||||
|                 sendInventoryRemovePackets((ushort)(oldListSize - 1)); | ||||
|                 SendInventoryRemovePackets((ushort)(oldListSize - 1)); | ||||
|  | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|  | ||||
|             if (inventoryCode == NORMAL) | ||||
|                 owner.getEquipment().SendFullEquipment(false); | ||||
|                 owner.GetEquipment().SendFullEquipment(false); | ||||
|  | ||||
|             owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public void removeItem(ushort slot) | ||||
|         public void RemoveItem(ushort slot) | ||||
|         { | ||||
|             if (slot >= list.Count) | ||||
|                 return; | ||||
|  | ||||
|             int oldListSize = list.Count; | ||||
|             list.RemoveAt((int)slot); | ||||
|             Database.removeItem(owner, slot, inventoryCode); | ||||
|             Database.RemoveItem(owner, slot, inventoryCode); | ||||
|  | ||||
|             //Realign slots | ||||
|             for (int i = slot; i < list.Count; i++) | ||||
|                 list[i].slot = (ushort)i; | ||||
|  | ||||
|             owner.queuePacket(InventoryBeginChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             owner.QueuePacket(InventoryBeginChangePacket.BuildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|  | ||||
|             sendInventoryPackets(slot); | ||||
|             sendInventoryRemovePackets(slot); | ||||
|             SendInventoryPackets(slot); | ||||
|             SendInventoryRemovePackets(slot); | ||||
|             if (slot != oldListSize - 1) | ||||
|                 sendInventoryRemovePackets((ushort)(oldListSize - 1)); | ||||
|                 SendInventoryRemovePackets((ushort)(oldListSize - 1)); | ||||
|  | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|  | ||||
|             if (inventoryCode == NORMAL) | ||||
|                 owner.getEquipment().SendFullEquipment(false); | ||||
|                 owner.GetEquipment().SendFullEquipment(false); | ||||
|  | ||||
|             owner.queuePacket(InventoryEndChangePacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventoryEndChangePacket.BuildPacket(owner.actorId)); | ||||
|         } | ||||
|  | ||||
|         public void changeDurability(uint slot, uint durabilityChange) | ||||
|         public void ChangeDurability(uint slot, uint durabilityChange) | ||||
|         { | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public void changeSpiritBind(uint slot, uint spiritBindChange) | ||||
|         public void ChangeSpiritBind(uint slot, uint spiritBindChange) | ||||
|         { | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public void changeMateria(uint slot, byte materiaSlot, byte materiaId) | ||||
|         public void ChangeMateria(uint slot, byte materiaSlot, byte materiaId) | ||||
|         { | ||||
|  | ||||
|         } | ||||
|         #endregion | ||||
|  | ||||
|         #region Packet Functions | ||||
|         public void sendFullInventory() | ||||
|         public void SendFullInventory() | ||||
|         {             | ||||
|             owner.queuePacket(InventorySetBeginPacket.buildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             sendInventoryPackets(0); | ||||
|             owner.queuePacket(InventorySetEndPacket.buildPacket(owner.actorId)); | ||||
|             owner.QueuePacket(InventorySetBeginPacket.BuildPacket(owner.actorId, inventoryCapacity, inventoryCode)); | ||||
|             SendInventoryPackets(0); | ||||
|             owner.QueuePacket(InventorySetEndPacket.BuildPacket(owner.actorId)); | ||||
|         } | ||||
|  | ||||
|         private void sendInventoryPackets(InventoryItem item) | ||||
|         private void SendInventoryPackets(InventoryItem item) | ||||
|         { | ||||
|             owner.queuePacket(InventoryListX01Packet.buildPacket(owner.actorId, item)); | ||||
|             owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, item)); | ||||
|         } | ||||
|  | ||||
|         private void sendInventoryPackets(List<InventoryItem> items) | ||||
|         private void SendInventoryPackets(List<InventoryItem> items) | ||||
|         { | ||||
|             int currentIndex = 0; | ||||
|  | ||||
|             while (true) | ||||
|             { | ||||
|                 if (items.Count - currentIndex >= 64) | ||||
|                     owner.queuePacket(InventoryListX64Packet.buildPacket(owner.actorId, items, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, items, ref currentIndex)); | ||||
|                 else if (items.Count - currentIndex >= 32) | ||||
|                     owner.queuePacket(InventoryListX32Packet.buildPacket(owner.actorId, items, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, items, ref currentIndex)); | ||||
|                 else if (items.Count - currentIndex >= 16) | ||||
|                     owner.queuePacket(InventoryListX16Packet.buildPacket(owner.actorId, items, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, items, ref currentIndex)); | ||||
|                 else if (items.Count - currentIndex > 1) | ||||
|                     owner.queuePacket(InventoryListX08Packet.buildPacket(owner.actorId, items, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, items, ref currentIndex)); | ||||
|                 else if (items.Count - currentIndex == 1) | ||||
|                 { | ||||
|                     owner.queuePacket(InventoryListX01Packet.buildPacket(owner.actorId, items[currentIndex])); | ||||
|                     owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, items[currentIndex])); | ||||
|                     currentIndex++; | ||||
|                 } | ||||
|                 else | ||||
| @@ -380,23 +380,23 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|  | ||||
|         } | ||||
|  | ||||
|         private void sendInventoryPackets(int startOffset) | ||||
|         private void SendInventoryPackets(int startOffset) | ||||
|         { | ||||
|             int currentIndex = startOffset; | ||||
|  | ||||
|             while (true) | ||||
|             { | ||||
|                 if (list.Count - currentIndex >= 64) | ||||
|                     owner.queuePacket(InventoryListX64Packet.buildPacket(owner.actorId, list, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryListX64Packet.BuildPacket(owner.actorId, list, ref currentIndex)); | ||||
|                 else if (list.Count - currentIndex >= 32) | ||||
|                     owner.queuePacket(InventoryListX32Packet.buildPacket(owner.actorId, list, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryListX32Packet.BuildPacket(owner.actorId, list, ref currentIndex)); | ||||
|                 else if (list.Count - currentIndex >= 16) | ||||
|                     owner.queuePacket(InventoryListX16Packet.buildPacket(owner.actorId, list, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryListX16Packet.BuildPacket(owner.actorId, list, ref currentIndex)); | ||||
|                 else if (list.Count - currentIndex > 1) | ||||
|                     owner.queuePacket(InventoryListX08Packet.buildPacket(owner.actorId, list, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryListX08Packet.BuildPacket(owner.actorId, list, ref currentIndex)); | ||||
|                 else if (list.Count - currentIndex == 1) | ||||
|                 { | ||||
|                     owner.queuePacket(InventoryListX01Packet.buildPacket(owner.actorId, list[currentIndex])); | ||||
|                     owner.QueuePacket(InventoryListX01Packet.BuildPacket(owner.actorId, list[currentIndex])); | ||||
|                     currentIndex++; | ||||
|                 } | ||||
|                 else | ||||
| @@ -405,28 +405,28 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|  | ||||
|         } | ||||
|  | ||||
|         private void sendInventoryRemovePackets(ushort index) | ||||
|         private void SendInventoryRemovePackets(ushort index) | ||||
|         { | ||||
|             owner.queuePacket(InventoryRemoveX01Packet.buildPacket(owner.actorId, index)); | ||||
|             owner.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, index)); | ||||
|         } | ||||
|  | ||||
|         private void sendInventoryRemovePackets(List<ushort> indexes) | ||||
|         private void SendInventoryRemovePackets(List<ushort> indexes) | ||||
|         { | ||||
|             int currentIndex = 0; | ||||
|  | ||||
|             while (true) | ||||
|             { | ||||
|                 if (indexes.Count - currentIndex >= 64) | ||||
|                     owner.queuePacket(InventoryRemoveX64Packet.buildPacket(owner.actorId, indexes, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryRemoveX64Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); | ||||
|                 else if (indexes.Count - currentIndex >= 32) | ||||
|                     owner.queuePacket(InventoryRemoveX32Packet.buildPacket(owner.actorId, indexes, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryRemoveX32Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); | ||||
|                 else if (indexes.Count - currentIndex >= 16) | ||||
|                     owner.queuePacket(InventoryRemoveX16Packet.buildPacket(owner.actorId, indexes, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryRemoveX16Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); | ||||
|                 else if (indexes.Count - currentIndex > 1) | ||||
|                     owner.queuePacket(InventoryRemoveX08Packet.buildPacket(owner.actorId, indexes, ref currentIndex)); | ||||
|                     owner.QueuePacket(InventoryRemoveX08Packet.BuildPacket(owner.actorId, indexes, ref currentIndex)); | ||||
|                 else if (indexes.Count - currentIndex == 1) | ||||
|                 { | ||||
|                     owner.queuePacket(InventoryRemoveX01Packet.buildPacket(owner.actorId, indexes[currentIndex])); | ||||
|                     owner.QueuePacket(InventoryRemoveX01Packet.BuildPacket(owner.actorId, indexes[currentIndex])); | ||||
|                     currentIndex++; | ||||
|                 } | ||||
|                 else | ||||
| @@ -439,18 +439,18 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|  | ||||
|         #region Inventory Utils | ||||
|  | ||||
|         public bool isFull() | ||||
|         public bool IsFull() | ||||
|         { | ||||
|             return list.Count >= inventoryCapacity; | ||||
|         } | ||||
|          | ||||
|         public bool isSpaceForAdd(uint itemId, int quantity) | ||||
|         public bool IsSpaceForAdd(uint itemId, int quantity) | ||||
|         { | ||||
|             int quantityCount = quantity; | ||||
|             for (int i = 0; i < list.Count; i++) | ||||
|             { | ||||
|                 InventoryItem item = list[i]; | ||||
|                 Item gItem = Server.getItemGamedata(item.itemId); | ||||
|                 Item gItem = Server.GetItemGamedata(item.itemId); | ||||
|                 if (item.itemId == itemId && item.quantity < gItem.maxStack) | ||||
|                 { | ||||
|                     quantityCount -= (gItem.maxStack - item.quantity); | ||||
| @@ -459,15 +459,15 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             return quantityCount <= 0 || (quantityCount > 0 && !isFull()); | ||||
|             return quantityCount <= 0 || (quantityCount > 0 && !IsFull()); | ||||
|         } | ||||
|  | ||||
|         public bool hasItem(uint itemId) | ||||
|         public bool HasItem(uint itemId) | ||||
|         { | ||||
|             return hasItem(itemId, 1); | ||||
|             return HasItem(itemId, 1); | ||||
|         } | ||||
|  | ||||
|         public bool hasItem(uint itemId, int minQuantity) | ||||
|         public bool HasItem(uint itemId, int minQuantity) | ||||
|         { | ||||
|             int count = 0; | ||||
|  | ||||
| @@ -483,7 +483,7 @@ namespace FFXIVClassic_Map_Server.actors.chara.player | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         public int getNextEmptySlot() | ||||
|         public int GetNextEmptySlot() | ||||
|         { | ||||
|             return list.Count == 0 ? 0 : list.Count();                 | ||||
|         } | ||||
|   | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -18,24 +18,24 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             this.className = "Debug"; | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         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); | ||||
|             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) | ||||
|         public override BasePacket GetSpawnPackets(uint playerActorId) | ||||
|         { | ||||
|             List<SubPacket> subpackets = new List<SubPacket>(); | ||||
|             subpackets.Add(createAddActorPacket(playerActorId, 0));             | ||||
|             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); | ||||
|             subpackets.Add(CreateAddActorPacket(playerActorId, 0));             | ||||
|             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); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|   | ||||
| @@ -15,35 +15,35 @@ namespace FFXIVClassic_Map_Server.actors.director | ||||
|             this.owner = owner; | ||||
|         } | ||||
|  | ||||
|         public virtual BasePacket getSpawnPackets(uint playerActorId, uint spawnType) | ||||
|         public virtual BasePacket GetSpawnPackets(uint playerActorId, uint spawnType) | ||||
|         { | ||||
|             List<SubPacket> subpackets = new List<SubPacket>(); | ||||
|             subpackets.Add(createAddActorPacket(playerActorId, 0)); | ||||
|             subpackets.AddRange(getEventConditionPackets(playerActorId)); | ||||
|             subpackets.Add(createSpeedPacket(playerActorId)); | ||||
|             subpackets.Add(createSpawnPositonPacket(playerActorId, 0)); | ||||
|             subpackets.Add(createNamePacket(playerActorId)); | ||||
|             subpackets.Add(createStatePacket(playerActorId)); | ||||
|             subpackets.Add(createIsZoneingPacket(playerActorId)); | ||||
|             subpackets.Add(createScriptBindPacket(playerActorId)); | ||||
|             return BasePacket.createPacket(subpackets, true, false); | ||||
|             subpackets.Add(CreateAddActorPacket(playerActorId, 0)); | ||||
|             subpackets.AddRange(GetEventConditionPackets(playerActorId)); | ||||
|             subpackets.Add(CreateSpeedPacket(playerActorId)); | ||||
|             subpackets.Add(CreateSpawnPositonPacket(playerActorId, 0)); | ||||
|             subpackets.Add(CreateNamePacket(playerActorId)); | ||||
|             subpackets.Add(CreateStatePacket(playerActorId)); | ||||
|             subpackets.Add(CreateIsZoneingPacket(playerActorId)); | ||||
|             subpackets.Add(CreateScriptBindPacket(playerActorId)); | ||||
|             return BasePacket.CreatePacket(subpackets, true, false); | ||||
|         }         | ||||
|  | ||||
|         public override BasePacket getInitPackets(uint playerActorId) | ||||
|         public override BasePacket GetInitPackets(uint playerActorId) | ||||
|         { | ||||
|             SetActorPropetyPacket initProperties = new SetActorPropetyPacket("/_init"); | ||||
|             initProperties.addTarget(); | ||||
|             return BasePacket.createPacket(initProperties.buildPacket(playerActorId, actorId), true, false); | ||||
|             initProperties.AddTarget(); | ||||
|             return BasePacket.CreatePacket(initProperties.BuildPacket(playerActorId, actorId), true, false); | ||||
|         } | ||||
|  | ||||
|         public void onTalked(Npc npc) | ||||
|         public void OnTalked(Npc npc) | ||||
|         { | ||||
|             LuaEngine.doDirectorOnTalked(this, owner, npc); | ||||
|             LuaEngine.DoDirectorOnTalked(this, owner, npc); | ||||
|         } | ||||
|  | ||||
|         public void onCommand(Command command) | ||||
|         public void OnCommand(Command command) | ||||
|         { | ||||
|             LuaEngine.doDirectorOnCommand(this, owner, command); | ||||
|             LuaEngine.DoDirectorOnCommand(this, owner, command); | ||||
|         } | ||||
|  | ||||
|     }     | ||||
|   | ||||
| @@ -30,11 +30,11 @@ namespace FFXIVClassic_Map_Server.actors.director | ||||
|             this.eventConditions.noticeEventConditions = noticeEventList; | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         public override SubPacket CreateScriptBindPacket(uint playerActorId) | ||||
|         { | ||||
|             List<LuaParam> lParams; | ||||
|             lParams = LuaUtils.createLuaParamList("/Director/OpeningDirector", false, false, false, false, 0x13881); | ||||
|             return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|             lParams = LuaUtils.CreateLuaParamList("/Director/OpeningDirector", false, false, false, false, 0x13881); | ||||
|             return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -25,24 +25,24 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             this.className = "Debug"; | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         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); | ||||
|             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) | ||||
|         public override BasePacket GetSpawnPackets(uint playerActorId) | ||||
|         { | ||||
|             List<SubPacket> subpackets = new List<SubPacket>(); | ||||
|             subpackets.Add(createAddActorPacket(playerActorId, 0));             | ||||
|             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); | ||||
|             subpackets.Add(CreateAddActorPacket(playerActorId, 0));             | ||||
|             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); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -27,11 +27,11 @@ namespace FFXIVClassic_Map_Server.actors.director | ||||
|             this.eventConditions.noticeEventConditions = noticeEventList; | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         public override SubPacket CreateScriptBindPacket(uint playerActorId) | ||||
|         { | ||||
|             List<LuaParam> lParams; | ||||
|             lParams = LuaUtils.createLuaParamList("/Director/Quest/QuestDirectorMan0g001", false, false, false, false, false, 0x753A); | ||||
|             return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|             lParams = LuaUtils.CreateLuaParamList("/Director/Quest/QuestDirectorMan0g001", false, false, false, false, false, 0x753A); | ||||
|             return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -27,11 +27,11 @@ namespace FFXIVClassic_Map_Server.actors.director | ||||
|             this.eventConditions.noticeEventConditions = noticeEventList; | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         public override SubPacket CreateScriptBindPacket(uint playerActorId) | ||||
|         { | ||||
|             List<LuaParam> lParams; | ||||
|             lParams = LuaUtils.createLuaParamList("/Director/Quest/QuestDirectorMan0l001", false, false, false, false, false, 0x7532); | ||||
|             return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|             lParams = LuaUtils.CreateLuaParamList("/Director/Quest/QuestDirectorMan0l001", false, false, false, false, false, 0x7532); | ||||
|             return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -27,11 +27,11 @@ namespace FFXIVClassic_Map_Server.actors.director | ||||
|             this.eventConditions.noticeEventConditions = noticeEventList; | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         public override SubPacket CreateScriptBindPacket(uint playerActorId) | ||||
|         { | ||||
|             List<LuaParam> lParams; | ||||
|             lParams = LuaUtils.createLuaParamList("/Director/Quest/QuestDirectorMan0u001", false, false, false, false, false, 0x757F); | ||||
|             return ActorInstantiatePacket.buildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|             lParams = LuaUtils.CreateLuaParamList("/Director/Quest/QuestDirectorMan0u001", false, false, false, false, false, 0x757F); | ||||
|             return ActorInstantiatePacket.BuildPacket(actorId, playerActorId, actorName, className, lParams); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -115,7 +115,7 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|  | ||||
|         public void SaveData() | ||||
|         { | ||||
|             Database.saveQuest(owner, this); | ||||
|             Database.SaveQuest(owner, this); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|   | ||||
| @@ -16,24 +16,24 @@ namespace FFXIVClassic_Map_Server.Actors | ||||
|             this.className = "WorldMaster"; | ||||
|         } | ||||
|  | ||||
|         public override SubPacket createScriptBindPacket(uint playerActorId) | ||||
|         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); | ||||
|             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) | ||||
|         public override BasePacket GetSpawnPackets(uint playerActorId) | ||||
|         { | ||||
|             List<SubPacket> subpackets = new List<SubPacket>(); | ||||
|             subpackets.Add(createAddActorPacket(playerActorId, 0)); | ||||
|             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); | ||||
|             subpackets.Add(CreateAddActorPacket(playerActorId, 0)); | ||||
|             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); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -29,7 +29,7 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|             actorInstanceList.Add(playerActor); | ||||
|         } | ||||
|  | ||||
|         public void setConnection(int type, ClientConnection conn) | ||||
|         public void SetConnection(int type, ClientConnection conn) | ||||
|         { | ||||
|             conn.connType = type; | ||||
|             switch (type) | ||||
| @@ -43,55 +43,55 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|             } | ||||
|         } | ||||
|         | ||||
|         public bool isClientConnectionsReady() | ||||
|         public bool IsClientConnectionsReady() | ||||
|         { | ||||
|             return (zoneConnection != null && chatConnection != null); | ||||
|         } | ||||
|  | ||||
|         public void disconnect() | ||||
|         public void Disconnect() | ||||
|         { | ||||
|             zoneConnection.disconnect(); | ||||
|             chatConnection.disconnect(); | ||||
|             zoneConnection.Disconnect(); | ||||
|             chatConnection.Disconnect(); | ||||
|         }       | ||||
|  | ||||
|         public bool isDisconnected() | ||||
|         public bool IsDisconnected() | ||||
|         { | ||||
|             return (!zoneConnection.isConnected() && !chatConnection.isConnected()); | ||||
|             return (!zoneConnection.IsConnected() && !chatConnection.IsConnected()); | ||||
|         } | ||||
|  | ||||
|         public void queuePacket(BasePacket basePacket) | ||||
|         public void QueuePacket(BasePacket basePacket) | ||||
|         { | ||||
|             zoneConnection.queuePacket(basePacket); | ||||
|             zoneConnection.QueuePacket(basePacket); | ||||
|         } | ||||
|  | ||||
|         public void queuePacket(SubPacket subPacket, bool isAuthed, bool isEncrypted) | ||||
|         public void QueuePacket(SubPacket subPacket, bool isAuthed, bool isEncrypted) | ||||
|         { | ||||
|                 zoneConnection.queuePacket(subPacket, isAuthed, isEncrypted); | ||||
|                 zoneConnection.QueuePacket(subPacket, isAuthed, isEncrypted); | ||||
|         } | ||||
|  | ||||
|         public Player getActor() | ||||
|         public Player GetActor() | ||||
|         { | ||||
|             return playerActor; | ||||
|         } | ||||
|  | ||||
|         public void ping() | ||||
|         public void Ping() | ||||
|         { | ||||
|             lastPingPacket = Utils.UnixTimeStampUTC(); | ||||
|         } | ||||
|  | ||||
|         public bool checkIfDCing() | ||||
|         public bool CheckIfDCing() | ||||
|         { | ||||
|             uint currentTime = Utils.UnixTimeStampUTC(); | ||||
|             if (currentTime - lastPingPacket >= 5000) //Show D/C flag | ||||
|                 playerActor.setDCFlag(true); | ||||
|                 playerActor.SetDCFlag(true); | ||||
|             else if (currentTime - lastPingPacket >= 30000) //DCed | ||||
|                 return true; | ||||
|             else | ||||
|                 playerActor.setDCFlag(false); | ||||
|                 playerActor.SetDCFlag(false); | ||||
|             return false; | ||||
|         } | ||||
|  | ||||
|         public void updatePlayerActorPosition(float x, float y, float z, float rot, ushort moveState) | ||||
|         public void UpdatePlayerActorPosition(float x, float y, float z, float rot, ushort moveState) | ||||
|         {             | ||||
|             playerActor.oldPositionX = playerActor.positionX; | ||||
|             playerActor.oldPositionY = playerActor.positionY; | ||||
| @@ -104,11 +104,11 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|             playerActor.rotation = rot; | ||||
|             playerActor.moveState = moveState; | ||||
|  | ||||
|             getActor().zone.updateActorPosition(getActor()); | ||||
|             GetActor().zone.UpdateActorPosition(GetActor()); | ||||
|               | ||||
|         }             | ||||
|          | ||||
|         public void updateInstance(List<Actor> list) | ||||
|         public void UpdateInstance(List<Actor> list) | ||||
|         {             | ||||
|             List<BasePacket> basePackets = new List<BasePacket>(); | ||||
|             List<SubPacket> removeActorSubpackets = new List<SubPacket>(); | ||||
| @@ -119,7 +119,7 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|             { | ||||
|                 if (!list.Contains(actorInstanceList[i])) | ||||
|                 { | ||||
|                     getActor().queuePacket(RemoveActorPacket.buildPacket(playerActor.actorId, actorInstanceList[i].actorId)); | ||||
|                     GetActor().QueuePacket(RemoveActorPacket.BuildPacket(playerActor.actorId, actorInstanceList[i].actorId)); | ||||
|                     actorInstanceList.RemoveAt(i);                     | ||||
|                 } | ||||
|             } | ||||
| @@ -134,18 +134,18 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|  | ||||
|                 if (actorInstanceList.Contains(actor)) | ||||
|                 { | ||||
|                     getActor().queuePacket(actor.createPositionUpdatePacket(playerActor.actorId)); | ||||
|                     GetActor().QueuePacket(actor.CreatePositionUpdatePacket(playerActor.actorId)); | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     getActor().queuePacket(actor.getSpawnPackets(playerActor.actorId, 1)); | ||||
|                     getActor().queuePacket(actor.getInitPackets(playerActor.actorId)); | ||||
|                     getActor().queuePacket(actor.getSetEventStatusPackets(playerActor.actorId));                    | ||||
|                     GetActor().QueuePacket(actor.GetSpawnPackets(playerActor.actorId, 1)); | ||||
|                     GetActor().QueuePacket(actor.GetInitPackets(playerActor.actorId)); | ||||
|                     GetActor().QueuePacket(actor.GetSetEventStatusPackets(playerActor.actorId));                    | ||||
|                     actorInstanceList.Add(actor); | ||||
|  | ||||
|                     if (actor is Npc) | ||||
|                     { | ||||
|                         LuaEngine.doActorOnSpawn(getActor(), (Npc)actor); | ||||
|                         LuaEngine.DoActorOnSpawn(GetActor(), (Npc)actor); | ||||
|                     } | ||||
|                 } | ||||
|             } | ||||
| @@ -153,7 +153,7 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|         } | ||||
|  | ||||
|  | ||||
|         public void clearInstance() | ||||
|         public void ClearInstance() | ||||
|         { | ||||
|             actorInstanceList.Clear(); | ||||
|         } | ||||
|   | ||||
| @@ -3,7 +3,7 @@ | ||||
|     class DBWorld | ||||
|     { | ||||
|         public ushort id; | ||||
|         public string address; | ||||
|         public string Address; | ||||
|         public ushort port; | ||||
|         public ushort listPosition; | ||||
|         public ushort population; | ||||
|   | ||||
| @@ -30,7 +30,7 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|             this.quantity = 1; | ||||
|             this.slot = slot; | ||||
|  | ||||
|             Item gItem = Server.getItemGamedata(itemId); | ||||
|             Item gItem = Server.GetItemGamedata(itemId); | ||||
|             itemType = gItem.isExclusive ? (byte)0x3 : (byte)0x0; | ||||
|         } | ||||
|  | ||||
| @@ -72,7 +72,7 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|             this.materia5 = materia5; | ||||
|         } | ||||
|  | ||||
|         public byte[] toPacketBytes() | ||||
|         public byte[] ToPacketBytes() | ||||
|         {            | ||||
|             byte[] data = new byte[0x70]; | ||||
|  | ||||
|   | ||||
| @@ -378,7 +378,7 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|             return -1; | ||||
|         } | ||||
|  | ||||
|         public double getItemHQValue(float value1, float value2) | ||||
|         public Double GetItemHQValue(float value1, float value2) | ||||
|         { | ||||
|             return Math.Max(value1 + 1, Math.Ceiling(value1 * value2)); | ||||
|         } | ||||
| @@ -420,7 +420,7 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|         public readonly int paramBonusType10; | ||||
|         public readonly short paramBonusValue10; | ||||
|  | ||||
|         public readonly short additionalEffect; | ||||
|         public readonly short AdditionalEffect; | ||||
|         public readonly bool materialBindPermission; | ||||
|         public readonly short materializeTable; | ||||
|  | ||||
| @@ -459,7 +459,7 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|             paramBonusType10 = reader.GetInt32("paramBonusType10"); | ||||
|             paramBonusValue10 = reader.GetInt16("paramBonusValue10"); | ||||
|  | ||||
|             additionalEffect = reader.GetInt16("additionalEffect"); | ||||
|             AdditionalEffect = reader.GetInt16("additionalEffect"); | ||||
|             materialBindPermission = reader.GetBoolean("materiaBindPermission"); | ||||
|             materializeTable = reader.GetInt16("materializeTable"); | ||||
|         } | ||||
|   | ||||
| @@ -16,7 +16,7 @@ namespace FFXIVClassic_Map_Server.dataobjects | ||||
|         public ushort[] classes = new ushort[2 * 20]; | ||||
|         public ushort[] jobs = new ushort[8]; | ||||
|  | ||||
|         public void writeSearchEntry(BinaryWriter writer) | ||||
|         public void WriteSearchEntry(BinaryWriter writer) | ||||
|         { | ||||
|             writer.Write((UInt16)preferredClass); | ||||
|             writer.Write((UInt16)langauges); | ||||
|   | ||||
| @@ -28,13 +28,13 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             UserData.RegistrationPolicy = InteropRegistrationPolicy.Automatic; | ||||
|         } | ||||
|  | ||||
|         public static List<LuaParam> doActorInstantiate(Player player, Actor target) | ||||
|         public static List<LuaParam> DoActorInstantiate(Player player, Actor target) | ||||
|         { | ||||
|             string luaPath; | ||||
|  | ||||
|             if (target is Npc) | ||||
|             { | ||||
|                 luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.getName()); | ||||
|                 luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName()); | ||||
|                 if (File.Exists(luaPath)) | ||||
|                 {                     | ||||
|                     Script script = loadScript(luaPath); | ||||
| @@ -43,12 +43,12 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|                         return null; | ||||
|  | ||||
|                     DynValue result = script.Call(script.Globals["init"], target); | ||||
|                     List<LuaParam> lparams = LuaUtils.createLuaParamList(result); | ||||
|                     List<LuaParam> lparams = LuaUtils.CreateLuaParamList(result); | ||||
|                     return lparams; | ||||
|                 } | ||||
|                 else | ||||
|                 { | ||||
|                     SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.getName())); | ||||
|                     SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName())); | ||||
|                     return null; | ||||
|                 } | ||||
|             } | ||||
| @@ -56,20 +56,20 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             return null; | ||||
|         }        | ||||
|  | ||||
|         public static void doActorOnEventStarted(Player player, Actor target, EventStartPacket eventStart) | ||||
|         public static void DoActorOnEventStarted(Player player, Actor target, EventStartPacket eventStart) | ||||
|         { | ||||
|             string luaPath; | ||||
|  | ||||
|             if (target is Command) | ||||
|             { | ||||
|                 luaPath = String.Format(FILEPATH_COMMANDS, target.getName()); | ||||
|                 luaPath = String.Format(FILEPATH_COMMANDS, target.GetName()); | ||||
|             } | ||||
|             else if (target is Director) | ||||
|             { | ||||
|                 luaPath = String.Format(FILEPATH_DIRECTORS, target.getName()); | ||||
|                 luaPath = String.Format(FILEPATH_DIRECTORS, target.GetName()); | ||||
|             } | ||||
|             else  | ||||
|                 luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.getName()); | ||||
|                 luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName()); | ||||
|  | ||||
|             if (File.Exists(luaPath)) | ||||
|             { | ||||
| @@ -78,14 +78,14 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|                 if (script == null) | ||||
|                     return; | ||||
|  | ||||
|                 //Have to do this to combine LuaParams | ||||
|                 //Have to Do this to combine LuaParams | ||||
|                 List<Object> objects = new List<Object>(); | ||||
|                 objects.Add(player); | ||||
|                 objects.Add(target); | ||||
|                 objects.Add(eventStart.triggerName); | ||||
|  | ||||
|                 if (eventStart.luaParams != null) | ||||
|                     objects.AddRange(LuaUtils.createLuaParamObjectList(eventStart.luaParams)); | ||||
|                     objects.AddRange(LuaUtils.CreateLuaParamObjectList(eventStart.luaParams)); | ||||
|  | ||||
|                 //Run Script | ||||
|                 if (!script.Globals.Get("onEventStarted").IsNil()) | ||||
| @@ -93,14 +93,14 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.getName())); | ||||
|                 SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName())); | ||||
|             } | ||||
|             | ||||
|         } | ||||
|  | ||||
|         public static void doActorOnSpawn(Player player, Npc target) | ||||
|         public static void DoActorOnSpawn(Player player, Npc target) | ||||
|         { | ||||
|             string luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.getName()); | ||||
|             string luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName()); | ||||
|  | ||||
|             if (File.Exists(luaPath)) | ||||
|             { | ||||
| @@ -115,21 +115,21 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.getName())); | ||||
|                 SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName())); | ||||
|             } | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public static void doActorOnEventUpdated(Player player, Actor target, EventUpdatePacket eventUpdate) | ||||
|         public static void DoActorOnEventUpdated(Player player, Actor target, EventUpdatePacket eventUpdate) | ||||
|         { | ||||
|             string luaPath;  | ||||
|  | ||||
|             if (target is Command)             | ||||
|                 luaPath = String.Format(FILEPATH_COMMANDS, target.getName()); | ||||
|                 luaPath = String.Format(FILEPATH_COMMANDS, target.GetName()); | ||||
|             else if (target is Director) | ||||
|                 luaPath = String.Format(FILEPATH_DIRECTORS, target.getName());             | ||||
|                 luaPath = String.Format(FILEPATH_DIRECTORS, target.GetName());             | ||||
|             else | ||||
|                 luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.getName()); | ||||
|                 luaPath = String.Format(FILEPATH_NPCS, target.zoneId, target.GetName()); | ||||
|  | ||||
|             if (File.Exists(luaPath)) | ||||
|             { | ||||
| @@ -138,12 +138,12 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|                 if (script == null) | ||||
|                     return; | ||||
|  | ||||
|                 //Have to do this to combine LuaParams | ||||
|                 //Have to Do this to combine LuaParams | ||||
|                 List<Object> objects = new List<Object>(); | ||||
|                 objects.Add(player); | ||||
|                 objects.Add(target); | ||||
|                 objects.Add(eventUpdate.val2); | ||||
|                 objects.AddRange(LuaUtils.createLuaParamObjectList(eventUpdate.luaParams)); | ||||
|                 objects.AddRange(LuaUtils.CreateLuaParamObjectList(eventUpdate.luaParams)); | ||||
|  | ||||
|                 //Run Script | ||||
|                 if (!script.Globals.Get("onEventUpdate").IsNil()) | ||||
| @@ -151,13 +151,13 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.getName())); | ||||
|                 SendError(player, String.Format("ERROR: Could not find script for actor {0}.", target.GetName())); | ||||
|             }                   | ||||
|         } | ||||
|  | ||||
|         public static void onZoneIn(Player player) | ||||
|         public static void OnZoneIn(Player player) | ||||
|         { | ||||
|             string luaPath = String.Format(FILEPATH_ZONE, player.getZone().actorId); | ||||
|             string luaPath = String.Format(FILEPATH_ZONE, player.GetZone().actorId); | ||||
|            | ||||
|             if (File.Exists(luaPath)) | ||||
|             { | ||||
| @@ -172,7 +172,7 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             }             | ||||
|         } | ||||
|  | ||||
|         public static void onBeginLogin(Player player) | ||||
|         public static void OnBeginLogin(Player player) | ||||
|         { | ||||
|             if (File.Exists(FILEPATH_PLAYER)) | ||||
|             { | ||||
| @@ -187,7 +187,7 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static void onLogin(Player player) | ||||
|         public static void OnLogin(Player player) | ||||
|         { | ||||
|             if (File.Exists(FILEPATH_PLAYER)) | ||||
|             { | ||||
| @@ -207,9 +207,9 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             Script script = new Script(); | ||||
|             ((FileSystemScriptLoader)script.Options.ScriptLoader).ModulePaths = FileSystemScriptLoader.UnpackStringPaths("./scripts/?;./scripts/?.lua"); | ||||
|             script.Globals["getWorldManager"] = (Func<WorldManager>)Server.GetWorldManager; | ||||
|             script.Globals["getStaticActor"] = (Func<string, Actor>)Server.getStaticActors; | ||||
|             script.Globals["getStaticActor"] = (Func<string, Actor>)Server.GetStaticActors; | ||||
|             script.Globals["getWorldMaster"] = (Func<Actor>)Server.GetWorldManager().GetActor; | ||||
|             script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.getItemGamedata; | ||||
|             script.Globals["getItemGamedata"] = (Func<uint, Item>)Server.GetItemGamedata; | ||||
|  | ||||
|             try | ||||
|             { | ||||
| @@ -225,16 +225,16 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|  | ||||
|         private static void SendError(Player player, string message) | ||||
|         { | ||||
|             List<SubPacket> sendError = new List<SubPacket>(); | ||||
|             sendError.Add(EndEventPacket.buildPacket(player.actorId, player.currentEventOwner, player.currentEventName)); | ||||
|             player.sendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", message); | ||||
|             player.playerSession.queuePacket(BasePacket.createPacket(sendError, true, false)); | ||||
|             List<SubPacket> SendError = new List<SubPacket>(); | ||||
|             SendError.Add(EndEventPacket.BuildPacket(player.actorId, player.currentEventOwner, player.currentEventName)); | ||||
|             player.SendMessage(SendMessagePacket.MESSAGE_TYPE_SYSTEM_ERROR, "", message); | ||||
|             player.playerSession.QueuePacket(BasePacket.CreatePacket(SendError, true, false)); | ||||
|         } | ||||
|  | ||||
|  | ||||
|         internal static void doDirectorOnTalked(Director director, Player player, Npc npc) | ||||
|         internal static void DoDirectorOnTalked(Director director, Player player, Npc npc) | ||||
|         { | ||||
|             string luaPath = String.Format(FILEPATH_DIRECTORS, director.getName()); | ||||
|             string luaPath = String.Format(FILEPATH_DIRECTORS, director.GetName()); | ||||
|  | ||||
|             if (File.Exists(luaPath)) | ||||
|             { | ||||
| @@ -249,13 +249,13 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 SendError(player, String.Format("ERROR: Could not find script for director {0}.", director.getName())); | ||||
|                 SendError(player, String.Format("ERROR: Could not find script for director {0}.", director.GetName())); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         internal static void doDirectorOnCommand(Director director, Player player, Command command) | ||||
|         internal static void DoDirectorOnCommand(Director director, Player player, Command command) | ||||
|         { | ||||
|             string luaPath = String.Format(FILEPATH_DIRECTORS, director.getName()); | ||||
|             string luaPath = String.Format(FILEPATH_DIRECTORS, director.GetName()); | ||||
|  | ||||
|             if (File.Exists(luaPath)) | ||||
|             { | ||||
| @@ -270,7 +270,7 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             } | ||||
|             else | ||||
|             { | ||||
|                 SendError(player, String.Format("ERROR: Could not find script for director {0}.", director.getName())); | ||||
|                 SendError(player, String.Format("ERROR: Could not find script for director {0}.", director.GetName())); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -2,12 +2,12 @@ | ||||
| { | ||||
|     class LuaEvent | ||||
|     { | ||||
|         public static void getStep() | ||||
|         public static void GetStep() | ||||
|         { | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public static void getParam() | ||||
|         public static void GetParam() | ||||
|         { | ||||
|  | ||||
|         } | ||||
|   | ||||
| @@ -15,55 +15,55 @@ namespace FFXIVClassic_Map_Server.lua | ||||
|             this.player = player; | ||||
|         } | ||||
|  | ||||
|         public void setMusic(ushort musicID, ushort playMode) | ||||
|         public void SetMusic(ushort musicID, ushort playMode) | ||||
|         { | ||||
|             player.playerSession.queuePacket(SetMusicPacket.buildPacket(player.actorId, musicID, playMode), true, false); | ||||
|             player.playerSession.QueuePacket(SetMusicPacket.BuildPacket(player.actorId, musicID, playMode), true, false); | ||||
|         } | ||||
|  | ||||
|         public void setWeather(ushort weatherID) | ||||
|         public void SetWeather(ushort weatherID) | ||||
|         { | ||||
|             player.playerSession.queuePacket(SetWeatherPacket.buildPacket(player.actorId, weatherID, 1), true, false); | ||||
|             player.playerSession.QueuePacket(SetWeatherPacket.BuildPacket(player.actorId, weatherID, 1), true, false); | ||||
|         } | ||||
|  | ||||
|         public void getParameter(string paramName) | ||||
|         public void GetParameter(string paramName) | ||||
|         { | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public void setParameter(string paramName, object value, string uiToRefresh) | ||||
|         public void SetParameter(string paramName, object value, string uiToRefresh) | ||||
|         { | ||||
|              | ||||
|         } | ||||
|  | ||||
|         public void getAttributePoints() | ||||
|         public void GetAttributePoints() | ||||
|         { | ||||
|              | ||||
|         } | ||||
|  | ||||
|         public void setAttributePoints(int str, int vit, int dex, int inte, int min, int pie) | ||||
|         public void SetAttributePoints(int str, int vit, int dex, int inte, int min, int pie) | ||||
|         { | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public void logout() | ||||
|         public void Logout() | ||||
|         { | ||||
|             player.playerSession.queuePacket(LogoutPacket.buildPacket(player.actorId), true, false); | ||||
|             player.playerSession.QueuePacket(LogoutPacket.BuildPacket(player.actorId), true, false); | ||||
|         } | ||||
|  | ||||
|         public void quitGame() | ||||
|         public void QuitGame() | ||||
|         { | ||||
|             player.playerSession.queuePacket(QuitPacket.buildPacket(player.actorId), true, false); | ||||
|             player.playerSession.QueuePacket(QuitPacket.BuildPacket(player.actorId), true, false); | ||||
|         } | ||||
|  | ||||
|         public void runEvent(string functionName, params object[] parameters) | ||||
|         public void RunEvent(string functionName, params object[] parameters) | ||||
|         { | ||||
|             List<LuaParam> lParams = LuaUtils.createLuaParamList(parameters); | ||||
|         //    player.playerSession.queuePacket(RunEventFunctionPacket.buildPacket(player.actorId, player.eventCurrentOwner, player.eventCurrentStarter, functionName, lParams), true, false); | ||||
|             List<LuaParam> lParams = LuaUtils.CreateLuaParamList(parameters); | ||||
|         //    player.playerSession.QueuePacket(RunEventFunctionPacket.BuildPacket(player.actorId, player.eventCurrentOwner, player.eventCurrentStarter, functionName, lParams), true, false); | ||||
|         } | ||||
|  | ||||
|         public void endEvent() | ||||
|         public void EndEvent() | ||||
|         { | ||||
|           //  player.playerSession.queuePacket(EndEventPacket.buildPacket(player.actorId, player.eventCurrentOwner, player.eventCurrentStarter), true, false); | ||||
|           //  player.playerSession.QueuePacket(EndEventPacket.BuildPacket(player.actorId, player.eventCurrentOwner, player.eventCurrentStarter), true, false); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|   | ||||
| @@ -40,7 +40,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static List<LuaParam> readLuaParams(BinaryReader reader) | ||||
|         public static List<LuaParam> ReadLuaParams(BinaryReader reader) | ||||
|         { | ||||
|             List<LuaParam> luaParams = new List<LuaParam>(); | ||||
|  | ||||
| @@ -54,10 +54,10 @@ namespace FFXIVClassic_Map_Server | ||||
|                 switch (code) | ||||
|                 { | ||||
|                     case 0x0: //Int32 | ||||
|                         value = Utils.swapEndian(reader.ReadInt32());                         | ||||
|                         value = Utils.SwapEndian(reader.ReadInt32());                         | ||||
|                         break; | ||||
|                     case 0x1: //Int32 | ||||
|                         value = Utils.swapEndian(reader.ReadUInt32());         | ||||
|                         value = Utils.SwapEndian(reader.ReadUInt32());         | ||||
|                         break;           | ||||
|                     case 0x2: //Null Termed String                         | ||||
|                         List<byte> list = new List<byte>(); | ||||
| @@ -79,17 +79,17 @@ namespace FFXIVClassic_Map_Server | ||||
|                         wasNil = true; | ||||
|                         break; | ||||
|                     case 0x6: //Actor (By Id) | ||||
|                         value = Utils.swapEndian(reader.ReadUInt32()); | ||||
|                         value = Utils.SwapEndian(reader.ReadUInt32()); | ||||
|                         break; | ||||
|                     case 0x7: //Weird one used for inventory | ||||
|                         uint type7ActorId = Utils.swapEndian(reader.ReadUInt32()); | ||||
|                         uint type7ActorId = Utils.SwapEndian(reader.ReadUInt32()); | ||||
|                         byte type7Unknown = reader.ReadByte(); | ||||
|                         byte type7Slot = reader.ReadByte(); | ||||
|                         byte type7InventoryType = reader.ReadByte(); | ||||
|                         value = new Type7Param(type7ActorId, type7Unknown, type7Slot, type7InventoryType); | ||||
|                         break;   | ||||
|                     case 0x9: //Two Longs (only storing first one) | ||||
|                         value = new Type9Param(Utils.swapEndian(reader.ReadUInt64()), Utils.swapEndian(reader.ReadUInt64())); | ||||
|                         value = new Type9Param(Utils.SwapEndian(reader.ReadUInt64()), Utils.SwapEndian(reader.ReadUInt64())); | ||||
|                         break; | ||||
|                     case 0xC: //Byte | ||||
|                         value = reader.ReadByte(); | ||||
| @@ -114,7 +114,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             return luaParams; | ||||
|         } | ||||
|  | ||||
|         public static void writeLuaParams(BinaryWriter writer, List<LuaParam> luaParams) | ||||
|         public static void WriteLuaParams(BinaryWriter writer, List<LuaParam> luaParams) | ||||
|         { | ||||
|             foreach (LuaParam l in luaParams) | ||||
|             {            | ||||
| @@ -126,10 +126,10 @@ namespace FFXIVClassic_Map_Server | ||||
|                 switch (l.typeID) | ||||
|                 { | ||||
|                     case 0x0: //Int32                         | ||||
|                         writer.Write((Int32)Utils.swapEndian((Int32)l.value)); | ||||
|                         writer.Write((Int32)Utils.SwapEndian((Int32)l.value)); | ||||
|                         break; | ||||
|                     case 0x1: //Int32                         | ||||
|                         writer.Write((UInt32)Utils.swapEndian((UInt32)l.value)); | ||||
|                         writer.Write((UInt32)Utils.SwapEndian((UInt32)l.value)); | ||||
|                         break; | ||||
|                     case 0x2: //Null Termed String | ||||
|                         string sv = (string)l.value; | ||||
| @@ -143,18 +143,18 @@ namespace FFXIVClassic_Map_Server | ||||
|                     case 0x5: //Nil                         | ||||
|                         break; | ||||
|                     case 0x6: //Actor (By Id) | ||||
|                         writer.Write((UInt32)Utils.swapEndian((UInt32)l.value)); | ||||
|                         writer.Write((UInt32)Utils.SwapEndian((UInt32)l.value)); | ||||
|                         break; | ||||
|                     case 0x7: //Weird one used for inventory | ||||
|                         Type7Param type7 = (Type7Param)l.value; | ||||
|                         writer.Write((UInt32)Utils.swapEndian((UInt32)type7.actorId)); | ||||
|                         writer.Write((UInt32)Utils.SwapEndian((UInt32)type7.actorId)); | ||||
|                         writer.Write((Byte)type7.unknown); | ||||
|                         writer.Write((Byte)type7.slot); | ||||
|                         writer.Write((Byte)type7.inventoryType); | ||||
|                         break; | ||||
|                     case 0x9: //Two Longs (only storing first one) | ||||
|                         writer.Write((UInt64)Utils.swapEndian(((Type9Param)l.value).item1)); | ||||
|                         writer.Write((UInt64)Utils.swapEndian(((Type9Param)l.value).item2)); | ||||
|                         writer.Write((UInt64)Utils.SwapEndian(((Type9Param)l.value).item1)); | ||||
|                         writer.Write((UInt64)Utils.SwapEndian(((Type9Param)l.value).item2)); | ||||
|                         break; | ||||
|                     case 0xC: //Byte | ||||
|                         writer.Write((Byte)l.value); | ||||
| @@ -169,7 +169,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             writer.Write((Byte)0xF); | ||||
|         } | ||||
|  | ||||
|         public static List<LuaParam> readLuaParams(byte[] bytesIn) | ||||
|         public static List<LuaParam> ReadLuaParams(byte[] bytesIn) | ||||
|         { | ||||
|             List<LuaParam> luaParams = new List<LuaParam>();             | ||||
|  | ||||
| @@ -187,10 +187,10 @@ namespace FFXIVClassic_Map_Server | ||||
|                         switch (code) | ||||
|                         { | ||||
|                             case 0x0: //Int32 | ||||
|                                 value = Utils.swapEndian(reader.ReadInt32()); | ||||
|                                 value = Utils.SwapEndian(reader.ReadInt32()); | ||||
|                                 break; | ||||
|                             case 0x1: //Int32 | ||||
|                                 value = Utils.swapEndian(reader.ReadUInt32()); | ||||
|                                 value = Utils.SwapEndian(reader.ReadUInt32()); | ||||
|                                 break; | ||||
|                             case 0x2: //Null Termed String                         | ||||
|                                 List<byte> list = new List<byte>(); | ||||
| @@ -213,17 +213,17 @@ namespace FFXIVClassic_Map_Server | ||||
|                                 wasNil = true; | ||||
|                                 break; | ||||
|                             case 0x6: //Actor (By Id) | ||||
|                                 value = Utils.swapEndian(reader.ReadUInt32()); | ||||
|                                 value = Utils.SwapEndian(reader.ReadUInt32()); | ||||
|                                 break; | ||||
|                             case 0x7: //Weird one used for inventory | ||||
|                                 uint type7ActorId = Utils.swapEndian(reader.ReadUInt32()); | ||||
|                                 uint type7ActorId = Utils.SwapEndian(reader.ReadUInt32()); | ||||
|                                 byte type7Unknown = reader.ReadByte(); | ||||
|                                 byte type7Slot = reader.ReadByte(); | ||||
|                                 byte type7InventoryType = reader.ReadByte(); | ||||
|                                 value = new Type7Param(type7ActorId, type7Unknown, type7Slot, type7InventoryType); | ||||
|                                 break; | ||||
|                             case 0x9: //Two Longs (only storing first one) | ||||
|                                 value = new Type9Param(Utils.swapEndian(reader.ReadUInt64()), Utils.swapEndian(reader.ReadUInt64())); | ||||
|                                 value = new Type9Param(Utils.SwapEndian(reader.ReadUInt64()), Utils.SwapEndian(reader.ReadUInt64())); | ||||
|                                 break; | ||||
|                             case 0xC: //Byte | ||||
|                                 value = reader.ReadByte(); | ||||
| @@ -249,7 +249,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             return luaParams; | ||||
|         } | ||||
|  | ||||
|         public static List<LuaParam> createLuaParamList(DynValue fromScript) | ||||
|         public static List<LuaParam> CreateLuaParamList(DynValue fromScript) | ||||
|         { | ||||
|             List<LuaParam> luaParams = new List<LuaParam>(); | ||||
|  | ||||
| @@ -257,16 +257,16 @@ namespace FFXIVClassic_Map_Server | ||||
|             { | ||||
|                 foreach (DynValue d in fromScript.Tuple) | ||||
|                 { | ||||
|                     addToList(d, luaParams); | ||||
|                     AddToList(d, luaParams); | ||||
|                 } | ||||
|             } | ||||
|             else | ||||
|                 addToList(fromScript, luaParams); | ||||
|                 AddToList(fromScript, luaParams); | ||||
|  | ||||
|             return luaParams; | ||||
|         } | ||||
|  | ||||
|         public static List<LuaParam> createLuaParamList(params object[] list) | ||||
|         public static List<LuaParam> CreateLuaParamList(params object[] list) | ||||
|         { | ||||
|             List<LuaParam> luaParams = new List<LuaParam>(); | ||||
|  | ||||
| @@ -276,16 +276,16 @@ namespace FFXIVClassic_Map_Server | ||||
|                 { | ||||
|                     Array arrayO = (Array)o; | ||||
|                     foreach (object o2 in arrayO) | ||||
|                         addToList(o2, luaParams); | ||||
|                         AddToList(o2, luaParams); | ||||
|                 } | ||||
|                 else | ||||
|                     addToList(o, luaParams);                      | ||||
|                     AddToList(o, luaParams);                      | ||||
|             } | ||||
|  | ||||
|             return luaParams; | ||||
|         } | ||||
|  | ||||
|         private static void addToList(DynValue d, List<LuaParam> luaParams) | ||||
|         private static void AddToList(DynValue d, List<LuaParam> luaParams) | ||||
|         { | ||||
|             if (d.Type == DataType.Number) | ||||
|             { | ||||
| @@ -316,7 +316,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         private static void addToList(object o, List<LuaParam> luaParams) | ||||
|         private static void AddToList(object o, List<LuaParam> luaParams) | ||||
|         { | ||||
|             if (o is int) | ||||
|             { | ||||
| @@ -326,7 +326,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             { | ||||
|                 luaParams.Add(new LuaParam(0x1, (uint)o)); | ||||
|             }                 | ||||
|             else if (o is double) | ||||
|             else if (o is Double) | ||||
|             { | ||||
|                 if (((double)o) % 1 == 0) | ||||
|                     luaParams.Add(new LuaParam(0x0, (int)(double)o)); | ||||
| @@ -364,7 +364,7 @@ namespace FFXIVClassic_Map_Server | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public static object[] createLuaParamObjectList(List <LuaParam> luaParams) | ||||
|         public static object[] CreateLuaParamObjectList(List <LuaParam> luaParams) | ||||
|         { | ||||
|             object[] list = new object[luaParams.Count]; | ||||
|  | ||||
| @@ -375,7 +375,7 @@ namespace FFXIVClassic_Map_Server | ||||
|         } | ||||
|      | ||||
|        | ||||
|         public static string dumpParams(List<LuaParam> lParams) | ||||
|         public static string DumpParams(List<LuaParam> lParams) | ||||
|         { | ||||
|             if (lParams == null) | ||||
|                 return "Param list was null?"; | ||||
|   | ||||
| @@ -102,7 +102,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             this.data = data; | ||||
|         } | ||||
|  | ||||
|         public List<SubPacket> getSubpackets() | ||||
|         public List<SubPacket> GetSubpackets() | ||||
|         { | ||||
|             List<SubPacket> subpackets = new List<SubPacket>(header.numSubpackets); | ||||
|  | ||||
| @@ -114,7 +114,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             return subpackets; | ||||
|         } | ||||
|  | ||||
|         public unsafe static BasePacketHeader getHeader(byte[] bytes) | ||||
|         public unsafe static BasePacketHeader GetHeader(byte[] bytes) | ||||
|         { | ||||
|             BasePacketHeader header; | ||||
|             if (bytes.Length < BASEPACKET_SIZE) | ||||
| @@ -128,7 +128,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             return header; | ||||
|         } | ||||
|  | ||||
|         public byte[] getHeaderBytes() | ||||
|         public byte[] GetHeaderBytes() | ||||
|         { | ||||
|             int size = Marshal.SizeOf(header); | ||||
|             byte[] arr = new byte[size]; | ||||
| @@ -140,16 +140,16 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             return arr; | ||||
|         } | ||||
|  | ||||
|         public byte[] getPacketBytes() | ||||
|         public byte[] GetPacketBytes() | ||||
|         { | ||||
|             byte[] outBytes = new byte[header.packetSize]; | ||||
|             Array.Copy(getHeaderBytes(), 0, outBytes, 0, BASEPACKET_SIZE); | ||||
|             Array.Copy(GetHeaderBytes(), 0, outBytes, 0, BASEPACKET_SIZE); | ||||
|             Array.Copy(data, 0, outBytes, BASEPACKET_SIZE, data.Length); | ||||
|             return outBytes; | ||||
|         } | ||||
|  | ||||
|         //Replaces all instances of the sniffed actorID with the given one | ||||
|         public void replaceActorID(uint actorID) | ||||
|         public void ReplaceActorID(uint actorID) | ||||
|         { | ||||
|             using (MemoryStream mem = new MemoryStream(data)) | ||||
|             { | ||||
| @@ -172,7 +172,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|         } | ||||
|  | ||||
|         //Replaces all instances of the sniffed actorID with the given one | ||||
|         public void replaceActorID(uint fromActorID, uint actorID) | ||||
|         public void ReplaceActorID(uint fromActorID, uint actorID) | ||||
|         { | ||||
|             using (MemoryStream mem = new MemoryStream(data)) | ||||
|             { | ||||
| @@ -195,7 +195,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|         } | ||||
|  | ||||
|         #region Utility Functions | ||||
|         public static BasePacket createPacket(List<SubPacket> subpackets, bool isAuthed, bool isCompressed) | ||||
|         public static BasePacket CreatePacket(List<SubPacket> subpackets, bool isAuthed, bool isCompressed) | ||||
|         { | ||||
|             //Create Header | ||||
|             BasePacketHeader header = new BasePacketHeader(); | ||||
| @@ -217,7 +217,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             int offset = 0; | ||||
|             foreach (SubPacket subpacket in subpackets) | ||||
|             { | ||||
|                 byte[] subpacketData = subpacket.getBytes(); | ||||
|                 byte[] subpacketData = subpacket.GetBytes(); | ||||
|                 Array.Copy(subpacketData, 0, data, offset, subpacketData.Length); | ||||
|                 offset += (ushort)subpacketData.Length; | ||||
|             } | ||||
| @@ -228,7 +228,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             return packet; | ||||
|         } | ||||
|  | ||||
|         public static BasePacket createPacket(SubPacket subpacket, bool isAuthed, bool isCompressed) | ||||
|         public static BasePacket CreatePacket(SubPacket subpacket, bool isAuthed, bool isCompressed) | ||||
|         { | ||||
|             //Create Header | ||||
|             BasePacketHeader header = new BasePacketHeader(); | ||||
| @@ -246,7 +246,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             data = new byte[header.packetSize - 0x10]; | ||||
|  | ||||
|             //Add Subpackets | ||||
|             byte[] subpacketData = subpacket.getBytes(); | ||||
|             byte[] subpacketData = subpacket.GetBytes(); | ||||
|             Array.Copy(subpacketData, 0, data, 0, subpacketData.Length);             | ||||
|  | ||||
|             Debug.Assert(data != null); | ||||
| @@ -255,7 +255,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             return packet; | ||||
|         } | ||||
|  | ||||
|         public static BasePacket createPacket(byte[] data, bool isAuthed, bool isCompressed) | ||||
|         public static BasePacket CreatePacket(byte[] data, bool isAuthed, bool isCompressed) | ||||
|         { | ||||
|  | ||||
|             Debug.Assert(data != null); | ||||
| @@ -276,7 +276,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             return packet; | ||||
|         } | ||||
|  | ||||
|         public static unsafe void encryptPacket(Blowfish blowfish, BasePacket packet) | ||||
|         public static unsafe void EncryptPacket(Blowfish blowfish, BasePacket packet) | ||||
|         { | ||||
|             byte[] data = packet.data; | ||||
|             int size = packet.header.packetSize; | ||||
| @@ -302,7 +302,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|  | ||||
|         } | ||||
|  | ||||
|         public static unsafe void decryptPacket(Blowfish blowfish, ref BasePacket packet) | ||||
|         public static unsafe void DecryptPacket(Blowfish blowfish, ref BasePacket packet) | ||||
|         { | ||||
|             byte[] data = packet.data; | ||||
|             int size = packet.header.packetSize; | ||||
| @@ -329,16 +329,16 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|         } | ||||
|         #endregion | ||||
|  | ||||
|         public void debugPrintPacket() | ||||
|         public void DebugPrintPacket() | ||||
|         { | ||||
| #if DEBUG | ||||
|             Console.BackgroundColor = ConsoleColor.DarkYellow; | ||||
|  | ||||
|             Program.Log.Debug("IsAuth: {0} IsEncrypted: {1}, Size: 0x{2:X}, NumSubpackets: {3}{4}{5}", header.isAuthenticated, header.isCompressed, header.packetSize, header.numSubpackets, Environment.NewLine, Utils.ByteArrayToHex(getHeaderBytes())); | ||||
|             Program.Log.Debug("IsAuth: {0} IsEncrypted: {1}, Size: 0x{2:X}, NumSubpackets: {3}{4}{5}", header.isAuthenticated, header.isCompressed, header.packetSize, header.numSubpackets, Environment.NewLine, Utils.ByteArrayToHex(GetHeaderBytes())); | ||||
|  | ||||
|             foreach (SubPacket sub in getSubpackets()) | ||||
|             foreach (SubPacket sub in GetSubpackets()) | ||||
|             { | ||||
|                 sub.debugPrintSubPacket(); | ||||
|                 sub.DebugPrintSubPacket(); | ||||
|             } | ||||
|  | ||||
|             Console.BackgroundColor = ConsoleColor.Black; | ||||
|   | ||||
| @@ -101,7 +101,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             data = original.data; | ||||
|         } | ||||
|  | ||||
|         public byte[] getHeaderBytes() | ||||
|         public byte[] GetHeaderBytes() | ||||
|         { | ||||
|             int size = Marshal.SizeOf(header); | ||||
|             byte[] arr = new byte[size]; | ||||
| @@ -113,7 +113,7 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             return arr; | ||||
|         } | ||||
|  | ||||
|         public byte[] getGameMessageBytes() | ||||
|         public byte[] GetGameMessageBytes() | ||||
|         { | ||||
|             int size = Marshal.SizeOf(gameMessage); | ||||
|             byte[] arr = new byte[size]; | ||||
| @@ -125,28 +125,28 @@ namespace FFXIVClassic_Map_Server.packets | ||||
|             return arr; | ||||
|         } | ||||
|  | ||||
|         public byte[] getBytes() | ||||
|         public byte[] GetBytes() | ||||
|         { | ||||
|             byte[] outBytes = new byte[header.subpacketSize]; | ||||
|             Array.Copy(getHeaderBytes(), 0, outBytes, 0, SUBPACKET_SIZE); | ||||
|             Array.Copy(GetHeaderBytes(), 0, outBytes, 0, SUBPACKET_SIZE); | ||||
|  | ||||
|             if (header.type == 0x3) | ||||
|                 Array.Copy(getGameMessageBytes(), 0, outBytes, SUBPACKET_SIZE, GAMEMESSAGE_SIZE); | ||||
|                 Array.Copy(GetGameMessageBytes(), 0, outBytes, SUBPACKET_SIZE, GAMEMESSAGE_SIZE); | ||||
|  | ||||
|             Array.Copy(data, 0, outBytes, SUBPACKET_SIZE + (header.type == 0x3 ? GAMEMESSAGE_SIZE : 0), data.Length); | ||||
|             return outBytes; | ||||
|         } | ||||
|  | ||||
|         public void debugPrintSubPacket() | ||||
|         public void DebugPrintSubPacket() | ||||
|         { | ||||
| #if DEBUG | ||||
|             Console.BackgroundColor = ConsoleColor.DarkRed; | ||||
|  | ||||
|             Program.Log.Debug("Size: 0x{0:X}{1}{2}", header.subpacketSize, Environment.NewLine, Utils.ByteArrayToHex(getHeaderBytes())); | ||||
|             Program.Log.Debug("Size: 0x{0:X}{1}{2}", header.subpacketSize, Environment.NewLine, Utils.ByteArrayToHex(GetHeaderBytes())); | ||||
|              | ||||
|             if (header.type == 0x03) | ||||
|             { | ||||
|                 Program.Log.Debug("Opcode: 0x{0:X}{1}{2}", gameMessage.opcode, Environment.NewLine, Utils.ByteArrayToHex(getGameMessageBytes(), SUBPACKET_SIZE)); | ||||
|                 Program.Log.Debug("Opcode: 0x{0:X}{1}{2}", gameMessage.opcode, Environment.NewLine, Utils.ByteArrayToHex(GetGameMessageBytes(), SUBPACKET_SIZE)); | ||||
|  | ||||
|                 Console.BackgroundColor = ConsoleColor.DarkMagenta; | ||||
|  | ||||
|   | ||||
| @@ -63,7 +63,7 @@ namespace FFXIVClassic_Map_Server.packets.receive.events | ||||
|  | ||||
|                         binReader.BaseStream.Seek(0x31, SeekOrigin.Begin); | ||||
|  | ||||
|                         luaParams = LuaUtils.readLuaParams(binReader); | ||||
|                         luaParams = LuaUtils.ReadLuaParams(binReader); | ||||
|                     } | ||||
|                     catch (Exception){ | ||||
|                         invalidPacket = true; | ||||
|   | ||||
| @@ -31,7 +31,7 @@ namespace FFXIVClassic_Map_Server.packets.receive.events | ||||
|                         val1 = binReader.ReadUInt32(); | ||||
|                         val2 = binReader.ReadUInt32(); | ||||
|                         step = binReader.ReadByte(); | ||||
|                         luaParams = LuaUtils.readLuaParams(binReader); | ||||
|                         luaParams = LuaUtils.ReadLuaParams(binReader); | ||||
|                     } | ||||
|                     catch (Exception){ | ||||
|                         invalidPacket = true; | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x00E1; | ||||
|         public const uint PACKET_SIZE = 0x30; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceActorId, uint targetActorId, uint targettedActorId, uint emoteID) | ||||
|         public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId, uint targettedActorId, uint emoteID) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
| @@ -28,7 +28,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             } | ||||
|  | ||||
|             SubPacket packet = new SubPacket(OPCODE, sourceActorId, targetActorId, data); | ||||
|             packet.debugPrintSubPacket(); | ||||
|             packet.DebugPrintSubPacket(); | ||||
|             return packet; | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -11,7 +11,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x00CC; | ||||
|         public const uint PACKET_SIZE = 0x128; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceActorID, uint targetActorID, string objectName, string className, List<LuaParam> initParams) | ||||
|         public static SubPacket BuildPacket(uint sourceActorID, uint targetActorID, string objectName, string className, List<LuaParam> initParams) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
| @@ -27,7 +27,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|                     binWriter.BaseStream.Seek(0x24, SeekOrigin.Begin); | ||||
|                     binWriter.Write(Encoding.ASCII.GetBytes(className), 0, Encoding.ASCII.GetByteCount(className) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(className)); | ||||
|                     binWriter.BaseStream.Seek(0x44, SeekOrigin.Begin); | ||||
|                     LuaUtils.writeLuaParams(binWriter, initParams); | ||||
|                     LuaUtils.WriteLuaParams(binWriter, initParams); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|   | ||||
| @@ -13,7 +13,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x00E3; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID, int iconCode) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, int iconCode) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -5,7 +5,7 @@ | ||||
|         public const ushort OPCODE = 0x00CA; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint actorID, byte val) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint actorID, byte val) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE-0x20]; | ||||
|             data[0] = val; //Why? | ||||
|   | ||||
| @@ -7,7 +7,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x0139; | ||||
|         public const uint PACKET_SIZE = 0x58; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceId, uint targetId) | ||||
|         public static SubPacket BuildPacket(uint sourceId, uint targetId) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -5,7 +5,7 @@ | ||||
|         public const ushort OPCODE = 0x0007; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID) | ||||
|         public static SubPacket BuildPacket(uint playerActorID) | ||||
|         { | ||||
|             return new SubPacket(OPCODE, playerActorID, playerActorID, new byte[8]); | ||||
|         } | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x00CF; | ||||
|         public const uint PACKET_SIZE = 0x50; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID, float x, float y, float z, float rot, ushort moveState) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, float x, float y, float z, float rot, ushort moveState) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x00CB; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint actorId) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint actorId) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -51,7 +51,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             appearanceIDs = appearanceTable; | ||||
|         } | ||||
|  | ||||
|         public SubPacket buildPacket(uint playerActorID, uint actorID) | ||||
|         public SubPacket BuildPacket(uint playerActorID, uint actorID) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -12,7 +12,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x0145; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID, uint iconCode) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, uint iconCode) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x144; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetID, uint idleAnimationId) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetID, uint idleAnimationId) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -5,7 +5,7 @@ | ||||
|         public const ushort OPCODE = 0x017B; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID, bool isDimmed) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, bool isDimmed) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|             data[0] = (byte)(isDimmed ? 1 : 0); | ||||
|   | ||||
| @@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x013D; | ||||
|         public const uint PACKET_SIZE = 0x48; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID, uint displayNameID, string customName) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, uint displayNameID, string customName) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -22,7 +22,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const float INNPOS_Z     = 165.050003f; | ||||
|         public const float INNPOS_ROT   =  -1.530000f; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceActorID, uint targetActorID, uint actorId, float x, float y, float z, float rotation, uint spawnType, bool isZoningPlayer) | ||||
|         public static SubPacket BuildPacket(uint sourceActorID, uint targetActorID, uint actorId, float x, float y, float z, float rotation, uint spawnType, bool isZoningPlayer) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE-0x20]; | ||||
|  | ||||
|   | ||||
| @@ -34,13 +34,13 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             currentTarget = startingTarget; | ||||
|         } | ||||
|  | ||||
|         public void closeStreams() | ||||
|         public void CloseStreams() | ||||
|         { | ||||
|             binWriter.Dispose(); | ||||
|             mem.Dispose(); | ||||
|         } | ||||
|  | ||||
|         public bool addByte(uint id, byte value) | ||||
|         public bool AddByte(uint id, byte value) | ||||
|         { | ||||
|             if (runningByteTotal + 6 + (1 + Encoding.ASCII.GetByteCount(currentTarget)) > MAXBYTES) | ||||
|                 return false; | ||||
| @@ -53,7 +53,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         public bool addShort(uint id, ushort value) | ||||
|         public bool AddShort(uint id, ushort value) | ||||
|         { | ||||
|             if (runningByteTotal + 7 + (1 + Encoding.ASCII.GetByteCount(currentTarget)) > MAXBYTES) | ||||
|                 return false; | ||||
| @@ -66,7 +66,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         public bool addInt(uint id, uint value) | ||||
|         public bool AddInt(uint id, uint value) | ||||
|         { | ||||
|             if (runningByteTotal + 9 + (1 + Encoding.ASCII.GetByteCount(currentTarget)) > MAXBYTES) | ||||
|                 return false; | ||||
| @@ -79,7 +79,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         public bool addBuffer(uint id, byte[] buffer) | ||||
|         public bool AddBuffer(uint id, byte[] buffer) | ||||
|         { | ||||
|             if (runningByteTotal + 5 + buffer.Length + (1 + Encoding.ASCII.GetByteCount(currentTarget)) > MAXBYTES) | ||||
|                 return false; | ||||
| @@ -92,7 +92,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         public bool addBuffer(uint id, byte[] buffer, int index, int length, int page) | ||||
|         public bool AddBuffer(uint id, byte[] buffer, int index, int length, int page) | ||||
|         { | ||||
|             if (runningByteTotal + 5 + length + (1 + Encoding.ASCII.GetByteCount(currentTarget)) > MAXBYTES) | ||||
|                 return false; | ||||
| @@ -106,7 +106,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             return true; | ||||
|         } | ||||
|  | ||||
|         public bool addProperty(FFXIVClassic_Map_Server.Actors.Actor actor, string name) | ||||
|         public bool AddProperty(FFXIVClassic_Map_Server.Actors.Actor actor, string name) | ||||
|         { | ||||
|             string[] split = name.Split('.'); | ||||
|             int arrayIndex = 0; | ||||
| @@ -151,43 +151,43 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|                 if (curObj == null) | ||||
|                     return false; | ||||
|  | ||||
|                 //Cast to the proper object and add to packet | ||||
|                 //Cast to the proper object and Add to packet | ||||
|                 uint id = Utils.MurmurHash2(name, 0); | ||||
|                 if (curObj is bool)                 | ||||
|                     return addByte(id, (byte)(((bool)curObj) ? 1 : 0)); | ||||
|                     return AddByte(id, (byte)(((bool)curObj) ? 1 : 0)); | ||||
|                 else if (curObj is byte) | ||||
|                     return addByte(id, (byte)curObj); | ||||
|                     return AddByte(id, (byte)curObj); | ||||
|                 else if (curObj is ushort) | ||||
|                     return addShort(id, (ushort)curObj); | ||||
|                     return AddShort(id, (ushort)curObj); | ||||
|                 else if (curObj is short) | ||||
|                     return addShort(id, (ushort)(short)curObj); | ||||
|                     return AddShort(id, (ushort)(short)curObj); | ||||
|                 else if (curObj is uint) | ||||
|                     return addInt(id, (uint)curObj); | ||||
|                     return AddInt(id, (uint)curObj); | ||||
|                 else if (curObj is int) | ||||
|                     return addInt(id, (uint)(int)curObj); | ||||
|                     return AddInt(id, (uint)(int)curObj); | ||||
|                 else if (curObj is float) | ||||
|                     return addBuffer(id, BitConverter.GetBytes((float)curObj)); | ||||
|                     return AddBuffer(id, BitConverter.GetBytes((float)curObj)); | ||||
|                 else | ||||
|                     return false; | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         public void setIsArrayMode(bool flag) | ||||
|         public void SetIsArrayMode(bool flag) | ||||
|         { | ||||
|             isArrayMode = flag; | ||||
|         } | ||||
|  | ||||
|         public void setIsMore(bool flag) | ||||
|         public void SetIsMore(bool flag) | ||||
|         { | ||||
|             isMore = flag; | ||||
|         } | ||||
|  | ||||
|         public void setTarget(string target) | ||||
|         public void SetTarget(string target) | ||||
|         { | ||||
|             currentTarget = target; | ||||
|         } | ||||
|  | ||||
|         public void addTarget() | ||||
|         public void AddTarget() | ||||
|         { | ||||
|             if (isArrayMode) | ||||
|                 binWriter.Write((byte)(0xA4 + currentTarget.Length)); | ||||
| @@ -197,7 +197,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             runningByteTotal += (ushort)(1 + Encoding.ASCII.GetByteCount(currentTarget)); | ||||
|         } | ||||
|  | ||||
|         public void addTarget(string newTarget) | ||||
|         public void AddTarget(string newTarget) | ||||
|         { | ||||
|             binWriter.Write((byte)(isMore ? 0x60 + currentTarget.Length : 0x82 + currentTarget.Length)); | ||||
|             binWriter.Write(Encoding.ASCII.GetBytes(currentTarget)); | ||||
| @@ -205,12 +205,12 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             currentTarget = newTarget; | ||||
|         } | ||||
|  | ||||
|         public SubPacket buildPacket(uint playerActorID, uint actorID) | ||||
|         public SubPacket BuildPacket(uint playerActorID, uint actorID) | ||||
|         { | ||||
|             binWriter.Seek(0, SeekOrigin.Begin); | ||||
|             binWriter.Write((byte)runningByteTotal); | ||||
|              | ||||
|             closeStreams(); | ||||
|             CloseStreams(); | ||||
|  | ||||
|             SubPacket packet = new SubPacket(OPCODE, actorID, playerActorID, data); | ||||
|             return packet; | ||||
|   | ||||
| @@ -12,7 +12,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const float DEFAULT_WALK = 2.0f; | ||||
|         public const float DEFAULT_RUN = 5.0f; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
| @@ -41,7 +41,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|             return new SubPacket(OPCODE, playerActorID, targetActorID, data); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID, float stopSpeed, float walkSpeed, float runSpeed) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, float stopSpeed, float walkSpeed, float runSpeed) | ||||
|         {                | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -27,7 +27,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x134; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetID, uint mainState, uint subState) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetID, uint mainState, uint subState) | ||||
|         {             | ||||
|             ulong combined = (mainState & 0xFF) | ((subState & 0xFF) << 8); | ||||
|             return new SubPacket(OPCODE, playerActorID, targetID, BitConverter.GetBytes(combined)); | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x0179; | ||||
|         public const uint PACKET_SIZE = 0x48; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID, ushort[] statusIds) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, ushort[] statusIds) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|            | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x0177; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID, ushort index, ushort statusCode) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, ushort index, ushort statusCode) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|            | ||||
|   | ||||
| @@ -7,7 +7,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x00D3; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|          | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID, uint targetID) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, uint targetID) | ||||
|         {             | ||||
|             return new SubPacket(OPCODE, playerActorID, targetID, BitConverter.GetBytes((ulong)targetID)); | ||||
|         } | ||||
|   | ||||
| @@ -7,7 +7,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x00DB; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|          | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID, uint targetID) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID, uint targetID) | ||||
|         {             | ||||
|             return new SubPacket(OPCODE, playerActorID, targetID, BitConverter.GetBytes((ulong)targetID)); | ||||
|         } | ||||
|   | ||||
| @@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x132; | ||||
|         public const uint PACKET_SIZE = 0x48; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, ushort number, string function) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, ushort number, string function) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -7,7 +7,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor | ||||
|         public const ushort OPCODE = 0x000F; | ||||
|         public const uint PACKET_SIZE = 0x38; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint targetActorID) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint targetActorID) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle | ||||
|         public const ushort OPCODE = 0x013C; | ||||
|         public const uint PACKET_SIZE = 0x48; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorId, uint targetActorId, uint animationId, ushort commandId) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorId, uint targetActorId, uint animationId, ushort commandId) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle | ||||
|         public const ushort OPCODE = 0x0139; | ||||
|         public const uint PACKET_SIZE = 0x58; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorId, uint targetActorId, uint animationId, uint effectId, ushort worldMasterTextId, ushort commandId, ushort amount, byte param) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorId, uint targetActorId, uint animationId, uint effectId, ushort worldMasterTextId, ushort commandId, ushort amount, byte param) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle | ||||
|         public const ushort OPCODE = 0x013A; | ||||
|         public const uint PACKET_SIZE = 0xD8; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorId, uint animationId, ushort commandId, BattleAction[] actionList) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorId, uint animationId, ushort commandId, BattleAction[] actionList) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.battle | ||||
|         public const ushort OPCODE = 0x013B; | ||||
|         public const uint PACKET_SIZE = 0x148; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorId, uint animationId, ushort commandId, BattleAction[] actionList) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorId, uint animationId, ushort commandId, BattleAction[] actionList) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events | ||||
|         public const ushort OPCODE = 0x016C; | ||||
|         public const uint PACKET_SIZE = 0x48; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorID, EventList.EmoteEventCondition condition) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.EmoteEventCondition condition) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events | ||||
|         public const ushort OPCODE = 0x0136; | ||||
|         public const uint PACKET_SIZE = 0x48; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorID, bool enabled, byte unknown2, string conditionName) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, bool enabled, byte unknown2, string conditionName) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events | ||||
|         public const ushort OPCODE = 0x016B; | ||||
|         public const uint PACKET_SIZE = 0x48; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorID, EventList.NoticeEventCondition condition) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.NoticeEventCondition condition) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events | ||||
|         public const ushort OPCODE = 0x016F; | ||||
|         public const uint PACKET_SIZE = 0x58; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorID, EventList.PushCircleEventCondition condition) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.PushCircleEventCondition condition) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events | ||||
|         public const ushort OPCODE = 0x0170; | ||||
|         public const uint PACKET_SIZE = 0x60; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorID, EventList.PushFanEventCondition condition) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.PushFanEventCondition condition) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
| @@ -30,7 +30,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events | ||||
|                     binWriter.Write(Encoding.ASCII.GetBytes(condition.conditionName), 0, Encoding.ASCII.GetByteCount(condition.conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(condition.conditionName)); | ||||
|                 } | ||||
|             } | ||||
|             new SubPacket(OPCODE, sourceActorID, playerActorID, data).debugPrintSubPacket(); | ||||
|             new SubPacket(OPCODE, sourceActorID, playerActorID, data).DebugPrintSubPacket(); | ||||
|             return new SubPacket(OPCODE, sourceActorID, playerActorID, data); | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events | ||||
|         public const ushort OPCODE = 0x0175; | ||||
|         public const uint PACKET_SIZE = 0x60; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorID, EventList.PushBoxEventCondition condition) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.PushBoxEventCondition condition) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.events | ||||
|         public const ushort OPCODE = 0x012E; | ||||
|         public const uint PACKET_SIZE = 0x48; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, uint sourceActorID, EventList.TalkEventCondition condition) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, uint sourceActorID, EventList.TalkEventCondition condition) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x014D; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, ushort equipSlot, uint itemSlot) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, ushort equipSlot, uint itemSlot) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x14E; | ||||
|         public const uint PACKET_SIZE = 0x58; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorId, InventoryItem[] equipment, List<ushort> slotsToUpdate, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] equipment, List<ushort> slotsToUpdate, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x14F; | ||||
|         public const uint PACKET_SIZE = 0x80; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorId, InventoryItem[] equipment, List<ushort> slotsToUpdate, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] equipment, List<ushort> slotsToUpdate, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x150; | ||||
|         public const uint PACKET_SIZE = 0xE0; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorId, InventoryItem[] equipment, List<ushort> slotsToUpdate, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] equipment, List<ushort> slotsToUpdate, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x151; | ||||
|         public const uint PACKET_SIZE = 0x194; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorId, InventoryItem[] equipment, List<ushort> slotsToUpdate, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorId, InventoryItem[] equipment, List<ushort> slotsToUpdate, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -5,14 +5,14 @@ | ||||
|         public const ushort OPCODE = 0x016D; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceActorId, uint targetActorId) | ||||
|         public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId) | ||||
|         { | ||||
|             byte[] data = new byte[8]; | ||||
|             data[0] = 2; | ||||
|             return new SubPacket(OPCODE, sourceActorId, targetActorId, data); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID) | ||||
|         public static SubPacket BuildPacket(uint playerActorID) | ||||
|         { | ||||
|             byte[] data = new byte[8]; | ||||
|             return new SubPacket(OPCODE, playerActorID, playerActorID, data); | ||||
|   | ||||
| @@ -5,12 +5,12 @@ | ||||
|         public const ushort OPCODE = 0x016E; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceActorId, uint targetActorId) | ||||
|         public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId) | ||||
|         { | ||||
|             return new SubPacket(OPCODE, sourceActorId, targetActorId, new byte[8]); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID) | ||||
|         public static SubPacket BuildPacket(uint playerActorID) | ||||
|         { | ||||
|             return new SubPacket(OPCODE, playerActorID, playerActorID, new byte[8]); | ||||
|         } | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x0149; | ||||
|         public const uint PACKET_SIZE = 0x90; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset) | ||||
|         { | ||||
|             byte[] data; | ||||
|  | ||||
| @@ -20,7 +20,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|                 { | ||||
|                     for (int i = listOffset; i < items.Count; i++) | ||||
|                     { | ||||
|                         binWriter.Write(items[i].toPacketBytes()); | ||||
|                         binWriter.Write(items[i].ToPacketBytes()); | ||||
|                         listOffset++; | ||||
|                     } | ||||
|                 } | ||||
|   | ||||
| @@ -10,7 +10,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x014A; | ||||
|         public const uint PACKET_SIZE = 0x90; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset) | ||||
|         { | ||||
|             byte[] data; | ||||
|  | ||||
| @@ -20,7 +20,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|                 { | ||||
|                     for (int i = listOffset; i < items.Count; i++) | ||||
|                     { | ||||
|                         binWriter.Write(items[i].toPacketBytes()); | ||||
|                         binWriter.Write(items[i].ToPacketBytes()); | ||||
|                         listOffset++; | ||||
|                     } | ||||
|                 } | ||||
|   | ||||
| @@ -8,12 +8,12 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory | ||||
|         public const ushort OPCODE = 0x0148; | ||||
|         public const uint PACKET_SIZE = 0x90; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorId, InventoryItem item) | ||||
|         public static SubPacket BuildPacket(uint playerActorId, InventoryItem item) | ||||
|         { | ||||
|             return buildPacket(playerActorId, playerActorId, item); | ||||
|             return BuildPacket(playerActorId, playerActorId, item); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceActorId, uint targetActorId, InventoryItem item) | ||||
|         public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId, InventoryItem item) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
| @@ -21,7 +21,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory | ||||
|             { | ||||
|                 using (BinaryWriter binWriter = new BinaryWriter(mem)) | ||||
|                 {                     | ||||
|                         binWriter.Write(item.toPacketBytes());                        | ||||
|                         binWriter.Write(item.ToPacketBytes());                        | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|   | ||||
| @@ -10,12 +10,12 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory | ||||
|         public const ushort OPCODE = 0x0149; | ||||
|         public const uint PACKET_SIZE = 0x3A8; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorId, List<InventoryItem> items, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorId, List<InventoryItem> items, ref int listOffset) | ||||
|         { | ||||
|             return buildPacket(playerActorId, playerActorId, items, ref listOffset); | ||||
|             return BuildPacket(playerActorId, playerActorId, items, ref listOffset); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceActorId, uint targetActorId, List<InventoryItem> items, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId, List<InventoryItem> items, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
| @@ -31,7 +31,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory | ||||
|  | ||||
|                     for (int i = 0; i < max; i++) | ||||
|                     { | ||||
|                         binWriter.Write(items[listOffset].toPacketBytes()); | ||||
|                         binWriter.Write(items[listOffset].ToPacketBytes()); | ||||
|                         listOffset++; | ||||
|                     } | ||||
|  | ||||
|   | ||||
| @@ -9,12 +9,12 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory | ||||
|         public const ushort OPCODE = 0x014A; | ||||
|         public const uint PACKET_SIZE = 0x720; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorId, List<InventoryItem> items, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorId, List<InventoryItem> items, ref int listOffset) | ||||
|         { | ||||
|             return buildPacket(playerActorId, playerActorId, items, ref listOffset); | ||||
|             return BuildPacket(playerActorId, playerActorId, items, ref listOffset); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceActorId, uint targetActorId, List<InventoryItem> items, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId, List<InventoryItem> items, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
| @@ -30,7 +30,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory | ||||
|  | ||||
|                     for (int i = 0; i < max; i++) | ||||
|                     { | ||||
|                         binWriter.Write(items[listOffset].toPacketBytes()); | ||||
|                         binWriter.Write(items[listOffset].ToPacketBytes()); | ||||
|                         listOffset++; | ||||
|                     } | ||||
|                 } | ||||
|   | ||||
| @@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory | ||||
|         public const ushort OPCODE = 0x014B; | ||||
|         public const uint PACKET_SIZE = 0xE20; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
| @@ -25,7 +25,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory | ||||
|  | ||||
|                     for (int i = 0; i < max; i++) | ||||
|                     { | ||||
|                         binWriter.Write(items[listOffset].toPacketBytes()); | ||||
|                         binWriter.Write(items[listOffset].ToPacketBytes()); | ||||
|                         listOffset++; | ||||
|                     } | ||||
|                 } | ||||
|   | ||||
| @@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory | ||||
|         public const ushort OPCODE = 0x014C; | ||||
|         public const uint PACKET_SIZE = 0x1C20; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, List<InventoryItem> items, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
| @@ -25,7 +25,7 @@ namespace FFXIVClassic_Map_Server.packets.send.actor.inventory | ||||
|  | ||||
|                     for (int i = 0; i < max; i++) | ||||
|                     { | ||||
|                         binWriter.Write(items[listOffset].toPacketBytes()); | ||||
|                         binWriter.Write(items[listOffset].ToPacketBytes()); | ||||
|                         listOffset++; | ||||
|                     } | ||||
|                 } | ||||
|   | ||||
| @@ -8,7 +8,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x0152; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, ushort slot) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, ushort slot) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x0153; | ||||
|         public const uint PACKET_SIZE = 0x38; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, List<ushort> slots, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, List<ushort> slots, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x154; | ||||
|         public const uint PACKET_SIZE = 0x40; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, List<ushort> slots, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, List<ushort> slots, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x0155; | ||||
|         public const uint PACKET_SIZE = 0x60; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, List<ushort> slots, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, List<ushort> slots, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -9,7 +9,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x156; | ||||
|         public const uint PACKET_SIZE = 0xA0; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID, List<ushort> slots, ref int listOffset) | ||||
|         public static SubPacket BuildPacket(uint playerActorID, List<ushort> slots, ref int listOffset) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|   | ||||
| @@ -8,12 +8,12 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|         public const ushort OPCODE = 0x0146; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorId, ushort size, ushort code) | ||||
|         public static SubPacket BuildPacket(uint playerActorId, ushort size, ushort code) | ||||
|         { | ||||
|             return buildPacket(playerActorId, playerActorId, size, code); | ||||
|             return BuildPacket(playerActorId, playerActorId, size, code); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceActorId, uint targetActorId, ushort size, ushort code) | ||||
|         public static SubPacket BuildPacket(uint sourceActorId, uint targetActorId, ushort size, ushort code) | ||||
|         { | ||||
|             byte[] data = new byte[8]; | ||||
|  | ||||
|   | ||||
| @@ -6,12 +6,12 @@ | ||||
|         public const ushort OPCODE = 0x0147; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorId) | ||||
|         public static SubPacket BuildPacket(uint playerActorId) | ||||
|         { | ||||
|             return new SubPacket(OPCODE, playerActorId, playerActorId, new byte[8]); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceActorId, uint targetActorID) | ||||
|         public static SubPacket BuildPacket(uint sourceActorId, uint targetActorID) | ||||
|         { | ||||
|             return new SubPacket(OPCODE, sourceActorId, targetActorID, new byte[8]); | ||||
|         } | ||||
|   | ||||
| @@ -42,7 +42,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|                 equipment[i] = UNEQUIPPED; //We will use this as "Unequipped" | ||||
|         } | ||||
|  | ||||
|         public void setItem(int slot, uint itemSlot) | ||||
|         public void SetItem(int slot, uint itemSlot) | ||||
|         { | ||||
|             if (slot >= equipment.Length) | ||||
|                 return; | ||||
| @@ -50,7 +50,7 @@ namespace FFXIVClassic_Map_Server.packets.send.Actor.inventory | ||||
|             equipment[slot] = itemSlot; | ||||
|         } | ||||
|  | ||||
|         public List<SubPacket> buildPackets(uint playerActorID) | ||||
|         public List<SubPacket> BuildPackets(uint playerActorID) | ||||
|         {             | ||||
|             List<SubPacket> packets = new List<SubPacket>(); | ||||
|             int packetCount = 0; | ||||
|   | ||||
| @@ -56,7 +56,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|         private const ushort SIZE_GAMEMESSAGE_WITHOUT_ACTOR4 = 0x48; | ||||
|         private const ushort SIZE_GAMEMESSAGE_WITHOUT_ACTOR5 = 0x68; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceId, uint targetId, uint actorId, uint textOwnerActorId, ushort textId, byte log) | ||||
|         public static SubPacket BuildPacket(uint sourceId, uint targetId, uint actorId, uint textOwnerActorId, ushort textId, byte log) | ||||
|         { | ||||
|             byte[] data = new byte[SIZE_GAMEMESSAGE_WITH_ACTOR1 - 0x20]; | ||||
|  | ||||
| @@ -74,7 +74,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|             return new SubPacket(OPCODE_GAMEMESSAGE_WITH_ACTOR1, sourceId, targetId, data); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceId, uint targetId, uint actorId, uint textOwnerActorId, ushort textId, byte log, List<LuaParam> lParams) | ||||
|         public static SubPacket BuildPacket(uint sourceId, uint targetId, uint actorId, uint textOwnerActorId, ushort textId, byte log, List<LuaParam> lParams) | ||||
|         { | ||||
|             int lParamsSize = findSizeOfParams(lParams); | ||||
|             byte[] data; | ||||
| @@ -109,7 +109,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|                     binWriter.Write((UInt32)textOwnerActorId); | ||||
|                     binWriter.Write((UInt16)textId); | ||||
|                     binWriter.Write((UInt16)log); | ||||
|                     LuaUtils.writeLuaParams(binWriter, lParams); | ||||
|                     LuaUtils.WriteLuaParams(binWriter, lParams); | ||||
|  | ||||
|                     if (lParamsSize <= 0x14-12) | ||||
|                     { | ||||
| @@ -122,7 +122,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|             return new SubPacket(opcode, sourceId, targetId, data); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, string sender, byte log) | ||||
|         public static SubPacket BuildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, string sender, byte log) | ||||
|         { | ||||
|             byte[] data = new byte[SIZE_GAMEMESSAGE_WITH_CUSTOM_SENDER1 - 0x20]; | ||||
|  | ||||
| @@ -140,7 +140,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|             return new SubPacket(OPCODE_GAMEMESSAGE_WITH_CUSTOM_SENDER1, sourceId, targetId, data); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, string sender, byte log, List<LuaParam> lParams) | ||||
|         public static SubPacket BuildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, string sender, byte log, List<LuaParam> lParams) | ||||
|         { | ||||
|             int lParamsSize = findSizeOfParams(lParams); | ||||
|             byte[] data; | ||||
| @@ -175,7 +175,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|                     binWriter.Write((UInt16)textId); | ||||
|                     binWriter.Write((UInt16)log); | ||||
|                     binWriter.Write(Encoding.ASCII.GetBytes(sender), 0, Encoding.ASCII.GetByteCount(sender) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(sender)); | ||||
|                     LuaUtils.writeLuaParams(binWriter, lParams); | ||||
|                     LuaUtils.WriteLuaParams(binWriter, lParams); | ||||
|  | ||||
|                     if (lParamsSize <= 0x14 - 12) | ||||
|                     { | ||||
| @@ -188,7 +188,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|             return new SubPacket(opcode, sourceId, targetId, data); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, uint senderDisplayNameId, byte log) | ||||
|         public static SubPacket BuildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, uint senderDisplayNameId, byte log) | ||||
|         { | ||||
|             byte[] data = new byte[SIZE_GAMEMESSAGE_WITH_DISPID_SENDER1 - 0x20]; | ||||
|  | ||||
| @@ -206,7 +206,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|             return new SubPacket(OPCODE_GAMEMESSAGE_WITH_DISPID_SENDER1, sourceId, targetId, data); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, uint senderDisplayNameId, byte log, List<LuaParam> lParams) | ||||
|         public static SubPacket BuildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, uint senderDisplayNameId, byte log, List<LuaParam> lParams) | ||||
|         { | ||||
|             int lParamsSize = findSizeOfParams(lParams); | ||||
|             byte[] data; | ||||
| @@ -241,7 +241,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|                     binWriter.Write((UInt32)textOwnerActorId); | ||||
|                     binWriter.Write((UInt16)textId); | ||||
|                     binWriter.Write((UInt16)log); | ||||
|                     LuaUtils.writeLuaParams(binWriter, lParams); | ||||
|                     LuaUtils.WriteLuaParams(binWriter, lParams); | ||||
|  | ||||
|                     if (lParamsSize <= 0x14 - 12) | ||||
|                     { | ||||
| @@ -254,7 +254,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|             return new SubPacket(opcode, sourceId, targetId, data); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, byte log) | ||||
|         public static SubPacket BuildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, byte log) | ||||
|         { | ||||
|             byte[] data = new byte[SIZE_GAMEMESSAGE_WITHOUT_ACTOR1 - 0x20]; | ||||
|  | ||||
| @@ -271,7 +271,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|             return new SubPacket(OPCODE_GAMEMESSAGE_WITHOUT_ACTOR1, sourceId, targetId, data); | ||||
|         } | ||||
|  | ||||
|         public static SubPacket buildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, byte log, List<LuaParam> lParams) | ||||
|         public static SubPacket BuildPacket(uint sourceId, uint targetId, uint textOwnerActorId, ushort textId, byte log, List<LuaParam> lParams) | ||||
|         { | ||||
|             int lParamsSize = findSizeOfParams(lParams); | ||||
|             byte[] data; | ||||
| @@ -305,7 +305,7 @@ namespace FFXIVClassic_Map_Server.packets.send | ||||
|                     binWriter.Write((UInt32)textOwnerActorId); | ||||
|                     binWriter.Write((UInt16)textId); | ||||
|                     binWriter.Write((UInt16)log); | ||||
|                     LuaUtils.writeLuaParams(binWriter, lParams); | ||||
|                     LuaUtils.WriteLuaParams(binWriter, lParams); | ||||
|  | ||||
|                     if (lParamsSize <= 0x8) | ||||
|                     { | ||||
|   | ||||
| @@ -5,7 +5,7 @@ | ||||
|         public const ushort OPCODE = 0x000E; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket buildPacket(uint playerActorID) | ||||
|         public static SubPacket BuildPacket(uint playerActorID) | ||||
|         { | ||||
|             return new SubPacket(OPCODE, playerActorID, playerActorID, new byte[8]); | ||||
|         } | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user