Commit graph

11 commits

Author SHA1 Message Date
Mag-nus
e2e88b7e87
Network perf improvements (#4205)
* initial

* More networking improvements
2024-07-23 11:13:56 +00: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
Mag-nus
8a5e113e4c
MemoryStream.ToArray() -> GetBuffer() (#1689)
* MemoryStream.ToArray() -> GetBuffer()

This is the partial implementation of the previous PR.

There is still one more MemoryStream.ToArray() in the code, but, the usage of MemoryStream in that area is a bit complex and will take some further work to get away from ToArray()

* This should fix the CreateReadyToSendPacket exception on retransmit
2019-04-11 08:09:28 -05:00
Mag-nus
ff770549ee
Revert "MemoryStream ToArray() -> GetBuffer() (#1676)" (#1682)
This reverts commit 2b9618cb9b.
2019-04-09 10:02:54 -05:00
Mag-nus
2b9618cb9b
MemoryStream ToArray() -> GetBuffer() (#1676)
ToArray does a copy where GetBuffer gets the underlying backing array.

Thanks Paradox for the tip.
2019-04-09 06:50:33 -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
daaac0e440
Handle logouts and session drops more gracefully (prevents null player exceptions) (#1134)
* ServerPacket.MaxPacketSize todo comment added

* Don't process enqueued WorldConnectioned inbound messages if player is null

* Handle logouts and session drops more gracefully (prevents null player exceptions)

* Add important comment
2018-12-11 19:59:44 -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
Mag-nus
99fb8bcc55
All this does is cleanup a bunch of style issues that Resharper complains about (#629)
* Removed unused using statements

* Removed redudnant ToString()'s

* Removed some redundant type casts

* Removed redundant bool comparisons

* remove redundant initializers

* xml summary in invalid place switched to comments

* Use string interpolation

* use format separators

* Removed redundant parenths

* remove redundant else

* direct cast when safe

* redundant string interpolation

* xml summary fixes

* removed empty ctors

* fix modifier order

* Convert to auto property

* Convert some getters to method bodies

* use format separators

* changelog

* Auto-properties that can made to get-only

* fixed some references in XML comments

* remove redundant base()

* Revert "Auto-properties that can made to get-only"

This reverts commit 32a1225ce8.

* fix starter gear json

* Use collections count property

* simplify conditional ternary expression

* remove redundant return statements

* Constructors for abstract classes changed to protected

* Moved declarations to inner scopes

* Join declaration and assignments

* inline out variables

* Use enum extension methods instead of static methods

* inline out more variables

* more unused usings

* Remove specifying enums as ints
2018-02-09 06:46:49 -06: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/ServerPacket.cs (Browse further)