PhlexPlexico / G5V

A front-end for G5API to manage matches/seasons/tournaments for CS:GO
MIT License
56 stars 29 forks source link

Order servers: My servers, My Public Servers, Other users public servers during match creation #111

Closed kubo6472 closed 2 years ago

kubo6472 commented 2 years ago

I have no idea if changing the order here: https://phlex.avidgamers.me/api/servers/available to have

  1. our servers that are not public to be the first
  2. then our public servers
  3. and then others' public servers

is wanted in any way, but I'd find it very useful.

I think it is caused by something in here: https://github.com/PhlexPlexico/G5API/blob/master/routes/servers.js#L174

PhlexPlexico commented 2 years ago

Well the API doesn't bring back any type of ordering, aside from just returning what servers are available. So it should be up to the front end to sort these things for the end users. I'm not sure if I'll have time to work on this, but pull requests are always welcome. All that would have to be done is check if the GetAllAvailableServers() call returns an array of objects, then just call a sort function based on the array of objects. Shouldn't be too difficult I wouldn't think.

kubo6472 commented 2 years ago

Too fast, thank you. 💯