Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Challenge result does not reflect color #46

Open
rwst opened this issue Dec 12, 2021 · 1 comment
Open

Challenge result does not reflect color #46

rwst opened this issue Dec 12, 2021 · 1 comment
Labels
bug Something isn't working

Comments

@rwst
Copy link

rwst commented Dec 12, 2021

  • berserk version: master
  • Python version: 3.6.12
  • Operating System: OpenSuSE Leap

Description

Challenge result does not indicate color correctly.

What I Did

In [5]: chall.create_ai(level=2, clock_limit=None, color=berserk.Color.WHITE)                                                      
Out[5]: 
{'id': 'UMpK5lST',
 'variant': {'key': 'standard', 'name': 'Standard', 'short': 'Std'},
 'speed': 'correspondence',
 'perf': 'correspondence',
 'rated': False,
 'fen': 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',
 'player': 'white',
 'turns': 0,
 'startedAtTurn': 0,
 'source': 'ai',
 'status': {'id': 20, 'name': 'started'},
 'createdAt': 1639302816645}

In [6]: chall.create_ai(level=2, clock_limit=None, color=berserk.Color.BLACK)                                                      
Out[6]: 
{'id': '3VdaeZQb',
 'variant': {'key': 'standard', 'name': 'Standard', 'short': 'Std'},
 'speed': 'correspondence',
 'perf': 'correspondence',
 'rated': False,
 'fen': 'rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',
 'player': 'white',
 'turns': 0,
 'startedAtTurn': 0,
 'source': 'ai',
 'status': {'id': 20, 'name': 'started'},
 'createdAt': 1639302860353}

Two AI games were challenged, one with white one with black. As you can see the returned "player" slot is always white.

@rwst
Copy link
Author

rwst commented Dec 12, 2021

The workaround would be to use the gameId to get the field by:

games = berserk.clients.Games(session)                                                                                     
[g.get('color') for g in games.get_ongoing() if g.get('gameId') == 'BC3zmVRw' ]

@rhgrant10 rhgrant10 added the bug Something isn't working label Apr 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants