Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10657) player_dlg must have a column for username
Home

[Freeciv-Dev] (PR#10657) player_dlg must have a column for username

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: kaufman@xxxxxxxxxxxxxxxxxxxxxx
Subject: [Freeciv-Dev] (PR#10657) player_dlg must have a column for username
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Sat, 23 Oct 2004 13:00:25 -0700
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10657 >

> [kauf - Thu Oct 21 05:43:13 2004]:
> 
> self explanatory.

Here's a patch. Please review and commit when appropriate.

Index: client/packhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/packhand.c,v
retrieving revision 1.411
diff -u -r1.411 packhand.c
--- client/packhand.c   21 Oct 2004 20:27:28 -0000      1.411
+++ client/packhand.c   23 Oct 2004 19:59:08 -0000
@@ -1472,6 +1472,7 @@
   struct player *pplayer = &game.players[pinfo->playerno];
 
   sz_strlcpy(pplayer->name, pinfo->name);
+  sz_strlcpy(pplayer->username, pinfo->username);
 
   pplayer->nation=pinfo->nation;
   pplayer->is_male=pinfo->is_male;
Index: client/plrdlg_common.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/plrdlg_common.c,v
retrieving revision 1.10
diff -u -r1.10 plrdlg_common.c
--- client/plrdlg_common.c      15 Aug 2004 09:47:04 -0000      1.10
+++ client/plrdlg_common.c      23 Oct 2004 19:59:08 -0000
@@ -79,6 +79,14 @@
 /******************************************************************
  ...
 *******************************************************************/
+static const char *col_username(struct player *player)
+{
+  return player->username;
+}
+
+/******************************************************************
+ ...
+*******************************************************************/
 static const char *col_nation(struct player *player)
 {
   return get_nation_name(player->nation);
@@ -212,6 +220,7 @@
 *******************************************************************/
 struct player_dlg_column player_dlg_columns[] = {
   {TRUE, COL_TEXT, N_("?Player:Name"), col_name, NULL, "name"},
+  {FALSE, COL_TEXT, N_("Username"), col_username, NULL, "username"},
   {TRUE, COL_FLAG, N_("Flag"), NULL, NULL, "flag"},
   {TRUE, COL_TEXT, N_("Nation"), col_nation, NULL, "nation"},
   {TRUE, COL_COLOR, N_("Border"), NULL, NULL, "border"},
Index: common/capstr.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/capstr.c,v
retrieving revision 1.193
diff -u -r1.193 capstr.c
--- common/capstr.c     21 Oct 2004 20:27:28 -0000      1.193
+++ common/capstr.c     23 Oct 2004 19:59:08 -0000
@@ -88,7 +88,7 @@
  *     as long as possible.  We want to maintain network compatibility with
  *     the stable branch for as long as possible.
  */
-#define CAPABILITY "+2.0 connecting conn_ping_info"
+#define CAPABILITY "+2.0 connecting conn_ping_info username_info"
 
 void init_our_capability(void)
 {
Index: common/packets.def
===================================================================
RCS file: /home/freeciv/CVS/freeciv/common/packets.def,v
retrieving revision 1.57
diff -u -r1.57 packets.def
--- common/packets.def  21 Oct 2004 20:27:28 -0000      1.57
+++ common/packets.def  23 Oct 2004 19:59:08 -0000
@@ -533,6 +533,8 @@
 PACKET_PLAYER_INFO=39; is-info,sc
   PLAYER playerno; key 
   STRING name[MAX_LEN_NAME];
+  STRING username[MAX_LEN_NAME]; add-cap(username_info)
+
   BOOL is_male;
   GOVERNMENT government;
   GOVERNMENT target_government;
Index: server/plrhand.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/server/plrhand.c,v
retrieving revision 1.333
diff -u -r1.333 plrhand.c
--- server/plrhand.c    23 Oct 2004 19:01:01 -0000      1.333
+++ server/plrhand.c    23 Oct 2004 19:59:16 -0000
@@ -1449,6 +1449,7 @@
 
   packet->playerno=plr->player_no;
   sz_strlcpy(packet->name, plr->name);
+  sz_strlcpy(packet->username, plr->username);
   packet->nation=plr->nation;
   packet->is_male=plr->is_male;
   packet->team = plr->team;

[Prev in Thread] Current Thread [Next in Thread]