mirror of
				https://bitbucket.org/Ioncannon/project-meteor-server.git
				synced 2025-05-20 08:26:59 -04:00 
			
		
		
		
	Packet refactoring.
This commit is contained in:
		@@ -34,7 +34,7 @@ namespace Meteor.Map.packets.send.events
 | 
			
		||||
        public const ushort OPCODE = 0x012F;
 | 
			
		||||
        public const uint PACKET_SIZE = 0x90;
 | 
			
		||||
 | 
			
		||||
        public static SubPacket BuildPacket(uint sourcePlayerActorId, uint targetEventActorId, uint unknown, string conditionName, List<LuaParam> luaParams)
 | 
			
		||||
        public static SubPacket BuildPacket(uint triggerActorId, uint ownerActorId, string eventName, byte eventType, List<LuaParam> luaParams)
 | 
			
		||||
        {
 | 
			
		||||
            byte[] data = new byte[PACKET_SIZE - 0x20];
 | 
			
		||||
 | 
			
		||||
@@ -42,11 +42,13 @@ namespace Meteor.Map.packets.send.events
 | 
			
		||||
            {
 | 
			
		||||
                using (BinaryWriter binWriter = new BinaryWriter(mem))
 | 
			
		||||
                {
 | 
			
		||||
                    binWriter.Write((UInt32)sourcePlayerActorId);
 | 
			
		||||
                    binWriter.Write((UInt32)targetEventActorId);
 | 
			
		||||
                    binWriter.Write((UInt32)unknown);
 | 
			
		||||
                    binWriter.Write((UInt32)0x30400000);
 | 
			
		||||
                    binWriter.Write(Encoding.ASCII.GetBytes(conditionName), 0, Encoding.ASCII.GetByteCount(conditionName) >= 0x20 ? 0x20 : Encoding.ASCII.GetByteCount(conditionName));
 | 
			
		||||
                    binWriter.Write((UInt32)triggerActorId);
 | 
			
		||||
                    binWriter.Write((UInt32)ownerActorId);
 | 
			
		||||
                    binWriter.Write((Byte)eventType);
 | 
			
		||||
                    binWriter.Write((Byte)0x17); //?
 | 
			
		||||
                    binWriter.Write((UInt16)0x75DC); //?
 | 
			
		||||
                    binWriter.Write((UInt32)0x30400000); //ServerCodes
 | 
			
		||||
                    Utils.WriteNullTermString(binWriter, eventName);
 | 
			
		||||
 | 
			
		||||
                    binWriter.Seek(0x30, SeekOrigin.Begin);
 | 
			
		||||
 | 
			
		||||
@@ -54,7 +56,7 @@ namespace Meteor.Map.packets.send.events
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            return new SubPacket(OPCODE, sourcePlayerActorId, data);
 | 
			
		||||
            return new SubPacket(OPCODE, triggerActorId, data);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user