Blacklisting Servers instead of "Favorite"
Grevas
Join Date: 2014-09-16 Member: 198561Members
Hello, is there a way to also mark a server as unwated in the Browser?
I experienced, for the first time, the reserved Slot "system" and i don't want to play on that server ever again.
My current approach would be to abuse the favorite-system (since i have none) to blacklist those for myself.
Is there another option?
I experienced, for the first time, the reserved Slot "system" and i don't want to play on that server ever again.
My current approach would be to abuse the favorite-system (since i have none) to blacklist those for myself.
Is there another option?
Comments
It would still be a nice feature, although reserved slots aren't nearly as bad as they were back then.
I read afterwards a little bit into it, but still - beeing jerked out midgame was disgusting for me. It's not like there were no servers, they're just empty and this one has been brought to life by admins. Faking usernumbers with bots and such. I would be more willing to get a server myself, before supporting that practice.
As for the history tab, that doesn't do the job for me at all. I play "random" server; considering only the current & max players of it before joining.
i'll bug the feature dudes for it.
I guess the issue is that often you forget (at least i do) what servers you want to avoid. If possible i avoid silly mods for example ( like those multikill announcers), but i do not always remember which server is running them.
But as i said, this sounds like something that should be implemented in a mod first. Its actually a nice way to get into NS2 modding.
If you can get someone to package it properly and probably redo...
I didn't think the menu would be moddable but it sure is. I didn't want to change the architecture since i didn't know what i was going into. Afterwards i have to say it probably would be better as a seperate key in serverEntry / serverData instead of a toggle on that boolean...
Here's the Diff: http://pastebin.com/rVPNS55v
Here's a little changed fav texture (needs to be in Steam\SteamApps\common\Natural Selection 2\ns2\ui\menu)
http://tempsend.com/1CDC0DB41B/8255/revertedfavorite.dds
Diff source again:
Edit: diff contains a little debug leftover, full sources (unlisted, setup for a month)
http://pastebin.com/DCxEzgj2
http://pastebin.com/GfAFwk4f
If someone feels like redoing parts of it, atleast you can see what "needs" to be changed and what the flow is
[edit2] redone the diff, it was on the wrong side and confusing
P.S. probably should say what it actually does... A click on Favorite will toggle a second state of the server, instead of "favorite - none" it goes "favorite - dislike - none"
If someone would collaborate and package this into a mod, i would redo the lua-part to use a custom key for easy deinstallation. Haven't looked into sorting / filtering yet, might add that too.
[edit2] oh, it *needs* to be packaged correctly in the first place or you won't be able to join a game *shrug*. If no one wants to collaborate i might try it out myself, but i'm not really keen to do that...
Can you package this guy's work into a clientside mod?
Anyway, I can't really read the code myself, but I do know that Favorite servers load first, much faster than non-favorite servers. Ideally blacklist servers would be prioritized last, or at least not before normal servers. I say this because I have the suspicion that all you really did was add a second color favorite icon. Of course loading blacklist servers first wouldn't really hurt anything compared to not having the blacklist option at all.
Atleast that's what i understood from the code.
It's fairly simple but i don't know if it's actually open to be modded since it modifies core lua files (basically what SamusDroid said)
@SamusDroid before this mess gets included, i would like to see if this is possible to be packaged seperatedly. If it's not possible*, let me first clean this up since it's really a half-hour work (and 1,5h reading through documentation for lua & redoing *rolleyes*)
Before adding this as a hardcoded feature, we could provide a hook into it, not 100% sure how the system works yet. Let me think on that though
Anyways, if you want to include it yourself it's fine with me. I'm just scratching an itch here.
If you would like support & i would change it anyways, we could collaborate on that. This solution is minimal and i might get some idea how to imporve it.
@ All if someone feels like doing a nicer texture, that would be neat. I'm not a graphics guy and spent like 2min on it...
[edits] tired, lots of typos and stuff.
* i don't know how the mod system works, haven't read through the info available yet. I assume it's a override system. Which would correlate with SamusDroids answer to a degree, it means the mod needs to be updated, but only *if* there are changes in those 2 files - which is the default state for mods changing core behaviour anyways?
Using hooks here is not really possible ( without either basically overloading the given function completly anyway or using a lot debug methods ) as the gui classes are a total mess structure wise and the entry system is not yet supported in the main menu (my new mod framework should solve that issue once it gets added to vanilla).
I started a modding guide once but never finished it but it might help you getting things sorted out: https://docs.google.com/document/d/1ewJCs-gPBKeBZOqFujpNa4gApvO5Sz-rabgHvHOoAWU/edit?usp=sharing
Overall i would suggest to introduce multiple server browser tabs for the given categories and organize the total server table as dynamically map we filter as needed.
But when it comes to main menu gui work well once you open that "box of pandora" i guarantee you that you will have work for months (there is always that one little part of "ugly" code you just want to improve/fix)
Other than that I personally don't see a reason to spend CDT time on that feature given that the game only has a handful of servers going at any given time. Pretty easy to remember which servers suck imho.
Sorry to say, but the guide in itself didn't really help me. It just confirmed a few things i've already noticed . But i'm not the audience for this kind of stuff so don't feel bad about that. The stuff i need would be an overall documentation how things are inteded to work together, like a "small" (read: large) graph portraying which files are involved into what (but that's a small issue since the packaging itself seems fine at first glance). A few bullet points of what the thoughts of the devs on the mod-system were is mostly helpful, they atleast give some pointers what the inteded use is and help you not to work against the system (i've never seen such content promoted though, just stumbled on it randomly in a few cases).
[prgorammertalk]
By providing hooks, i meant only adding a few calls in the notion of do_after_filter, do_after_sort, do_after_init really (providing the most likely needed variables). I know GUI tends to be a mess of references everywhere OR completely bloated. It's the nature of things... In NS2 it's atleast sanely packaged /scoped so i have no issues with it. Really, i would add the hooks *i* need to implement this feature as a mod, this doesn't mean the menu is modular or anything.
But doing that in a fashion feasible for a override system is a pain in the a** anyways, that's why i would first have to think about it Depending on what you mean with "multiple server browser tabs" i would most likely not touch that.
I'm guessing you mean it like in a webbrowser, so you have multiple tabs you can switch.
Set filters accordingly and so on.
But afaik since there are only a few checkbox & sliders now i can't see much improvement from that, but a huge effort for it.
I would agree, if the server base would be larger / more populated and filtering by mods, player numbers (min, max) would get added though.
As long i can grasp all my filtered servers in one page, i don't really need much more. I thought about adding a filter for player numbers (because that's what i look for) and decided it would be too minor improvement for myself.
[edit] huge efforts = about a day or so
[edit2] after a cigaret-thought about the override system in the case of the menu, i think it would most likely end up in re-structuring that thing and encapsulating each step into its own file. But that still wouldn't solve the issue, is there a global EventBus or something? Without sharing something like that i can't imagine an actual API for this task.
[/prgorammertalk]
[edit3] @0ni i don't really care if you want this or not, seriously. It's my personal itch and some people seem to have it too and i'm willing to do the coding work for it (as i have already put a prove of concept code for it - by that i mean a basic version of it is already implemented which was 0,5h work if you know the systems involved - i spent more time on this post than on developing this feature!).
[edit5] to really make it clear, if you guys want to add it in a real patch (as is), i want to rework it in a professional manner. This was a first attempt that works and i have issues with it.
P.S. for documentations sake, is there a VCS i can commit to?
- Redone the texture, after 45m i gave up on "broken-heart" icon since it kept looking like garbage. It's an X now.
- Looked deeper into the files and started redoing ServerBrowser, but i gave up on it. Need a proper testing setup for it (ran into legacy problems for which i don't have files to test against). Would've preffered to unify the local server-storage into one .json file (but lua is sh***y for list comprehensions, so that was already frustrating)
- Took the version from yesterday.
- Changed the value to use a string in favorite to be less confusing ("avoid").
- The default sorting can't be changed, because there is none. It basically renders as soon as it gets an entry (that's why local entries end up on the top anyways). I haven't found any clue suggesting a "this process is finished" method for cleanup or whatever (might be in the Client lib, to include a pun: it's an hard-core feature).
- Adapted SortByFavorite to check for the new flag, so disliked servers get sorted as expected. Not sure if this is how lua really handles that expression but it works. ( x = true and -1 => x = -1)
An update routine for the current storage is not needed this way.
If someone feels like / has reasons to change ServerBrowser to use a single list & get rid of that redundancy i'd gladly assist. In my case it made it harder to extend properly in a safe manner.
P.S. i didn't make a version with it's own storage file since i felt it would make things even more messy with copy-paste code.
[edit] if someone has a bonus point for adding a third storage file for disliked-servers, that would fix the default-sorting issue (i'd just not add them to the table in the initialization). As it is now i wouldn't feel good about it.
[edit2] reasoning for the abuse of Favorites: well, you can't like and dislike a server, can you? which reminds me, i could truncate a few bits from the logic by a few changes (FYI, "is in favorites != is favorite" is in place already, instead of using a string then it would be nicer to have it to evaluate the actual entry. Haven't got it in me to do a second swipe and check what implications a missing key would have... Lua makes me mad. But a String entry is a little bit more flexible so i actually prefer it done this way)
[edit3] i'll give it a try for first edit if i can remove the dependency on adding disliked servers in the initialization. Having a hard time to leave the topic with optimisations in mind ...
[edit4] nope, those tables are too coupled, changing the logic to not add those is the same effort it would take to add a seperate file for them. Or unify instead.
[grammar errors *again*, damnit, i don't write in english that often... Code has a syntax, don't judge ]
[edit5] checked the package, the files were in wrong directories, manual patching needs attention *nod* link updated
I tried to resort the list after each entry is added and had to realize it won't work, so do not even attempt to do it this way . (well, it works, but is a flickery-mess*, assumed the rendering process would be limited somewhere else - it is not)
Might give it another try, in case i get distracted tomorrow by something else & you're interested just drop me a PM.
* the main issue is that reordering doesn't always provide the same result, since entries can be equal by order (so some entries will jump up and down depending on the current state). This means it has to be tackled where the data is inserted in the first place.
Since nobody has brought it up yet, I'll do it. Say what you want about the reserved slot system, but I've found that the presence of one usually is an indicator of a strong community. Not that it's strong because of RS, or the other way around, they're just two things that are usually found together. NS2 is best played within a strong community of people, those have been the best games for me.
Yea it sucks getting bumped by a reserved slot holder but... if you find a server that you really like, and you play there often... why not get a RS? Some servers even offer free RS.
I can understand the advantages of RS in itself*, but still, i'm not going to participate in it. For me it's done wrong way and that is absoultely subjective. There have been other servers i would like to avoid, but they've not reached the boiling point in my case.
* i'm 100% certain the server i was on is a very populated one and has many regulars.
The only issue could be that two players connect at the same time but there is only 1 free slot left, so one fails to connect. But that can also happen to you on normal servers.
So sorry but could someone explain me the issue with the rs system?
Btw. i just woke up with the thought "you moron, you were like 10 lines away from the stuff which needed change" - no distractions and i'll finish that TODO or it would bug me the rest of the day.
I started on the mentioned TODO earlier and have it working except local-stored servers. http://tempsend.com/C8EC4D141A
Before i add any more effort to it i'd like a confirmation that you actually still need it. I might have misunderstood it after all.
Is this good enough?
Turns into
Or
Or
Source files are in PNG, so you'll still have to convert it to DDS: