Loading...
  OR  Zero-K Name:    Password:   

zero-k lobby simple bug

5 posts, 795 views
Post comment
Filter:    Player:  
sort
9 years ago
Happened to Xivender, [19:20] Xivender I have Linux Mint 17 Installed and Zk bzw Spring dont start

http://pastebin.com/0bxjUAEX

It seems to need special report on github and I dont know what, I dont have github account, i just write it here. Fix is simple, however I dont do .net anymore (only java), so can't create patch for xiv and test :-(

I checked a bit the error, zero-k channel chatlog says it all:
[19:48] Xivender and the zk code is shit
[19:49] Svatopluk well according to https://msdn.microsoft.com/en-us/library/kfw3x8dc(v=vs.110).aspx
[19:49] Svatopluk you should check for ListBox.NoMatches
[19:49] Svatopluk after using ListBox.IndexFromPoint method
[19:49] Svatopluk and zero-k lobby doesnt check https://github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/ZeroKLobby/MicroLobby/PlayerListBox.cs#L191
[19:50] Svatopluk simple insert of line would stop error: if (hoverIndex == ListBox.NoMatches) return;
[19:50] Svatopluk i have no patience for creating account, logging, reporting etc.
[19:51] Svatopluk + can't create patch because i switched dev tools from .net to java
[19:51] Svatopluk :-(
[19:52] KingRaptor hmm line 199 does check both bounds
[19:52] Svatopluk https://github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/ZeroKLobby/MicroLobby/PlayerListBox.cs#L192
[19:52] Svatopluk GetItemRectangle(hoverIndex)
[19:52] Svatopluk fails in method GetItemRectangle(hoverIndex)
[19:52] Svatopluk hoverIndex is not checked
[19:52] Svatopluk only hoverIndex >= base.Items.Count-1
[19:52] Svatopluk and I dont know what ListBox.NoMatches is exactly
[19:53] Svatopluk docs doesnt say so
[19:53] Svatopluk ListBox.NoMatches could be, for example, Integer.MaxValue
[19:53] Svatopluk in which case code happily goes and fails
[19:53] KingRaptor think I'll look at it tomorrow at any rate
+0 / -0

9 years ago
known for 3 months already
+1 / -0


9 years ago
DErankXivender: try this ZKL .exe
+0 / -0
9 years ago
Yesterday in the Night, after 7 hours from Install, Reinstall, Configure and return again zk will works...

I Dont think the Error was in ZKL.

+0 / -0
9 years ago
From the Sprung link, value "Index 65535" seems pretty much bug as described by me (ListBox.NoMatches seems to have value 0xffff, not -1, in which case it would not happen).

Fact that it works for Xivender after reinstall, doesn't make it less bug, just it shows it happens rarely, and depends on (random?) circumstances.

Anyway, comment on that line https://github.com/ZeroK-RTS/Zero-K-Infrastructure/blob/master/ZeroKLobby/MicroLobby/PlayerListBox.cs#L191 says " //note: this don't return value exceeding base.Items.Count -1", which is false, because documentation says it can return ListBox.NoMatches (with unspecified value).

Funny how weak typing produces programming errors: in (newer) language like Ceylon, return value of function would be Integer|ListBox.NoMatchesEnum, and comments/documentation not needed, bug never happens, because compiler error.
+0 / -0