Closed FlowingSPDG closed 1 year ago
Related #134 . e.g. "is_pug" in "match" table.
Related question about this - the way I organized ten man's was making two teams (Pug Team One and Pug Team Two) and turned off get5_check_auths 0
. Is there another way around this so stats are still tracked per player?
I think you can put steamids in form field on front-end, and POST it to API. Not sure if I chose this wat tho.
There's several way to implement pug,but every single choice has problem :
Create temporary team for each pug matches. PRO:Back compatibility with get5-web CON:API will generate teams in each match(but it also generates player_stats and round_stats for every matches, so it should'nt be big issue) Plus I need to think about member picks(captain picks,random,ELO-based,manual.)
Add "players" column on match table PRO:API won't generate team. CON:We'll lost compatibility with get5-web cuz get5-web can't find teams. get5-web will be bugged if it can't solve team.
Add "match_pug" table and manage pugs with that. PRO:its completely separated with original "match" table, so it won't affect original matches. back-compatibility safe. CON:implementing it is not easy(?) Like match list(/matches) shows match by "ID DESC" order,it can't be mixed. Also original get5-web can't see those pugs.
Thoughts? @PhlexPlexico
Hmmm, I think solution 3 would be the best to go if you want to keep backwards compatibility.
What I did (option 1) when organizing pugs through discord is I had two teams (Pug Team 1 and Pug Team 2) with empty player ID fields. When the selection through discord was done, it would assign each player into the given team, then do match setup. Once match is finished, it wiped away the teams from the player column (or should have). It was a very experimental feature I put in here and here.
That was my hack solution of fixing for pugs. I understand that get5 is not intended for pugs, but yeah. That was my workaround to play with the system as it currently was.
The good option with 3 is that if you have that match_pug
table, you can always just call a union on the table, and even check if the table exists first, and display if it doesn't, that should fix some compatibility issues.
TL;DR - Option 1 is fastest and it has caveats, esp. with captain picks on front-end, can have two static teams. Option 2 is de-normalizing DB as well, would be against. Option 3 is most complete and can put in enough checks to keep backwards compatibility, but indeed hardest.
Hope that helps :)
Thanks! I'll think to go with 3rd way. There's lot of things to think about to do 3rd way :P
One other way of approaching this actually - send in an incomplete match structure to the game side, or just set the API key with the hostname, and get people to setup pugs in game (i.e. call /get5 from chat). Provided the match is created in the DB with the API key, it should have no issue in updating playerstats during the match, right? Then teams/etc can be determined during setup in the game... Always a possibility.
I think that also works,but ppl who knows server password can freely enter the game(get5_check_auths?
).
and other players can't kick other guy if there's no admin.
but using icomplete structure approach is good imo,I'll think about it 👍
So coming back a year later here, I think I have figured out a good approach to this that takes care of tables from being clogged up. It's a bit messy on the DB side though, since it does allow some constraints to be changed.
NULL
values on match
table team_ids. On delete team set null.team1/2_string
field in the match
table.is_pug
in match
table (default 0/false). This can be used to track stats of players in PUGs only.is_pug
flag set to 1
is_pug
is set to 1, delete teams from team
table.
player_stats
, team
, map_stats
, and match
I believe will have to have loose restrictions on the team_id
FK constraint to allow NULLs and on DELETE SET NULL.The front end could have a "create pug" where a user can enter 10 Steam IDs and it randomizes the teams and captains as well.
Pros of this:
get5_check_auths
can be enforced and no one should be able to enter the game.Cons:
This is the approach I use and I don't think I've found any issues with it so far. The workflow I have setup is:
And it seems to work pretty well, the only thing increasing is the team ID
Sorry for late res, and thanks for nice proposal! I was so inactive to maintain this project tbh, I was using a lot of my time to do for another project actually thats great approach, back-compatibility and close to original structure(only one column).
I regret that I added so much functions even though project itself isnt so stable... I'll think to implement this approach, and way to improve stability of this project xd again thank you for proposal and focusing on get5-web-go, I'm promise to maintain this project once again!
duplicate #166
not for team,for 10 personal pug match