Coder Social home page Coder Social logo

Comments (8)

fp12 avatar fp12 commented on September 13, 2024

Thanks for reporting the issue!
I need to test more for group stages it seems...
I'll look into it!

from achallonge.

fp12 avatar fp12 commented on September 13, 2024

@3rdCore did you create the group stage via API/achallonge?
If so, could you share the code? Thanks!

from achallonge.

3rdCore avatar 3rdCore commented on September 13, 2024

I created the tournament using the web interface and I then call the tournament using its token.
Every thing was then done using the Challonge API. This is my main function :

  my_user = await challonge.get_user(my_username, my_api_key)
  my_tournament_id = 'ycpl6a79'
  my_tournament = await my_user.get_tournament(my_tournament_id)
  print(my_tournament.name, my_tournament.full_challonge_url)
  #if not (my_tournament.state =='pending'): 
  #    print("tournament reseted")
  #    await my_tournament.reset()
  #print("Beginning of the tournament !")
  await my_tournament.start()
  matches = await my_tournament.get_matches()
  players = await my_tournament.get_participants()
  player_index = {players[i].id:i for i in range(0,len(players))}

  for match in matches:
          player1 = await my_tournament.get_participant(match.player1_id)
          player2 = await my_tournament.get_participant(match.player2_id)
          #print("players id : ", player1.id, " ", player2.id)
          #player1.id = player1.  [0]
          #player2.id = player2.group_player_ids[0]
          #print("players id : ", player1, " ", player2.id)
          winner, score = get_winner_and_score(player1, player2)
          await match.report_winner(winner,score)

from achallonge.

fp12 avatar fp12 commented on September 13, 2024

ok, so with my_tournament_id = 'ycpl6a79', I'm assuming you set up the (group) tournament on the website and you are then updating the results through the API, right?

from achallonge.

3rdCore avatar 3rdCore commented on September 13, 2024

That's right. I set up the tournament ( number of player, tournament tree.. ) online, does it come from this ?

First of all, the function start() doesn't start the group phase so we have to manually start the group phase on the website ( with the button ) otherwise the tournament is stuck in an in-between phase where the user can't modify anything.

Should I try to totally setup a tournament through the API ?

Have you understand the difference between .id an. .group_player_id ?

Thanks for your help.

from achallonge.

3rdCore avatar 3rdCore commented on September 13, 2024

do you guys figured out what could be the problem ?

from achallonge.

fp12 avatar fp12 commented on September 13, 2024

No, sorry, I haven't looked into it yet.
And since we can't do groups from the API, it makes testing a bit harder/longer...

from achallonge.

3rdCore avatar 3rdCore commented on September 13, 2024

I've managed to update the scores using the function report_tie(). This function makes it possible to give un-tie scores and therefore undirectly declare a winner (it would appear as a tie on the web interface, but will still rank players in order of their score.)

This is obviously not a solution but could help someone else stuck in the same situation as me.

from achallonge.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.