Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Source/ACE.Server/Network/ClientPacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,13 @@ public bool VerifyCRC(CryptoSystem fq)
{
if (headerChecksum + payloadChecksum == Header.Checksum)
{
packetLog.DebugFormat("{0}", this);
if (packetLog.IsDebugEnabled)
packetLog.DebugFormat("{0}", this);
return true;
}

packetLog.DebugFormat("{0}, Checksum Failed", this);
if (packetLog.IsDebugEnabled)
packetLog.DebugFormat("{0}, Checksum Failed", this);
}

NetworkStatistics.C2S_CRCErrors_Aggregate_Increment();
Expand Down
3 changes: 2 additions & 1 deletion Source/ACE.Server/Network/Handlers/AuthenticationHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ private static void DoLogin(Session session, PacketInboundLoginRequest loginRequ

private static void AccountSelectCallback(Account account, Session session, PacketInboundLoginRequest loginRequest)
{
packetLog.DebugFormat("ConnectRequest TS: {0}", Timers.PortalYearTicks);
if (packetLog.IsDebugEnabled)
packetLog.DebugFormat("ConnectRequest TS: {0}", Timers.PortalYearTicks);

if (session.Network.ConnectionData.ServerSeed == null || session.Network.ConnectionData.ClientSeed == null)
{
Expand Down
6 changes: 4 additions & 2 deletions Source/ACE.Server/Network/Managers/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ public static void ProcessPacket(ConnectionListener connectionListener, ClientPa
//ServerPerformanceMonitor.RestartEvent(ServerPerformanceMonitor.MonitorType.ProcessPacket_1);
if (packet.Header.Flags.HasFlag(PacketHeaderFlags.ConnectResponse))
{
packetLog.DebugFormat("{0}, {1}", packet, endPoint);
if (packetLog.IsDebugEnabled)
packetLog.DebugFormat("{0}, {1}", packet, endPoint);
PacketInboundConnectResponse connectResponse = new PacketInboundConnectResponse(packet);

// This should be set on the second packet to the server from the client.
Expand Down Expand Up @@ -95,7 +96,8 @@ public static void ProcessPacket(ConnectionListener connectionListener, ClientPa
//ServerPerformanceMonitor.RestartEvent(ServerPerformanceMonitor.MonitorType.ProcessPacket_0);
if (packet.Header.HasFlag(PacketHeaderFlags.LoginRequest))
{
packetLog.DebugFormat("{0}, {1}", packet, endPoint);
if (packetLog.IsDebugEnabled)
packetLog.DebugFormat("{0}, {1}", packet, endPoint);
if (GetAuthenticatedSessionCount() >= ConfigManager.Config.Server.Network.MaximumAllowedSessions)
{
log.InfoFormat("Login Request from {0} rejected. Server full.", endPoint);
Expand Down
9 changes: 6 additions & 3 deletions Source/ACE.Server/Network/MessageFragment.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public MessageFragment(GameMessage message, uint sequence)
Index = 0;
if (Count == 1)
TailSent = true;
packetLog.DebugFormat("Sequence {0}, count {1}, DataRemaining {2}", sequence, Count, DataRemaining);
if (packetLog.IsDebugEnabled)
packetLog.DebugFormat("Sequence {0}, count {1}, DataRemaining {2}", sequence, Count, DataRemaining);
}

public ServerPacketFragment GetTailFragment()
Expand All @@ -65,7 +66,8 @@ public ServerPacketFragment GetNextFragment()

private ServerPacketFragment CreateServerFragment(ushort index)
{
packetLog.DebugFormat("Creating ServerFragment for index {0}", index);
if (packetLog.IsDebugEnabled)
packetLog.DebugFormat("Creating ServerFragment for index {0}", index);
if (index >= Count)
throw new ArgumentOutOfRangeException("index", index, "Passed index is greater then computed count");

Expand Down Expand Up @@ -97,7 +99,8 @@ private ServerPacketFragment CreateServerFragment(ushort index)
fragment.Header.Queue = (ushort)Message.Group;

DataRemaining -= dataToSend;
packetLog.DebugFormat("Done creating ServerFragment for index {0}. After reading {1} DataRemaining {2}", index, dataToSend, DataRemaining);
if (packetLog.IsDebugEnabled)
packetLog.DebugFormat("Done creating ServerFragment for index {0}. After reading {1} DataRemaining {2}", index, dataToSend, DataRemaining);
return fragment;
}
}
Expand Down
104 changes: 69 additions & 35 deletions Source/ACE.Server/Network/NetworkSession.cs

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions Source/ACE.Server/Physics/Polygon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,11 +403,14 @@ public bool walkable_hits_sphere(SpherePath path, Sphere sphere, Vector3 up)
if (dp <= path.WalkableAllowance) return false;
Vector3 contactPoint = Vector3.Zero;
var hit = polygon_hits_sphere_precise(sphere, ref contactPoint);
if (hit != polygon_hits_sphere(sphere, ref contactPoint))
{
polygon_hits_sphere_precise(sphere, ref contactPoint);
polygon_hits_sphere(sphere, ref contactPoint);
}
// The client decompile has this branch of code as well.
// The purpose was likely for a devleoper to put a break point to debug if these two functions ever return a different result.
// Comment this out and put a break point, long, debug, or exception if you want to debug cross-check.
//if (hit != polygon_hits_sphere(sphere, ref contactPoint))
//{
// polygon_hits_sphere_precise(sphere, ref contactPoint);
// polygon_hits_sphere(sphere, ref contactPoint);
//}
return hit;
}

Expand Down
4 changes: 1 addition & 3 deletions Source/ACE.Server/Physics/Transition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -689,9 +689,7 @@ public TransitionState InsertIntoCell(ObjCell cell, int num_insertion_attempts)
/// <returns></returns>
public static Transition MakeTransition()
{
var transition = new Transition();
transition.Init();
return transition;
return new Transition();
}

public TransitionState PlacementInsert()
Expand Down
2 changes: 1 addition & 1 deletion Source/ACE.Server/WorldObjects/Creature_BodyPart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public float GetArmorMod(WorldObject armor, DamageType damageType, bool ignoreMa
{
// get base armor/resistance level
var baseArmor = armor.GetProperty(PropertyInt.ArmorLevel) ?? 0;
var armorType = armor.GetProperty(PropertyInt.ArmorType) ?? 0;
//var armorType = armor.GetProperty(PropertyInt.ArmorType) ?? 0;
var resistance = Creature.GetResistance(armor, damageType);

/*Console.WriteLine(armor.Name);
Expand Down
2 changes: 1 addition & 1 deletion Source/ACE.Server/WorldObjects/Monster_Melee.cs
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ public float GetArmorMod(WorldObject armor, DamageType damageType, bool ignoreMa
{
// get base armor/resistance level
var baseArmor = armor.GetProperty(PropertyInt.ArmorLevel) ?? 0;
var armorType = armor.GetProperty(PropertyInt.ArmorType) ?? 0;
//var armorType = armor.GetProperty(PropertyInt.ArmorType) ?? 0;
var resistance = GetResistance(armor, damageType);

/*Console.WriteLine(armor.Name);
Expand Down