Spell ID and UID consistently all-caps

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2017-08-05 21:14:20 +02:00
parent aa59a6aa0a
commit a1ba346736
28 changed files with 113 additions and 113 deletions

View file

@ -19,11 +19,11 @@ Changes to Empire 4.3.33 - Wed May 20 18:17:43 UTC 2015
- Don't disclose that the torpedo's path to the target is blocked - Don't disclose that the torpedo's path to the target is blocked
by land when the target is out of range. Screwed up in 4.2.2. by land when the target is out of range. Screwed up in 4.2.2.
- When a submarine gets hit by return fire after firing its deck - When a submarine gets hit by return fire after firing its deck
gun, the defender again learns the submarine's uid and type, just gun, the defender again learns the submarine's UID and type, just
like for surface ships. This is how it worked before Empire 2.3. like for surface ships. This is how it worked before Empire 2.3.
- When a submarine gets hit by return fire after launching a - When a submarine gets hit by return fire after launching a
torpedo, the defender again learns the submarine's uid. Before torpedo, the defender again learns the submarine's UID. Before
Empire 2.3, he learned uid and type. Empire 2.3, he learned UID and type.
- Print "Kaboom" even when the target is out of range. - Print "Kaboom" even when the target is out of range.
- Always clear missions when firing guns or dropping depth charges. - Always clear missions when firing guns or dropping depth charges.
Screwed up when missions were added in Chainsaw. Screwed up when missions were added in Chainsaw.
@ -42,7 +42,7 @@ Changes to Empire 4.3.33 - Wed May 20 18:17:43 UTC 2015
* Fix news to report the actual owner of ships sunk by return * Fix news to report the actual owner of ships sunk by return
torpedoes instead of POGO. Screwed up when return torpedoes were torpedoes instead of POGO. Screwed up when return torpedoes were
added in Chainsaw. added in Chainsaw.
* Don't disclose uid, type and owner of torpedoed submarines. The * Don't disclose UID, type and owner of torpedoed submarines. The
latter leaked through the news. latter leaked through the news.
* Changes to bomb: * Changes to bomb:
- Fix damage to mobility when bombing planes. Has always been - Fix damage to mobility when bombing planes. Has always been
@ -649,7 +649,7 @@ Changes to Empire 4.3.28 - Sat Jul 16 11:30:53 UTC 2011
* Remove option TRADESHIPS. Deities can customize the ship table to * Remove option TRADESHIPS. Deities can customize the ship table to
enable trade ships. enable trade ships.
* Configuration table changes (builtin and custom): * Configuration table changes (builtin and custom):
- Rows must be in ascending uid order. - Rows must be in ascending UID order.
- Omitting rows in tables item, sect-chr and infrastructure is no - Omitting rows in tables item, sect-chr and infrastructure is no
longer permitted. longer permitted.
- Custom tables now replace the builtin table completely. Before, - Custom tables now replace the builtin table completely. Before,
@ -855,7 +855,7 @@ Changes to Empire 4.3.26 - Mon May 24 16:37:40 UTC 2010
* Fix retreat and lretreat condition 'c'. Broken in 4.3.16. * Fix retreat and lretreat condition 'c'. Broken in 4.3.16.
* coastwatch and skywatch could see too far. Up to one sector for * coastwatch and skywatch could see too far. Up to one sector for
practical radar ranges. practical radar ranges.
* skywatch now reports satellite uids. The uid is required for * skywatch now reports satellite UIDs. The UID is required for
launching a-sats since 4.3.23. launching a-sats since 4.3.23.
* Fix client not to send an empty line of input before aborting the * Fix client not to send an empty line of input before aborting the
command on player interrupt (normally ^C). command on player interrupt (normally ^C).
@ -1174,7 +1174,7 @@ Changes to Empire 4.3.20 - Fri Feb 20 18:14:20 UTC 2009
land units anymore. Loading stuff in foreign sectors was land units anymore. Loading stuff in foreign sectors was
prohibited already for ships. prohibited already for ships.
- lload and lunload now work on foreign land units only when - lload and lunload now work on foreign land units only when
they're explicitly named by uid. This matches behavior of load they're explicitly named by UID. This matches behavior of load
and unload. and unload.
- Fix to test relations of foreign object's owner to player instead - Fix to test relations of foreign object's owner to player instead
of the other way round. of the other way round.
@ -1230,7 +1230,7 @@ Changes to Empire 4.3.19 - Sun Dec 7 23:15:34 UTC 2008
* Improved nightly build, with additional tests. * Improved nightly build, with additional tests.
Changes to Empire 4.3.18 - Sat Oct 18 18:39:17 UTC 2008 Changes to Empire 4.3.18 - Sat Oct 18 18:39:17 UTC 2008
* Fix building of planes, land units and nukes with uids that have * Fix building of planes, land units and nukes with UIDs that have
never been used before. This could crash the server on some never been used before. This could crash the server on some
systems in certain states. Broken in 4.3.17. systems in certain states. Broken in 4.3.17.
* Improved nightly build, with restructured and extended tests. * Improved nightly build, with restructured and extended tests.
@ -1667,8 +1667,8 @@ Changes to Empire 4.3.11 - Tue Jan 1 18:57:38 UTC 2008
* New sector selector elev. It's set by fairland, but has no effect * New sector selector elev. It's set by fairland, but has no effect
on the game. It can be useful for deities to customize a world on the game. It can be useful for deities to customize a world
created by fairland. created by fairland.
* The client now copes with ids greater than 15. The Empire * The client now copes with IDs greater than 15. The Empire
protocol currently uses 14 ids. protocol currently uses 14 IDs.
* Rewrite the client's code for reading server output during login. * Rewrite the client's code for reading server output during login.
The old code could write one byte beyond the end of the buffer The old code could write one byte beyond the end of the buffer
(theoretically a remote hole), got confused by long lines, and (theoretically a remote hole), got confused by long lines, and
@ -2598,7 +2598,7 @@ Changes to Empire 4.2.20 - Tue Mar 22 21:07:18 UTC 2005
population limit. population limit.
* neweff miscalculated work when the population limit exceeded 999. * neweff miscalculated work when the population limit exceeded 999.
* Fix capping of avail when a big city is torn down. * Fix capping of avail when a big city is torn down.
* Fix a bug in fire that allowed players to find all submarine uids. * Fix a bug in fire that allowed players to find all submarine UIDs.
* Maximum sector population is no longer hardcoded, and now covered * Maximum sector population is no longer hardcoded, and now covered
by xdump. Option RES_POP now affects mountains and plains as by xdump. Option RES_POP now affects mountains and plains as
well. From Ray Hyatt. well. From Ray Hyatt.

View file

@ -17,13 +17,13 @@ The server sends lines of output. Each output line starts with an
identification string, followed by a space, then arbitrary text, then identification string, followed by a space, then arbitrary text, then
a line feed. a line feed.
Identification strings encode small integers called output ids as base Identification strings encode small integers called output IDs as base
36 numbers. Characters '0' to '9' represent digits 0 to 9, and 'a' to 36 numbers. Characters '0' to '9' represent digits 0 to 9, and 'a' to
'z' represent 10..35, as do 'A' to 'Z'. Symbolic names for ids are 'z' represent 10..35, as do 'A' to 'Z'. Symbolic names for IDs are
defined in proto.h. defined in proto.h.
empire-client versions before version 4.3.11 parse large output ids empire-client versions before version 4.3.11 parse large output IDs
incorrectly. Such ids do not currently occur. incorrectly. Such IDs do not currently occur.
Clients shall be able to safely handle output lines of arbitrary Clients shall be able to safely handle output lines of arbitrary
length. Naturally, a client may not be able to handle a sufficiently length. Naturally, a client may not be able to handle a sufficiently
@ -185,7 +185,7 @@ empire-client signals `EOF' when it encounters an end-of-file
condition while reading player input. It signals `interrupt' when it condition while reading player input. It signals `interrupt' when it
catches SIGINT, which is normally triggered by Ctrl-C. catches SIGINT, which is normally triggered by Ctrl-C.
The following ids occur: The following IDs occur:
* Command prompt C_PROMPT * Command prompt C_PROMPT
@ -351,12 +351,12 @@ The following ids occur:
The security considerations on C_PIPE apply to C_REDIR as well. The security considerations on C_PIPE apply to C_REDIR as well.
* Other ids * Other IDs
Other ids do not occur currently. Clients shall deal gracefully Other IDs do not occur currently. Clients shall deal gracefully
with ids they don't know. with IDs they don't know.
empire-client treats unknown ids like C_DATA. Versions before empire-client treats unknown IDs like C_DATA. Versions before
4.3.11 prepend "Aborted\n" to C_ABORT lines, and "Error; " to 4.3.11 prepend "Aborted\n" to C_ABORT lines, and "Error; " to
C_CMDERR and C_BADCMD lines for historical reasons. C_CMDERR and C_BADCMD lines for historical reasons.

View file

@ -492,7 +492,7 @@ equivalent to a newline.
Rationale: Follow econfig syntax. Rationale: Follow econfig syntax.
Tables with a record uid in the leftmost field can be `split Tables with a record UID in the leftmost field can be `split
vertically' into multiple parts. Each part must contain the same set vertically' into multiple parts. Each part must contain the same set
of records. The leftmost field must be repeated in each part. Other of records. The leftmost field must be repeated in each part. Other
fields may be repeated. Repeated fields must be the same in all fields may be repeated. Repeated fields must be the same in all
@ -501,7 +501,7 @@ a table that is not split.
Rationale: This is to let you avoid long lines. Line continuation Rationale: This is to let you avoid long lines. Line continuation
syntax would be simpler, but turns out to be illegible. Requiring syntax would be simpler, but turns out to be illegible. Requiring
record uid is not technically necessary, as counting records works the record UID is not technically necessary, as counting records works the
same whether a table is split or not. Except humans can't count. same whether a table is split or not. Except humans can't count.
Perhaps this should be a recommendation for use rather than part of Perhaps this should be a recommendation for use rather than part of
the language. the language.

View file

@ -55,7 +55,7 @@ struct empfile {
/* flags bits EFF_MEM, EFF_PRIVATE, EFF_NOTIME also fixed then */ /* flags bits EFF_MEM, EFF_PRIVATE, EFF_NOTIME also fixed then */
/* Members whose values may vary throughout operation */ /* Members whose values may vary throughout operation */
int baseid; /* id of first entry in cache */ int baseid; /* ID of first entry in cache */
int cids; /* # entries in cache */ int cids; /* # entries in cache */
int fids; /* # entries in table */ int fids; /* # entries in table */
int fd; /* file descriptor, -1 if not open */ int fd; /* file descriptor, -1 if not open */
@ -68,13 +68,13 @@ struct empfile {
*/ */
void (*oninit)(void *elt); void (*oninit)(void *elt);
/* /*
* Called after read. @id is the element id, and @elt is the * Called after read. @id is the element ID, and @elt is the
* element read. May modify the element. Modifications are * element read. May modify the element. Modifications are
* visible to caller of ef_read(), but have no effect on the file. * visible to caller of ef_read(), but have no effect on the file.
*/ */
void (*postread)(int id, void *elt); void (*postread)(int id, void *elt);
/* /*
* Called before write. @id is the element id, @old is the * Called before write. @id is the element ID, @old is the
* element being updated (null unless it is cached) and @elt is * element being updated (null unless it is cached) and @elt is
* the element being written. May modify the element. * the element being written. May modify the element.
* Modifications will be visible to caller of ef_write() and are * Modifications will be visible to caller of ef_write() and are

View file

@ -50,7 +50,7 @@ struct lndstr {
signed ef_type: 8; signed ef_type: 8;
unsigned lnd_seqno: 12; unsigned lnd_seqno: 12;
unsigned lnd_generation: 12; unsigned lnd_generation: 12;
int lnd_uid; /* unit id (land #) */ int lnd_uid; /* unit ID (land #) */
time_t lnd_timestamp; /* Last time this unit was touched */ time_t lnd_timestamp; /* Last time this unit was touched */
natid lnd_own; /* owner's country num */ natid lnd_own; /* owner's country num */
coord lnd_x; /* x location in abs coords */ coord lnd_x; /* x location in abs coords */
@ -65,7 +65,7 @@ struct lndstr {
short lnd_mission; /* mission code */ short lnd_mission; /* mission code */
short lnd_radius; /* mission radius */ short lnd_radius; /* mission radius */
/* end of part matching struct empobj */ /* end of part matching struct empobj */
int lnd_ship; /* uid of transporting ship, or -1 */ int lnd_ship; /* UID of transporting ship, or -1 */
signed char lnd_harden; /* fortification */ signed char lnd_harden; /* fortification */
short lnd_retreat; /* retreat percentage */ short lnd_retreat; /* retreat percentage */
int lnd_rflags; /* When do I retreat? */ int lnd_rflags; /* When do I retreat? */
@ -74,7 +74,7 @@ struct lndstr {
short lnd_item[I_MAX+1]; /* amount of items on board */ short lnd_item[I_MAX+1]; /* amount of items on board */
short lnd_pstage; /* plague stage */ short lnd_pstage; /* plague stage */
short lnd_ptime; /* how many ETUs remain in this stage */ short lnd_ptime; /* how many ETUs remain in this stage */
int lnd_land; /* uid of transporting land unit, or -1 */ int lnd_land; /* UID of transporting land unit, or -1 */
short lnd_access; /* Last tick mob was updated (MOB_ACCESS) */ short lnd_access; /* Last tick mob was updated (MOB_ACCESS) */
}; };

View file

@ -46,7 +46,7 @@ struct loststr {
natid lost_owner; /* Who lost it */ natid lost_owner; /* Who lost it */
/* end of part matching struct empobj */ /* end of part matching struct empobj */
short lost_type; /* Type of thing (ship, plane, nuke, land, sector) */ short lost_type; /* Type of thing (ship, plane, nuke, land, sector) */
int lost_id; /* uid of lost thing (0 for sector) */ int lost_id; /* UID of lost thing (0 for sector) */
coord lost_x; coord lost_x;
coord lost_y; coord lost_y;
}; };

View file

@ -60,7 +60,7 @@ enum nsc_type {
NSC_FLOAT, /* float */ NSC_FLOAT, /* float */
NSC_STRINGY, /* char[] */ NSC_STRINGY, /* char[] */
/* aliases, must match typedefs */ /* aliases, must match typedefs */
NSC_NATID = NSC_UCHAR /* nation id */ NSC_NATID = NSC_UCHAR /* nation ID */
}; };
/* Is TYPE a promoted value type? */ /* Is TYPE a promoted value type? */

View file

@ -46,7 +46,7 @@ struct nukstr {
signed ef_type: 8; signed ef_type: 8;
unsigned nuk_seqno: 12; unsigned nuk_seqno: 12;
unsigned nuk_generation: 12; unsigned nuk_generation: 12;
int nuk_uid; /* unit id (nuke #) */ int nuk_uid; /* unit ID (nuke #) */
time_t nuk_timestamp; /* Last time this nuke was touched */ time_t nuk_timestamp; /* Last time this nuke was touched */
natid nuk_own; natid nuk_own;
coord nuk_x, nuk_y; /* current loc of device */ coord nuk_x, nuk_y; /* current loc of device */
@ -60,7 +60,7 @@ struct nukstr {
short nuk_mission; /* mission code, unused */ short nuk_mission; /* mission code, unused */
short nuk_radius; /* mission radius, unused */ short nuk_radius; /* mission radius, unused */
/* end of part matching struct empobj */ /* end of part matching struct empobj */
int nuk_plane; /* uid of transporting plane, or -1 */ int nuk_plane; /* UID of transporting plane, or -1 */
}; };
struct nchrstr { struct nchrstr {

View file

@ -49,7 +49,7 @@ struct plnstr {
signed ef_type: 8; signed ef_type: 8;
unsigned pln_seqno: 12; unsigned pln_seqno: 12;
unsigned pln_generation: 12; unsigned pln_generation: 12;
int pln_uid; /* unit id (plane #) */ int pln_uid; /* unit ID (plane #) */
time_t pln_timestamp; /* Last time this plane was touched */ time_t pln_timestamp; /* Last time this plane was touched */
natid pln_own; /* owning country */ natid pln_own; /* owning country */
coord pln_x; /* plane x-y */ coord pln_x; /* plane x-y */
@ -67,8 +67,8 @@ struct plnstr {
/* end of part matching struct empobj */ /* end of part matching struct empobj */
unsigned char pln_range; /* total distance, not radius */ unsigned char pln_range; /* total distance, not radius */
signed char pln_harden; /* for missiles */ signed char pln_harden; /* for missiles */
int pln_ship; /* uid of carrier, or -1 */ int pln_ship; /* UID of carrier, or -1 */
int pln_land; /* uid of transporting land unit, or -1 */ int pln_land; /* UID of transporting land unit, or -1 */
int pln_flags; /* State of the plane */ int pln_flags; /* State of the plane */
short pln_access; /* Last tick mob was updated (MOB_ACCESS) */ short pln_access; /* Last tick mob was updated (MOB_ACCESS) */
float pln_theta; /* position in orbital sine wave */ float pln_theta; /* position in orbital sine wave */

View file

@ -84,7 +84,7 @@ struct player {
int aborted; /* command aborted? */ int aborted; /* command aborted? */
int got_ctld; /* EOF cookie received? */ int got_ctld; /* EOF cookie received? */
int recvfail; /* #recvclient() failures */ int recvfail; /* #recvclient() failures */
int curid; /* for pr, cur. line's id, -1 none */ int curid; /* for pr, cur. line's ID, -1 none */
char *map; /* pointer to in-mem map */ char *map; /* pointer to in-mem map */
char *bmap; /* pointer to in-mem bmap */ char *bmap; /* pointer to in-mem bmap */
}; };

View file

@ -57,10 +57,10 @@ struct sctstr {
unsigned char sct_off; /* Should this sector produce? */ unsigned char sct_off; /* Should this sector produce? */
/* end of part matching struct empobj */ /* end of part matching struct empobj */
unsigned char sct_loyal; /* updates until civilans "converted" */ unsigned char sct_loyal; /* updates until civilans "converted" */
unsigned char sct_terr; /* territory 0 id # of sector */ unsigned char sct_terr; /* territory 0 number */
unsigned char sct_terr1; /* territory 1 id # of sector */ unsigned char sct_terr1; /* territory 1 number */
unsigned char sct_terr2; /* territory 2 id # of sector */ unsigned char sct_terr2; /* territory 2 number */
unsigned char sct_terr3; /* territory 3 id # of sector */ unsigned char sct_terr3; /* territory 3 number */
unsigned char sct_dterr; /* deity's territory # */ unsigned char sct_dterr; /* deity's territory # */
coord sct_dist_x; /* Dist sector */ coord sct_dist_x; /* Dist sector */
coord sct_dist_y; coord sct_dist_y;

View file

@ -28,11 +28,11 @@ Changes to Empire 4.3.33 - Wed May 20 18:17:43 UTC 2015
- Don't disclose that the torpedo's path to the target is blocked - Don't disclose that the torpedo's path to the target is blocked
by land when the target is out of range. Screwed up in 4.2.2. by land when the target is out of range. Screwed up in 4.2.2.
- When a submarine gets hit by return fire after firing its deck - When a submarine gets hit by return fire after firing its deck
gun, the defender again learns the submarine's uid and type, just gun, the defender again learns the submarine's UID and type, just
like for surface ships. This is how it worked before Empire 2.3. like for surface ships. This is how it worked before Empire 2.3.
- When a submarine gets hit by return fire after launching a - When a submarine gets hit by return fire after launching a
torpedo, the defender again learns the submarine's uid. Before torpedo, the defender again learns the submarine's UID. Before
Empire 2.3, he learned uid and type. Empire 2.3, he learned UID and type.
- Print "Kaboom" even when the target is out of range. - Print "Kaboom" even when the target is out of range.
- Always clear missions when firing guns or dropping depth charges. - Always clear missions when firing guns or dropping depth charges.
Screwed up when missions were added in Chainsaw. Screwed up when missions were added in Chainsaw.
@ -51,7 +51,7 @@ Changes to Empire 4.3.33 - Wed May 20 18:17:43 UTC 2015
* Fix news to report the actual owner of ships sunk by return * Fix news to report the actual owner of ships sunk by return
torpedoes instead of POGO. Screwed up when return torpedoes were torpedoes instead of POGO. Screwed up when return torpedoes were
added in Chainsaw. added in Chainsaw.
* Don't disclose uid, type and owner of torpedoed submarines. The * Don't disclose UID, type and owner of torpedoed submarines. The
latter leaked through the news. latter leaked through the news.
* Changes to bomb: * Changes to bomb:
- Fix damage to mobility when bombing planes. Has always been - Fix damage to mobility when bombing planes. Has always been
@ -658,7 +658,7 @@ Changes to Empire 4.3.28 - Sat Jul 16 11:30:53 UTC 2011
* Remove option TRADESHIPS. Deities can customize the ship table to * Remove option TRADESHIPS. Deities can customize the ship table to
enable trade ships. enable trade ships.
* Configuration table changes (builtin and custom): * Configuration table changes (builtin and custom):
- Rows must be in ascending uid order. - Rows must be in ascending UID order.
- Omitting rows in tables item, sect-chr and infrastructure is no - Omitting rows in tables item, sect-chr and infrastructure is no
longer permitted. longer permitted.
- Custom tables now replace the builtin table completely. Before, - Custom tables now replace the builtin table completely. Before,
@ -864,7 +864,7 @@ Changes to Empire 4.3.26 - Mon May 24 16:37:40 UTC 2010
* Fix retreat and lretreat condition 'c'. Broken in 4.3.16. * Fix retreat and lretreat condition 'c'. Broken in 4.3.16.
* coastwatch and skywatch could see too far. Up to one sector for * coastwatch and skywatch could see too far. Up to one sector for
practical radar ranges. practical radar ranges.
* skywatch now reports satellite uids. The uid is required for * skywatch now reports satellite UIDs. The UID is required for
launching a-sats since 4.3.23. launching a-sats since 4.3.23.
* Fix client not to send an empty line of input before aborting the * Fix client not to send an empty line of input before aborting the
command on player interrupt (normally ^C). command on player interrupt (normally ^C).
@ -1183,7 +1183,7 @@ Changes to Empire 4.3.20 - Fri Feb 20 18:14:20 UTC 2009
land units anymore. Loading stuff in foreign sectors was land units anymore. Loading stuff in foreign sectors was
prohibited already for ships. prohibited already for ships.
- lload and lunload now work on foreign land units only when - lload and lunload now work on foreign land units only when
they're explicitly named by uid. This matches behavior of load they're explicitly named by UID. This matches behavior of load
and unload. and unload.
- Fix to test relations of foreign object's owner to player instead - Fix to test relations of foreign object's owner to player instead
of the other way round. of the other way round.
@ -1239,7 +1239,7 @@ Changes to Empire 4.3.19 - Sun Dec 7 23:15:34 UTC 2008
* Improved nightly build, with additional tests. * Improved nightly build, with additional tests.
Changes to Empire 4.3.18 - Sat Oct 18 18:39:17 UTC 2008 Changes to Empire 4.3.18 - Sat Oct 18 18:39:17 UTC 2008
* Fix building of planes, land units and nukes with uids that have * Fix building of planes, land units and nukes with UIDs that have
never been used before. This could crash the server on some never been used before. This could crash the server on some
systems in certain states. Broken in 4.3.17. systems in certain states. Broken in 4.3.17.
* Improved nightly build, with restructured and extended tests. * Improved nightly build, with restructured and extended tests.
@ -1676,8 +1676,8 @@ Changes to Empire 4.3.11 - Tue Jan 1 18:57:38 UTC 2008
* New sector selector elev. It's set by fairland, but has no effect * New sector selector elev. It's set by fairland, but has no effect
on the game. It can be useful for deities to customize a world on the game. It can be useful for deities to customize a world
created by fairland. created by fairland.
* The client now copes with ids greater than 15. The Empire * The client now copes with IDs greater than 15. The Empire
protocol currently uses 14 ids. protocol currently uses 14 IDs.
* Rewrite the client's code for reading server output during login. * Rewrite the client's code for reading server output during login.
The old code could write one byte beyond the end of the buffer The old code could write one byte beyond the end of the buffer
(theoretically a remote hole), got confused by long lines, and (theoretically a remote hole), got confused by long lines, and
@ -2607,7 +2607,7 @@ Changes to Empire 4.2.20 - Tue Mar 22 21:07:18 UTC 2005
population limit. population limit.
* neweff miscalculated work when the population limit exceeded 999. * neweff miscalculated work when the population limit exceeded 999.
* Fix capping of avail when a big city is torn down. * Fix capping of avail when a big city is torn down.
* Fix a bug in fire that allowed players to find all submarine uids. * Fix a bug in fire that allowed players to find all submarine UIDs.
* Maximum sector population is no longer hardcoded, and now covered * Maximum sector population is no longer hardcoded, and now covered
by xdump. Option RES_POP now affects mountains and plains as by xdump. Option RES_POP now affects mountains and plains as
well. From Ray Hyatt. well. From Ray Hyatt.

View file

@ -28,7 +28,7 @@ Note that in the case of load, lload, unload, tend, and lunload, the
way you specify whether you are moving a commodity, land unit or plane way you specify whether you are moving a commodity, land unit or plane
is by using the word "land" or "plane" instead of the commodity name is by using the word "land" or "plane" instead of the commodity name
in the <WHAT> field. If <WHAT> is "land" or "plane", then <NUM> is in the <WHAT> field. If <WHAT> is "land" or "plane", then <NUM> is
the unit or plane id. So for example, to load ship #1 with land unit the unit or plane ID. So for example, to load ship #1 with land unit
#2, you would type: #2, you would type:
.EX "load land 1 2" .EX "load land 1 2"
.s1 .s1

View file

@ -96,7 +96,7 @@ type of unit (e.g. cavalry or frigate)
.L tech .L tech
tech level the unit was built at tech level the unit was built at
.L uid .L uid
unit id number unit ID number
.L group .L group
fleet/wing/army fleet/wing/army
.L opx .L opx

View file

@ -7,9 +7,9 @@ database for your country.
.s1 .s1
All lost items are timestamped at the time they were lost. If All lost items are timestamped at the time they were lost. If
you had a previously lost item in the database, and then build a you had a previously lost item in the database, and then build a
new item of the same type with the same id, or regain an item of the new item of the same type with the same ID, or regain an item of the
same type with the same same type with the same
id, it is removed from the database. This is done because the new item ID, it is removed from the database. This is done because the new item
will now show up in the other dump commands, and is no longer lost. will now show up in the other dump commands, and is no longer lost.
.s1 .s1
Lost items are kept in the database for 48 hours (default) but may Lost items are kept in the database for 48 hours (default) but may
@ -48,7 +48,7 @@ The type of lost item. They are as follows:
4 - Nuclear stockpile 4 - Nuclear stockpile
.L id .L id
The # of the ship, plane, land unit or nuke. All of these items The # of the ship, plane, land unit or nuke. All of these items
are identified by id. Sectors are identified by x and y. are identified by ID. Sectors are identified by x and y.
.L x .L x
The x coordinate of the lost item when it was lost. The x coordinate of the lost item when it was lost.
.L y .L y

View file

@ -32,11 +32,11 @@ use Dumpvalue;
# Map table name to meta table reference # Map table name to meta table reference
my %meta_by_name = (); my %meta_by_name = ();
# Map table uid to meta table reference # Map table UID to meta table reference
my @meta_by_uid = (); my @meta_by_uid = ();
# Map table name to table reference # Map table name to table reference
my %table_by_name = (); my %table_by_name = ();
# Map table uid to table reference # Map table UID to table reference
my @table_by_uid = (); my @table_by_uid = ();
# The meta meta table # The meta meta table
@ -67,7 +67,7 @@ my $dumper = new Dumpvalue;
# xdump meta table # xdump meta table
$meta_by_name{table} = []; $meta_by_name{table} = [];
parse_xdump(send_cmd('xdump meta table'), undef); parse_xdump(send_cmd('xdump meta table'), undef);
# table's first field is record uid, and its table field is the table uid: # table's first field is record UID, and its table field is the table uid:
my $tuid = $meta_by_name{table}->[0]->{table}; my $tuid = $meta_by_name{table}->[0]->{table};
$meta_by_uid[$tuid] = $meta_by_name{table}; $meta_by_uid[$tuid] = $meta_by_name{table};
@ -78,7 +78,7 @@ my $dumper = new Dumpvalue;
# complete work for xdump meta meta # complete work for xdump meta meta
{ {
# find the meta table uid # find the meta table UID
my ($meta) = grep { defined $_ && $_->{name} eq 'meta' } my ($meta) = grep { defined $_ && $_->{name} eq 'meta' }
@{$table_by_name{table}}; @{$table_by_name{table}};
my $tuid = $meta->{uid}; my $tuid = $meta->{uid};
@ -91,7 +91,7 @@ my $dumper = new Dumpvalue;
{ {
# lookup record with name => 'type' in meta meta: # lookup record with name => 'type' in meta meta:
my ($mmt) = grep {$_->{name} eq 'type'} @meta_meta; my ($mmt) = grep {$_->{name} eq 'type'} @meta_meta;
# its table field is uid of table meta-type: # its table field is UID of table meta-type:
my $tuid = $mmt->{table}; my $tuid = $mmt->{table};
# lookup table meta-type's name: # lookup table meta-type's name:
my $name = $table_by_name{table}->[$tuid]->{name}; my $name = $table_by_name{table}->[$tuid]->{name};
@ -215,7 +215,7 @@ sub eval_fld {
} }
sub has_record_uid { sub has_record_uid {
# a table has record uids if the first field's table is the table's uid # a table has record UIDs if the first field's table is the table's UID
my ($tuid) = @_; my ($tuid) = @_;
die unless defined $tuid; die unless defined $tuid;
die unless defined $meta_by_uid[$tuid]; die unless defined $meta_by_uid[$tuid];

View file

@ -84,7 +84,7 @@ parseid(char *line)
id = strtol(line, &end, 36); id = strtol(line, &end, 36);
if (end == line || *end != ' ') { if (end == line || *end != ' ') {
fprintf(stderr, "Malformed id in line %s", line); fprintf(stderr, "Malformed ID in line %s", line);
id = -1; id = -1;
} }
if (id > C_LAST) if (id > C_LAST)

View file

@ -332,10 +332,10 @@ recv_output(int sock)
* simple state machine. * simple state machine.
* Initial state is SCANNING_ID. * Initial state is SCANNING_ID.
* In state SCANNING_ID, buffer the character. If it's a space, * In state SCANNING_ID, buffer the character. If it's a space,
* decode the id that has been buffered, and enter state BUFFERING * decode the ID that has been buffered, and enter state BUFFERING
* or COPYING depending on its value. * or COPYING depending on its value.
* In state BUFFERING, buffer the character. If it's newline, * In state BUFFERING, buffer the character. If it's newline,
* pass id and buffered text to servercmd(), then enter state * pass ID and buffered text to servercmd(), then enter state
* SCANNING_ID. * SCANNING_ID.
* In state COPYING, pass the character to outch(). If it's * In state COPYING, pass the character to outch(). If it's
* newline, enter state SCANNING_ID. * newline, enter state SCANNING_ID.
@ -382,7 +382,7 @@ recv_output(int sock)
state = BUFFERING; state = BUFFERING;
break; break;
default: default:
/* unknown or unexpected id, treat like C_DATA */ /* unknown or unexpected ID, treat like C_DATA */
case C_DATA: case C_DATA:
state = COPYING; state = COPYING;
break; break;

View file

@ -143,7 +143,7 @@ launch_as(struct plnstr *pp)
|| !pln_is_in_orbit(&plane)) { || !pln_is_in_orbit(&plane)) {
pr("No such satellite exists!\n"); pr("No such satellite exists!\n");
return RET_FAIL; return RET_FAIL;
/* Can be abused to find satellite ids. Tolerable. */ /* Can be abused to find satellite IDs. Tolerable. */
} }
if (mapdist(pp->pln_x, pp->pln_y, plane.pln_x, plane.pln_y) if (mapdist(pp->pln_x, pp->pln_y, plane.pln_x, plane.pln_y)

View file

@ -46,7 +46,7 @@ struct clink {
* Cargo lists * Cargo lists
* *
* Persistent game state encodes "who carries what" by storing the * Persistent game state encodes "who carries what" by storing the
* carrier uid in the cargo. Cargo lists augment that: they store * carrier UID in the cargo. Cargo lists augment that: they store
* lists of cargo for each carrier. * lists of cargo for each carrier.
* *
* clink[TYPE] points to an array of cargo list links. The array has * clink[TYPE] points to an array of cargo list links. The array has
@ -56,10 +56,10 @@ struct clink {
* EF_NUKE. Other slots of clink[] and nclink[] are unused and remain * EF_NUKE. Other slots of clink[] and nclink[] are unused and remain
* zero. * zero.
* *
* clink[TYPE][UID].next is the uid of the next unit of the same type * clink[TYPE][UID].next is the UID of the next unit of the same type
* in the same carrier, -1 if none. * in the same carrier, -1 if none.
* *
* clink[TYPE][UID].head[CARGO-EF_PLANE] is the uid of the first unit * clink[TYPE][UID].head[CARGO-EF_PLANE] is the UID of the first unit
* of type CARGO carried by this unit, -1 if none. The next unit, if * of type CARGO carried by this unit, -1 if none. The next unit, if
* any, is clink[CARGO][clink[TYPE][UID].head[CARGO-EF_PLANE]].next, * any, is clink[CARGO][clink[TYPE][UID].head[CARGO-EF_PLANE]].next,
* and so forth. * and so forth.
@ -99,7 +99,7 @@ clink_init(struct clink *cl)
} }
/* /*
* Check whether *@uidp is a valid uid for file type @type. * Check whether *@uidp is a valid UID for file type @type.
*/ */
static void static void
clink_check1(int *uidp, int type) clink_check1(int *uidp, int type)
@ -130,7 +130,7 @@ clink_check(int type)
} }
/* /*
* Add to @cl's cargo list for type @type the uid @uid. * Add to @cl's cargo list for type @type the UID @uid.
* @uid must not be on any cargo list already. * @uid must not be on any cargo list already.
*/ */
static void static void
@ -149,7 +149,7 @@ clink_add(struct clink *cl, int type, int uid)
} }
/* /*
* Remove from @cl's cargo list for type @type the uid @uid. * Remove from @cl's cargo list for type @type the UID @uid.
* @uid must be on that cargo list. * @uid must be on that cargo list.
*/ */
static void static void
@ -176,8 +176,8 @@ clink_rem(struct clink *cl, int type, int uid)
/* /*
* Update cargo lists for a change of @cargo's carrier. * Update cargo lists for a change of @cargo's carrier.
* Carrier is of type @type, and changes from uid @old to @new. * Carrier is of type @type, and changes from UID @old to @new.
* Negative uids mean no carrier. * Negative UIDs mean no carrier.
*/ */
void void
unit_carrier_change(struct empobj *cargo, int type, int old, int new) unit_carrier_change(struct empobj *cargo, int type, int old, int new)
@ -192,8 +192,8 @@ unit_carrier_change(struct empobj *cargo, int type, int old, int new)
/* /*
* Update cargo lists for a change of @pp's carrier. * Update cargo lists for a change of @pp's carrier.
* Carrier is of type @type, and changes from uid @old to @new. * Carrier is of type @type, and changes from UID @old to @new.
* Negative uids mean no carrier. * Negative UIDs mean no carrier.
*/ */
void void
pln_carrier_change(struct plnstr *pp, int type, int old, int new) pln_carrier_change(struct plnstr *pp, int type, int old, int new)
@ -203,8 +203,8 @@ pln_carrier_change(struct plnstr *pp, int type, int old, int new)
/* /*
* Update cargo lists for a change of @lp's carrier. * Update cargo lists for a change of @lp's carrier.
* Carrier is of type @type, and changes from uid @old to @new. * Carrier is of type @type, and changes from UID @old to @new.
* Negative uids mean no carrier. * Negative UIDs mean no carrier.
*/ */
void void
lnd_carrier_change(struct lndstr *lp, int type, int old, int new) lnd_carrier_change(struct lndstr *lp, int type, int old, int new)
@ -214,8 +214,8 @@ lnd_carrier_change(struct lndstr *lp, int type, int old, int new)
/* /*
* Update cargo lists for a change of @np's carrier. * Update cargo lists for a change of @np's carrier.
* Carrier is of type @type, and changes from uid @old to @new. * Carrier is of type @type, and changes from UID @old to @new.
* Negative uids mean no carrier. * Negative UIDs mean no carrier.
*/ */
void void
nuk_carrier_change(struct nukstr *np, int type, int old, int new) nuk_carrier_change(struct nukstr *np, int type, int old, int new)
@ -299,7 +299,7 @@ unit_onresize(int type)
/* /*
* Find first unit on a carrier's cargo list for file type @cargo_type. * Find first unit on a carrier's cargo list for file type @cargo_type.
* Search carrier @uid of type @type. * Search carrier @uid of type @type.
* Return first unit's uid, or -1 if the carrier isn't carrying such * Return first unit's UID, or -1 if the carrier isn't carrying such
* units. * units.
*/ */
int int
@ -320,7 +320,7 @@ unit_cargo_first(int type, int uid, int cargo_type)
/* /*
* Find the next unit on a cargo list for file type @cargo_type. * Find the next unit on a cargo list for file type @cargo_type.
* Get the unit after @cargo_uid. * Get the unit after @cargo_uid.
* Return its uid, or -1 if there are no more on this list. * Return its UID, or -1 if there are no more on this list.
*/ */
int int
unit_cargo_next(int cargo_type, int cargo_uid) unit_cargo_next(int cargo_type, int cargo_uid)
@ -333,7 +333,7 @@ unit_cargo_next(int cargo_type, int cargo_uid)
} }
/* /*
* If @sp carries planes, return the uid of the first one, else -1. * If @sp carries planes, return the UID of the first one, else -1.
*/ */
int int
pln_first_on_ship(struct shpstr *sp) pln_first_on_ship(struct shpstr *sp)
@ -342,7 +342,7 @@ pln_first_on_ship(struct shpstr *sp)
} }
/* /*
* If @lp carries planes, return the uid of the first one, else -1. * If @lp carries planes, return the UID of the first one, else -1.
*/ */
int int
pln_first_on_land(struct lndstr *lp) pln_first_on_land(struct lndstr *lp)
@ -352,7 +352,7 @@ pln_first_on_land(struct lndstr *lp)
/* /*
* Find the next plane on the same carrier as plane#@uid. * Find the next plane on the same carrier as plane#@uid.
* Return its uid, or -1 if there are no more. * Return its UID, or -1 if there are no more.
*/ */
int int
pln_next_on_unit(int uid) pln_next_on_unit(int uid)
@ -361,7 +361,7 @@ pln_next_on_unit(int uid)
} }
/* /*
* If @sp carries land units, return the uid of the first one, else -1. * If @sp carries land units, return the UID of the first one, else -1.
*/ */
int int
lnd_first_on_ship(struct shpstr *sp) lnd_first_on_ship(struct shpstr *sp)
@ -370,7 +370,7 @@ lnd_first_on_ship(struct shpstr *sp)
} }
/* /*
* If @lp carries land units, return the uid of the first one, else -1. * If @lp carries land units, return the UID of the first one, else -1.
*/ */
int int
lnd_first_on_land(struct lndstr *lp) lnd_first_on_land(struct lndstr *lp)
@ -380,7 +380,7 @@ lnd_first_on_land(struct lndstr *lp)
/* /*
* Find the next land unit on the same carrier as land#@uid. * Find the next land unit on the same carrier as land#@uid.
* Return its uid, or -1 if there are no more. * Return its UID, or -1 if there are no more.
*/ */
int int
lnd_next_on_unit(int uid) lnd_next_on_unit(int uid)
@ -389,7 +389,7 @@ lnd_next_on_unit(int uid)
} }
/* /*
* If @pp carries a nuke, return its uid, else -1. * If @pp carries a nuke, return its UID, else -1.
*/ */
int int
nuk_on_plane(struct plnstr *pp) nuk_on_plane(struct plnstr *pp)

View file

@ -175,7 +175,7 @@ verify_row(int type, int row)
continue; continue;
} }
if (ca[i].ca_table == type && i == 0) { if (ca[i].ca_table == type && i == 0) {
/* uid */ /* UID */
if (val.val_as.lng != row) { if (val.val_as.lng != row) {
verify_fail(type, row, &ca[i], j, verify_fail(type, row, &ca[i], j,
"value is %ld instead of %d", "value is %ld instead of %d",

View file

@ -576,10 +576,10 @@ ef_write(int type, int id, void *from)
} }
/* /*
* Change element id. * Change element ID.
* @buf is an element of table @type. * @buf is an element of table @type.
* @id is its new element ID. * @id is its new element ID.
* If table is EFF_TYPED, change id and sequence number stored in @buf. * If table is EFF_TYPED, change ID and sequence number stored in @buf.
* Else do nothing. * Else do nothing.
*/ */
void void

View file

@ -57,7 +57,7 @@ static char *bufrotate(char *buf, size_t bufsz, size_t i);
*/ */
/* /*
* Array of sector data, indexed by sector uid * Array of sector data, indexed by sector UID
* *
* We need to store a few values per sector visited by the path * We need to store a few values per sector visited by the path
* search. An array is the stupidest data structure that could * search. An array is the stupidest data structure that could
@ -98,7 +98,7 @@ static struct pf_map *pf_map;
*/ */
struct pf_heap { struct pf_heap {
int uid; /* sector uid and */ int uid; /* sector UID and ... */
coord x, y; /* coordinates, @uid == XYOFFSET(@x, @y) */ coord x, y; /* coordinates, @uid == XYOFFSET(@x, @y) */
double cost; /* cost from source */ double cost; /* cost from source */
}; };
@ -131,7 +131,7 @@ static double pf_sumcost;
#endif /* !PATH_FIND_STATS */ #endif /* !PATH_FIND_STATS */
#ifndef NDEBUG /* silence "not used" warning */ #ifndef NDEBUG /* silence "not used" warning */
/* Is sector with uid @uid open? */ /* Is sector with UID @uid open? */
static int static int
pf_is_open(int uid) pf_is_open(int uid)
{ {
@ -139,7 +139,7 @@ pf_is_open(int uid)
} }
#endif #endif
/* Is sector with uid @uid closed? */ /* Is sector with UID @uid closed? */
static int static int
pf_is_closed(int uid) pf_is_closed(int uid)
{ {
@ -150,7 +150,7 @@ pf_is_closed(int uid)
return pf_map[uid].visit > pf_visit; return pf_map[uid].visit > pf_visit;
} }
/* Is sector with uid @uid unvisited? */ /* Is sector with UID @uid unvisited? */
static int static int
pf_is_unvisited(int uid) pf_is_unvisited(int uid)
{ {
@ -234,7 +234,7 @@ pf_sift_up(int n)
/* /*
* Open the unvisited sector @x,@y. * Open the unvisited sector @x,@y.
* @uid is sector uid, it equals XYOFFSET(@x,@y). * @uid is sector UID, it equals XYOFFSET(@x,@y).
* Cheapest path from source comes from direction @dir and has cost @cost. * Cheapest path from source comes from direction @dir and has cost @cost.
*/ */
static void static void
@ -283,7 +283,7 @@ pf_close(void)
/* silence "not used" warning */ /* silence "not used" warning */
#ifdef PATH_FIND_DEBUG #ifdef PATH_FIND_DEBUG
/* /*
* Return cost from source to sector with uid @uid. * Return cost from source to sector with UID @uid.
* It must be visited, i.e. open or closed. * It must be visited, i.e. open or closed.
*/ */
static double static double
@ -327,7 +327,7 @@ y_in_dir(coord y, int dir)
/* /*
* Set the current source and cost function. * Set the current source and cost function.
* @sx,@sy is the source. * @sx,@sy is the source.
* The cost to enter the sector with uid ID is @cost(@actor, ID). * The cost to enter the sector with UID ID is @cost(@actor, ID).
* Negative value means the sector can't be entered. * Negative value means the sector can't be entered.
*/ */
static void static void

View file

@ -448,7 +448,7 @@ empth_create(void (*entry)(void *), int size, int flags,
goto bad; goto bad;
} }
loc_debug("new thread id is %ld", pThread->ulThreadID); loc_debug("new thread ID is %ld", pThread->ulThreadID);
empth_yield(); empth_yield();
return pThread; return pThread;

View file

@ -58,7 +58,7 @@ struct empth_t {
void *ud; /* user data */ void *ud; /* user data */
int wakeup; int wakeup;
void (*ep)(void *); /* entry point */ void (*ep)(void *); /* entry point */
pthread_t id; /* thread id */ pthread_t id; /* thread ID */
}; };
struct empth_rwlock_t { struct empth_rwlock_t {
@ -214,7 +214,7 @@ empth_create(void (*entry)(void *), int size, int flags,
logerror("can not create thread: %s: %s", name, strerror(eno)); logerror("can not create thread: %s: %s", name, strerror(eno));
goto bad; goto bad;
} }
empth_status("new thread id is %ld", (long)t); empth_status("new thread ID is %ld", (long)t);
empth_yield(); empth_yield();
return ctx; return ctx;

View file

@ -105,7 +105,7 @@ delete_old_news(void)
if (news.nws_vrb == 0 || news.nws_when >= expiry_time) if (news.nws_vrb == 0 || news.nws_when >= expiry_time)
break; break;
} }
/* news id 0..I-1 have expired */ /* news ID 0..I-1 have expired */
CANT_HAPPEN(i > news_tail); CANT_HAPPEN(i > news_tail);
/* no items to delete if I is equal zero */ /* no items to delete if I is equal zero */
if (i == 0) if (i == 0)

View file

@ -43,9 +43,9 @@
* without yielding the processor. * without yielding the processor.
* *
* Each line of output starts with an identification character * Each line of output starts with an identification character
* encoding the output id, followed by space. Ids less than 10 are * encoding the output ID, followed by space. Ids less than 10 are
* encoded as decimal digits, and larger ids as lower case letters, * encoded as decimal digits, and larger IDs as lower case letters,
* starting with 'a'. Symbolic names for ids are defined in proto.h. * starting with 'a'. Symbolic names for IDs are defined in proto.h.
*/ */
#include <config.h> #include <config.h>
@ -108,7 +108,7 @@ uprnf(char *buf)
} }
/* /*
* Send some text to @p with id @id, line-buffered. * Send some text to @p with ID @id, line-buffered.
* Format text to send using printf-style @format and optional * Format text to send using printf-style @format and optional
* arguments. It is assumed to be already user text. Plain ASCII and * arguments. It is assumed to be already user text. Plain ASCII and
* text received from the same player are fine, for anything else the * text received from the same player are fine, for anything else the
@ -212,7 +212,7 @@ pr_wall(char *format, ...)
/* /*
* Send @id text @buf to @pl, line-buffered. * Send @id text @buf to @pl, line-buffered.
* @buf is user text. * @buf is user text.
* If a partial line with different id is buffered, terminate it with * If a partial line with different ID is buffered, terminate it with
* a newline first. * a newline first.
*/ */
static void static void
@ -251,7 +251,7 @@ pr_player(struct player *pl, int id, char *buf)
/* /*
* Send @id text @buf to @pl, line-buffered. * Send @id text @buf to @pl, line-buffered.
* This function translates from normal text to user text. * This function translates from normal text to user text.
* If a partial line with different id is buffered, terminate it with * If a partial line with different ID is buffered, terminate it with
* a newline first. * a newline first.
*/ */
static void static void
@ -304,7 +304,7 @@ upr_player(struct player *pl, int id, char *buf)
} }
/* /*
* Send id @n to @pl. * Send ID @n to @pl.
* This runs always at the beginning of a line. * This runs always at the beginning of a line.
*/ */
static void static void

View file

@ -218,7 +218,7 @@ snxtitem_list(struct nstr_item *np, int type, int *list, int len)
/* /*
* Initialize @np to iterate over the items of type @type in a carrier. * Initialize @np to iterate over the items of type @type in a carrier.
* The carrier has file type @carrier_type and uid @carrier_uid. * The carrier has file type @carrier_type and UID @carrier_uid.
* Note: you can take an item gotten with nxtitem() off its carrier * Note: you can take an item gotten with nxtitem() off its carrier
* without disturbing the iterator. Whether the iterator will pick up * without disturbing the iterator. Whether the iterator will pick up
* stuff you load onto the carrier during iteration is unspecified. * stuff you load onto the carrier during iteration is unspecified.