[Freeciv] Re: new ranking calculation
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Thu, 9 Oct 2003, Horn Gábor wrote:
> I'd need more info about diplo actions. Now i parse the gamelog for
> lines that contains (Treaty), which indicates tech exchange. But there
> are (at least) two other type of alliances
...
> and shared isn't stored any way.
Attached patch adds this info to the gamelog. However, this info is not
protected in any way (by characters that are illegal in player names), so
that a player can cheat by setting his player name to the string being
searched for when parsing the game log.
I guess this should be fixed in a uniform manner for all strings parsed
from the gamelog for ranking purposes. What characters can we use?
- Per
-- Attached file included as plaintext by Ecartis --
-- File: gamelog1.diff
Index: server/diplhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/diplhand.c,v
retrieving revision 1.73
diff -u -r1.73 diplhand.c
--- server/diplhand.c 8 Aug 2003 22:11:42 -0000 1.73
+++ server/diplhand.c 10 Oct 2003 19:15:33 -0000
@@ -374,6 +374,9 @@
notify_player(pdest, _("Game: You get %d gold."), pclause->value);
pgiver->economic.gold -= pclause->value;
pdest->economic.gold += pclause->value;
+ gamelog(GAMELOG_TECH, _("%s acquire %d gold from %s"),
+ get_nation_name_plural(pdest->nation), pclause->value,
+ get_nation_name_plural(pgiver->nation));
break;
case CLAUSE_MAP:
give_map_from_player_to_player(pgiver, pdest);
@@ -404,6 +407,9 @@
_("Game: You give city of %s to %s."),
pcity->name, pdest->name);
+ gamelog(GAMELOG_TECH, _("%s acquire the city %s from %s"),
+ get_nation_name_plural(pdest->nation), pcity->name,
+ get_nation_name_plural(pgiver->nation));
transfer_city(pdest, pcity, -1, TRUE, TRUE, FALSE);
break;
}
@@ -442,6 +448,9 @@
notify_player_ex(pdest, -1, -1, E_TREATY_ALLIANCE,
_("Game: You agree on an alliance with %s."),
pgiver->name);
+ gamelog(GAMELOG_TECH, _("%s agree on an alliance with %s"),
+ get_nation_name_plural(pdest->nation),
+ get_nation_name_plural(pgiver->nation));
check_city_workers(plr0);
check_city_workers(plr1);
break;
@@ -453,6 +462,9 @@
notify_player_ex(pdest, -1, -1, E_TREATY_SHARED_VISION,
_("Game: %s gives you shared vision."),
pgiver->name);
+ gamelog(GAMELOG_TECH, _("%s share vision with %s"),
+ get_nation_name_plural(pdest->nation),
+ get_nation_name_plural(pgiver->nation));
break;
case CLAUSE_LAST:
freelog(LOG_ERROR, "Received bad clause type");
|
|