Skip to content

Commit

Permalink
add flightspline and remove excessive logs
Browse files Browse the repository at this point in the history
  • Loading branch information
insunaa committed Jun 5, 2022
1 parent 52011d1 commit 5a6263e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
1 change: 1 addition & 0 deletions Framework/Framework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Platforms>x64</Platforms>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<DebugType>embedded</DebugType>
Expand Down
6 changes: 0 additions & 6 deletions HermesProxy/World/Client/PacketHandlers/CombatHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,9 @@ void HandlePartyKillLog(WorldPacket packet)
[PacketHandler(Opcode.SMSG_THREAT_UPDATE)]
void HandleThreatUpdate(WorldPacket packet)
{
Log.Print(LogType.Error, "ThreatUpdate Received!");
ThreatUpdate update = new();
update.UnitGUID = packet.ReadPackedGuid().To128(GetSession().GameState);
update.ThreatListCount = packet.ReadUInt32();
Log.Print(LogType.Error, $"{update.UnitGUID} . {update.ThreatListCount}");
for (int i = 0; i < update.ThreatListCount; i++)
{
var temp = new ThreatInfo();
Expand All @@ -174,12 +172,10 @@ void HandleThreatUpdate(WorldPacket packet)
[PacketHandler(Opcode.SMSG_HIGHEST_THREAT_UPDATE)]
void HandleHighestThreatUpdate(WorldPacket packet)
{
Log.Print(LogType.Error, "HighestThreatUpdate Received!");
HighestThreatUpdate update = new();
update.UnitGUID = packet.ReadPackedGuid().To128(GetSession().GameState);
update.HighestThreatGUID = packet.ReadPackedGuid().To128(GetSession().GameState);
update.ThreatListCount = packet.ReadUInt32();
Log.Print(LogType.Error, $"{update.UnitGUID} . {update.ThreatListCount}");
for (int i = 0; i < update.ThreatListCount; i++)
{
var temp = new ThreatInfo();
Expand All @@ -192,15 +188,13 @@ void HandleHighestThreatUpdate(WorldPacket packet)
[PacketHandler(Opcode.SMSG_THREAT_CLEAR)]
void HandleThreatClear(WorldPacket packet)
{
Log.Print(LogType.Error, "ThreatClear Received!");
ThreatClear clear = new();
clear.UnitGUID = packet.ReadPackedGuid().To128(GetSession().GameState);
SendPacketToClient(clear);
}
[PacketHandler(Opcode.SMSG_THREAT_REMOVE)]
void HandleThreatRemove(WorldPacket packet)
{
Log.Print(LogType.Error, "ThreatRemove Received!");
ThreatRemove remove = new();
remove.UnitGUID = packet.ReadPackedGuid().To128(GetSession().GameState);
remove.AboutGUID = packet.ReadPackedGuid().To128(GetSession().GameState);
Expand Down
9 changes: 9 additions & 0 deletions HermesProxy/World/Client/PacketHandlers/MovementHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,5 +521,14 @@ void HandleMonsterMove(WorldPacket packet)
GetSession().GameState.IsInTaxiFlight = true;
}
}

[PacketHandler(Opcode.SMSG_FLIGHT_SPLINE_SYNC)]
void HandleFlightSplineSync(WorldPacket packet)
{
FlightSplineSync sync = new();
sync.SplineDist = packet.ReadFloat();
sync.Guid = packet.ReadGuid().To128(GetSession().GameState);
SendPacketToClient(sync);
}
}
}
14 changes: 14 additions & 0 deletions HermesProxy/World/Server/Packets/MovementPackets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -570,4 +570,18 @@ public override void Read()
public WowGuid128 MoverGUID;
public uint TimeSkipped;
}

class FlightSplineSync : ServerPacket
{
public FlightSplineSync() : base(Opcode.SMSG_FLIGHT_SPLINE_SYNC) { }

public override void Write()
{
_worldPacket.WritePackedGuid128(Guid);
_worldPacket.WriteFloat(SplineDist);
}

public WowGuid128 Guid;
public float SplineDist;
}
}

0 comments on commit 5a6263e

Please sign in to comment.