-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
network layer reduction #1785
network layer reduction #1785
Conversation
added null inspection to FlushPackets after dequeueing the next packet
reverted 1687
move all session handling code to new class network manager
public static void HandleConnectResponse(Session session) | ||
{ | ||
if (WorldManager.WorldStatus == WorldManager.WorldStatusState.Open || session.AccessLevel > AccessLevel.Player) | ||
{ | ||
DatabaseManager.Shard.GetCharacters(session.AccountId, false, result => | ||
{ | ||
// If you want to create default characters for accounts that have none, here is where you would do it. | ||
if (result.Count == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think everything in this func isn't meant for master...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
woops, left that in by accident, thanks for the note, i'll remove it.
@@ -45,44 +45,74 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ACE.Adapter", "ACE.Adapter\ | |||
EndProject | |||
Global | |||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | |||
Debug|Any CPU = Debug|Any CPU |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is needed for FakeClient, but for sure none of the already existing projects/sln should have added AnyCPU build choices as those were specifically removed a year+ ago to force x64 only
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix this by removing the extra build configurations, good call
|
||
<ItemGroup> | ||
<Reference Include="ACE.Common"> | ||
<HintPath>..\ACE.Server\bin\x64\Debug\netcoreapp2.1\ACE.Common.dll</HintPath> | ||
<HintPath>E:\from desktop\ACE\ACE-plugin\Source\ACE.Server\bin\x64\Debug\netcoreapp2.1\ACE.Common.dll</HintPath> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
might be an issue here, not sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good call, i'll try to make it relative, had to move the project folder because VS tries to add the project to the main .sln file when the project folder resides here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned this in DM's, but you can make it a lot easier for us to review this PR by creating a dummy Session.Network object that simply relays EnqueueSend down to the base session.
It would leave the vast majority of these files unchanged so we can review the actual changes more clearly.
Then, after the architecture change is approved and merged, the wrapper class can be removed.
Can you please describe to us what this PR accomplishes? |
I'll see if it can't revert the reduction and do it right. Good call! |
I'm starting to go over your checklist, thank you for providing that. The first thing I notice is the combination of Session and NetworkSession. I was aware that you had done this, which is why I suggested the wrapper, but I was curious as to why. The reason for combining class does not apply here. Session and NetworkSession should be kept functionally separate. NetworkSession is designed to handle low level packet work. This includes:
Session is designed to handle higher level session management. This includes:
|
i'll revert that reduction, there's one piece around all that, Network Management, manages the session collection, does session discrimination, and does low level network I/O, not sure how much that deviates from "the pattern". |
Combine as many classes as possible without violating KISS or "the pattern"
Implement I/O queues
Test mass connections and correct shortcomings of the implementation during extreme conditions
To prevent flooding, Implement inbound session packet governor and find threshold
To prevent flooding, Implement
ProcessFragment
governor and find thresholdProcessFragment
needs to be a producer for game loop consumer, game loop consumer pull X number of messages to keep server loop tight (500? 1000? more?)S2C Retransmission request fulfillment, or C2S NAK, needs to have complexity added
Outbound queue needs an independent consumer thread, there should be no reason to send via game loop in bursts every game iteration, outbound can be constant
Sessions should only be created upon authentication success, reducing the abuse potential and increasing network layer fitness.
the cookie in the cookie exchange can be a constant, eliminating the need for a state machine during authentication, it doesn't actually provide any security or stability related benefits.
port 9001 listener can/should be omitted as it adds unnecessary complexity at the cost of readability, understandability, and changeability.
ConnectionResponse
to 9001 at the routing level almost immediately, and the client will enter port 9000 only mode, and then sends it to 9000session keys should consist of
IP Address | Port
combined into a Unt64,Uint64 where the top32 is the IP and bottom 32 is the port
first packet analysis consists of the following:
FindOrCreateSession
needs to have a lock around the entire body of the functionmisc fixes: