Wulf2k / DaS-PC-MPChan

77 stars 30 forks source link

Do not connect to irc nodes while we are in the menu #27

Closed Chronial closed 8 years ago

Chronial commented 8 years ago

As neither soul level nor world are known yet, we can't make a good decision about who to connect to. We are not in a hurry, dscm-net is ridiculously fast at getting us 15 nodes – we can wait till the player has selected a character.

Wulf2k commented 8 years ago

One thing I was meaning to look at with the new code, is the phantom type and world always comparing to the numeric value? I was thinking that they should be split off into separate hidden columns instead of always converting from text to numeral, that way there will be no accidental comparison of text equaling the number.

I think that was an issue with my original implementation of deciding who to connect to after the first 3.

And with the number of nodes that DSCM-Net currently receives, I don't think we need to be indiscriminate with those first few. Did you already disable that, or was it just something I'd meant to discuss but never brought up?

Edit: I should find some time this weekend to go over all your recent changes and fully process them in my head.

Chronial commented 8 years ago

The node information is stored in the DSNode structure. Conversion to Text is only done on the fly for display via properties.

So yes, all comparison is done one the actual numeric values.

And with the number of nodes that DSCM-Net currently receives, I don't think we need to be indiscriminate with those first few. Did you already disable that, or was it just something I'd meant to discuss but never brought up?

That is two times yes :). You didn't bring that up yet, but I thought exactly the same thing, so I already removed that (it also meant less code to refactor ;).

You can see the logic in the main class here: https://github.com/Wulf2k/DaS-PC-MPChan/blob/70d04157802b64ee874fc7b071784854c912bd8e/DaS-PC-MPChan/DSCM.vb#L243

And the selection of a node to connect to is done here: https://github.com/Wulf2k/DaS-PC-MPChan/blob/70d04157802b64ee874fc7b071784854c912bd8e/DaS-PC-MPChan/IRCClient.vb#L36

I was wondering whether we should also disable irc node autoconnect until 3 minutes have passed (and we thus have gathered all nodes), But the IRC node connect interval is high enough (20 sec) for that not to be a necessary – you will at most get one "bad" node.