mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	Built subpackets to let the zone servers talk to the world server. Implemented cross-server zoning but the E2 packet or something isn't being sent.
This commit is contained in:
		| @@ -0,0 +1,27 @@ | ||||
| using FFXIVClassic.Common; | ||||
| using FFXIVClassic_Map_Server.dataobjects; | ||||
| using System; | ||||
| using System.IO; | ||||
|  | ||||
| namespace  FFXIVClassic_Map_Server.packets.WorldPackets.Send | ||||
| { | ||||
|     class SessionBeginConfirmPacket | ||||
|     { | ||||
|         public const ushort OPCODE = 0x1000; | ||||
|         public const uint PACKET_SIZE = 0x28; | ||||
|  | ||||
|         public static SubPacket BuildPacket(Session session, ushort errorCode = 0) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|             using (MemoryStream mem = new MemoryStream(data)) | ||||
|             { | ||||
|                 using (BinaryWriter binWriter = new BinaryWriter(mem)) | ||||
|                 { | ||||
|                     binWriter.Write((UInt32)session.id); | ||||
|                     binWriter.Write((UInt16)errorCode); | ||||
|                 } | ||||
|             } | ||||
|             return new SubPacket(true, OPCODE, 0, session.id, data); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,28 @@ | ||||
| using FFXIVClassic.Common; | ||||
| using FFXIVClassic_Map_Server.dataobjects; | ||||
| using System; | ||||
| using System.IO; | ||||
|  | ||||
| namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send | ||||
| { | ||||
|     class SessionEndConfirmPacket | ||||
|     { | ||||
|         public const ushort OPCODE = 0x1001; | ||||
|         public const uint PACKET_SIZE = 0x30; | ||||
|  | ||||
|         public static SubPacket BuildPacket(Session session, uint destinationZone, ushort errorCode = 0) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|             using (MemoryStream mem = new MemoryStream(data)) | ||||
|             { | ||||
|                 using (BinaryWriter binWriter = new BinaryWriter(mem)) | ||||
|                 { | ||||
|                     binWriter.Write((UInt32)session.id); | ||||
|                     binWriter.Write((UInt16)errorCode); | ||||
|                     binWriter.Write((UInt32)destinationZone); | ||||
|                 } | ||||
|             } | ||||
|             return new SubPacket(true, OPCODE, 0, session.id, data); | ||||
|         } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,37 @@ | ||||
| using FFXIVClassic.Common; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.Linq; | ||||
| using System.Text; | ||||
| using System.Threading.Tasks; | ||||
|  | ||||
| namespace FFXIVClassic_Map_Server.packets.WorldPackets.Send | ||||
| { | ||||
|     class WorldRequestZoneChangePacket | ||||
|     { | ||||
|         public const ushort OPCODE = 0x1002; | ||||
|         public const uint PACKET_SIZE = 0x048; | ||||
|  | ||||
|         public static SubPacket BuildPacket(uint sessionId, uint destinationZoneId, byte spawnType, float spawnX, float spawnY, float spawnZ, float spawnRotation) | ||||
|         { | ||||
|             byte[] data = new byte[PACKET_SIZE - 0x20]; | ||||
|  | ||||
|             using (MemoryStream mem = new MemoryStream(data)) | ||||
|             { | ||||
|                 using (BinaryWriter binWriter = new BinaryWriter(mem)) | ||||
|                 { | ||||
|                     binWriter.Write((UInt32)sessionId); | ||||
|                     binWriter.Write((UInt32)destinationZoneId); | ||||
|                     binWriter.Write((UInt16)spawnType); | ||||
|                     binWriter.Write((Single)spawnX); | ||||
|                     binWriter.Write((Single)spawnY); | ||||
|                     binWriter.Write((Single)spawnZ); | ||||
|                     binWriter.Write((Single)spawnRotation); | ||||
|                 } | ||||
|             } | ||||
|  | ||||
|             return new SubPacket(OPCODE, sessionId, sessionId, data); | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user