-
Notifications
You must be signed in to change notification settings - Fork 496
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
Conversation
…th persistence. Exposed SteamClient.Servers.ServerListProvider (Defaults to NullServerListProvider)
…erverList. Updated sample #7.
} | ||
} | ||
SteamClient.Servers.CellID = cellid; | ||
SteamClient.Servers.ServerListProvider = new FileStorageServerListProvider("servers.bin"); |
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.
Suggest using a different name here - for anyone who has run Sample7 before, the existing data will be incompatible.
byte[] buf = new byte[2048]; | ||
|
||
timeOut = DateTime.Now.AddSeconds(TIMEOUT_DELAY); | ||
nextResend = DateTime.Now.AddSeconds(RESEND_DELAY); | ||
if (param is IPEndPoint) |
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.
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.
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 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
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.
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.
👍 🚢 |
I can smell new release 😄 |
See sample 7 for how persistence can be used.