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)
|
(tournament_id)
|
||||||
(registered_players)
|
(registered_players)
|
||||||
(payers)
|
(payers)
|
||||||
|
(players_payers)
|
||||||
(matches))
|
(matches))
|
||||||
//FC_REFLECT_TYPENAME(graphene::chain::tournament_object) // manually serialized
|
//FC_REFLECT_TYPENAME(graphene::chain::tournament_object) // manually serialized
|
||||||
FC_REFLECT(graphene::chain::tournament_object, (creator))
|
FC_REFLECT(graphene::chain::tournament_object, (creator))
|
||||||
|
|
|
||||||
|
|
@ -1733,6 +1733,7 @@ FC_API( graphene::wallet::wallet_api,
|
||||||
(receive_blind_transfer)
|
(receive_blind_transfer)
|
||||||
(tournament_create)
|
(tournament_create)
|
||||||
(tournament_join)
|
(tournament_join)
|
||||||
|
(tournament_leave)
|
||||||
(rps_throw)
|
(rps_throw)
|
||||||
(get_upcoming_tournaments)
|
(get_upcoming_tournaments)
|
||||||
(get_tournament)
|
(get_tournament)
|
||||||
|
|
|
||||||
|
|
@ -2521,14 +2521,28 @@ public:
|
||||||
tournament_object tournament = result.as<tournament_object>();
|
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_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();
|
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 << "Tournament starts at " << tournament.start_time->to_iso_string() << "\n";
|
||||||
ss << "Players:\n";
|
ss << "Players:\n";
|
||||||
for (const account_id_type& player : tournament_details.registered_players)
|
for (const account_id_type& player : tournament_details.registered_players)
|
||||||
ss << "\t" << get_account(player).name << "\n";
|
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)
|
state == tournament_state::concluded)
|
||||||
{
|
{
|
||||||
unsigned num_matches = tournament_details.matches.size();
|
unsigned num_matches = tournament_details.matches.size();
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,18 @@
|
||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
i=1
|
i=1
|
||||||
|
file='tournament-2'
|
||||||
|
file2=$file
|
||||||
while [ 0 ]; do
|
while [ 0 ]; do
|
||||||
|
|
||||||
echo "*** $i `date`"
|
echo "*** $i `date`"
|
||||||
if [ -f tournament-2 ]; then
|
if [ "$1" = "-c" ]; then
|
||||||
mv tournament-2 tournament-2-last
|
file2=$file-`date +%Y-%m-%d:%H:%M:%S`
|
||||||
|
|
||||||
|
elif [ -f $file2 ]; then
|
||||||
|
mv $file2 $file2-last
|
||||||
fi
|
fi
|
||||||
./tournament_test --log_level=message 2> tournament-2
|
./tournament_test --log_level=message 2> $file2
|
||||||
echo
|
echo
|
||||||
if [ "$1" = "-c" ]; then
|
if [ "$1" = "-c" ]; then
|
||||||
sleep 2
|
sleep 2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue