Skip to content
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

Persistent server list #293

Merged
merged 12 commits into from
Jul 8, 2016
Merged

Persistent server list #293

merged 12 commits into from
Jul 8, 2016

Conversation

azuisleet
Copy link
Member

  • Addresses the need to fetch servers from SteamDirectory
  • Provides persistent storage mechanisms with: FileStorageServerListProvider, IsolatedStorageServerListProvider (with an attached snk), and NullServerListProvider (the default)
  • Modifies the connect path to take tasks and uses continuations for them
  • The guts of SmartCMServerList have been replaced to only handle the most recent complete list. It not longer allows adding individual endpoints.

See sample 7 for how persistence can be used.

}
}
SteamClient.Servers.CellID = cellid;
SteamClient.Servers.ServerListProvider = new FileStorageServerListProvider("servers.bin");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest using a different name here - for anyone who has run Sample7 before, the existing data will be incompatible.

@Netshroud Netshroud added this to the 1.8.0 milestone Jun 25, 2016
byte[] buf = new byte[2048];

timeOut = DateTime.Now.AddSeconds(TIMEOUT_DELAY);
nextResend = DateTime.Now.AddSeconds(RESEND_DELAY);
if (param is IPEndPoint)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block seems iffy. You're doing is then as (better to just do as and check for null), followed by as and dereference. If param is neither an IPEndPoint not a Task<IPEndPoint>, this will just be a NullReferenceException. Better to just do an as for IPEndPoint, then a cast for Task<IPEndPoint>. Or ditch IPEndPoint entirely and always supply a task.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is a mistake, as I don't think param can even be an IPEndPoint so this can be simplified to a single as

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's only ever Task<IPEndPoint> then just cast it.

…tion handling around tasks now looks explicitly at AggregateException. Cleaned up unnecessary MemoryStream copy in FIleStorageServerListProvider and IsolatedStorageServerListProvider.
@Netshroud
Copy link

👍 🚢

@Netshroud Netshroud closed this Jul 8, 2016
@Netshroud Netshroud reopened this Jul 8, 2016
@Netshroud Netshroud merged commit 6d0a396 into master Jul 8, 2016
@JustArchi
Copy link
Contributor

I can smell new release 😄

@yaakov-h yaakov-h deleted the persistent-server-list branch September 3, 2017 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants