1
Fork 0
mirror of https://bitbucket.org/Ioncannon/project-meteor-server.git synced 2025-04-20 19:57:46 +00:00

Fixed event status packet using the wrong event type. Changed kickevent in player class to use notice type.

This commit is contained in:
Filip Maj 2020-02-28 00:05:46 -05:00
parent d588dd0348
commit 99c8aff702
3 changed files with 13 additions and 12 deletions

View file

@ -267,37 +267,37 @@ namespace Meteor.Map.Actors
if (eventConditions.talkEventConditions != null) if (eventConditions.talkEventConditions != null)
{ {
foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions) foreach (EventList.TalkEventCondition condition in eventConditions.talkEventConditions)
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 1, condition.conditionName)); subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 1, condition.conditionName));
} }
if (eventConditions.noticeEventConditions != null) if (eventConditions.noticeEventConditions != null)
{ {
foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions) foreach (EventList.NoticeEventCondition condition in eventConditions.noticeEventConditions)
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 1, condition.conditionName)); subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 5, condition.conditionName));
} }
if (eventConditions.emoteEventConditions != null) if (eventConditions.emoteEventConditions != null)
{ {
foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions) foreach (EventList.EmoteEventCondition condition in eventConditions.emoteEventConditions)
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 3, condition.conditionName)); subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 3, condition.conditionName));
} }
if (eventConditions.pushWithCircleEventConditions != null) if (eventConditions.pushWithCircleEventConditions != null)
{ {
foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions) foreach (EventList.PushCircleEventCondition condition in eventConditions.pushWithCircleEventConditions)
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 2, condition.conditionName)); subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 2, condition.conditionName));
} }
if (eventConditions.pushWithFanEventConditions != null) if (eventConditions.pushWithFanEventConditions != null)
{ {
foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions) foreach (EventList.PushFanEventCondition condition in eventConditions.pushWithFanEventConditions)
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 2, condition.conditionName)); subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 2, condition.conditionName));
} }
if (eventConditions.pushWithBoxEventConditions != null) if (eventConditions.pushWithBoxEventConditions != null)
{ {
foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions) foreach (EventList.PushBoxEventCondition condition in eventConditions.pushWithBoxEventConditions)
subpackets.Add(SetEventStatus.BuildPacket(actorId, true, 2, condition.conditionName)); subpackets.Add(SetEventStatusPacket.BuildPacket(actorId, true, 2, condition.conditionName));
} }
return subpackets; return subpackets;

View file

@ -45,6 +45,7 @@ using Meteor.Map.packets.send.player;
using Meteor.Map.packets.send.actor.battle; using Meteor.Map.packets.send.actor.battle;
using Meteor.Map.packets.receive.events; using Meteor.Map.packets.receive.events;
using static Meteor.Map.LuaUtils; using static Meteor.Map.LuaUtils;
using Meteor.Map.packets.send.actor.events;
namespace Meteor.Map.Actors namespace Meteor.Map.Actors
{ {
@ -1813,7 +1814,7 @@ namespace Meteor.Map.Actors
return; return;
List<LuaParam> lParams = LuaUtils.CreateLuaParamList(parameters); List<LuaParam> lParams = LuaUtils.CreateLuaParamList(parameters);
SubPacket spacket = KickEventPacket.BuildPacket(actorId, actor.actorId, eventName, 0, lParams); SubPacket spacket = KickEventPacket.BuildPacket(actorId, actor.actorId, eventName, 5, lParams);
spacket.DebugPrintSubPacket(); spacket.DebugPrintSubPacket();
QueuePacket(spacket); QueuePacket(spacket);
} }
@ -1829,9 +1830,9 @@ namespace Meteor.Map.Actors
QueuePacket(spacket); QueuePacket(spacket);
} }
public void SetEventStatus(Actor actor, string conditionName, bool enabled, byte unknown) public void SetEventStatus(Actor actor, string conditionName, bool enabled, byte type)
{ {
QueuePacket(packets.send.actor.events.SetEventStatus.BuildPacket(actor.actorId, enabled, unknown, conditionName)); SetEventStatusPacket.BuildPacket(actor.actorId, enabled, type, conditionName);
} }
public void RunEventFunction(string functionName, params object[] parameters) public void RunEventFunction(string functionName, params object[] parameters)

View file

@ -27,12 +27,12 @@ using Meteor.Common;
namespace Meteor.Map.packets.send.actor.events namespace Meteor.Map.packets.send.actor.events
{ {
class SetEventStatus class SetEventStatusPacket
{ {
public const ushort OPCODE = 0x0136; public const ushort OPCODE = 0x0136;
public const uint PACKET_SIZE = 0x48; public const uint PACKET_SIZE = 0x48;
public static SubPacket BuildPacket(uint sourceActorId, bool enabled, byte unknown2, string conditionName) public static SubPacket BuildPacket(uint sourceActorId, bool enabled, byte type, string conditionName)
{ {
byte[] data = new byte[PACKET_SIZE - 0x20]; byte[] data = new byte[PACKET_SIZE - 0x20];
@ -41,7 +41,7 @@ namespace Meteor.Map.packets.send.actor.events
using (BinaryWriter binWriter = new BinaryWriter(mem)) using (BinaryWriter binWriter = new BinaryWriter(mem))
{ {
binWriter.Write((UInt32)(enabled ? 1 : 0)); binWriter.Write((UInt32)(enabled ? 1 : 0));
binWriter.Write((Byte)unknown2); binWriter.Write((Byte)type);
binWriter.Write(Encoding.ASCII.GetBytes(conditionName), 0, Encoding.ASCII.GetByteCount(conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(conditionName)); binWriter.Write(Encoding.ASCII.GetBytes(conditionName), 0, Encoding.ASCII.GetByteCount(conditionName) >= 0x24 ? 0x24 : Encoding.ASCII.GetByteCount(conditionName));
} }
} }