Blacklisting Servers instead of "Favorite"

GrevasGrevas 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?
«1

Comments

  • sotanahtsotanaht Join Date: 2013-01-12 Member: 179215Members
    I remember asking for that... 2 years ago. At least we did finally get a history tab.

    It would still be a nice feature, although reserved slots aren't nearly as bad as they were back then.
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    Thanks, i'll take that as a "no" 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.
  • AurOn2AurOn2 COOKIES! FREEDOM, AND BISCUITS! Australia Join Date: 2012-01-13 Member: 140224Members, Forum Moderators, NS2 Playtester, Forum staff
    It's possibly a very easy implement.
    i'll bug the feature dudes for it.
  • AsranielAsraniel Join Date: 2002-06-03 Member: 724Members, Playtest Lead, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, Retired Community Developer
    This is typically a feature that can start out as a mod. I would like to see it myself. But there a certainly a few ui problems to solve. Like how to un blacklist a server again etc. But i like the idea
  • DecoyDecoy Join Date: 2012-09-11 Member: 159037Members, Super Administrators, Playtest Lead, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Shadow, WC 2013 - Silver, Subnautica Playtester, Subnautica PT Lead, Pistachionauts, Retired Community Developer
    Yeah. I don't even think the servers would need to be entirely removed... Just if you blacklist them they go to the very bottom of the server browser. Then you can just click/unclick like you would to favorite a server. A reverse favoriteing :P
  • joshhhjoshhh Milwaukee, WI Join Date: 2011-06-21 Member: 105717Members, NS2 Playtester, NS2 Map Tester, Reinforced - Supporter, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester
    There are, at most, 20 populated servers if you put the ping cap at 250. Do you really need a blacklist?
  • AsranielAsraniel Join Date: 2002-06-03 Member: 724Members, Playtest Lead, Forum Moderators, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, Retired Community Developer
    joshhh wrote: »
    There are, at most, 20 populated servers if you put the ping cap at 250. Do you really need a blacklist?

    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.
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    AurOn2 wrote: »
    It's possibly a very easy implement.
    i'll bug the feature dudes for it.

    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:


    --- a/ServerBrowser_original.lua
    +++ b/ServerBrowser_mod.lua
    @ function SetServerIsFavorite(serverData, isFavorite)

    end

    - if isFavorite and not foundIndex then
    -
    + if isFavorite == 2 and foundIndex then
    + local savedServerData = { }
    + serverData = 2
    + for k, v in pairs(serverData) do savedServerData[k] = v end
    + gFavoriteServers[foundIndex] = savedServerData
    + StartSoundEffect(kFavoriteAddedSound)
    +
    + elseif isFavorite and not foundIndex then
    local savedServerData = { }
    for k, v in pairs(serverData) do savedServerData[k] = v end
    table.insert(gFavoriteServers, savedServerData)
    StartSoundEffect(kFavoriteAddedSound)

    elseif foundIndex then
    -
    + Shared.Message('removed from fav')
    table.remove(gFavoriteServers, foundIndex)
    StartSoundEffect(kFavoriteRemovedSound)

    @ function GetServerIsFavorite(address)
    for f = 1, #gFavoriteServers do

    if gFavoriteServers[f].address == address then
    - return true
    + return gFavoriteServers[f].favorite
    end

    end
    @ function GetStoredServers()
    for f = 1, #gFavoriteServers do

    table.insert(servers, gFavoriteServers[f])
    - servers[f].favorite = true
    + servers[f].favorite = gFavoriteServers[f].favorite

    end




    --- a/ServerEntry_orig.lua
    +++ b/ServerEntry_mod.lua
    @ local kBadPing = 180
    local kFavoriteIconSize = Vector(26, 26, 0)
    local kFavoriteIconPos = Vector(12, 4, 0)
    local kFavoriteTexture = PrecacheAsset("ui/menu/favorite.dds")
    +local kNonFavoriteTextureSecond = PrecacheAsset("ui/menu/revertedfavorite.dds")
    local kNonFavoriteTexture = PrecacheAsset("ui/menu/nonfavorite.dds")

    local kFavoriteMouseOverColor = Color(1,1,0,1)
    @ function ServerEntry:Initialize()
    self.favorite:SetTexture(kFavoriteTexture)
    self.serverData.favorite = true
    SetServerIsFavorite(self.serverData, true)
    -
    - else
    -
    + elseif self.serverData.favorite == 2 then
    self.favorite:SetTexture(kNonFavoriteTexture)
    self.serverData.favorite = false
    SetServerIsFavorite(self.serverData, false)
    + else
    + self.favorite:SetTexture(kNonFavoriteTextureSecond)
    + self.serverData.favorite = 2
    + SetServerIsFavorite(self.serverData, 2)

    end

    @ function ServerEntry:SetServerData(serverData)
    self.modName:SetColor(kWhite)
    end

    - if serverData.favorite then
    + if serverData.favorite == 2 then
    + self.favorite:SetTexture(kNonFavoriteTextureSecond)
    + elseif serverData.favorite then
    self.favorite:SetTexture(kFavoriteTexture)
    else
    self.favorite:SetTexture(kNonFavoriteTexture)



    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 :)
  • AurOn2AurOn2 COOKIES! FREEDOM, AND BISCUITS! Australia Join Date: 2012-01-13 Member: 140224Members, Forum Moderators, NS2 Playtester, Forum staff
    @Grevas FYI, the feature dudes, shine blue.
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    @AurOn2‌ i didn't look at the badges, just assumed it to be a moderator. Well that went fast then.

    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...
  • IronHorseIronHorse Developer, QA Manager, Technical Support & contributor Join Date: 2010-05-08 Member: 71669Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Subnautica Playtester, Subnautica PT Lead, Pistachionauts
    Paging the menu mod master mind @SamusDroid‌
    Can you package this guy's work into a clientside mod?
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    I tried this a long time ago but was unsuccessful. I'll try again. Making a mod of the menu would require it to be updated every patch, I'd rather just do it officially as it's something I've always wanted to do.
  • sotanahtsotanaht Join Date: 2013-01-12 Member: 179215Members
    I have to say I'm impressed. Your 5th post on the forum and you are already out there modding your own solutions to two year old problems.

    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.
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    @sotanaht‌ sorry to disappoint you, the servers are not loaded first. They're put in the list first and while the servers are loaded the list get's updated. If a server is no longer there it gets removed from favorites. Meaning, it creates the illusion that your favorites are always there ;)

    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?
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    edited January 2015
    Grevas wrote: »
    @sotanaht‌ sorry to disappoint you, the servers are not loaded first. They're put in the list first and while the servers are loaded the list get's updated. If a server is no longer there it gets removed from favorites. Meaning, it creates the illusion that your favorites are always there ;)

    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 first 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 :)

    @ 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...

    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)
  • 0ni0ni Join Date: 2012-08-30 Member: 156991Members
    Some servers deserve to be outright banned. Anyone ever played on Hyperion (not the "new" one) when it's at capacity? Just awful, after 16-18 players the red plugs just get ridiculous. Of course the server has never in it's life had any admins on it to report the issue to. Had a really good game of Kodiak going last night but every time we rushed Surface everyone on both teams red plugged for 10-30 seconds. Made aliens lose because it's not like you can just phase back in and pick your lerk back up. Not that aliens would have won mind you, as in any good game the final outcome was uncertain, but it certainly didn't help.

    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.
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    @GhoulofGSG9 skimmed through it, and my assumption was right. Just a plain override system then :) [edit 4]which is basically free, if you do stuff in a scripting language, don't be proud of it ...[/edit 4]
    Sorry to say, but the guide in itself didn't really help me. It just confirmed a few things i've already noticed :neutral_face: . 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 ;)
    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.
    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.
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    edited January 2015
    Make it official quality as you can and I'll see about adding it. It's something I've always wanted to do. No hooks, no overrides, just the files with your stuff added in
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    @SamusDroid sure thing. I should get it done it the next 6h or so.
    P.S. for documentations sake, is there a VCS i can commit to?
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    Packaged http://tempsend.com/C8BDEA4283

    - 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? :smiley: 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 :blush: ]
    [edit5] checked the package, the files were in wrong directories, manual patching needs attention *nod* link updated
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    FYI, i noticed there is also a TODO on the trelloboard for the default ServerList ordering.
    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 :D. (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.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    Grevas wrote: »
    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?

    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.
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    @BeigeAlert‌ i'm not saying i need this because i dislike the RS-System itself, it's just one of the cases that tickled me enough to get out and ask if it's feasible :).
    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.
  • GhoulofGSG9GhoulofGSG9 Join Date: 2013-03-31 Member: 184566Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Reinforced - Supporter, WC 2013 - Supporter, Pistachionauts
    The way the vanilla and shine rs systems are done they do not kick any players at any time.

    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?
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    @GhoulofGSG9 in this case, i got kicked midgame from the team. So i probably mean a custom one.

    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.
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    To do this officially, it would need to be a whole new config file for blacklisted servers, a tab for blacklisted servers where you could unblacklist servers, and another column added where you click to (un)hide server.
  • GrevasGrevas Join Date: 2014-09-16 Member: 198561Members
    edited January 2015
    @SamusDroid mkay. A little bit frustrating that this info comes now, since i've described the behaviour very early. It would be neat if you could PM me your reasoning for the multiple-files approach.

    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.
  • IronHorseIronHorse Developer, QA Manager, Technical Support & contributor Join Date: 2010-05-08 Member: 71669Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Subnautica Playtester, Subnautica PT Lead, Pistachionauts
    edited January 2015
    That broken heart icon is a must.

    Is this good enough?
    4KJNwIZ.png
    Turns into
    NKk8noE.png
    Or
    MO5mYV7.png
    Or
    z9O3gGA.png

  • IronHorseIronHorse Developer, QA Manager, Technical Support & contributor Join Date: 2010-05-08 Member: 71669Members, Super Administrators, Forum Admins, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Blue, Subnautica Playtester, Subnautica PT Lead, Pistachionauts
    Since i can't attach in an edit..
    Source files are in PNG, so you'll still have to convert it to DDS:
  • NotPaLaGiNotPaLaGi Join Date: 2014-05-29 Member: 196291Members
    Between this and that advanced alien vision shader mod, I wouldn't be surprised if we aren't over 1500+ concurrent players next patch! Can't wait!
Sign In or Register to comment.