These are chat archives for Ruhrpottpatriot/GW2.NET

13th
Jan 2016
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:13
You have to set the line ending handling in Git, see HERE fore more infos
Happy new year BTW
Also I'm currently refactoring the repositories to use HTTPClient and the new repository layout. Converters will stay the same for now. After those chances work fine we can tackle the converters itself
I'm also thinking of a very basic and small InMemory cache
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:18
help me out with this: The only time an item in the cache becomes stale is, if it implements ITimesensitive and the stored timestamp is outside of a set margin, or if a new build comes out, right?
Steven Liekens
@StevenLiekens
Jan 13 2016 15:31
or if the cache header expires
well
what you said about ITimeSensitive
where the margin is set by a response header
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:32
So the date set in ITimeSensitive is the time the chache expires, right?
Steven Liekens
@StevenLiekens
Jan 13 2016 15:33
not exactly
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:33
how do I have to treat it then?
Steven Liekens
@StevenLiekens
Jan 13 2016 15:33
the date set in ITimeSensitive is the Date header
which is the server time when the response was generated
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:33
ah
Steven Liekens
@StevenLiekens
Jan 13 2016 15:34
more recently they added cache headers that contains the expiry date for that response
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:34
So it'd be best to add to the ITimeSensitive header a property that tells us when it expires?
Steven Liekens
@StevenLiekens
Jan 13 2016 15:34
so ITimeSensitive needs to be updated with an Expires : DateTimeOffset property
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:35
yeah thought so too
Steven Liekens
@StevenLiekens
Jan 13 2016 15:35
apparently there was a big patch today
who knows what they changed this time :(
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:36
^^
Oh boy, was it DateTime or DateTimeOffset? The latter, right?
Steven Liekens
@StevenLiekens
Jan 13 2016 15:41
yeah
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:42
Why do they even have to. As far as I understood it, DateTime was localized and DateTimeOffset not. Why not just implement one with a method to convert it to local time...
Steven Liekens
@StevenLiekens
Jan 13 2016 15:45
DateTimeOffset is used to represent an instant
DateTime is used to represent a moment
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:46
so what's the difference then?
Steven Liekens
@StevenLiekens
Jan 13 2016 15:46
where the first is absolute and the latter is relative
eg. noon is the moment when most people eat lunch
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:47
ah
Steven Liekens
@StevenLiekens
Jan 13 2016 15:47
but it is relative to where you are
but if I say I'm eating lunch this instant
then that's a DateTimeOffset
:)
that signature sounds right, or did I miss something?
Steven Liekens
@StevenLiekens
Jan 13 2016 15:48
besides the name?
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:48
yeah
Steven Liekens
@StevenLiekens
Jan 13 2016 15:49
how do you look up values by key?
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 15:50
Via the Get(Func<T,bool>) method
sec
You could write var items = cache.Get(i => i.Id == someId)
or you could run a LINQ query on the Values property, but then you'd have to filter for a possible localized item
Steven Liekens
@StevenLiekens
Jan 13 2016 16:01
you have to do that anyway
the unique key for any localized item is id + lang
Robert Logiewa
@Ruhrpottpatriot
Jan 13 2016 16:02
Yeah, I just saw that too. I'm trying to do it that if I use the Get method only objects for the current repository langauge are returned and Value is used to acess the complete repository
Steven Liekens
@StevenLiekens
Jan 13 2016 16:38
by the way can you pull from here https://github.com/StevenLiekens/GW2.NET
it's kind of a messy situation with changes happening in both master and maintenance
Steven Liekens
@StevenLiekens
Jan 13 2016 16:56
Still have to change chat codes in maintenance :( the game client uses new header bytes