Implementing missing functionality (6)
Peerplays Blockchain pre-launch settings & modifications I II III
This commit is contained in:
parent
94ba6266c6
commit
c16454890c
4 changed files with 26 additions and 5 deletions
|
|
@ -235,6 +235,7 @@ FC_REFLECT_DERIVED(graphene::chain::tournament_details_object, (graphene::db::ob
|
|||
(tournament_id)
|
||||
(registered_players)
|
||||
(payers)
|
||||
(players_payers)
|
||||
(matches))
|
||||
//FC_REFLECT_TYPENAME(graphene::chain::tournament_object) // manually serialized
|
||||
FC_REFLECT(graphene::chain::tournament_object, (creator))
|
||||
|
|
|
|||
|
|
@ -1733,6 +1733,7 @@ FC_API( graphene::wallet::wallet_api,
|
|||
(receive_blind_transfer)
|
||||
(tournament_create)
|
||||
(tournament_join)
|
||||
(tournament_leave)
|
||||
(rps_throw)
|
||||
(get_upcoming_tournaments)
|
||||
(get_tournament)
|
||||
|
|
|
|||
|
|
@ -2521,14 +2521,28 @@ public:
|
|||
tournament_object tournament = result.as<tournament_object>();
|
||||
tournament_details_object tournament_details = _remote_db->get_objects({result["tournament_details_id"].as<object_id_type>()})[0].as<tournament_details_object>();
|
||||
tournament_state state = tournament.get_state();
|
||||
if (state == tournament_state::awaiting_start)
|
||||
if (state == tournament_state::accepting_registrations)
|
||||
{
|
||||
ss << "Tournament is accepting registrations\n";
|
||||
ss << "Players " << tournament.registered_players << "/" << tournament.options.number_of_players << ":\n";
|
||||
for (const account_id_type& player : tournament_details.registered_players)
|
||||
ss << "\t" << get_account(player).name << "\n";
|
||||
}
|
||||
else if (state == tournament_state::registration_period_expired)
|
||||
{
|
||||
ss << "Tournament registration period expired\n";
|
||||
ss << "Players " << tournament.registered_players << "/" << tournament.options.number_of_players << ":\n";
|
||||
for (const account_id_type& player : tournament_details.registered_players)
|
||||
ss << "\t" << get_account(player).name << "\n";
|
||||
}
|
||||
else if (state == tournament_state::awaiting_start)
|
||||
{
|
||||
ss << "Tournament starts at " << tournament.start_time->to_iso_string() << "\n";
|
||||
ss << "Players:\n";
|
||||
for (const account_id_type& player : tournament_details.registered_players)
|
||||
ss << "\t" << get_account(player).name << "\n";
|
||||
}
|
||||
else if (state == tournament_state::in_progress ||
|
||||
else if (state == tournament_state::in_progress ||
|
||||
state == tournament_state::concluded)
|
||||
{
|
||||
unsigned num_matches = tournament_details.matches.size();
|
||||
|
|
|
|||
|
|
@ -1,13 +1,18 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
i=1
|
||||
file='tournament-2'
|
||||
file2=$file
|
||||
while [ 0 ]; do
|
||||
|
||||
echo "*** $i `date`"
|
||||
if [ -f tournament-2 ]; then
|
||||
mv tournament-2 tournament-2-last
|
||||
if [ "$1" = "-c" ]; then
|
||||
file2=$file-`date +%Y-%m-%d:%H:%M:%S`
|
||||
|
||||
elif [ -f $file2 ]; then
|
||||
mv $file2 $file2-last
|
||||
fi
|
||||
./tournament_test --log_level=message 2> tournament-2
|
||||
./tournament_test --log_level=message 2> $file2
|
||||
echo
|
||||
if [ "$1" = "-c" ]; then
|
||||
sleep 2
|
||||
|
|
|
|||
Loading…
Reference in a new issue