Commit graph

16 commits

Author SHA1 Message Date
Mag-nus
c2ed2eab9a
Performance improvements with the help of Claude (#4472)
* Network performance improvements, limit boxing

* Polygon comment out redundant test code

* Transition remove duplicate Init()

* Creature_BodyPart and Monster_Melee comment out unused var
2026-08-03 11:48:37 +00:00
Mag-nus
362dabf362
[TEST] Reuse buffer in ConnectionListener (#3021)
Spelling fix.

Re-use the buffer in Connection Listener, and add ReleaseBuffer() method in ClientPacket to explicitly release references to the shared buffer.

This retains the optional ability to retain ClientPacket and it's underlying data for longer (server development, or 3rd party tool)
2020-07-11 08:35:28 -05:00
fartwhif
762dd072ec
fixed bug allowing a corrupt or malformed packet to crash the server when the fragment parser tries to read past the end of the data (#2903)
simplified CryptoSystem
removed unused counter from ISAAC
simplified client packet CRC verification call stack
2020-04-11 12:54:25 -04:00
fartwhif
22bb6143c6 remove network test helpers (#2603) 2020-01-19 12:52:57 -05:00
Mag-nus
fea5014c13
Network improvements (#2515)
* Fartwhifs "Removing unused pattern from CryptoSystem for slightly better performance." PR

* PacketHeader Improved Efficiency

* Improve ClientPacket.ParsePacketData() efficiency

* Packet.Data does not need to be disposed()

See here: ac99a1b716/src/Common/src/CoreLib/System/IO/MemoryStream.cs (L124)

Disposing simply sets _isOpen, _writable, _expandable to false. It doesn't even release the reference to the buffer passed in to the ctor.

* WIP

* revert the RangeAdvance stuff

* More improvements

* More improvements

* More naming improvements
2019-12-30 19:10:12 -06:00
Yonneh0
d69a1d14d9 minor math optimization (#2549) 2019-12-22 02:53:25 -05:00
fartwhif
2b606d505c Removing unused pattern from CryptoSystem for slightly better performance. (#2398)
* Adding .NET IDisposable pattern to CryptoSystem
Removing unused pattern from CryptoSystem for better performance.
Slightly improved CryptoSystem documentation

* convert IDisposable pattern to custom function
add cleanup for stream cipher
2019-12-21 08:29:05 -05:00
fartwhif
63dbd428a0 fixed an bug that occurs when client sends only a cleartext CRC NAK and ACE ignoring them, switch from honoring only ciphertext CRC NAK to honoring only cleartext CRC NAK (#2541) 2019-12-16 12:06:22 -05:00
fartwhif
90e328660c move order-insensitive items earlier in packet processing pipeline (#1647)
* moved order-insensitive "half-processing" earlier in packet processing pipeline
added adaptive resiliency to CryptoSystem

* undo untested assumption
2019-04-06 00:52:07 -05:00
fartwhif
10498076d0 network stability (#1511)
* fixed bug causing disconnects due to NAK requests being dropped.
added asynchronous verification of encrypted CRCs
added checksum caching to ClientPacket
removed "generational ISAAC" debugging tools
fixed a bug causing session to enter an unspecified state when the connect request packet sent to the client was corrupted in transit
added handling of trusted packet with ClientSentNetErrorDisconnect flag
fixed bug during handshake causing defunct session to linger
fixed AccountSelectCallback was being called in both the try and catch sections of a try/catch block leading to crashes whenever a bad handshake occurs
implemented parsing of optional "flow" header data
added more network logging

* added packetLog to WorldManager
removed pre-processor definition NETDIAG and directives
2019-03-10 17:40:23 -04:00
Mag-nus
a7a2fd33ee
Network efficiency improvements (#1313)
* Remove RunActions() from IActor interface

* make Landblock an IActor

* Make WorldManager an IActor

* Remove AgressiveInlinding from ActionQueue.RunActions (Helps break up profiling results)

* Fix WorldManager EnqueueAction

* Split WorldObject ActionQueues into Landblock and Player

* Switch Landblock from o(n) to o(1)

* Loop in reverse order, no need to create a new list using FindAll.

* use an ArrayPool<byte> to conserve resources and improve performance

* cosmetic

* Update/Tick Age every 7 seconds for Players (Before, this was consuming 1% CPU)

* More packet transmission improvements
2019-01-22 22:09:59 -06:00
Mag-nus
ac156bd19f
This fixes ServerPackets that were built with too many fragments, and thus too large (#1131)
Because of this bug, ACE has been sending packets with no size limit. While this works well on a local network, it could have had reliablity issues over a WAN.

ServerPacket has a MaxPacketSize of 464. This stems from the original days of ACE.

I suspect this is the maximum size of AC related data we can stuff into a UDP packet (before overhead is added) to keep the UDP packet sent over the WAN in a single fragment.

If we increase this value, it could reduce some server load and byte overhead, but, if a single fragment of the UDP is lost, all fragments will be lost and have to be resent.
2018-12-10 20:44:30 -06:00
fartwhif
f0717d4d23 fixing networking bugs (#1104)
* adding @netstats admin command

* trying to figure out the issue

* fixing bug causing AcknowledgeSequence packets to increment the lastReceivedFragmentSequence variable, causing the Sequence to break and never recover for that session
fixing bug causing RequestTransmit packets to be ignored
fixing bug causing the server to crash when a C2S packet is corrupt or malformed
changing the C2S RequestForTransmit packet count to be per request packet instead of per requested sequence
adding Developer commands junk, junk_s2c, junk_c2s, trash_s2c, and trash_c2s to simulate bad connections and manually corrupt packets

* updating changelog.md

* Update changelog.md

fixed incorrect variable name referred to in change log

* Update changelog.md

fix formatting

* adding preprocessor definition NETDIAG and directives to ACE.Common and ACE.Server to help development by preserving troubleshooting tools without interference with the optimal solution

* Apply suggestions from code review

set accessor only needed for NETDIAG functionality
minor change log addition

* reverting some unnecessary source syntax and formatting changes.
removing an unused exception variable

* reverting some unnecessary source syntax and formatting changes

* minor optimization of a duplicate prevention check
2018-11-30 23:58:00 -05:00
Mag-nus
ac678dd99e
Packets log level to separate configurable value via log4net.config file. (#974)
* GetPlayerBiotas and Player SaveBiotas moved to log.Debug level.

* Packets are now in separate configurable log
2018-08-26 06:45:47 -05:00
spazmodica
ade13cc475 Fix for issue #453: bad packet types crash server (#631)
* Issue 453
Added boolean to ClientPacket if packet fails to parse.
Use Packet.IsValid to determine whether to readfragments
Use Packet.IsValid to determine whether to send Packet to WorldManager
Added new list for tracking endpoints calling server before creating sessions
Added check if client is already in the loggedIn list and sending another Login packet to remove
Added check if client is not in the loggedIn list ignore requests
Added removal of client from loggedIn list
Set loggedIn list max to match ConfigManager.Config.Server.Network.MaximumAllowedSessions

* Issue 453 fix
2018-02-09 23:55:11 -05:00
Mag-nus
7e256a7fb3
ACE prj to ACE.Server rename (#628)
* ACE.DatLoader renames PositionNew to Position

* Remove comment

* ACE.DatLoader DatDatabase I prefer this type instead.

* Unused references removed

* namespace fixes

* ACE prj to ACE.Server rename

* Appveyor fix I think

* Changelog

* appveyor fixes

* Update AccountTests.cs

* Update ConstructedStatementTests.cs

* Update WeenieSearchTests.cs

* ACE.Tests -> ACE.Server.Tests

* Appvyeor
2018-02-08 17:05:02 -06:00
Renamed from Source/ACE/Network/ClientPacket.cs (Browse further)