mirror of
https://github.com/tstellar/bygfoot.git
synced 2025-02-11 17:10:40 +01:00
Promotion games, supercups (phew).
This commit is contained in:
parent
3f5cbacf89
commit
fd6e42af8e
@ -11,7 +11,7 @@ bin_PROGRAMS = bygfoot
|
||||
bygfoot_SOURCES = \
|
||||
callback_func.c callback_func.h callbacks.h cup.h finance.h fixture.h game_gui.h league.h live_game.h maths.h misc.h option.h player.h start_end.h team.h transfer.h treeview.h user.h window.h \
|
||||
callbacks.c callbacks.h callback_func.h free.h game_gui.h gui.h load_save.h main.h option.h player.h team.h transfer.h treeview.h user.h window.h \
|
||||
cup.c cup.h free.h main.h maths.h misc.h team.h variables.h xml_league.h \
|
||||
cup.c cup.h fixture.h free.h league.h main.h maths.h misc.h team.h variables.h xml_league.h \
|
||||
file.c file.h free.h main.h misc.h option.h support.h variables.h \
|
||||
finance.c callbacks.h finance.h game_gui.h maths.h option.h player.h team.h user.h \
|
||||
fixture.c cup.h fixture.h free.h league.h main.h maths.h misc.h table.h team.h variables.h \
|
||||
@ -47,7 +47,7 @@ bygfoot_SOURCES = \
|
||||
user.c fixture.h free.h game_gui.h live_game.h maths.h misc.h option.h player.h team.h transfer.h treeview.h user.h window.h \
|
||||
window.c file.h finance.h free.h game_gui.h gui.h interface.h main.h misc_interface.h misc2_interface.h option.h support.h user.h window.h \
|
||||
xml.c cup.h file.h free.h gui.h league.h misc.h support.h table.h transfer_struct.h user.h variables.h xml.h xml_loadsave_cup.h xml_loadsave_league.h xml_loadsave_teams.h xml_loadsave_fixtures.h xml_loadsave_table.h xml_loadsave_transfers.h xml_loadsave_users.h \
|
||||
xml_loadsave_misc.c file.h misc.h variables.h xml.h xml_loadsave_misc.h xml_loadsave_cup.h xml_loadsave_league.h \
|
||||
xml_loadsave_misc.c cup.h file.h misc.h variables.h xml.h xml_loadsave_misc.h xml_loadsave_cup.h xml_loadsave_league.h \
|
||||
xml_loadsave_cup.c cup.h file.h misc.h team.h xml.h xml_loadsave_cup.h xml_loadsave_fixtures.h xml_loadsave_table.h xml_loadsave_teams.h \
|
||||
xml_loadsave_fixtures.c file.h fixture.h misc.h team.h xml.h xml_loadsave_fixtures.h \
|
||||
xml_loadsave_league.c file.h league.h misc.h xml.h xml_loadsave_fixtures.h xml_loadsave_league.h xml_loadsave_table.h xml_loadsave_teams.h \
|
||||
@ -56,7 +56,7 @@ bygfoot_SOURCES = \
|
||||
xml_loadsave_teams.c file.h misc.h player.h team.h xml.h xml_loadsave_teams.h \
|
||||
xml_loadsave_transfers.c file.h misc.h team.h transfer.h xml.h xml_loadsave_transfers.h \
|
||||
xml_loadsave_users.c file.h misc.h team.h user.h variables.h xml.h xml_loadsave_users.h \
|
||||
xml_cup.c cup.h file.h main.h misc.h xml_cup.h \
|
||||
xml_cup.c cup.h file.h main.h misc.h variables.h xml_cup.h \
|
||||
xml_country.c file.h free.h misc.h variables.h xml_cup.h xml_country.h xml_league.h \
|
||||
xml_league.c cup_struct.h file.h free.h league.h misc.h team.h table.h variables.h xml_league.h xml_cup.h \
|
||||
xml_name.c file.h free.h maths.h misc.h variables.h xml_name.h
|
||||
|
@ -31,6 +31,14 @@
|
||||
#define ID_LEAGUE_START 1000
|
||||
#define ID_CUP_START 2000
|
||||
#define ID_PROM_CUP_START 3000
|
||||
#define ID_SUPERCUP_START 4000
|
||||
|
||||
#define player_id_new (counters[COUNT_PLAYER_ID]++)
|
||||
#define team_id_new (counters[COUNT_TEAM_ID]++)
|
||||
#define cup_id_new (counters[COUNT_CUP_ID]++)
|
||||
#define prom_cup_id_new (counters[COUNT_PROM_CUP_ID]++)
|
||||
#define supercup_id_new (counters[COUNT_SUPERCUP_ID]++)
|
||||
#define league_id_new (counters[COUNT_LEAGUE_ID]++)
|
||||
|
||||
/** Convenience abbreviation. */
|
||||
#define ligs country.leagues
|
||||
@ -42,6 +50,16 @@
|
||||
/** Convenience abbreviation. */
|
||||
#define cp(i) g_array_index(country.cups, Cup, i)
|
||||
|
||||
/** Convenience abbreviation. */
|
||||
#define scps country.supercups
|
||||
/** Convenience abbreviation. */
|
||||
#define scp(i) g_array_index(country.supercups, Cup, i)
|
||||
|
||||
/** Convenience abbreviation. */
|
||||
#define acps country.allcups
|
||||
/** Convenience abbreviation. */
|
||||
#define acp(i) ((Cup*)g_ptr_array_index(country.allcups, i))
|
||||
|
||||
/** Convenience abbreviation. */
|
||||
#define player_name(i) ((GString*)g_ptr_array_index(player_names, i))->str;
|
||||
|
||||
@ -53,9 +71,6 @@
|
||||
#define stat4 status[4]
|
||||
#define old_stat status[5]
|
||||
|
||||
#define player_id_new (counters[COUNT_PLAYER_ID]++)
|
||||
#define team_id_new (counters[COUNT_TEAM_ID]++)
|
||||
|
||||
#define debug opt_int("int_opt_debug")
|
||||
|
||||
/**
|
||||
@ -85,7 +100,10 @@ typedef struct
|
||||
*sid; /**< Id of the country, eg 'england'. */
|
||||
|
||||
/** Leagues and cups arrays. */
|
||||
GArray *leagues, *cups;
|
||||
GArray *leagues, *cups, *supercups;
|
||||
|
||||
/** Pointer array holding all cups. */
|
||||
GPtrArray *allcups;
|
||||
} Country;
|
||||
|
||||
/** Struct used for having all the windows
|
||||
|
342
src/cup.c
342
src/cup.c
@ -1,6 +1,7 @@
|
||||
#include "cup.h"
|
||||
#include "fixture.h"
|
||||
#include "free.h"
|
||||
#include "league.h"
|
||||
#include "main.h"
|
||||
#include "maths.h"
|
||||
#include "misc.h"
|
||||
@ -15,7 +16,7 @@
|
||||
@see #Cup
|
||||
*/
|
||||
Cup
|
||||
cup_new(void)
|
||||
cup_new(gboolean new_id)
|
||||
{
|
||||
Cup new;
|
||||
|
||||
@ -24,9 +25,10 @@ cup_new(void)
|
||||
new.symbol = g_string_new("");
|
||||
new.sid = g_string_new("");
|
||||
|
||||
new.id = cup_new_id(FALSE);
|
||||
new.id = (new_id) ? cup_id_new : -1;
|
||||
new.type = CUP_TYPE_NATIONAL;
|
||||
new.last_week = new.week_gap = -1;
|
||||
new.last_week = -1;
|
||||
new.week_gap = 1;
|
||||
new.yellow_red = 1000;
|
||||
new.skill_diff = 0;
|
||||
|
||||
@ -45,34 +47,6 @@ cup_new(void)
|
||||
return new;
|
||||
}
|
||||
|
||||
/** Return a new numerical id for a cup.
|
||||
We browse through the existing cups and take the
|
||||
first free id.
|
||||
@param prom_cup Whether we need a promotion games cup id.
|
||||
*/
|
||||
gint
|
||||
cup_new_id(gboolean prom_cup)
|
||||
{
|
||||
gint i, j;
|
||||
gint start = (prom_cup) ? ID_PROM_CUP_START : ID_CUP_START;
|
||||
|
||||
if(cps->len == 0)
|
||||
return start;
|
||||
|
||||
for(i=start;i<start+1000;i++)
|
||||
{
|
||||
for(j=0;j<cps->len;j++)
|
||||
if(cp(j).id == i)
|
||||
break;
|
||||
|
||||
if(j == cps->len)
|
||||
return i;
|
||||
}
|
||||
|
||||
g_warning("cup_new_id: didn't find a free numerical id.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/** Return a CupChooseTeam with default values. */
|
||||
CupChooseTeam
|
||||
cup_choose_team_new(void)
|
||||
@ -103,6 +77,21 @@ cup_round_new(void)
|
||||
return new;
|
||||
}
|
||||
|
||||
/** Find out whether a choose_team definition refers to a
|
||||
league in the country. If so, no teams get loaded for that
|
||||
choose_team. */
|
||||
gboolean
|
||||
query_cup_choose_team_is_league(const gchar *sid)
|
||||
{
|
||||
gint i;
|
||||
|
||||
for(i=0;i<ligs->len;i++)
|
||||
if(strcmp(lig(i).sid->str, sid) == 0)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/** Fill the teams array of a cup with teams according to the choose_teams of
|
||||
the cup. Only called for international cups.
|
||||
@param cup The pointer to the cup. */
|
||||
@ -126,13 +115,16 @@ cup_load_choose_teams(Cup *cup)
|
||||
|
||||
for(j=0;j<sids->len;j++)
|
||||
{
|
||||
xml_league_read(((GString*)g_ptr_array_index(sids, j))->str, leagues);
|
||||
|
||||
for(k=0; k < g_array_index(leagues, League, leagues->len - 1).teams->len; k++)
|
||||
g_array_append_val(teams, g_array_index(
|
||||
g_array_index(leagues, League, leagues->len - 1).teams, Team, k));
|
||||
|
||||
g_array_free(g_array_index(leagues, League, leagues->len - 1).teams, TRUE);
|
||||
if(!query_cup_choose_team_is_league(((GString*)g_ptr_array_index(sids, j))->str))
|
||||
{
|
||||
xml_league_read(((GString*)g_ptr_array_index(sids, j))->str, leagues);
|
||||
|
||||
for(k=0; k < g_array_index(leagues, League, leagues->len - 1).teams->len; k++)
|
||||
g_array_append_val(teams, g_array_index(
|
||||
g_array_index(leagues, League, leagues->len - 1).teams, Team, k));
|
||||
|
||||
g_array_free(g_array_index(leagues, League, leagues->len - 1).teams, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
g_array_free(leagues, TRUE);
|
||||
@ -141,7 +133,7 @@ cup_load_choose_teams(Cup *cup)
|
||||
for(j=0;j<teams->len;j++)
|
||||
permutation[j] = j;
|
||||
|
||||
if(choose_team->randomly)
|
||||
if(choose_team->randomly && teams->len > 0)
|
||||
{
|
||||
if(choose_team->start_idx == -1)
|
||||
math_generate_permutation(permutation, 0, teams->len - 1);
|
||||
@ -175,7 +167,7 @@ cup_load_choose_teams(Cup *cup)
|
||||
break;
|
||||
}
|
||||
|
||||
if(number_of_teams != choose_team->number_of_teams)
|
||||
if(number_of_teams != choose_team->number_of_teams && teams->len > 0)
|
||||
cup_choose_team_abort(cup, choose_team, FALSE);
|
||||
|
||||
for(j=teams->len - 1; j>=0;j--)
|
||||
@ -184,15 +176,161 @@ cup_load_choose_teams(Cup *cup)
|
||||
|
||||
free_g_string_array(&sids);
|
||||
free_teams_array(&teams, FALSE);
|
||||
|
||||
}
|
||||
|
||||
for(i=0;i<cup->teams->len;i++)
|
||||
team_generate_players_stadium(&g_array_index(cup->teams, Team, i));
|
||||
}
|
||||
|
||||
/*d*/
|
||||
/* printf("\n%s\n", cup->name->str); */
|
||||
/* for(i=0;i<cup->teams->len;i++) */
|
||||
/* printf("%d %s\n", i, g_array_index(cup->teams, Team, i).name->str); */
|
||||
/** Write the cup or league of the chooseteam into the appropriate pointer. */
|
||||
void
|
||||
cup_get_choose_team_league_cup(const CupChooseTeam *ct,
|
||||
League **league, Cup **cup)
|
||||
{
|
||||
gint i, idx;
|
||||
gchar trash[SMALL];
|
||||
|
||||
sscanf(ct->sid->str, "%[^0-9]%d", trash, &idx);
|
||||
|
||||
if(g_str_has_prefix(ct->sid->str, "league"))
|
||||
{
|
||||
*league = &lig(idx - 1);
|
||||
*cup = NULL;
|
||||
}
|
||||
else if(g_str_has_prefix(ct->sid->str, "cup"))
|
||||
{
|
||||
*cup = &cp(idx - 1);
|
||||
*league = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i=0;i<ligs->len;i++)
|
||||
if(strcmp(lig(i).sid->str, ct->sid->str) == 0)
|
||||
{
|
||||
*league = &lig(i);
|
||||
*cup = NULL;
|
||||
break;
|
||||
}
|
||||
|
||||
for(i=0;i<cps->len;i++)
|
||||
if(strcmp(cp(i).sid->str, ct->sid->str) == 0)
|
||||
{
|
||||
*cup = &cp(i);
|
||||
*league = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Get the team pointers for the supercup. */
|
||||
GPtrArray*
|
||||
cup_get_choose_teams_pointers(Cup *cup)
|
||||
{
|
||||
gint i, j, start, end;
|
||||
gint number_of_teams = 0;
|
||||
CupChooseTeam *ct = NULL;
|
||||
GArray *team_ids = g_array_new(FALSE, FALSE, sizeof(gint));
|
||||
GPtrArray *cup_teams_sorted = NULL;
|
||||
GPtrArray *teams = g_ptr_array_new();
|
||||
League *league = NULL;
|
||||
Cup *cup_temp = NULL;
|
||||
|
||||
free_g_ptr_array(&cup->user_teams);
|
||||
cup->user_teams = g_ptr_array_new();
|
||||
|
||||
for(i=0;i<cup->choose_teams->len;i++)
|
||||
{
|
||||
number_of_teams = 0;
|
||||
|
||||
ct = &g_array_index(cup->choose_teams, CupChooseTeam, i);
|
||||
cup_get_choose_team_league_cup(ct, &league, &cup_temp);
|
||||
|
||||
if(cup_temp == NULL)
|
||||
{
|
||||
if(ct->number_of_teams == -1 && cup->type != CUP_TYPE_SUPERCUP)
|
||||
{
|
||||
start = 0;
|
||||
end = league->teams->len;
|
||||
}
|
||||
else
|
||||
{
|
||||
start = ct->start_idx - 1;
|
||||
end = ct->end_idx - start;
|
||||
}
|
||||
|
||||
gint order[end];
|
||||
for(j=0;j<end;j++)
|
||||
order[j] = j + start;
|
||||
|
||||
if(ct->randomly)
|
||||
math_generate_permutation(order, start, start + end);
|
||||
|
||||
for(j = 0;j < end; j++)
|
||||
{
|
||||
if(!query_misc_integer_is_in_g_array(
|
||||
g_array_index(league->table.elements, TableElement, order[j]).team_id,
|
||||
team_ids))
|
||||
{
|
||||
g_ptr_array_add(teams, g_array_index(league->table.elements,
|
||||
TableElement, order[j]).team);
|
||||
g_array_append_val(team_ids, g_array_index(
|
||||
league->table.elements, TableElement, order[j]).team_id);
|
||||
number_of_teams++;
|
||||
|
||||
if(number_of_teams == ct->number_of_teams ||
|
||||
(cup->type == CUP_TYPE_SUPERCUP && teams->len == 2))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(ct->number_of_teams != -1 &&
|
||||
number_of_teams != ct->number_of_teams)
|
||||
g_warning("cup_load_choose_teams_pointers: didn't find enough teams in cup %s for chooseteam %s\n",
|
||||
cup->name->str, ct->sid->str);
|
||||
}
|
||||
else
|
||||
{
|
||||
cup_teams_sorted = cup_get_teams_sorted(cup_temp);
|
||||
|
||||
if(ct->number_of_teams == -1 && cup->type != CUP_TYPE_SUPERCUP)
|
||||
{
|
||||
start = 0;
|
||||
end = cup_teams_sorted->len;
|
||||
}
|
||||
else
|
||||
{
|
||||
start = ct->start_idx - 1;
|
||||
end = ct->end_idx;
|
||||
}
|
||||
|
||||
for(j = start; j < end; j++)
|
||||
{
|
||||
if(!query_misc_integer_is_in_g_array(
|
||||
((Team*)g_ptr_array_index(cup_teams_sorted, j))->id, team_ids))
|
||||
{
|
||||
g_ptr_array_add(teams, g_ptr_array_index(cup_teams_sorted, j));
|
||||
g_array_append_val(team_ids, ((Team*)g_ptr_array_index(cup_teams_sorted, j))->id);
|
||||
number_of_teams++;
|
||||
|
||||
if(number_of_teams == ct->number_of_teams ||
|
||||
(cup->type == CUP_TYPE_SUPERCUP && teams->len == 2))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
g_ptr_array_free(cup_teams_sorted, TRUE);
|
||||
|
||||
if(ct->number_of_teams != -1 &&
|
||||
number_of_teams != ct->number_of_teams)
|
||||
g_warning("cup_load_choose_teams_pointers: didn't find enough teams in cup %s for chooseteam %s\n",
|
||||
cup->name->str, ct->sid->str);
|
||||
}
|
||||
}
|
||||
|
||||
g_array_free(team_ids, TRUE);
|
||||
|
||||
return teams;
|
||||
}
|
||||
|
||||
/** Add the teams specified by the choose_team_user rule to the teams
|
||||
@ -204,27 +342,27 @@ cup_load_choose_team_user(Cup *cup)
|
||||
gint i;
|
||||
gchar type[SMALL];
|
||||
gint number, number_of_teams = 0;
|
||||
CupChooseTeam *choose_team = &cup->choose_team_user;
|
||||
CupChooseTeam *ct = &cup->choose_team_user;
|
||||
GPtrArray *user_teams_sorted = NULL;
|
||||
Team *table_team = NULL;
|
||||
|
||||
g_ptr_array_free(cup->user_teams, TRUE);
|
||||
cup->user_teams = g_ptr_array_new();
|
||||
|
||||
sscanf(choose_team->sid->str, "%[^0-9]%d", type, &number);
|
||||
sscanf(ct->sid->str, "%[^0-9]%d", type, &number);
|
||||
|
||||
if(strcmp(type, "league") != 0 &&
|
||||
strcmp(type, "cup") != 0)
|
||||
cup_choose_team_abort(cup, choose_team, TRUE);
|
||||
cup_choose_team_abort(cup, ct, TRUE);
|
||||
|
||||
/** Teams from a league. */
|
||||
if(strcmp(type, "league") == 0)
|
||||
{
|
||||
if(ligs->len < number ||
|
||||
lig(number - 1).teams->len < choose_team->end_idx)
|
||||
cup_choose_team_abort(cup, choose_team, TRUE);
|
||||
lig(number - 1).teams->len < ct->end_idx)
|
||||
cup_choose_team_abort(cup, ct, TRUE);
|
||||
|
||||
for(i = choose_team->start_idx - 1; i <= choose_team->end_idx - 1; i++)
|
||||
for(i = ct->start_idx - 1; i <= ct->end_idx - 1; i++)
|
||||
{
|
||||
table_team = team_of_id(
|
||||
g_array_index(lig(number - 1).table.elements, TableElement, i).team_id);
|
||||
@ -235,12 +373,12 @@ cup_load_choose_team_user(Cup *cup)
|
||||
number_of_teams++;
|
||||
}
|
||||
|
||||
if(number_of_teams == choose_team->number_of_teams)
|
||||
if(number_of_teams == ct->number_of_teams)
|
||||
break;
|
||||
}
|
||||
|
||||
if(number_of_teams != choose_team->number_of_teams)
|
||||
cup_choose_team_abort(cup, choose_team, TRUE);
|
||||
if(number_of_teams != ct->number_of_teams)
|
||||
cup_choose_team_abort(cup, ct, TRUE);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -249,30 +387,30 @@ cup_load_choose_team_user(Cup *cup)
|
||||
we load random teams from the first league. */
|
||||
if(season == 1)
|
||||
{
|
||||
if(lig(0).teams->len < choose_team->number_of_teams)
|
||||
cup_choose_team_abort(cup, choose_team, TRUE);
|
||||
if(lig(0).teams->len < ct->number_of_teams)
|
||||
cup_choose_team_abort(cup, ct, TRUE);
|
||||
|
||||
gint permutation[lig(0).teams->len];
|
||||
math_generate_permutation(permutation, 0, lig(0).teams->len - 1);
|
||||
|
||||
for(i = choose_team->start_idx - 1; i <= choose_team->end_idx - 1; i++)
|
||||
for(i = ct->start_idx - 1; i <= ct->end_idx - 1; i++)
|
||||
{
|
||||
if(!query_is_in_international_cups(
|
||||
&g_array_index(lig(number - 1).teams,
|
||||
Team, permutation[i - choose_team->start_idx + 1])))
|
||||
Team, permutation[i - ct->start_idx + 1])))
|
||||
{
|
||||
g_ptr_array_add(cup->user_teams,
|
||||
(gpointer)&g_array_index(lig(number - 1).teams,
|
||||
Team, permutation[i - choose_team->start_idx + 1]));
|
||||
Team, permutation[i - ct->start_idx + 1]));
|
||||
number_of_teams++;
|
||||
}
|
||||
|
||||
if(number_of_teams == choose_team->number_of_teams)
|
||||
if(number_of_teams == ct->number_of_teams)
|
||||
break;
|
||||
}
|
||||
|
||||
if(number_of_teams != choose_team->number_of_teams)
|
||||
cup_choose_team_abort(cup, choose_team, TRUE);
|
||||
if(number_of_teams != ct->number_of_teams)
|
||||
cup_choose_team_abort(cup, ct, TRUE);
|
||||
|
||||
return;
|
||||
}
|
||||
@ -281,7 +419,7 @@ cup_load_choose_team_user(Cup *cup)
|
||||
participated in the cup. */
|
||||
user_teams_sorted = cup_get_teams_sorted(&cp(number - 1));
|
||||
|
||||
for(i = choose_team->start_idx - 1; i <= choose_team->end_idx - 1; i++)
|
||||
for(i = ct->start_idx - 1; i <= ct->end_idx - 1; i++)
|
||||
{
|
||||
if(!query_is_in_international_cups((Team*)g_ptr_array_index(user_teams_sorted, i)))
|
||||
{
|
||||
@ -289,12 +427,12 @@ cup_load_choose_team_user(Cup *cup)
|
||||
number_of_teams++;
|
||||
}
|
||||
|
||||
if(number_of_teams == choose_team->number_of_teams)
|
||||
if(number_of_teams == ct->number_of_teams)
|
||||
break;
|
||||
}
|
||||
|
||||
if(number_of_teams != choose_team->number_of_teams)
|
||||
cup_choose_team_abort(cup, choose_team, TRUE);
|
||||
if(number_of_teams != ct->number_of_teams)
|
||||
cup_choose_team_abort(cup, ct, TRUE);
|
||||
|
||||
g_ptr_array_free(user_teams_sorted, TRUE);
|
||||
}
|
||||
@ -413,6 +551,19 @@ cup_get_first_week_of_cup_round(const Cup *cup, gint cup_round)
|
||||
return week_number;
|
||||
}
|
||||
|
||||
/** Calculate the last week of a cup if we only know the first week. */
|
||||
gint
|
||||
cup_get_last_week_from_first(const Cup *cup, gint first_week)
|
||||
{
|
||||
gint i;
|
||||
gint matchdays = 0;
|
||||
|
||||
for(i=0;i<cup->rounds->len;i++)
|
||||
matchdays += cup_get_matchdays_in_cup_round(cup, i);
|
||||
|
||||
return first_week + (matchdays - 1) * cup->week_gap;
|
||||
}
|
||||
|
||||
/** Return the number of matchdays for a given cup round.
|
||||
@param cup The cup we examine.
|
||||
@param cup_round The index of the cup round.
|
||||
@ -490,7 +641,17 @@ cup_from_clid(gint clid)
|
||||
if(cp(i).id == clid)
|
||||
return &cp(i);
|
||||
|
||||
g_warning("cup_from_clid: didn't find cup with id %d\n", clid);
|
||||
for(i=0;i<scps->len;i++)
|
||||
if(scp(i).id == clid)
|
||||
return &scp(i);
|
||||
|
||||
for(i=0;i<ligs->len;i++)
|
||||
if(league_has_prom_games((&lig(i))) &&
|
||||
lig(i).prom_rel.prom_games_cup.id == clid)
|
||||
return &lig(i).prom_rel.prom_games_cup;
|
||||
|
||||
g_warning("cup_all_from_clid: didn't find cup with id %d\n", clid);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -529,3 +690,52 @@ cup_round_name(const Fixture *fix, gchar *buf)
|
||||
strcat(buf, " -- Replay match");
|
||||
}
|
||||
}
|
||||
|
||||
/** Find out whether it's time to write the
|
||||
fixtures for the supercup. */
|
||||
gboolean
|
||||
query_cup_supercup_begins(const Cup *supercup)
|
||||
{
|
||||
gint i;
|
||||
League *league = NULL;
|
||||
Cup *cup = NULL;
|
||||
gboolean proceed = FALSE;
|
||||
|
||||
for(i=0;i<supercup->choose_teams->len;i++)
|
||||
{
|
||||
cup_get_choose_team_league_cup(
|
||||
&g_array_index(supercup->choose_teams,
|
||||
CupChooseTeam, i), &league, &cup);
|
||||
|
||||
if((cup == NULL &&
|
||||
g_array_index(league->fixtures, Fixture,
|
||||
league->fixtures->len - 1).week_number == week &&
|
||||
g_array_index(league->fixtures, Fixture,
|
||||
league->fixtures->len - 1).week_round_number == week_round) ||
|
||||
(league == NULL &&
|
||||
g_array_index(cup->fixtures, Fixture,
|
||||
cup->fixtures->len - 1).week_number == week &&
|
||||
g_array_index(cup->fixtures, Fixture,
|
||||
cup->fixtures->len - 1).week_round_number == week_round))
|
||||
proceed = TRUE;
|
||||
}
|
||||
|
||||
if(!proceed)
|
||||
return FALSE;
|
||||
|
||||
for(i=0;i<supercup->choose_teams->len;i++)
|
||||
{
|
||||
cup_get_choose_team_league_cup(
|
||||
&g_array_index(supercup->choose_teams,
|
||||
CupChooseTeam, i), &league, &cup);
|
||||
if((cup == NULL &&
|
||||
g_array_index(league->fixtures, Fixture,
|
||||
league->fixtures->len - 1).attendance == -1) ||
|
||||
(league == NULL &&
|
||||
g_array_index(cup->fixtures, Fixture,
|
||||
cup->fixtures->len - 1).attendance == -1))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
21
src/cup.h
21
src/cup.h
@ -4,12 +4,12 @@
|
||||
#include "bygfoot.h"
|
||||
#include "cup_struct.h"
|
||||
#include "fixture_struct.h"
|
||||
#include "league_struct.h"
|
||||
|
||||
#define query_cup_is_prom(clid) (clid >= ID_PROM_CUP_START && clid < ID_SUPERCUP_START)
|
||||
|
||||
Cup
|
||||
cup_new(void);
|
||||
|
||||
gint
|
||||
cup_new_id(gboolean prom_cup);
|
||||
cup_new(gboolean new_id);
|
||||
|
||||
CupChooseTeam
|
||||
cup_choose_team_new(void);
|
||||
@ -56,4 +56,17 @@ cup_compare_success(gconstpointer a, gconstpointer b, gpointer data);
|
||||
gint
|
||||
cup_get_round_reached(const Team *tm, const GArray *fixtures);
|
||||
|
||||
GPtrArray*
|
||||
cup_get_choose_teams_pointers(Cup *cup);
|
||||
|
||||
gboolean
|
||||
query_cup_supercup_begins(const Cup *supercup);
|
||||
|
||||
void
|
||||
cup_get_choose_team_league_cup(const CupChooseTeam *ct,
|
||||
League **league, Cup **cup);
|
||||
|
||||
gint
|
||||
cup_get_last_week_from_first(const Cup *cup, gint first_week);
|
||||
|
||||
#endif
|
||||
|
@ -80,7 +80,7 @@ typedef struct
|
||||
gint type;
|
||||
/** Last week (typically the week the final
|
||||
takes place) and weeks between matchdays.
|
||||
Default: -1. */
|
||||
Default: -1 and 1. */
|
||||
gint last_week, week_gap;
|
||||
/** Number of yellow cards that lead to a missed match.
|
||||
Default: 1000 (off). */
|
||||
|
@ -8,6 +8,10 @@ enum Counters
|
||||
COUNT_AUTOSAVE_FILE,
|
||||
COUNT_TEAM_ID,
|
||||
COUNT_PLAYER_ID,
|
||||
COUNT_CUP_ID,
|
||||
COUNT_PROM_CUP_ID,
|
||||
COUNT_SUPERCUP_ID,
|
||||
COUNT_LEAGUE_ID,
|
||||
COUNT_END
|
||||
};
|
||||
|
||||
|
@ -68,7 +68,7 @@ fixture_write_cup_fixtures(Cup *cup)
|
||||
if(cup->type == CUP_TYPE_INTERNATIONAL)
|
||||
teams = cup_get_team_pointers(cup);
|
||||
else
|
||||
teams = team_get_pointers_from_choose_teams(cup->choose_teams);
|
||||
teams = cup_get_choose_teams_pointers(cup);
|
||||
|
||||
fixture_write_knockout_round(cup, 0, teams);
|
||||
}
|
||||
@ -115,25 +115,10 @@ fixture_update(Cup *cup)
|
||||
free_g_ptr_array(&cup->bye);
|
||||
}
|
||||
|
||||
/*d*/
|
||||
printf("\n");
|
||||
for(i=0;i<teams->len;i++)
|
||||
printf("%d adv %s\n", i, ((Team*)g_ptr_array_index(teams, i))->name->str);
|
||||
printf("\n");
|
||||
|
||||
if(new_round->round_robin_number_of_groups > 0)
|
||||
fixture_write_cup_round_robin(cup, round + 1, teams);
|
||||
else
|
||||
fixture_write_knockout_round(cup, round + 1, teams);
|
||||
|
||||
for(i=0;i<cup->fixtures->len;i++)
|
||||
if(g_array_index(cup->fixtures, Fixture, i).round == round + 1)
|
||||
printf("%d %d %d %25s - %-25s\n",
|
||||
g_array_index(cup->fixtures, Fixture, i).week_number,
|
||||
g_array_index(cup->fixtures, Fixture, i).week_round_number,
|
||||
g_array_index(cup->fixtures, Fixture, i).clid,
|
||||
g_array_index(cup->fixtures, Fixture, i).teams[0]->name->str,
|
||||
g_array_index(cup->fixtures, Fixture, i).teams[1]->name->str);
|
||||
}
|
||||
|
||||
/** Return the teams that advance to the next cup round.
|
||||
@ -239,17 +224,6 @@ fixture_winner_of(const Fixture *fix, gboolean team_id)
|
||||
{
|
||||
first_leg = fixture_get_first_leg(fix);
|
||||
|
||||
/*d*/
|
||||
printf("win_of %s %d - %d %s\n",
|
||||
team_of_id(fix->team_ids[0])->name->str, fix->result[0][0],
|
||||
fix->result[1][0],
|
||||
team_of_id(fix->team_ids[1])->name->str);
|
||||
printf("win_of %s %d - %d %s\n", team_of_id(first_leg->team_ids[0])->name->str,
|
||||
first_leg->result[0][0],
|
||||
first_leg->result[1][0],
|
||||
team_of_id(first_leg->team_ids[1])->name->str);
|
||||
printf("\n");
|
||||
|
||||
if(fix->result[0][0] + first_leg->result[1][0] >
|
||||
fix->result[1][0] + first_leg->result[0][0])
|
||||
winner_idx = 0;
|
||||
@ -567,8 +541,7 @@ fixture_get_free_round(gint week_number, gint clid)
|
||||
gint i, j;
|
||||
gint max_round = 1;
|
||||
|
||||
if(clid < ID_CUP_START ||
|
||||
clid >= ID_PROM_CUP_START)
|
||||
if(clid < ID_CUP_START || query_cup_is_prom(clid))
|
||||
return 1;
|
||||
|
||||
for(i=0;i<cps->len;i++)
|
||||
@ -759,13 +732,12 @@ fixture_get_number_of_matches(gint week_number, gint week_round_number)
|
||||
gint i, j;
|
||||
gint sum = 0;
|
||||
|
||||
for(i=0;i<cps->len;i++)
|
||||
if(week_round_number > 1 || cp(i).id >= ID_PROM_CUP_START)
|
||||
for(i=0;i<acps->len;i++)
|
||||
if(week_round_number > 1 || query_cup_is_prom(acp(i)->id))
|
||||
{
|
||||
|
||||
for(j=0;j<cp(i).fixtures->len;j++)
|
||||
if(g_array_index(cp(i).fixtures, Fixture, j).week_number == week_number &&
|
||||
g_array_index(cp(i).fixtures, Fixture, j).week_round_number == week_round_number)
|
||||
for(j=0;j<acp(i)->fixtures->len;j++)
|
||||
if(g_array_index(acp(i)->fixtures, Fixture, j).week_number == week_number &&
|
||||
g_array_index(acp(i)->fixtures, Fixture, j).week_round_number == week_round_number)
|
||||
sum++;
|
||||
}
|
||||
|
||||
@ -861,8 +833,8 @@ fixture_get(gint type, gint clid, gint week_number, gint week_round_number, cons
|
||||
}
|
||||
|
||||
if(fix == NULL)
|
||||
g_warning("fixture_get: no fixture found for type %d clid %d week %d round %d\n",
|
||||
type, clid, week_number, week_round_number);
|
||||
g_warning("fixture_get: no fixture found for type %d clid %d (%s) week %d round %d\n",
|
||||
type, clid, league_cup_get_name_string(clid), week_number, week_round_number);
|
||||
|
||||
return fix;
|
||||
}
|
||||
@ -1026,7 +998,9 @@ fixture_get_index(const Fixture *fix)
|
||||
if(fix == &g_array_index(fixtures, Fixture, i))
|
||||
return i;
|
||||
|
||||
g_warning("fixture_get_index: fixture not found.\n");
|
||||
g_warning("fixture_get_index: fixture not found (%s - %s clid %d lc %s.\n",
|
||||
fix->teams[0]->name->str, fix->teams[1]->name->str,
|
||||
fix->clid, league_cup_get_name_string(fix->clid));
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
@ -144,6 +144,7 @@ free_country(gboolean reset)
|
||||
free_leagues_array(&ligs, reset);
|
||||
|
||||
free_cups_array(&cps, reset);
|
||||
free_cups_array(&scps, reset);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -189,6 +190,9 @@ free_league(League *league)
|
||||
{&league->teams,
|
||||
&league->prom_rel.elements};
|
||||
|
||||
if(strlen(league->prom_rel.prom_games_dest_sid->str) > 0)
|
||||
free_cup(&league->prom_rel.prom_games_cup);
|
||||
|
||||
for(i=0;i<5;i++)
|
||||
free_g_string(strings[i]);
|
||||
|
||||
@ -201,6 +205,7 @@ free_league(League *league)
|
||||
free_table(&league->table);
|
||||
|
||||
free_g_array(&league->fixtures);
|
||||
|
||||
}
|
||||
|
||||
/** Free a table. */
|
||||
@ -284,7 +289,8 @@ free_cups_array(GArray **cups, gboolean reset)
|
||||
}
|
||||
|
||||
for(i=0;i<(*cups)->len;i++)
|
||||
free_cup(&g_array_index(*cups, Cup, i));
|
||||
if(g_array_index(*cups, Cup, i).id < ID_PROM_CUP_START)
|
||||
free_cup(&g_array_index(*cups, Cup, i));
|
||||
|
||||
free_g_array(cups);
|
||||
|
||||
|
103
src/league.c
103
src/league.c
@ -11,7 +11,7 @@
|
||||
@see League
|
||||
*/
|
||||
League
|
||||
league_new(void)
|
||||
league_new(gboolean new_id)
|
||||
{
|
||||
League new;
|
||||
|
||||
@ -20,7 +20,7 @@ league_new(void)
|
||||
new.short_name = g_string_new("");
|
||||
new.symbol = g_string_new("");
|
||||
|
||||
new.id = league_new_id();
|
||||
new.id = (new_id) ? league_id_new : -1;
|
||||
|
||||
new.average_skill = -1;
|
||||
|
||||
@ -60,32 +60,6 @@ prom_rel_element_new(void)
|
||||
return new;
|
||||
}
|
||||
|
||||
/** Return a new numerical id for a league.
|
||||
We browse through the existing leagues and take the
|
||||
first free nid.
|
||||
*/
|
||||
gint
|
||||
league_new_id(void)
|
||||
{
|
||||
gint i, j;
|
||||
|
||||
if(ligs == NULL)
|
||||
return ID_LEAGUE_START;
|
||||
|
||||
for(i=ID_LEAGUE_START;i<ID_LEAGUE_START+1000;i++)
|
||||
{
|
||||
for(j=0;j<ligs->len;j++)
|
||||
if(lig(j).id == i)
|
||||
break;
|
||||
|
||||
if(j == ligs->len)
|
||||
return i;
|
||||
}
|
||||
|
||||
g_warning("league_new_id: didn't find a free numerical id.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
/** Get the array index of the given league or cup id.
|
||||
@param clid The id of the league or cup.
|
||||
@return The index in the leagues or cups array. */
|
||||
@ -157,12 +131,12 @@ league_cup_get_next_clid(gint clid)
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i=0;i<cps->len;i++)
|
||||
if(cp(i).id == clid)
|
||||
for(i=0;i<acps->len;i++)
|
||||
if(acp(i)->id == clid)
|
||||
break;
|
||||
|
||||
if(i != cps->len - 1)
|
||||
return_value = cp(i + 1).id;
|
||||
if(i != acps->len - 1)
|
||||
return_value = acp(i + 1)->id;
|
||||
else
|
||||
return_value = lig(0).id;
|
||||
}
|
||||
@ -186,19 +160,19 @@ league_cup_get_previous_clid(gint clid)
|
||||
|
||||
if(i != 0)
|
||||
return_value = lig(i - 1).id;
|
||||
else if(cps->len > 0)
|
||||
return_value = cp(cps->len - 1).id;
|
||||
else if(acps->len > 0)
|
||||
return_value = acp(acps->len - 1)->id;
|
||||
else
|
||||
return_value = lig(ligs->len - 1).id;
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i=cps->len - 1;i>=0;i--)
|
||||
if(cp(i).id == clid)
|
||||
for(i=acps->len - 1;i>=0;i--)
|
||||
if(acp(i)->id == clid)
|
||||
break;
|
||||
|
||||
if(i != 0)
|
||||
return_value = cp(i - 1).id;
|
||||
return_value = acp(i - 1)->id;
|
||||
else
|
||||
return_value = lig(ligs->len - 1).id;
|
||||
}
|
||||
@ -218,7 +192,7 @@ league_cup_get_next_fixture(gint clid, gint week_number, gint week_round_number)
|
||||
for(i=0;i<fixtures->len;i++)
|
||||
if(g_array_index(fixtures, Fixture, i).week_number > week_number ||
|
||||
(g_array_index(fixtures, Fixture, i).week_number == week_number &&
|
||||
g_array_index(fixtures, Fixture, i).week_round_number > week_round_number))
|
||||
g_array_index(fixtures, Fixture, i).week_round_number >= week_round_number))
|
||||
return &g_array_index(fixtures, Fixture, i);
|
||||
|
||||
return NULL;
|
||||
@ -331,15 +305,15 @@ league_get_team_movements(League *league, GArray *team_movements)
|
||||
}
|
||||
}
|
||||
|
||||
if(strlen(league->prom_rel.prom_games_dest_sid->str) > 0)
|
||||
if(league_has_prom_games(league))
|
||||
{
|
||||
for(i=0;i<cps->len;i++)
|
||||
if(cp(i).id >= ID_PROM_CUP_START)
|
||||
for(i=0;i<acps->len;i++)
|
||||
if(query_cup_is_prom(acp(i)->id))
|
||||
{
|
||||
for(j=0;j<cp(i).fixtures->len;j++)
|
||||
for(j=0;j<acp(i)->fixtures->len;j++)
|
||||
{
|
||||
if(g_array_index(cp(i).fixtures, Fixture, j).teams[0]->clid == league->id ||
|
||||
g_array_index(cp(i).fixtures, Fixture, j).teams[1]->clid == league->id)
|
||||
if(g_array_index(acp(i)->fixtures, Fixture, j).teams[0]->clid == league->id ||
|
||||
g_array_index(acp(i)->fixtures, Fixture, j).teams[1]->clid == league->id)
|
||||
{
|
||||
cp_idx = i;
|
||||
break;
|
||||
@ -357,7 +331,7 @@ league_get_team_movements(League *league, GArray *team_movements)
|
||||
return;
|
||||
}
|
||||
|
||||
prom_games_teams = cup_get_teams_sorted(&cp(cp_idx));
|
||||
prom_games_teams = cup_get_teams_sorted(acp(cp_idx));
|
||||
dest_idx = league_index_from_sid(league->prom_rel.prom_games_dest_sid->str);
|
||||
|
||||
for(i=0;i<league->prom_rel.prom_games_number_of_advance;i++)
|
||||
@ -419,20 +393,43 @@ query_league_rank_in_prom_games(const League *league, gint rank)
|
||||
{
|
||||
gint i, j;
|
||||
|
||||
/*d*/
|
||||
/* for(i=0;i<ligs->len;i++) */
|
||||
/* printf("%d les %s lig %s sid %s id %d rank %d\n", i, */
|
||||
/* lig(i).name->str, league->sid->str, */
|
||||
/* lig(i).sid->str, lig(i).id, rank);getchar(); */
|
||||
|
||||
for(i=0;i<ligs->len;i++)
|
||||
if(strlen(lig(i).prom_rel.prom_games_dest_sid->str) > 0)
|
||||
if(league_has_prom_games((&lig(i))))
|
||||
{
|
||||
/* printf("dest %s nam %s ctlen %d\n", */
|
||||
/* lig(i).prom_rel.prom_games_dest_sid->str, */
|
||||
/* lig(i).prom_rel.prom_games_cup.name->str, */
|
||||
/* lig(i).prom_rel.prom_games_cup.choose_teams->len);getchar(); */
|
||||
|
||||
for(j=0;j<lig(i).prom_rel.prom_games_cup.choose_teams->len;j++)
|
||||
{
|
||||
/* printf("fo %s %s\n", */
|
||||
/* g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams, CupChooseTeam, j).sid->str, */
|
||||
/* league->sid->str); */
|
||||
if(strcmp(g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams, CupChooseTeam, j).sid->str,
|
||||
league->sid->str) == 0 &&
|
||||
((rank >= g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams, CupChooseTeam, j).start_idx &&
|
||||
rank <= g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams, CupChooseTeam, j).end_idx &&
|
||||
g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams, CupChooseTeam, j).randomly) ||
|
||||
(rank >= g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams, CupChooseTeam, j).start_idx &&
|
||||
rank < g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams, CupChooseTeam, j).start_idx +
|
||||
g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams, CupChooseTeam, j).number_of_teams &&
|
||||
!g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams, CupChooseTeam, j).randomly)))
|
||||
((rank >= g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams,
|
||||
CupChooseTeam, j).start_idx &&
|
||||
rank <= g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams,
|
||||
CupChooseTeam, j).end_idx &&
|
||||
g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams,
|
||||
CupChooseTeam, j).randomly) ||
|
||||
(rank >= g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams,
|
||||
CupChooseTeam, j).start_idx &&
|
||||
rank < g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams,
|
||||
CupChooseTeam, j).start_idx +
|
||||
g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams,
|
||||
CupChooseTeam, j).number_of_teams &&
|
||||
!g_array_index(lig(i).prom_rel.prom_games_cup.choose_teams,
|
||||
CupChooseTeam, j).randomly)))
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
@ -10,15 +10,14 @@
|
||||
#define league_cup_get_name_string(clid) (clid < ID_CUP_START) ? league_from_clid(clid)->name->str : cup_from_clid(clid)->name->str
|
||||
#define league_cup_get_yellow_red(clid) (clid < ID_CUP_START) ? league_from_clid(clid)->yellow_red : cup_from_clid(clid)->yellow_red
|
||||
|
||||
#define league_has_prom_games(league) (strlen(league->prom_rel.prom_games_dest_sid->str) > 0)
|
||||
|
||||
League
|
||||
league_new(void);
|
||||
league_new(gboolean new_id);
|
||||
|
||||
PromRelElement
|
||||
prom_rel_element_new(void);
|
||||
|
||||
gint
|
||||
league_new_id(void);
|
||||
|
||||
TableElement
|
||||
league_table_element_new(Team *team);
|
||||
|
||||
|
@ -38,14 +38,7 @@ load_save_save_game(const gchar *filename)
|
||||
file_my_system(buf);
|
||||
}
|
||||
|
||||
gui_show_progress(0, "Saving miscellaneous...");
|
||||
|
||||
xml_loadsave_misc_write(prefix);
|
||||
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
"Saving options/constants...");
|
||||
gui_show_progress(0, "Saving options/constants...");
|
||||
|
||||
sprintf(buf, "%s___options", prefix);
|
||||
file_save_opt_file(buf, &options);
|
||||
@ -68,6 +61,9 @@ load_save_save_game(const gchar *filename)
|
||||
for(i=0;i<cps->len;i++)
|
||||
xml_loadsave_cup_write(prefix, &cp(i));
|
||||
|
||||
for(i=0;i<scps->len;i++)
|
||||
xml_loadsave_cup_write(prefix, &scp(i));
|
||||
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
@ -82,6 +78,13 @@ load_save_save_game(const gchar *filename)
|
||||
|
||||
xml_loadsave_transfers_write(prefix);
|
||||
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
"Saving miscellaneous...");
|
||||
|
||||
xml_loadsave_misc_write(prefix);
|
||||
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
@ -110,6 +113,8 @@ load_save_load_game(const gchar* filename)
|
||||
*dirname = g_path_get_dirname(filename);
|
||||
gchar *prefix = g_strndup(basename, strlen(basename) - strlen(const_str("string_save_suffix")));
|
||||
|
||||
gtk_widget_hide(window.main);
|
||||
|
||||
if(strcmp(basename, "last_save") == 0)
|
||||
{
|
||||
g_free(basename);
|
||||
@ -133,13 +138,6 @@ load_save_load_game(const gchar* filename)
|
||||
|
||||
file_decompress(filename);
|
||||
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
"Loading miscellaneous...");
|
||||
|
||||
xml_loadsave_misc_read(dirname, prefix);
|
||||
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
@ -178,6 +176,13 @@ load_save_load_game(const gchar* filename)
|
||||
|
||||
xml_load_transfers(dirname, prefix);
|
||||
|
||||
gui_show_progress(
|
||||
((PROGRESS_MAX * gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar")))) + 1) / PROGRESS_MAX,
|
||||
"Loading miscellaneous...");
|
||||
|
||||
xml_loadsave_misc_read(dirname, prefix);
|
||||
|
||||
gui_show_progress(1, "Done.");
|
||||
|
||||
sprintf(buf, "rm -rf %s/%s___*", dirname, prefix);
|
||||
@ -192,6 +197,9 @@ load_save_load_game(const gchar* filename)
|
||||
load_save_last_save_set(filename);
|
||||
|
||||
gui_show_progress(-1, "");
|
||||
|
||||
gtk_widget_show(window.main);
|
||||
|
||||
setsav1;
|
||||
|
||||
cur_user = 0;
|
||||
|
@ -22,7 +22,8 @@ main_init_variables(void)
|
||||
{
|
||||
gint i;
|
||||
|
||||
ligs = cps = NULL;
|
||||
ligs = cps = scps = NULL;
|
||||
acps = NULL;
|
||||
country.name = country.symbol = country.sid = NULL;
|
||||
transfer_list = NULL;
|
||||
player_names = NULL;
|
||||
@ -30,6 +31,11 @@ main_init_variables(void)
|
||||
for(i=0;i<COUNT_END;i++)
|
||||
counters[i] = 0;
|
||||
|
||||
counters[COUNT_LEAGUE_ID] = ID_LEAGUE_START;
|
||||
counters[COUNT_CUP_ID] = ID_CUP_START;
|
||||
counters[COUNT_PROM_CUP_ID] = ID_PROM_CUP_START;
|
||||
counters[COUNT_SUPERCUP_ID] = ID_SUPERCUP_START;
|
||||
|
||||
window.main = window.startup =
|
||||
window.live = window.warning = window.progress = window.digits =
|
||||
window.stadium = window.job_offer = window.yesno =
|
||||
|
13
src/player.c
13
src/player.c
@ -16,7 +16,7 @@
|
||||
The player's skill can deviate from this value by #CONSTANT_PLAYER_AVERAGE_SKILL_VARIANCE %
|
||||
@return A newly created player. */
|
||||
Player
|
||||
player_new(Team *tm, gfloat average_skill)
|
||||
player_new(Team *tm, gfloat average_skill, gboolean new_id)
|
||||
{
|
||||
gfloat skill_factor =
|
||||
math_rnd(1 - const_float("float_player_average_skill_variance"),
|
||||
@ -25,7 +25,7 @@ player_new(Team *tm, gfloat average_skill)
|
||||
|
||||
new.name =
|
||||
g_string_new(((GString*)g_ptr_array_index(player_names, math_rndi(0, player_names->len - 1)))->str);
|
||||
new.id = player_id_new;
|
||||
new.id = (new_id) ? player_id_new : -1;
|
||||
new.pos = player_get_position_from_structure(tm->structure, tm->players->len);
|
||||
new.cpos = new.pos;
|
||||
new.age = math_gauss_dist(const_float("float_player_age_lower"),
|
||||
@ -922,8 +922,11 @@ player_update_weekly(Team *tm, gint idx)
|
||||
{
|
||||
Player *pl = player_of_idx_team(tm, idx);
|
||||
|
||||
pl->age += 0.0192;
|
||||
pl->contract -= 0.0192;
|
||||
if(debug < 50)
|
||||
{
|
||||
pl->age += 0.0192;
|
||||
pl->contract -= 0.0192;
|
||||
}
|
||||
|
||||
/*todo: warning*/
|
||||
if(pl->contract <= 0)
|
||||
@ -983,7 +986,7 @@ player_replace_by_new(Player *pl, gboolean free_player)
|
||||
{
|
||||
Team *tm = pl->team;
|
||||
gint idx = player_id_index(tm, pl->id);
|
||||
Player new = player_new(tm, team_get_average_skill(tm, FALSE));
|
||||
Player new = player_new(tm, team_get_average_skill(tm, FALSE), FALSE);
|
||||
|
||||
new.pos = pl->pos;
|
||||
new.cpos = pl->cpos;
|
||||
|
@ -23,7 +23,7 @@ enum PlayerValue
|
||||
};
|
||||
|
||||
Player
|
||||
player_new(Team *tm, gfloat average_skill);
|
||||
player_new(Team *tm, gfloat average_skill, gboolean new_id);
|
||||
|
||||
gint
|
||||
player_new_id(const GArray *players);
|
||||
|
103
src/start_end.c
103
src/start_end.c
@ -75,13 +75,10 @@ start_new_season(void)
|
||||
fixture_write_league_fixtures(&lig(i));
|
||||
}
|
||||
|
||||
for(i=cps->len - 1;i >= 0;i--)
|
||||
for(i=acps->len - 1;i >= 0;i--)
|
||||
{
|
||||
if(cp(i).type >= ID_PROM_CUP_START)
|
||||
{
|
||||
free_cup(&cp(i));
|
||||
g_array_remove_index(cps, i);
|
||||
}
|
||||
if(acp(i)->id >= ID_PROM_CUP_START)
|
||||
g_ptr_array_remove_index(acps, i);
|
||||
else
|
||||
fixture_write_cup_fixtures(&cp(i));
|
||||
}
|
||||
@ -160,8 +157,8 @@ end_week_round(void)
|
||||
break;
|
||||
}
|
||||
|
||||
for(i=0;i<cps->len;i++)
|
||||
if(query_fixture_in_week_round(cp(i).id, week, week_round))
|
||||
for(i=0;i<acps->len;i++)
|
||||
if(query_fixture_in_week_round(acp(i)->id, week, week_round))
|
||||
{
|
||||
new_week = FALSE;
|
||||
break;
|
||||
@ -215,23 +212,23 @@ end_week_round_results(void)
|
||||
}
|
||||
}
|
||||
|
||||
for(i=0;i<cps->len;i++)
|
||||
if(week_round > 1 || cp(i).id >= ID_PROM_CUP_START)
|
||||
for(i=0;i<acps->len;i++)
|
||||
if(week_round > 1 || query_cup_is_prom(acp(i)->id))
|
||||
{
|
||||
for(j=0;j<cp(i).fixtures->len;j++)
|
||||
for(j=0;j<acp(i)->fixtures->len;j++)
|
||||
{
|
||||
if(g_array_index(cp(i).fixtures, Fixture, j).week_number == week &&
|
||||
g_array_index(cp(i).fixtures, Fixture, j).week_round_number == week_round &&
|
||||
g_array_index(cp(i).fixtures, Fixture, j).attendance == -1)
|
||||
if(g_array_index(acp(i)->fixtures, Fixture, j).week_number == week &&
|
||||
g_array_index(acp(i)->fixtures, Fixture, j).week_round_number == week_round &&
|
||||
g_array_index(acp(i)->fixtures, Fixture, j).attendance == -1)
|
||||
{
|
||||
live_game_calculate_fixture(&g_array_index(cp(i).fixtures, Fixture, j));
|
||||
live_game_calculate_fixture(&g_array_index(acp(i)->fixtures, Fixture, j));
|
||||
|
||||
done++;
|
||||
fixture_result_to_buf(&g_array_index(cp(i).fixtures, Fixture, j), buf);
|
||||
fixture_result_to_buf(&g_array_index(acp(i)->fixtures, Fixture, j), buf);
|
||||
sprintf(buf2, "%s %s %s",
|
||||
g_array_index(cp(i).fixtures, Fixture, j).teams[0]->name->str,
|
||||
g_array_index(acp(i)->fixtures, Fixture, j).teams[0]->name->str,
|
||||
buf,
|
||||
g_array_index(cp(i).fixtures, Fixture, j).teams[1]->name->str);
|
||||
g_array_index(acp(i)->fixtures, Fixture, j).teams[1]->name->str);
|
||||
gui_show_progress((gfloat)done / num_matches, buf2);
|
||||
}
|
||||
}
|
||||
@ -252,15 +249,15 @@ end_week_round_sort_tables(void)
|
||||
(GCompareDataFunc)table_element_compare_func,
|
||||
GINT_TO_POINTER(lig(i).id));
|
||||
|
||||
for(i=0;i<cps->len;i++)
|
||||
if(cp(i).tables != NULL && cp(i).tables->len != 0 &&
|
||||
query_fixture_in_week_round(cp(i).id, week, week_round) &&
|
||||
g_array_index(cp(i).fixtures, Fixture, cp(i).fixtures->len - 1).round ==
|
||||
g_array_index(cp(i).tables, Table, 0).round)
|
||||
for(j=0;j<cp(i).tables->len;j++)
|
||||
g_array_sort_with_data(g_array_index(cp(i).tables, Table, j).elements,
|
||||
for(i=0;i<acps->len;i++)
|
||||
if(acp(i)->tables != NULL && acp(i)->tables->len != 0 &&
|
||||
query_fixture_in_week_round(acp(i)->id, week, week_round) &&
|
||||
g_array_index(acp(i)->fixtures, Fixture, acp(i)->fixtures->len - 1).round ==
|
||||
g_array_index(acp(i)->tables, Table, 0).round)
|
||||
for(j=0;j<acp(i)->tables->len;j++)
|
||||
g_array_sort_with_data(g_array_index(acp(i)->tables, Table, j).elements,
|
||||
(GCompareDataFunc)table_element_compare_func,
|
||||
GINT_TO_POINTER(cp(i).id));
|
||||
GINT_TO_POINTER(acp(i)->id));
|
||||
}
|
||||
|
||||
/** Update cup fixtures. */
|
||||
@ -269,19 +266,34 @@ end_week_round_update_fixtures(void)
|
||||
{
|
||||
gint i;
|
||||
|
||||
for(i=0;i<acps->len;i++)
|
||||
if(acp(i)->next_fixture_update_week == week &&
|
||||
acp(i)->next_fixture_update_week_round == week_round)
|
||||
fixture_update(acp(i));
|
||||
|
||||
for(i=0;i<ligs->len;i++)
|
||||
if(strlen(lig(i).prom_rel.prom_games_dest_sid->str) > 0 &&
|
||||
if(league_has_prom_games((&lig(i))) &&
|
||||
query_league_prom_games_begin(&lig(i)))
|
||||
{
|
||||
lig(i).prom_rel.prom_games_cup.id = cup_new_id(TRUE);
|
||||
g_array_append_val(cps, lig(i).prom_rel.prom_games_cup);
|
||||
fixture_write_cup_fixtures(&cp(cps->len - 1));
|
||||
if(season == 1)
|
||||
lig(i).prom_rel.prom_games_cup.last_week =
|
||||
cup_get_last_week_from_first(&lig(i).prom_rel.prom_games_cup, week + 1);
|
||||
|
||||
fixture_write_cup_fixtures(&lig(i).prom_rel.prom_games_cup);
|
||||
g_ptr_array_add(acps, &lig(i).prom_rel.prom_games_cup);
|
||||
}
|
||||
|
||||
for(i=0;i<cps->len;i++)
|
||||
if(cp(i).next_fixture_update_week == week &&
|
||||
cp(i).next_fixture_update_week_round == week_round)
|
||||
fixture_update(&cp(i));
|
||||
for(i=0;i<scps->len;i++)
|
||||
{
|
||||
if(query_cup_supercup_begins(&scp(i)))
|
||||
{
|
||||
if(season == 1)
|
||||
scp(i).last_week = cup_get_last_week_from_first(&scp(i), week + 1);
|
||||
|
||||
fixture_write_cup_fixtures(&scp(i));
|
||||
g_ptr_array_add(acps, &scp(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Start a new week round. */
|
||||
@ -296,15 +308,15 @@ start_week_round(void)
|
||||
start_func++;
|
||||
}
|
||||
|
||||
if(!query_user_games_this_week_round() &&
|
||||
if(/*d*/FALSE && !query_user_games_this_week_round() &&
|
||||
((week_round == 1 && !query_user_games_in_week_round(week - 1, fixture_last_week_round(week - 1))) ||
|
||||
(week_round > 1 && !query_user_games_in_week_round(week, week_round - 1))))
|
||||
end_week_round();
|
||||
else
|
||||
{
|
||||
cur_user = 0;
|
||||
game_gui_show_main();
|
||||
|
||||
cur_user = 0;
|
||||
game_gui_show_main();
|
||||
|
||||
/*d ??*/
|
||||
/* if(week_round == 1) */
|
||||
user_event_show_next();
|
||||
@ -386,9 +398,9 @@ query_start_end_season_end(void)
|
||||
if(g_array_index(lig(i).fixtures, Fixture, j).week_number > week)
|
||||
return FALSE;
|
||||
|
||||
for(i=0;i<cps->len;i++)
|
||||
for(j=0;j<cp(i).fixtures->len;j++)
|
||||
if(g_array_index(cp(i).fixtures, Fixture, j).week_number > week)
|
||||
for(i=0;i<acps->len;i++)
|
||||
for(j=0;j<acp(i)->fixtures->len;j++)
|
||||
if(g_array_index(acp(i)->fixtures, Fixture, j).week_number > week)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
@ -409,7 +421,7 @@ start_new_season_team_movements(void)
|
||||
g_array_index(team_movements, TeamMove, i).tm);
|
||||
|
||||
g_array_free(team_movements, TRUE);
|
||||
|
||||
|
||||
for(i=0;i<ligs->len;i++)
|
||||
{
|
||||
for(j=0;j<lig(i).teams->len;j++)
|
||||
@ -420,11 +432,4 @@ start_new_season_team_movements(void)
|
||||
&g_array_index(lig(i).teams, Team, j);
|
||||
}
|
||||
}
|
||||
|
||||
for(i=cps->len - 1;i>=0;i--)
|
||||
if(cp(i).id >= ID_PROM_CUP_START)
|
||||
{
|
||||
free_cup(&cp(i));
|
||||
g_array_remove_index(cps, i);
|
||||
}
|
||||
}
|
||||
|
47
src/team.c
47
src/team.c
@ -18,7 +18,7 @@
|
||||
@return A new team.
|
||||
*/
|
||||
Team
|
||||
team_new(void)
|
||||
team_new(gboolean new_id)
|
||||
{
|
||||
Team new;
|
||||
|
||||
@ -26,7 +26,7 @@ team_new(void)
|
||||
new.symbol = g_string_new("");
|
||||
|
||||
new.clid = -1;
|
||||
new.id = team_id_new;
|
||||
new.id = (new_id) ? team_id_new : -1;
|
||||
new.structure = team_assign_playing_structure();
|
||||
new.style = team_assign_playing_style();
|
||||
new.boost = 0;
|
||||
@ -125,7 +125,7 @@ team_generate_players_stadium(Team *tm)
|
||||
|
||||
for(i=0;i<const_int("int_team_max_players");i++)
|
||||
{
|
||||
new = player_new(tm, average_skill);
|
||||
new = player_new(tm, average_skill, TRUE);
|
||||
wages += new.wage;
|
||||
g_array_append_val(tm->players, new);
|
||||
}
|
||||
@ -315,45 +315,6 @@ team_get_pointers_from_array(const GArray *teams)
|
||||
return team_pointers;
|
||||
}
|
||||
|
||||
/** Return a pointer array containing the teams from
|
||||
the leagues that are specified in the choose_teams array.
|
||||
@param choose_teams The choose_team array.
|
||||
@return A pointer array containing team pointers. */
|
||||
GPtrArray*
|
||||
team_get_pointers_from_choose_teams(const GArray *choose_teams)
|
||||
{
|
||||
gint i, j, k;
|
||||
CupChooseTeam *ct = NULL;
|
||||
GPtrArray *teams = g_ptr_array_new();
|
||||
|
||||
for(i=0;i<choose_teams->len;i++)
|
||||
{
|
||||
ct = &g_array_index(choose_teams, CupChooseTeam, i);
|
||||
for(j=0;j<ligs->len;j++)
|
||||
if(strcmp(ct->sid->str, lig(j).sid->str) == 0)
|
||||
{
|
||||
if(ct->number_of_teams == -1)
|
||||
for(k=0;k<lig(j).teams->len;k++)
|
||||
g_ptr_array_add(teams, &g_array_index(lig(j).teams, Team, k));
|
||||
else
|
||||
{
|
||||
gint order[ct->end_idx - ct->start_idx + 1];
|
||||
|
||||
for(k=ct->start_idx - 1;k<ct->end_idx;k++)
|
||||
order[k - ct->start_idx + 1] = k;
|
||||
|
||||
if(ct->randomly)
|
||||
math_generate_permutation(order, ct->start_idx - 1, ct->end_idx);
|
||||
|
||||
for(k=0;k<ct->number_of_teams;k++)
|
||||
g_ptr_array_add(teams, g_array_index(lig(j).table.elements, TableElement, order[k]).team);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return teams;
|
||||
}
|
||||
|
||||
/** Return the pointer to the team belonging to
|
||||
the id. */
|
||||
Team*
|
||||
@ -386,7 +347,7 @@ team_get_player_pointers(const Team *tm)
|
||||
GPtrArray *players = g_ptr_array_new();
|
||||
|
||||
for(i=0;i<tm->players->len;i++)
|
||||
g_ptr_array_add(players, (gpointer)&g_array_index(tm->players, Player, i));
|
||||
g_ptr_array_add(players, &g_array_index(tm->players, Player, i));
|
||||
|
||||
return players;
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ typedef struct
|
||||
} TeamMove;
|
||||
|
||||
Team
|
||||
team_new(void);
|
||||
team_new(gboolean new_id);
|
||||
|
||||
gint
|
||||
team_assign_playing_structure(void);
|
||||
@ -57,9 +57,6 @@ query_is_in_cup(const Team *tm, const Cup *cup);
|
||||
GPtrArray*
|
||||
team_get_pointers_from_array(const GArray *teams);
|
||||
|
||||
GPtrArray*
|
||||
team_get_pointers_from_choose_teams(const GArray *choose_teams);
|
||||
|
||||
Team*
|
||||
team_of_id(gint id);
|
||||
|
||||
|
@ -1489,11 +1489,6 @@ treeview_get_table_element_colours(const Table *table, gint idx, gchar *colour_f
|
||||
}
|
||||
}
|
||||
|
||||
/* if(strlen(league->prom_rel.prom_games_dest_sid->str) != 0 && */
|
||||
/* g_array_index(league->prom_rel.prom_games_cup.choose_teams, */
|
||||
/* CupChooseTeam, 0).start_idx <= idx + 1 && */
|
||||
/* idx + 1 <= g_array_index(league->prom_rel.prom_games_cup.choose_teams, */
|
||||
/* CupChooseTeam, 0).end_idx) */
|
||||
if(query_league_rank_in_prom_games(league, idx + 1))
|
||||
strcpy(colour_bg, const_str("string_treeview_table_promgames"));
|
||||
}
|
||||
@ -1986,17 +1981,18 @@ treeview_create_next_opponent(void)
|
||||
return NULL;
|
||||
|
||||
gtk_list_store_append(liststore, &iter);
|
||||
gtk_list_store_set(liststore, &iter, 0, _("Your next opponent"), -1);
|
||||
if(!fix->home_advantage)
|
||||
gtk_list_store_set(liststore, &iter, 1, _("Neutral ground"), -1);
|
||||
else if(fix->teams[0] == current_user.tm)
|
||||
gtk_list_store_set(liststore, &iter, 1, _("Home"), -1);
|
||||
else
|
||||
gtk_list_store_set(liststore, &iter, 1, _("Away"), -1);
|
||||
gtk_list_store_set(liststore, &iter, 0, _("Your next opponent"), 1,
|
||||
league_cup_get_name_string(fix->clid), -1);
|
||||
|
||||
gtk_list_store_append(liststore, &iter);
|
||||
sprintf(buf, "Week %d Round %d", fix->week_number, fix->week_round_number);
|
||||
gtk_list_store_set(liststore, &iter, 0, buf, 1, "", -1);
|
||||
if(!fix->home_advantage)
|
||||
strcpy(buf2, _("Neutral ground"));
|
||||
else if(fix->teams[0] == current_user.tm)
|
||||
strcpy(buf2, _("Home"));
|
||||
else
|
||||
strcpy(buf2, _("Away"));
|
||||
gtk_list_store_set(liststore, &iter, 0, buf, 1, buf2, -1);
|
||||
|
||||
gtk_list_store_append(liststore, &iter);
|
||||
gtk_list_store_set(liststore, &iter, 0, "", 1, "", -1);
|
||||
|
45
src/xml.c
45
src/xml.c
@ -77,7 +77,7 @@ xml_load_league(const gchar *dirname, const gchar *basename, const GPtrArray *di
|
||||
{
|
||||
gint i;
|
||||
gchar buf[SMALL];
|
||||
League new = league_new();
|
||||
League new = league_new(FALSE);
|
||||
gchar *prefix = g_strndup(basename, strlen(basename) - 4);
|
||||
|
||||
sprintf(buf, "%s/%s", dirname, basename);
|
||||
@ -100,9 +100,9 @@ xml_load_league(const gchar *dirname, const gchar *basename, const GPtrArray *di
|
||||
sprintf(buf, "%s/%s_table.xml", dirname, prefix);
|
||||
xml_loadsave_table_read(buf, &lig(ligs->len - 1).table);
|
||||
|
||||
if(strlen(lig(ligs->len - 1).prom_rel.prom_games_dest_sid->str) != 0)
|
||||
if(league_has_prom_games((&lig(ligs->len - 1))))
|
||||
{
|
||||
lig(ligs->len - 1).prom_rel.prom_games_cup = cup_new();
|
||||
lig(ligs->len - 1).prom_rel.prom_games_cup = cup_new(FALSE);
|
||||
sprintf(buf, "%s_promcup", prefix);
|
||||
|
||||
for(i=0;i<dir_contents->len;i++)
|
||||
@ -111,8 +111,9 @@ xml_load_league(const gchar *dirname, const gchar *basename, const GPtrArray *di
|
||||
!g_str_has_suffix(((GString*)g_ptr_array_index(dir_contents, i))->str, "_fixtures.xml") &&
|
||||
!g_str_has_suffix(((GString*)g_ptr_array_index(dir_contents, i))->str, "_teams.xml"))
|
||||
{
|
||||
sprintf(buf, "%s/%s", dirname, ((GString*)g_ptr_array_index(dir_contents, i))->str);
|
||||
xml_loadsave_cup_read(buf, &lig(ligs->len - 1).prom_rel.prom_games_cup);
|
||||
xml_load_cup(&lig(ligs->len - 1).prom_rel.prom_games_cup,
|
||||
dirname, ((GString*)g_ptr_array_index(dir_contents, i))->str,
|
||||
dir_contents);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -126,52 +127,66 @@ xml_load_cups(const gchar *dirname, const gchar *basename)
|
||||
gint i;
|
||||
gchar buf[SMALL];
|
||||
GPtrArray *dir_contents = NULL;
|
||||
Cup new_cup;
|
||||
|
||||
sprintf(buf, "%s___cup_", basename);
|
||||
dir_contents = file_dir_get_contents(dirname, buf, ".xml");
|
||||
|
||||
free_cups_array(&cps, TRUE);
|
||||
free_cups_array(&scps, TRUE);
|
||||
|
||||
for(i=0;i<dir_contents->len;i++)
|
||||
{
|
||||
if(!query_misc_string_contains(((GString*)g_ptr_array_index(dir_contents, i))->str, "_table") &&
|
||||
!g_str_has_suffix(((GString*)g_ptr_array_index(dir_contents, i))->str, "_fixtures.xml") &&
|
||||
!g_str_has_suffix(((GString*)g_ptr_array_index(dir_contents, i))->str, "_teams.xml"))
|
||||
xml_load_cup(dirname, ((GString*)g_ptr_array_index(dir_contents, i))->str,
|
||||
{
|
||||
new_cup = cup_new(FALSE);
|
||||
xml_load_cup(&new_cup, dirname, ((GString*)g_ptr_array_index(dir_contents, i))->str,
|
||||
dir_contents);
|
||||
}
|
||||
}
|
||||
|
||||
free_g_string_array(&dir_contents);
|
||||
}
|
||||
|
||||
void
|
||||
xml_load_cup(const gchar *dirname, const gchar *basename, const GPtrArray *dir_contents)
|
||||
xml_load_cup(Cup *cup, const gchar *dirname, const gchar *basename, const GPtrArray *dir_contents)
|
||||
{
|
||||
gint i;
|
||||
gchar buf[SMALL];
|
||||
Cup new = cup_new();
|
||||
Table new_table;
|
||||
gchar *prefix = g_strndup(basename, strlen(basename) - 4);
|
||||
Cup *local_cup = cup;
|
||||
|
||||
sprintf(buf, "%s/%s", dirname, basename);
|
||||
xml_loadsave_cup_read(buf, &new);
|
||||
xml_loadsave_cup_read(buf, cup);
|
||||
|
||||
g_array_append_val(cps, new);
|
||||
if(cup->id < ID_PROM_CUP_START)
|
||||
{
|
||||
g_array_append_val(cps, *cup);
|
||||
local_cup = &cp(cps->len - 1);
|
||||
}
|
||||
else if(cup->id >= ID_SUPERCUP_START)
|
||||
{
|
||||
g_array_append_val(scps, *cup);
|
||||
local_cup = &scp(scps->len - 1);
|
||||
}
|
||||
|
||||
sprintf(buf, "Loading cup: %s",
|
||||
new.name->str);
|
||||
local_cup->name->str);
|
||||
gui_show_progress(
|
||||
gtk_progress_bar_get_fraction(
|
||||
GTK_PROGRESS_BAR(lookup_widget(window.progress, "progressbar"))), buf);
|
||||
|
||||
if(new.type == CUP_TYPE_INTERNATIONAL)
|
||||
if(local_cup->type == CUP_TYPE_INTERNATIONAL)
|
||||
{
|
||||
sprintf(buf, "%s/%s_teams.xml", dirname, prefix);
|
||||
xml_loadsave_teams_read(buf, cp(cps->len - 1).teams);
|
||||
xml_loadsave_teams_read(buf, local_cup->teams);
|
||||
}
|
||||
|
||||
sprintf(buf, "%s/%s_fixtures.xml", dirname, prefix);
|
||||
xml_loadsave_fixtures_read(buf, cp(cps->len - 1).fixtures);
|
||||
xml_loadsave_fixtures_read(buf, local_cup->fixtures);
|
||||
|
||||
for(i=0;i<dir_contents->len;i++)
|
||||
{
|
||||
@ -184,7 +199,7 @@ xml_load_cup(const gchar *dirname, const gchar *basename, const GPtrArray *dir_c
|
||||
sprintf(buf, "%s/%s", dirname,
|
||||
((GString*)g_ptr_array_index(dir_contents, i))->str);
|
||||
xml_loadsave_table_read(buf, &new_table);
|
||||
g_array_append_val(cp(cps->len - 1).tables, new_table);
|
||||
g_array_append_val(local_cup->tables, new_table);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -60,7 +60,7 @@ void
|
||||
xml_load_cups(const gchar *dirname, const gchar *basename);
|
||||
|
||||
void
|
||||
xml_load_cup(const gchar *dirname, const gchar *basename, const GPtrArray *dir_contents);
|
||||
xml_load_cup(Cup *cup, const gchar *dirname, const gchar *basename, const GPtrArray *dir_contents);
|
||||
|
||||
gint
|
||||
xml_get_tag_from_name(const gchar *element_name);
|
||||
|
@ -17,6 +17,7 @@
|
||||
#define TAG_LEAGUE "league"
|
||||
#define TAG_CUPS "cups"
|
||||
#define TAG_CUP "cup"
|
||||
#define TAG_SUPERCUPS "supercups"
|
||||
|
||||
/**
|
||||
* Enum with the states used in the XML parser functions.
|
||||
@ -31,6 +32,7 @@ enum XmlCountryStates
|
||||
STATE_LEAGUE,
|
||||
STATE_CUPS,
|
||||
STATE_CUP,
|
||||
STATE_SUPERCUPS,
|
||||
STATE_END
|
||||
};
|
||||
|
||||
@ -38,6 +40,7 @@ enum XmlCountryStates
|
||||
* The state variable used in the XML parsing functions.
|
||||
*/
|
||||
gint state;
|
||||
gboolean in_supercups;
|
||||
|
||||
/**
|
||||
* The function called by the parser when an opening tag is read.
|
||||
@ -72,6 +75,14 @@ xml_country_read_start_element (GMarkupParseContext *context,
|
||||
state = STATE_CUPS;
|
||||
if(cps == NULL)
|
||||
cps = g_array_new(FALSE, FALSE, sizeof(Cup));
|
||||
in_supercups = FALSE;
|
||||
}
|
||||
else if(strcmp(element_name, TAG_SUPERCUPS) == 0)
|
||||
{
|
||||
state = STATE_SUPERCUPS;
|
||||
if(scps == NULL)
|
||||
scps = g_array_new(FALSE, FALSE, sizeof(Cup));
|
||||
in_supercups = TRUE;
|
||||
}
|
||||
else if(strcmp(element_name, TAG_CUP) == 0)
|
||||
state = STATE_CUP;
|
||||
@ -95,12 +106,13 @@ xml_country_read_end_element (GMarkupParseContext *context,
|
||||
strcmp(element_name, TAG_SYMBOL) == 0 ||
|
||||
strcmp(element_name, TAG_SID) == 0 ||
|
||||
strcmp(element_name, TAG_LEAGUES) == 0 ||
|
||||
strcmp(element_name, TAG_CUPS) == 0)
|
||||
strcmp(element_name, TAG_CUPS) == 0 ||
|
||||
strcmp(element_name, TAG_SUPERCUPS) == 0)
|
||||
state = STATE_COUNTRY;
|
||||
else if(strcmp(element_name, TAG_LEAGUE) == 0)
|
||||
state = STATE_LEAGUES;
|
||||
else if(strcmp(element_name, TAG_CUP) == 0)
|
||||
state = STATE_CUPS;
|
||||
state = (in_supercups) ? STATE_SUPERCUPS : STATE_CUPS;
|
||||
|
||||
else if(strcmp(element_name, TAG_COUNTRY) != 0)
|
||||
g_warning("xml_country_read_start_element: unknown tag: %s; I'm in state %d\n",
|
||||
@ -134,7 +146,7 @@ xml_country_read_text (GMarkupParseContext *context,
|
||||
else if(state == STATE_LEAGUE)
|
||||
xml_league_read(buf, ligs);
|
||||
else if(state == STATE_CUP)
|
||||
xml_cup_read(buf, cps);
|
||||
xml_cup_read(buf, (in_supercups) ? scps : cps);
|
||||
}
|
||||
|
||||
|
||||
@ -149,6 +161,7 @@ xml_country_read_text (GMarkupParseContext *context,
|
||||
void
|
||||
xml_country_read(const gchar *country_name)
|
||||
{
|
||||
gint i;
|
||||
gchar *file_name = file_find_support_file(country_name, FALSE);
|
||||
GMarkupParser parser = {xml_country_read_start_element,
|
||||
xml_country_read_end_element,
|
||||
@ -192,4 +205,9 @@ xml_country_read(const gchar *country_name)
|
||||
g_critical("xml_country_read: error parsing file %s\n", buf);
|
||||
misc_print_error(&error, TRUE);
|
||||
}
|
||||
|
||||
free_g_ptr_array(&acps);
|
||||
acps = g_ptr_array_new();
|
||||
for(i=0;i<cps->len;i++)
|
||||
g_ptr_array_add(acps, &cp(i));
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
#include "file.h"
|
||||
#include "main.h"
|
||||
#include "misc.h"
|
||||
#include "variables.h"
|
||||
#include "xml_cup.h"
|
||||
|
||||
/**
|
||||
@ -105,7 +106,7 @@ xml_cup_read_start_element (GMarkupParseContext *context,
|
||||
|
||||
if(strcmp(element_name, TAG_CUP) == 0)
|
||||
{
|
||||
new_cup = cup_new();
|
||||
new_cup = cup_new(FALSE);
|
||||
state = STATE_CUP;
|
||||
}
|
||||
else if(strcmp(element_name, TAG_NAME) == 0)
|
||||
@ -267,8 +268,10 @@ xml_cup_read_text (GMarkupParseContext *context,
|
||||
new_cup.type = CUP_TYPE_NATIONAL;
|
||||
else if(strcmp(buf, TYPE_INTERNATIONAL) == 0)
|
||||
new_cup.type = CUP_TYPE_INTERNATIONAL;
|
||||
else
|
||||
else if(strcmp(buf, TYPE_SUPERCUP) == 0)
|
||||
new_cup.type = CUP_TYPE_SUPERCUP;
|
||||
else
|
||||
g_warning("xml_cup_read_text: unknown cup type %s\n", buf);
|
||||
}
|
||||
else if(state == STATE_LAST_WEEK)
|
||||
new_cup.last_week = value;
|
||||
@ -349,8 +352,6 @@ xml_cup_read(const gchar *cup_name, GArray *cups)
|
||||
g_markup_parse_context_end_parse(context, NULL);
|
||||
g_markup_parse_context_free(context);
|
||||
g_free(file_contents);
|
||||
|
||||
g_array_append_val(cups, new_cup);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -358,12 +359,18 @@ xml_cup_read(const gchar *cup_name, GArray *cups)
|
||||
misc_print_error(&error, TRUE);
|
||||
}
|
||||
|
||||
if(g_array_index(g_array_index(cups, Cup, cups->len - 1).rounds,
|
||||
CupRound, g_array_index(cups, Cup, cups->len - 1).rounds->len - 1).
|
||||
if(g_array_index(new_cup.rounds, CupRound, new_cup.rounds->len - 1).
|
||||
round_robin_number_of_groups != 0)
|
||||
{
|
||||
sprintf(buf, "xml_cup_read: last cup round of cup %s is round robin which is forbidden.\n",
|
||||
g_array_index(cups, Cup, cups->len - 1).name->str);
|
||||
new_cup.name->str);
|
||||
main_exit_program(EXIT_CUP_LAST_ROUND, buf);
|
||||
}
|
||||
|
||||
if(cups == cps)
|
||||
new_cup.id = cup_id_new;
|
||||
else if(cups == scps)
|
||||
new_cup.id = supercup_id_new;
|
||||
|
||||
g_array_append_val(cups, new_cup);
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ xml_league_read_start_element (GMarkupParseContext *context,
|
||||
|
||||
if(strcmp(element_name, TAG_LEAGUE) == 0)
|
||||
{
|
||||
new_league = league_new();
|
||||
new_league = league_new(TRUE);
|
||||
state = STATE_LEAGUE;
|
||||
}
|
||||
else if(strcmp(element_name, TAG_NAME) == 0)
|
||||
@ -143,7 +143,7 @@ xml_league_read_start_element (GMarkupParseContext *context,
|
||||
state = STATE_TEAMS;
|
||||
else if(strcmp(element_name, TAG_TEAM) == 0)
|
||||
{
|
||||
new_team = team_new();
|
||||
new_team = team_new(TRUE);
|
||||
g_string_printf(new_team.symbol, "%s", new_league.symbol->str);
|
||||
new_team.clid = new_league.id;
|
||||
g_array_append_val(new_league.teams, new_team);
|
||||
@ -253,6 +253,7 @@ xml_league_read_text (GMarkupParseContext *context,
|
||||
temp_cups = g_array_new(FALSE, FALSE, sizeof(Cup));
|
||||
xml_cup_read(buf, temp_cups);
|
||||
new_league.prom_rel.prom_games_cup = g_array_index(temp_cups, Cup, 0);
|
||||
new_league.prom_rel.prom_games_cup.id = prom_cup_id_new;
|
||||
free_g_array(&temp_cups);
|
||||
}
|
||||
else if(state == STATE_PROM_REL_ELEMENT_RANK_START)
|
||||
|
@ -302,14 +302,14 @@ xml_loadsave_cup_write(const gchar *prefix, const Cup *cup)
|
||||
fprintf(fil, "<_%d>\n", TAG_CUP_CHOOSE_TEAM_USER);
|
||||
xml_loadsave_cup_write_choose_team(fil, &cup->choose_team_user);
|
||||
fprintf(fil, "</_%d>\n", TAG_CUP_CHOOSE_TEAM_USER);
|
||||
}
|
||||
|
||||
for(i=0;i<cup->user_teams->len;i++)
|
||||
{
|
||||
fprintf(fil, "<_%d>\n", TAG_CUP_USER_TEAM);
|
||||
xml_write_int(fil, ((Team*)g_ptr_array_index(cup->user_teams, i))->id,
|
||||
TAG_TEAM_ID, I1);
|
||||
fprintf(fil, "</_%d>\n", TAG_CUP_USER_TEAM);
|
||||
}
|
||||
for(i=0;i<cup->user_teams->len;i++)
|
||||
{
|
||||
fprintf(fil, "<_%d>\n", TAG_CUP_USER_TEAM);
|
||||
xml_write_int(fil, ((Team*)g_ptr_array_index(cup->user_teams, i))->id,
|
||||
TAG_TEAM_ID, I1);
|
||||
fprintf(fil, "</_%d>\n", TAG_CUP_USER_TEAM);
|
||||
}
|
||||
|
||||
for(i=0;i<cup->choose_teams->len;i++)
|
||||
|
@ -225,7 +225,7 @@ xml_loadsave_league_write(const gchar *prefix, const League *league)
|
||||
xml_write_int(fil, league->average_skill, TAG_LEAGUE_AVERAGE_SKILL, I0);
|
||||
|
||||
fprintf(fil, "%s<_%d>\n", I0, TAG_LEAGUE_PROM_REL);
|
||||
if(strlen(league->prom_rel.prom_games_dest_sid->str) != 0)
|
||||
if(league_has_prom_games(league))
|
||||
{
|
||||
xml_write_g_string(fil, league->prom_rel.prom_games_dest_sid,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_DEST_SID, I2);
|
||||
@ -236,7 +236,7 @@ xml_loadsave_league_write(const gchar *prefix, const League *league)
|
||||
xml_loadsave_cup_write(buf, &league->prom_rel.prom_games_cup);
|
||||
}
|
||||
|
||||
if(strlen(league->prom_rel.prom_games_loser_sid->str) != 0)
|
||||
if(league_has_prom_games(league))
|
||||
xml_write_g_string(fil, league->prom_rel.prom_games_loser_sid,
|
||||
TAG_LEAGUE_PROM_REL_PROM_GAMES_LOSER_SID, I2);
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
#include "cup.h"
|
||||
#include "file.h"
|
||||
#include "misc.h"
|
||||
#include "xml.h"
|
||||
@ -13,6 +14,7 @@ enum XmlLoadSaveCountryTags
|
||||
TAG_MISC_WEEK,
|
||||
TAG_MISC_WEEK_ROUND,
|
||||
TAG_MISC_COUNTER,
|
||||
TAG_MISC_ALLCUP,
|
||||
TAG_END
|
||||
};
|
||||
|
||||
@ -63,6 +65,7 @@ xml_loadsave_misc_end_element (GMarkupParseContext *context,
|
||||
if(tag == TAG_NAME ||
|
||||
tag == TAG_SYMBOL ||
|
||||
tag == TAG_SID ||
|
||||
tag == TAG_MISC_ALLCUP ||
|
||||
tag == TAG_MISC_COUNTER ||
|
||||
tag == TAG_MISC_SEASON ||
|
||||
tag == TAG_MISC_WEEK ||
|
||||
@ -106,6 +109,8 @@ xml_loadsave_misc_text (GMarkupParseContext *context,
|
||||
week_round = int_value;
|
||||
else if(state == TAG_MISC_COUNTER)
|
||||
counters[countidx] = int_value;
|
||||
else if(state == TAG_MISC_ALLCUP)
|
||||
g_ptr_array_add(acps, cup_from_clid(int_value));
|
||||
}
|
||||
|
||||
|
||||
@ -133,6 +138,9 @@ xml_loadsave_misc_read(const gchar *dirname, const gchar *basename)
|
||||
misc_print_error(&error, TRUE);
|
||||
}
|
||||
|
||||
g_ptr_array_free(acps, TRUE);
|
||||
acps = g_ptr_array_new();
|
||||
|
||||
if(g_markup_parse_context_parse(context, file_contents, length, &error))
|
||||
{
|
||||
g_markup_parse_context_end_parse(context, NULL);
|
||||
@ -170,6 +178,9 @@ xml_loadsave_misc_write(const gchar *prefix)
|
||||
for(i=0;i<COUNT_END;i++)
|
||||
xml_write_int(fil, counters[i], TAG_MISC_COUNTER, I0);
|
||||
|
||||
for(i=0;i<acps->len;i++)
|
||||
xml_write_int(fil, acp(i)->id, TAG_MISC_ALLCUP, I0);
|
||||
|
||||
fprintf(fil, "</_%d>\n", TAG_MISC);
|
||||
fclose(fil);
|
||||
}
|
||||
|
@ -85,10 +85,10 @@ xml_loadsave_teams_start_element (GMarkupParseContext *context,
|
||||
}
|
||||
|
||||
if(tag == TAG_TEAM)
|
||||
new_team = team_new();
|
||||
new_team = team_new(FALSE);
|
||||
else if(tag == TAG_TEAM_PLAYER)
|
||||
{
|
||||
new_player = player_new(&new_team, 80);
|
||||
new_player = player_new(&new_team, 80, FALSE);
|
||||
etalidx = 0;
|
||||
}
|
||||
|
||||
|
@ -6,22 +6,22 @@
|
||||
|
||||
int_opt_confirm_quit 0
|
||||
int_opt_confirm_unfit 0
|
||||
int_opt_save_will_overwrite 1
|
||||
int_opt_save_will_overwrite 0
|
||||
int_opt_maximize_main_window 1
|
||||
int_opt_prefer_messages 0
|
||||
int_opt_autosave 0
|
||||
int_opt_autosave_interval 3
|
||||
int_opt_autosave_files 3
|
||||
int_opt_autosave 1
|
||||
int_opt_autosave_interval 5
|
||||
int_opt_autosave_files 5
|
||||
|
||||
# precision of skill and talent in player lists
|
||||
int_opt_player_precision 0
|
||||
|
||||
# refresh rate of the player list during a live game
|
||||
# the smaller the more often the list gets refreshed
|
||||
int_opt_live_game_player_list_refresh 45
|
||||
int_opt_live_game_player_list_refresh 48
|
||||
|
||||
# whether some debugging info's shown (in the console)
|
||||
int_opt_debug 0
|
||||
int_opt_debug 0 #60
|
||||
|
||||
string_opt_player_names_file player_names.xml
|
||||
string_opt_constants_file bygfoot_constants
|
||||
|
@ -18,4 +18,10 @@
|
||||
<cup>cwc</cup>
|
||||
<cup>uefa</cup>
|
||||
</cups>
|
||||
|
||||
<supercups>
|
||||
<cup>supercup_league_vs_cup</cup>
|
||||
<cup>supercup_uefa</cup>
|
||||
</supercups>
|
||||
|
||||
</country>
|
||||
|
@ -38,6 +38,12 @@
|
||||
|
||||
<choose_teams>
|
||||
|
||||
<choose_team>
|
||||
<choose_team_sid>england1</choose_team_sid>
|
||||
<number_of_teams>1</number_of_teams>
|
||||
<randomly>1</randomly>
|
||||
</choose_team>
|
||||
|
||||
<choose_team>
|
||||
<choose_team_sid>france1_short</choose_team_sid>
|
||||
<number_of_teams>1</number_of_teams>
|
||||
|
@ -35,6 +35,12 @@
|
||||
|
||||
<choose_teams>
|
||||
|
||||
<choose_team>
|
||||
<choose_team_sid>england1</choose_team_sid>
|
||||
<number_of_teams>1</number_of_teams>
|
||||
<randomly>1</randomly>
|
||||
</choose_team>
|
||||
|
||||
<choose_team>
|
||||
<choose_team_sid>france1_short</choose_team_sid>
|
||||
<number_of_teams>1</number_of_teams>
|
||||
|
@ -5,8 +5,6 @@
|
||||
<symbol>flag_en.png</symbol>
|
||||
<sid>england_prom_games2</sid>
|
||||
<type>national</type>
|
||||
<week_gap>1</week_gap>
|
||||
<last_week>49</last_week>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
||||
|
@ -5,8 +5,6 @@
|
||||
<symbol>flag_en.png</symbol>
|
||||
<sid>england_prom_games3</sid>
|
||||
<type>national</type>
|
||||
<week_gap>1</week_gap>
|
||||
<last_week>49</last_week>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
||||
|
@ -5,8 +5,6 @@
|
||||
<symbol>flag_en.png</symbol>
|
||||
<sid>england_prom_games4</sid>
|
||||
<type>national</type>
|
||||
<week_gap>1</week_gap>
|
||||
<last_week>49</last_week>
|
||||
|
||||
<cup_rounds>
|
||||
<cup_round>
|
||||
|
@ -36,13 +36,13 @@
|
||||
|
||||
<choose_teams>
|
||||
<choose_team>
|
||||
<choose_team_sid>france1_short germany1_short greece1_short italy1_short netherlands1_short
|
||||
portugal1_short russia1_short scotland1_short spain1_short
|
||||
switzerland1_short turkey1_short ukraine1_short belgium1_short
|
||||
czech1_short denmark1_short</choose_team_sid>
|
||||
<choose_team_sid>england1 france1_short germany1_short greece1_short
|
||||
italy1_short netherlands1_short portugal1_short russia1_short
|
||||
scotland1_short spain1_short switzerland1_short turkey1_short
|
||||
ukraine1_short belgium1_short czech1_short
|
||||
denmark1_short</choose_team_sid>
|
||||
<number_of_teams>29</number_of_teams>
|
||||
<randomly>1</randomly>
|
||||
</choose_team>
|
||||
</choose_teams>
|
||||
</choose_team> </choose_teams>
|
||||
|
||||
</cup>
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>brazil1</prom_games_dest_sid>
|
||||
<cup>brazil_prom_games</cup>
|
||||
<cup>cup_brazil_prom_games</cup>
|
||||
</prom_games>
|
||||
|
||||
<prom_rel_element>
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>brazil3</prom_games_dest_sid>
|
||||
<cup>brazil_prom_games</cup>
|
||||
<cup>cup_brazil_prom_games</cup>
|
||||
</prom_games>
|
||||
|
||||
<prom_rel_element>
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>brazil4</prom_games_dest_sid>
|
||||
<cup>brazil_prom_games</cup>
|
||||
<cup>cup_brazil_prom_games</cup>
|
||||
</prom_games>
|
||||
|
||||
<prom_rel_element>
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>brazil4</prom_games_dest_sid>
|
||||
<cup>brazil_prom_games</cup>
|
||||
<cup>cup_brazil_prom_games</cup>
|
||||
</prom_games>
|
||||
|
||||
<prom_rel_element>
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
<prom_games>
|
||||
<prom_games_dest_sid>brazil6</prom_games_dest_sid>
|
||||
<cup>brazil_prom_games</cup>
|
||||
<cup>cup_brazil_prom_games</cup>
|
||||
</prom_games>
|
||||
|
||||
</prom_rel>
|
||||
|
Loading…
x
Reference in New Issue
Block a user