DELTA 18843 0 672
SVN  „Ô`„ß5=‡ ‚Çt €j Lƒ“  ‚Œ"‚È> G €G A‡ €‚ Wƒ¹<• A‡ €‚ Uƒ¹;­ A‡ €
  /* No delegation. */
  pplayer->server.delegate_to[0] = '\0';
  pplayer->server.orig_username[0] = '\0'
****
  Returns the username the control of the player is delegated to.
*********/
const char *player_delegation_get(const struct player *pplayer)
{
  if (pplayer == NULL || strlen(pplayer->server.delegate_to) == 0) {
    /* No delegation if there is no player. */
    return NULL;
  } else {
    return pplayer->server.delegate_toDefine a delegation.
*********/
void player_delegation_set(struct player *pplayer, const char *username)
{
  fc_assert_ret(pplayer != NULL);

  if (username == NULL || strlen(username) == 0) {
    pplayer->server.delegate_to[0] = '\0';
  } else {
    sz_strlcpy(pplayer->server.delegate_to, username***
 Returns TRUE if a delegation is active.
************/
bool player_delegation_active(const struct player *pplayer)
{
  return (pplayer && strlen(pplayer->server.orig_username) != 0);
}
ENDREP
DELTA 18054 587 804
SVN  YR
t : €t$5bool connection_delegate_take(struct connection *pconn,
                              struct player *pplayer);
bool connection_delegate_restore(struct connection *pconn);

void connection_close_server(struct connection *pconn, const char *reasoENDREP
DELTA 18845 9747 2380
SVN  †  †   ‘O  †Ž!‘* delegation    †  †‚P†ˆ@…g† J> ¸	 Y„‰  „,¹ˆ VƒÇ*€5  _½0 Ãcß(€- „·i¢U€ v…ÕJ€e ¦]…Ûsumbers  string "player%d.delegation_username",
                                      plrno);
  /* Defaults to no delegation. */
  if (strlen(string)) {
    player_delegation_set(plr, string);
  }
                     player_delegation_get(plr) ? player_delegation_get(plr)
                                                : "",
                     "player%d.delegationIterate over all players. */
  player_slots_iterate(pslot) {
    int plrno = player_slot_index(pslot);

    if (NULL == secfile_section_lookup(sav/* Remove the definition of the AI type. */
    secfile_entry_delete(saving->file, "player%d.ai_type", plrno);

    /* Remove delegation information. */
    secfile_entry_delete(saving->file, "player%d.delegation_username", plrnoENDREP
DELTA 18843 3322 1649
SVN  †  †  j‡o Ÿ< ƒ †AŸ?€2 D¥v¯ ²§/€ c„áe€ Úl‡ †Ûk€` •â‚ ‹2÷1š C¬@€ ‰‚ƒk€# Iî  e‚Ž¢ N‚z‚ „ˆ‚Zstrbool delegate_command(struct connection *caller, char *arg,
                             bool check);
static const char *delegate_player_str(struct player *pplayer, bool observervoid show_delegations(struct connection *callerstr,
                           bool check)
{
  enum rfc_status status;
  char buf[MAX_LEN_CONSOLE_LINE];
  char *arg[2];
  int ntokens;
  char *ai;1) {
    ai = FC_AI_DEFAULT_NAME;
  } else {
    ai = arg[1];
  }

  if (game_was_started()) {
    status = create_command_newcomer(arg[0], ai[0], ai
                                        const char *ai,
                                       aiCreate player in pregame.
*******/
enum rfc_status create_command_pregame(const char *name,
                                       const char *ai,
                                      pplayer) {
    struct ai_type *ait = ai_type_by_name(ai);

    if (ait == NULL) {
      fc_snprintf(buf, buflen,
                  _("There is no AI type %s."), ai  pplayer->ai = ai_type_by_name(aiai†  …‡…ô'ä3¦ a¹w€< Zƒ¾?‡ ~Ïb€U `Ð~‚ ¢.˜ £4  ê£6 ´b‚€ƒe h‚¤5 ‚¥€ Y„Ž ¢ Lƒ¾?€Î_ P„Ñ@§ Kƒ¾@€‚w Q„Ñ@£ Tƒ¾@ ¦2‚Ã=‡   ‚éo‡ Ê	ƒ‰o¬ Lƒ¾?€…} uƒôt ´DƒÓ{€ƒ@ ‚¤5 ˆ[„Œ7œ ó„”fme."), msg_len);
    return FALSE;
  }Observe another player. If we were already attached, detach 
 (see connection_detach()). The console and those with ALLOW_HACK can
 use the two-argument command and force others to observeobserve2], msg[MAX_LEN_MSG];  
  bool is_newgame = !game_was_started();
  enum m_pre_result   , only certain syntax ifDELEGATE:
    return delegate Define the possible arguments to the delegation command */
#define SPECENUM_NAME delegate_args
#define SPECENUM_VALUE0     DELEGATE_CANCEL
#define SPECENUM_VALUE0NAME "cancel"
#define SPECENUM_VALUE1     DELEGATE_RESTORE
#define SPECENUM_VALUE1NAME "restore"
#define SPECENUM_VALUE2     DELEGATE_SHOW
#define SPECENUM_VALUE2NAME "show"
#define SPECENUM_VALUE3     DELEGATE_TAKE
#define SPECENUM_VALUE3NAME "take"
#define SPECENUM_VALUE4     DELEGATE_TO
#define SPECENUM_VALUE4NAME "to***/
static const char *delegate_accessor(int i)
{
  i = CLIP(0, i, delegate_args_max());
  return delegate_args_name((enum delegate***
  Handle delegation of control***/
static bool delegate_command(struct connection *caller, char *arg,
                             bool check)
{
  char *tokens[3];
  int ntokens, ind;
  enum m_pre_result result;
  bool ret = FALSE;
  const char *username = NULL;
  struct player *dplayer = NULL;

  if (!game_was_started()) {
    cmd_reply(CMD_DELEGATE, caller, C_OK, _("Game was not started - "
                                            "delegation not possible."));
    return FALSE;
  }

  ntokens = get_tokens(arg, tokens, 3, TOKEN_DELIMITERS);

  if (ntokens > 0) {
    /* match the argument */
    result = match_prefix(delegate_accessor, delegate_args_max() + 1, 0,
                          fc_strncasecmp, NULL, tokens[0], &ind);

    switch (result) {
    case M_PRE_EXACT:
    case M_PRE_ONLY:
      /* we have a match */
      break;
    case M_PRE_EMPTY:
      /* Use 'delegate show' as default. */
      ind = DELEGATE_SHOW;
      break;
    case M_PRE_AMBIGUOUS:
    case M_PRE_LONG:
    case M_PRE_FAIL:
    case M_PRE_LAST:
      {
        char buf[256] = "";
        enum delegate_args valid_args;

        for (valid_args = delegate_args_begin();
             valid_args != delegate_args_end();
             valid_args = delegate_args_next(valid_args)) {
          cat_snprintf(buf, sizeof(buf), "'%s'",
                       delegate_args_name(valid_args));
          if (valid_args != delegate_args_max()) {
            cat_snprintf(buf, sizeof(buf), ", ");
          }
        }

        cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                  /* TRANS: do not translate the command 'delegate'. */
                  _("Valid arguments for 'delegate' are: %s."), buf);
        ret =  FALSE;
        goto cleanup;
      }
      break;
    }
  } else {
    /* Use 'delegate show' as default. */
    ind = DELEGATE_SHOW;
  }

  /* Get the data (player, username for delegation). */
  switch (ind) {
  case DELEGATE_CANCEL:
    /* delegate cancel [player] */
    if ((!caller || conn_get_access(caller) >= ALLOW_ADMIN) && ntokens > 1) {
      dplayer = player_by_name_prefix(tokens[1], &result);
      if (!dplayer) {
        cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                  _("Unknown player name: '%s'"), tokens[1]);
        ret = FALSE;
        goto cleanup;
      }
    } else {
      dplayer = conn_get_player(caller);
      if (!dplayer) {
        cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                  _("Please define a player for whom the delegation should "
                    "be canceled."));
        ret = FALSE;
        goto cleanup;
      }
    }
    break;
  case DELEGATE_RESTORE:
    /* delegate restore */
    if (!caller) {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("You can't restore control of a player from the console."));
      ret = FALSE;
      goto cleanup;
    }
    break;
  case DELEGATE_SHOW:
    /* delegate show [player] */
    if (ntokens > 1) {
      dplayer = player_by_name_prefix(tokens[1], &result);
      if (!dplayer) {
        cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                  _("Unknown player name: '%s'"), tokens[1]);
        ret = FALSE;
        goto cleanup;
      }
    } else {
      dplayer = conn_get_player(caller);
      if (!dplayer) {
        cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                  _("Please define a player for whom the delegation should "
                    "be shown."));
        ret = FALSE;
        goto cleanup;
      }
    }
    break;
  case DELEGATE_TAKE:
    /* delegate take <player> */
    if (!caller) {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("You can't take a player from the console."));
      ret = FALSE;
      goto cleanup;
    }
    if (ntokens > 1) {
      dplayer = player_by_name_prefix(tokens[1], &result);
      if (!dplayer) {
        cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                  _("Unknown player name: '%s'"), tokens[1]);
        ret = FALSE;
        goto cleanup;
      }
    } else {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("Please define a player to take control of."));
      ret = FALSE;
      goto cleanup;
    }
    break;
  case DELEGATE_TO:
    /* delegate to <username> [player] */
    if (ntokens > 1) {
      username = tokens[1];
    } else {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("Please define a username to whom the control is "
                  "delegated."));
      ret = FALSE;
      goto cleanup;
    }
    if ((!caller || conn_get_access(caller) >= ALLOW_ADMIN) && ntokens > 2) {
      dplayer = player_by_name_prefix(tokens[2], &result);
      if (!dplayer) {
        cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                  _("Unknown player name: '%s'"), tokens[2]);
        ret = FALSE;
        goto cleanup;
      }
    } else {
      dplayer = conn_controls_player(caller) ? conn_get_player(caller) : NULL;
      if (!dplayer) {
        cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                  _("You do not control a player."));
        ret = FALSE;
        goto cleanup;
      }
    }
    break;
  }

  if (check) {
    ret = TRUE;
    goto cleanup;
  }

  switch (ind) {
  case DELEGATE_TO:
    /* Delegate to another player. */
    fc_assert_ret_val(dplayer, FALSE);
    fc_assert_ret_val(username != '\0', FALSE);

    if (caller && strcmp(caller->username, username) == 0) {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("Delegation to yourself?"));
      ret = FALSE;
      goto cleanup;
    }

    if (conn_get_player(caller) == dplayer
        && caller->server.delegation.playing != NULL) {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("You can't define a delegation if you are in delegation "
                  "mode. See '/list delegation'"));
      ret = FALSE;
      goto cleanup;
    }

    player_delegation_set(dplayer, username);
    cmd_reply(CMD_DELEGATE, caller, C_OK,
              _("Define delegation for player '%s' to user '%s'."),
              player_name(dplayer), username);
    ret = TRUE;
    goto cleanup;
    break;

  case DELEGATE_SHOW:
    /* Show delegations. */
    fc_assert_ret_val(dplayer, FALSE);

    if (player_delegation_get(dplayer) == NULL) {
      /* No delegation set. */
      cmd_reply(CMD_DELEGATE, caller, C_OK,
                _("No delegation defined for %s."),
                player_name(dplayer));
    } else {
      cmd_reply(CMD_DELEGATE, caller, C_OK,
                  _("Control of player '%s' delegated to user '%s'."),
                  player_name(dplayer), player_delegation_get(dplayer));
    }
    ret = TRUE;
    goto cleanup;
    break;

  case DELEGATE_CANCEL:
    if (player_delegation_get(dplayer) == NULL) {
      /* No delegation set. */
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("No delegation defined for %s."),
                player_name(dplayer));
      ret = FALSE;
      goto cleanup;
    }

    player_delegation_set(dplayer, NULL);
    cmd_reply(CMD_DELEGATE, caller, C_OK, _("Delegation canceld."));
    ret = TRUE;
    goto cleanup;
    break;

  case DELEGATE_TAKE:
    /* Try to take another player. */
    fc_assert_ret_val(dplayer, FALSE);
    fc_assert_ret_val(caller, FALSE);

    if (caller->server.delegation.status) {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("Please restore first your original connection."));
      ret = FALSE;
      goto cleanup;
    }

    if (player_delegation_get(conn_get_player(caller)) != NULL) {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("Please cancel first your own delegation."));
      ret = FALSE;
      goto cleanup;
    }

    /* Taking your own player makes no sense. */
    if (dplayer == conn_get_player(caller)) {
      cmd_reply(CMD_TAKE, caller, C_FAIL, _("You already controls %s."),
                player_name(conn_get_player(caller)));
      ret =  FALSE;
      goto cleanup;
    }

    /* If the player is controlled by another user, fail. */
    if (dplayer->is_connected) {
      cmd_reply(CMD_TAKE, caller, C_FAIL,
                _("A user is connect to player '%s'."),
                player_name(dplayer));
      ret =  FALSE;
      goto cleanup;
    }

    /* No chain of delegations. */
    if (caller->server.delegation.status == TRUE) {
      cmd_reply(CMD_TAKE, caller, C_FAIL,
                _("You currently are using a delegation. Cancel it first."));
      ret =  FALSE;
      goto cleanup;
    }

    if (!connection_delegate_take(caller, dplayer)) {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("Failed to take control of '%s'."), player_name(dplayer));
      ret =  FALSE;
      goto cleanup;
    }

    cmd_reply(CMD_DELEGATE, caller, C_OK,
              _("'%s' is now controlling player '%s'."), caller->username,
              player_name(conn_get_player(caller)));
    ret = TRUE;
    goto cleanup;
    break;

  case DELEGATE_RESTORE:
    /* Restore the original player. */
    fc_assert_ret_val(caller, FALSE);

    if (caller->server.delegation.status == FALSE) {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("There is no original player to restore."));
      ret = FALSE;
      goto cleanup;
    }

    if (caller->server.delegation.playing
        && strcmp(caller->server.delegation.playing->server.orig_username,
                  caller->username) != 0) {
      /* This is _not_ the original connection. */
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("Player data does not match."));
      ret = FALSE;
      goto cleanup;
    }

    if (!connection_delegate_restore(caller)) {
      cmd_reply(CMD_DELEGATE, caller, C_FAIL,
                _("Failed to restore control over '%s'."),
                player_name(caller->server.delegation.playing));
      ret = FALSE;
      goto cleanup;
    }

    cmd_reply(CMD_DELEGATE, caller, C_OK,
              _("'%s' is now connected as: %s."), caller->username,
              delegate_player_str(conn_get_player(caller), caller->observer));
    ret = TRUE;
    goto cleanup;
    break;
  }

 cleanup:
  free_tokens(tokens, ntokens);
  return ret***
 Send start command related message***/
static const char *delegate_player_str(struct player *pplayer, bool observer)
{
  static char buf[128];

  if (pplayer) {
    if (observer) {
      fc_snprintf(buf, sizeof(buf), "%s (observer)", player_name(pplayer));
    } else {
      fc_snprintf(buf, sizeof(buf), "%s", player_name(pplayer));
    }
  } else {
    sz_strlcpy(buf, "global observer");
  }

  return buf Send start command related message_server_server*
  List all delegations of the current game***/
static void show_delegations(struct connection *caller)
{
  bool empty = TRUE;

  cmd_reply(CMD_DELEGATE, caller, C_COMMENT, _("List of all delegations:"));
  cmd_reply(CMD_DELEGATE, caller, C_COMMENT, horiz_line);

  players_iterate(pplayer) {
    const char *delegate_to = player_delegation_get(pplayer);
    if (delegate_to != NULL) {
      cmd_reply(CMD_DELEGATE, caller, C_COMMENT,
                _("Control over player '%s' delegated to user '%s'%s."),
                player_name(pplayer), delegate_to,
                player_delegation_active(pplayer) ? _(" (active)") : "");
      empty = FALSE;
    }
  } players_iterate_end;

  if (empty) {
    cmd_reply(CMD_DELEGATE, caller, C_COMMENT, _("No delegations defined."));
  }

  cmd_reply(CMD_DELEGATEDELEGATIONS
#define SPECENUM_VALUE1NAME "delegations"
#define SPECENUM_VALUE2     LIST_IGNORE
#define SPECENUM_VALUE2NAME "ignored users"
#define SPECENUM_VALUE3     LIST_PLAYERS
#define SPECENUM_VALUE3NAME "players"
#define SPECENUM_VALUE4     LIST_SCENARIOS
#define SPECENUM_VALUE4NAME "scenarios"
#define SPECENUM_VALUE5     LIST_TEAMS
#define SPECENUM_VALUE5NAME "teams"
#define SPECENUM_VALUE6     LIST_VOTES
#define SPECENUM_VALUE6NAME "votesDELEGATIONS:
    show_delegaENDREP
DELTA 18843 5001 609
SVN  œJž
D œ. €D!œ)const char *player_delegation_get(const struct player *pplayer);
void player_delegation_set(struct player *pplayer, const char *username);
bool player_delegation_active(const struct player *pplayeENDREP
DELTA 18604 5944 8495
SVN  ‚ß\‚àD Â9 €F F‚¼? ŠÃ>¬ IÅ? Š:Î1‡ tØk‡ žyé_‡ ¡
ˆX‡ ”F©b‡ ¾(‡  .¿.
  connection_close_server() instead of calling this function directly_server(pconn, _("lagging connection"));
  }_server_server_server_server_server_serverENDREP
DELTA 18471 6775 3269
SVN  ÷*÷Md “g ¯ †#”µ Ü_šKconnection_close_server(pconn, _("auth failed")      connection_close_server(pconn, _("auth failed")ENDREP
DELTA 18553 0 8132
SVN  ÍÓa†K Þ Š ‚bÞ€h Ò/ào€„Y ™w³ [ai type]\n"
      "AI type parameter can be used to select which AI module will be "
      "used for created player. This requires that freeciv has been "
      "compiled with AI module support and respective module has been "
      "loadeddelegate", ALLOW_BASIC,
   /* TRANS: translate only text between [] and <> */
   N_("delegate cancel [player-name]\n"
      "delegate restore\n"
      "delegate show <player-name>\n"
      "delegate take <player-name>\n"
      "delegate to <username> [player-name]"),
   N_("Delegate control to another user."),
   N_("This command can be used to delegate the control over a player. The "
      "[player-name] argument can only be used by connections with the "
      "cmdlevel 'admin' or above to force the corresponding change of the "
      "delegation status."),
   CMD_ECHO_NONE, VCF_NONE, 0
  },ENDREP
DELTA 18858 2497 5912
SVN  ñ@òa »t € µN»r
      /* Delegation to this user. */
      char delegate_to[MAX_LEN_NAME];
      /* Set if the delegation is active. */
      char orig_username[MAX_LEN_NAME]ENDREP
DELTA 18618 0 3081
SVN  È)çYB ˆ ‰ :ˆ€ õ"¥7€= ¬9›p Lþ@º Aš €  P†}» Aš €‰< P†}€ Aš €liiface.h"pconn->server.delegation.status = FALSE;
  pconn->server.delegation.playing = NULL;
  pconn->server.delegation.observer = FALSE, FC_AI_DEFAULT_NAME);
        if (!pplayer) {
          return FALSE;
        }
      } else {
        team_remove_player(pplayer);
      }
      server_player_init(pplayer, FALSE, TRUE);
***
 Use a delegation to get control over another player.
************/
bool connection_delegate_take(struct connection *pconn,
                              struct player *pplayer)
{
  fc_assert_ret_val(pconn->server.delegation.status == FALSE, FALSE);

  /* Save the original player of this connection and the original username of
   * the player. */
  pconn->server.delegation.status = TRUE;
  pconn->server.delegation.playing = conn_get_player(pconn);
  pconn->server.delegation.observer = pconn->observer;
  if (conn_get_player(pconn) != NULL) {
    struct player *plr = conn_get_player(pconn);
    fc_assert_ret_val(strlen(plr->server.orig_username) == 0, FALSE);
    sz_strlcpy(plr->server.orig_username, plr->username);
  }
  fc_assert_ret_val(strlen(pplayer->server.orig_username) == 0, FALSE);
  sz_strlcpy(pplayer->server.orig_username, pplayer->username);

  /* Detach the current connection. */
  if (NULL != pconn->playing || pconn->observer) {
    connection_detach(pconn);
  }

  /* Try to attach to the new player */
  if (!connection_attach(pconn, pplayer, FALSE)) {

    /* Restore original connection. */
    fc_assert_ret_val(connection_attach(pconn,
                                        pconn->server.delegation.playing,
                                        pconn->server.delegation.observer),
                      FALSE);

    /* Reset all changes done above. */
    pconn->server.delegation.status = FALSE;
    pconn->server.delegation.playing = NULL;
    pconn->server.delegation.observer = FALSE;
    if (conn_get_player(pconn) != NULL) {
      struct player *plr = conn_get_player(pconn);
      plr->server.orig_username[0] = '\0';
    }
    pplayer->server.orig_username[0] = '\0';

    return FALSE;
  }

  return TRUE***
 Restore the original status after using a delegation.
************/
bool connection_delegate_restore(struct connection *pconn)
{
  struct player *pplayer;

  if (!pconn->server.delegation.status) {
    return FALSE;
  }

  /* Save the current player. */
  pplayer = conn_get_player(pconn);

  /* There should be a player connected to pconn. */
  fc_assert_ret_val(pplayer, FALSE);

  /* Detach the current connection. */
  if (NULL != pconn->playing || pconn->observer) {
    connection_detach(pconn);
  }

  /* Try to attach to the original player */
  if (!connection_attach(pconn, pconn->server.delegation.playing,
                         pconn->server.delegation.observer)) {
    return FALSE;
  }

  /* Reset data. */
  pconn->server.delegation.status = FALSE;
  pconn->server.delegation.playing = NULL;
  pconn->server.delegation.observer = FALSE;
  if (conn_get_player(pconn) != NULL) {
    struct player *plr = conn_get_player(pconn);
    plr->server.orig_username[0] = '\0';
  }

  /* Restore the username of the player which delegated control. */
  sz_strlcpy(pplayer->username, pplayer->server.orig_username);
  pplayer->server.orig_username[0] = '\0';
  /* Send updated username to all connections. */
  send_player_info_c(pplayer, NULL);

  return TRUE***
 Close a connection. Use this in the server to take care of delegation stuff
 (reset the username of the controlled connection).
************/
void connection_close_server(struct connection *pconn, const char *reason)
{
  /* Restore possible delegations before the connection is closed. */
  connection_delegate_restore(pconn);
  connection_close(pconn, reason);
}
ENDREP
DELTA 18471 2788 3641
SVN  Ø:Û=0 …m ¶ œ+…i— ‡[¢€‡ L±5€‚R N´:€„ †w·#€ ™¿€Mfdef __cplusplus
extern "C" {
#endif /* __cplusplus */  char *closing_reason;union {
    struct {
      /* Increases for every packet send to the server. */
      int last_request_id_used;

      /* Increases for every received PACKET_PROCESSING_FINISHED packet. */
      int last_processed_request_id_seen;

      /* Holds the id of the request which caused this packet. Can be zero. */
      int request_id_of_currently_handled_packet;
    } client;

    struct {
      /* Holds the id of the request which is processed now. Can be zero. */
      int currently_processed_request_id;

      /* Will increase for every received packet. */
      int last_request_id_seen;

      /* The start times of the PACKET_CONN_PING which have been sent but
       * weren't PACKET_CONN_PONGed yet? */
      struct timer_list *ping_timers;

      /* Holds number of tries for authentication from client. */
      int auth_tries;

      /* the time that the server will respond after receiving an auth reply.
    * connection if we've waited too long for a password. */
      time_t auth_settime;

      /* used to follow where the connection is in the authentication
       * process */
      enum auth_status status;
      char password[MAX_LEN_PASSWORD];

      /* for reverse lookup and blacklisting in db */
      char ipaddr[MAX_LEN_ADDR];

    enum cmdlevel granted_access_level;

      /* The list of ignored connection patterns. */
      struct conn_pattern_list *ignore_list;

      /* Something has occurred that means the connection should be closed,
       * but the closing has been postponed. */
      bool is_closing;

      /* If we use delegation the original player (playing) is replaced. Save
       * it here to easily restore it. */
      struct {
        bool status;
        struct player *playing;
        bool observer;
      } delegation;
    } server;
  }onn);
void connections_set_close_callback(conn_close_fn_t func);
void connection_close(struct connection *pconn, const char *reasonifdef __cplusplus
}
#endif /* __cplusplus */

#endif  /* FC__CONNECTION_H */
ENDREP
DELTA 18023 22909 988
SVN  –z™ b † € G  ‰w†[€I …Pš 4•Fenum cmd_echo {
  CMD_ECHO_NONE = 0,
  CMD_ECHO_ADMINS,      /* i.e. all with 'admin' access and above. */
  CMD_ECHO_ALL,
};

  CMD_KICK,
#ifdef DEBUG
  CMD_OLDSAVE,
#endif /* DEBUG */
  CMD_DELEGATEenum cmd_echo command_echoENDREP
id: 2ly.5ck.r18942/24475
type: file
pred: 2ly.5ck.r18920/5205
count: 50
text: 18942 17067 884 27105 b0f087e206b54b741c648eadbb04ad2e
props: 11087 2327 111 0 28e613ef70fc8e4efe7ed7b15f74e6e7
cpath: /trunk/server/commands.c
copyroot: 15280 /trunk

id: 2lz.5ck.r18942/24721
type: file
pred: 2lz.5ck.r18553/26361
count: 20
text: 18942 24181 265 3200 c5f35166cce5785b57213b5740f1b55f
props: 11087 2677 110 0 2297367bb62237eae251d6a189335c2c
cpath: /trunk/server/commands.h
copyroot: 15280 /trunk

id: 2dw.5ck.r18942/24967
type: file
pred: 2dw.5ck.r18843/7555
count: 138
text: 18942 18189 3799 29657 b72e560a5fa0d049fee86cd3e3219452
props: 11086 310 111 0 e5ad8d36ef6bfd356bb06d6f3ece066f
cpath: /trunk/server/connecthand.c
copyroot: 15280 /trunk

id: 2dx.5ck.r18942/25217
type: file
pred: 2dx.5ck.r18054/16767
count: 17
text: 18942 1025 266 2002 3bd08b8981071f50f7d484d8affce5f5
props: 8119 7500 110 0 2297367bb62237eae251d6a189335c2c
cpath: /trunk/server/connecthand.h
copyroot: 15280 /trunk

id: 39c.5ck.r18942/25464
type: file
pred: 39c.5ck.r18473/12225
count: 26
text: 18942 16906 132 31693 ac834cf618a36a556b5c7559a62c88ea
props: 12670 11903 34 0 25e6c2f7558b7484000d4d090dea5b92
cpath: /trunk/server/auth.c
copyroot: 15280 /trunk

id: 4m0.5ck.r18942/25707
type: file
pred: 4m0.5ck.r18853/78
count: 62
text: 18942 1318 859 201747 50714197a60f556f1f5677c2d3facc1b
cpath: /trunk/server/savegame2.c
copyroot: 15280 /trunk

id: 15.5ck.r18942/25895
type: file
pred: 15.5ck.r18604/17609
count: 213
text: 18942 16639 238 45076 8e58d7e0f97399735a562ccc80a8778f
props: 10956 5264 112 0 3b4f53580729e091747f5670a0f86c52
cpath: /trunk/server/sernet.c
copyroot: 15280 /trunk

id: 4z.5ck.r18942/26139
type: file
pred: 4z.5ck.r18920/7066
count: 654
text: 18942 2206 14158 199196 c9e37e0cd08c81da27bf4b29a5a9b8be
props: 11087 3718 112 0 d0e5ada95c1c714385b6751e38a4f15d
cpath: /trunk/server/stdinhand.c
copyroot: 15280 /trunk

id: 4u.5ck.r18942/26387
type: file
pred: 4u.5ck.r18843/9151
count: 549
text: 18942 0 1000 77749 478fdf6ad1d0f286406cf1d52eba6038
props: 11057 14272 112 0 ab87823e529bcaae2ff952f918d53839
cpath: /trunk/server/plrhand.c
copyroot: 15280 /trunk

id: 4v.5ck.r18942/26629
type: file
pred: 4v.5ck.r18843/9390
count: 109
text: 18942 16393 218 3859 4745af661c53d43f0b4bfb751e4d4c39
props: 11057 14627 111 0 1506d3ea4bc6eda8c5630824cdee7154
cpath: /trunk/server/plrhand.h
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 23
file 5q.5ck.r18919/1289
K 8
advisors
V 24
dir 4n2.5ck.r18939/20758
K 9
aiiface.c
V 23
file 4gm.5ck.r18921/516
K 9
aiiface.h
V 25
file 4gn.5ck.r18899/20936
K 6
auth.c
V 25
file 39c.5ck.r18942/25464
K 6
auth.h
V 23
file 39d.0.r13513/10535
K 11
barbarian.c
V 23
file lw.5ck.r18843/7802
K 11
barbarian.h
V 24
file lx.5ck.r18054/18407
K 10
cityhand.c
V 23
file 10.5ck.r18581/9188
K 10
cityhand.h
V 23
file 4f.0.r13297/423686
K 11
citytools.c
V 22
file 4g.5ck.r18823/450
K 11
citytools.h
V 24
file 4h.5ck.r18270/28958
K 10
cityturn.c
V 23
file 4i.5ck.r18928/6302
K 10
cityturn.h
V 24
file 4j.5ck.r18660/18227
K 11
civserver.c
V 24
file 4k.5ck.r18899/20261
K 11
civserver.h
V 21
file 4l.0.r2805/33121
K 10
commands.c
V 25
file 2ly.5ck.r18942/24475
K 10
commands.h
V 25
file 2lz.5ck.r18942/24721
K 13
connecthand.c
V 25
file 2dw.5ck.r18942/24967
K 13
connecthand.h
V 25
file 2dx.5ck.r18942/25217
K 9
console.c
V 23
file dd.5ck.r18091/5268
K 9
console.h
V 24
file de.5ck.r18054/16526
K 10
diplhand.c
V 21
file 4m.5ck.r18847/47
K 10
diplhand.h
V 21
file 4n.0.r13421/6826
K 11
diplomats.c
V 21
file vz.5ck.r18848/53
K 11
diplomats.h
V 24
file w0.5ck.r18384/65844
K 10
edithand.c
V 24
file 3bk.5ck.r18843/8236
K 10
edithand.h
V 26
file 4ez.5ck.r18452/115476
K 10
gamehand.c
V 24
file 4o.5ck.r18854/28291
K 10
gamehand.h
V 24
file 4p.5ck.r15698/24111
K 9
generator
V 23
dir 2me.5ck.r18574/1856
K 11
ggzserver.c
V 25
file 39a.5ck.r18471/14634
K 11
ggzserver.h
V 25
file 39b.5bk.r15001/48999
K 10
handchat.c
V 25
file 4q.5ck.r18362/122188
K 10
handchat.h
V 24
file dj.5ck.r18270/28229
K 9
maphand.c
V 23
file 13.5ck.r18876/1722
K 9
maphand.h
V 23
file 14.5ck.r18740/8378
K 6
meta.c
V 24
file 4s.5ck.r18604/17366
K 6
meta.h
V 24
file 4t.5ck.r18054/19078
K 8
notify.c
V 23
file 4i2.5ck.r18493/146
K 8
notify.h
V 24
file 4i3.5ck.r18282/3660
K 9
plrhand.c
V 24
file 4u.5ck.r18942/26387
K 9
plrhand.h
V 24
file 4v.5ck.r18942/26629
K 8
report.c
V 25
file vi.5ck.r18308/133485
K 8
report.h
V 24
file vj.5ck.r18270/29203
K 9
ruleset.c
V 24
file 8w.5ck.r18926/12299
K 9
ruleset.h
V 22
file 8x.5ck.r17946/997
K 13
sanitycheck.c
V 23
file wi.5ck.r18740/9112
K 13
sanitycheck.h
V 23
file wj.5ck.r18740/9358
K 10
savegame.c
V 24
file vl.5ck.r18902/26534
K 10
savegame.h
V 24
file vm.5ck.r17289/22938
K 11
savegame2.c
V 25
file 4m0.5ck.r18942/25707
K 11
savegame2.h
V 25
file 4m1.5ck.r18078/67503
K 7
score.c
V 26
file 2eg.5ck.r18308/128519
K 7
score.h
V 24
file 2eh.5ck.r17332/6378
K 9
scripting
V 24
dir 31x.5ck.r18926/12055
K 8
sernet.c
V 24
file 15.5ck.r18942/25895
K 8
sernet.h
V 24
file 4y.5ck.r18473/12711
K 10
settings.c
V 25
file 2m0.5ck.r18902/26284
K 10
settings.h
V 24
file 2m1.5ck.r18294/3094
K 11
spacerace.c
V 25
file 9a.5ck.r18362/123929
K 11
spacerace.h
V 21
file 9b.0.r11338/1129
K 9
srv_log.c
V 25
file 15t.5el.r18872/67926
K 9
srv_log.h
V 25
file 15u.5em.r17928/40497
K 10
srv_main.c
V 24
file vg.5ck.r18902/26038
K 10
srv_main.h
V 24
file vh.5ck.r18279/84001
K 11
stdinhand.c
V 24
file 4z.5ck.r18942/26139
K 11
stdinhand.h
V 23
file 50.5ck.r18920/7312
K 11
techtools.c
V 24
file 33n.5ck.r18804/3065
K 11
techtools.h
V 24
file 33o.5ck.r18665/2277
K 10
unithand.c
V 23
file 18.5ck.r18581/9432
K 10
unithand.h
V 24
file 19.5ck.r18578/17031
K 11
unittools.c
V 24
file 1a.5ck.r18802/16945
K 11
unittools.h
V 24
file 1b.5ck.r18384/66086
K 8
voting.c
V 26
file 4ex.5ck.r18308/137159
K 8
voting.h
V 25
file 4ey.5ck.r18054/19315
END
ENDREP
id: z.5ck.r18942/30324
type: dir
pred: z.5ck.r18939/24442
count: 4376
text: 18942 26873 3438 3438 175ae055cb9b5ffd65f7adb1d1d50b7c
props: 17175 659 139 0 d1c9699dde7f9d81e54426750008041d
cpath: /trunk/server
copyroot: 15280 /trunk

id: 46.5ck.r18942/30556
type: file
pred: 46.5ck.r18858/99032
count: 225
text: 18942 17977 183 14689 1eadbdcad7a96558e700f1c7e29a147a
props: 11057 32360 112 0 008c1f4aede3063a105ee5510d8fc5d7
cpath: /trunk/common/player.h
copyroot: 15280 /trunk

id: uo.5ck.r18942/30801
type: file
pred: uo.5ck.r18941/1694
count: 60
text: 18942 22014 2138 11709 8dd367421ae5b12ce19ac6292b65faa5
props: 10151 1179 111 0 14533b38c2d22fb145a05b253c8fb2e8
cpath: /trunk/common/connection.h
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 23
file 5h.5ck.r18890/8906
K 4
ai.c
V 25
file 4go.5ck.r18899/24800
K 4
ai.h
V 25
file 4gp.5ck.r18899/24980
K 6
aicore
V 24
dir 18t.5ck.r18903/23201
K 6
base.c
V 25
file 3jw.5ck.r18855/11779
K 6
base.h
V 25
file 3jx.5ck.r18858/93788
K 9
borders.c
V 25
file 4f0.5ck.r18297/35065
K 9
borders.h
V 25
file 4f1.5ck.r18858/99721
K 8
capstr.c
V 24
file dv.5ck.r17617/51579
K 8
capstr.h
V 24
file dw.5ck.r18858/97074
K 6
city.c
V 22
file q.5ck.r18931/1095
K 6
city.h
V 24
file 3q.5ck.r18858/96165
K 8
combat.c
V 24
file wp.5ck.r18854/32215
K 8
combat.h
V 24
file wq.5ck.r18858/95678
K 12
connection.c
V 24
file un.5ck.r18473/17001
K 12
connection.h
V 24
file uo.5ck.r18942/30801
K 8
dataio.c
V 25
file 15r.5ck.r17928/47899
K 8
dataio.h
V 25
file 15s.5ck.r18858/95001
K 11
diptreaty.c
V 23
file 3r.5ck.r18298/9103
K 11
diptreaty.h
V 24
file 3s.5ck.r18858/95921
K 9
effects.c
V 25
file 2eo.5ck.r18926/16217
K 9
effects.h
V 25
file 2ep.5ck.r18926/16460
K 8
events.c
V 24
file 33h.5ck.r18857/8551
K 8
events.h
V 24
file 3t.5ck.r18858/95439
K 14
fc_interface.c
V 24
file 4up.5ck.r18890/8208
K 14
fc_interface.h
V 24
file 4uq.5ck.r18890/8397
K 10
fc_types.h
V 25
file 2ll.5ck.r18893/63396
K 15
featured_text.c
V 25
file 4h3.5ck.r18623/44037
K 15
featured_text.h
V 24
file 4h4.5ck.r18873/5922
K 6
game.c
V 23
file 3u.5ck.r18873/6113
K 6
game.h
V 24
file 3v.5ck.r18902/30454
K 19
generate_packets.py
V 25
file 2f4.5ck.r18863/12240
K 12
government.c
V 23
file he.5ck.r18403/6790
K 12
government.h
V 24
file hf.5ck.r18858/98787
K 6
idex.c
V 23
file qo.5ck.r18342/2669
K 6
idex.h
V 24
file qp.5ck.r18858/92434
K 13
improvement.c
V 25
file vb.5ck.r18308/142158
K 13
improvement.h
V 24
file vc.5ck.r18858/93351
K 5
map.c
V 23
file r.5ck.r18903/23441
K 5
map.h
V 24
file 41.5ck.r18903/23683
K 10
movement.c
V 25
file 2xv.5ck.r18854/33561
K 10
movement.h
V 25
file 2xw.5ck.r18858/96827
K 18
name_translation.h
V 25
file 4k1.5ck.r18858/99277
K 8
nation.c
V 23
file il.5ck.r18706/4984
K 8
nation.h
V 25
file im.5ck.r18858/101381
K 9
packets.c
V 24
file 43.5ck.r18623/44227
K 11
packets.def
V 25
file 2f5.5ck.r18559/27563
K 9
packets.h
V 24
file 44.5ck.r18858/92670
K 8
player.c
V 25
file 45.5ck.r18308/148128
K 8
player.h
V 24
file 46.5ck.r18942/30556
K 14
requirements.c
V 25
file 2wq.5ck.r18326/39682
K 14
requirements.h
V 26
file 2wr.5ck.r18858/101129
K 10
research.c
V 24
file 4ro.5ck.r17856/7997
K 10
research.h
V 25
file 4rp.5ck.r18858/92915
K 10
rgbcolor.c
V 22
file 6i6.5ck.r18896/50
K 10
rgbcolor.h
V 22
file 6i7.5ck.r18894/46
K 11
spaceship.c
V 20
file 98.0.r9977/2632
K 11
spaceship.h
V 25
file 99.5ck.r18858/100885
K 12
specialist.c
V 25
file 33f.5ck.r18326/38937
K 12
specialist.h
V 25
file 33g.5ck.r18858/93104
K 6
team.c
V 24
file 33i.5ck.r18062/9622
K 6
team.h
V 25
file 33j.5ck.r18858/94759
K 6
tech.c
V 23
file t.5ck.r18428/28454
K 6
tech.h
V 23
file u.5ck.r18858/94519
K 9
terrain.c
V 26
file 2fp.5ck.r18308/147138
K 9
terrain.h
V 24
file qs.5ck.r18858/97556
K 6
tile.c
V 25
file 2ys.5ck.r18740/13280
K 6
tile.h
V 25
file 2yt.5ck.r18858/97315
K 6
unit.c
V 23
file v.5ck.r18802/20869
K 6
unit.h
V 24
file 48.5ck.r18858/94031
K 10
unitlist.c
V 25
file 39m.5ck.r18578/21945
K 10
unitlist.h
V 26
file 39n.5ck.r18858/100396
K 10
unittype.c
V 23
file v9.5ck.r18588/1099
K 10
unittype.h
V 24
file va.5ck.r18858/94273
K 9
version.c
V 25
file oe.5ck.r17122/322944
K 9
version.h
V 24
file e7.5ck.r18858/96407
K 8
vision.c
V 25
file 4dm.5ck.r18000/29175
K 8
vision.h
V 25
file 4dn.5ck.r18858/99907
K 10
worklist.c
V 25
file o8.5ck.r16929/277491
K 10
worklist.h
V 24
file o9.5ck.r18858/98299
END
ENDREP
id: p.5ck.r18942/34657
type: dir
pred: p.5ck.r18941/5545
count: 2953
text: 18942 31048 3596 3596 81aae36c007361444c3d4dd64cebc2a5
props: 12883 2571 96 0 2763e13ff5d021346ae24ff6c9ced232
cpath: /trunk/common
copyroot: 15280 /trunk

PLAIN
K 9
ABOUT-NLS
V 22
file fu.0.r13215/85704
K 7
AUTHORS
V 19
file 5u.0.r12982/94
K 7
COPYING
V 19
file 1h.0.r9643/400
K 9
ChangeLog
V 26
file 6l.5ck.r18394/4622094
K 7
INSTALL
V 22
file 6.5ck.r17486/2711
K 11
Makefile.am
V 23
file 59.5ck.r18925/3202
K 4
NEWS
V 22
file 6m.5ck.r18758/131
K 6
README
V 20
file 7.0.r4421/96382
K 2
ai
V 21
dir 8.5ck.r18940/2537
K 10
autogen.sh
V 24
file 12o.5ck.r16223/7590
K 9
bootstrap
V 24
dir 2p5.5ck.r17613/37512
K 6
client
V 21
dir d.5ck.r18912/7085
K 6
common
V 22
dir p.5ck.r18942/34657
K 12
config.mac.h
V 20
file hb.0.r6045/5982
K 12
configure.ac
V 23
file 149.5ck.r18927/475
K 4
data
V 22
dir w.5ck.r18936/15029
K 6
debian
V 22
dir 5w.5ck.r17748/2019
K 12
dependencies
V 23
dir 2yu.5ck.r18715/5254
K 11
diff_ignore
V 21
file qq.5ck.r17605/92
K 3
doc
V 23
dir k7.5ck.r18902/25809
K 10
fc_version
V 26
file 2lo.5en.r18452/124959
K 2
m4
V 23
dir 12p.5ck.r18925/2740
K 6
manual
V 23
dir 2m2.5ck.r18773/2094
K 7
modinst
V 23
dir 4pj.5ck.r18918/3658
K 2
po
V 24
dir fs.5ck.r18909/477958
K 7
scripts
V 23
dir 2yo.5bk.r14810/1300
K 6
server
V 22
dir z.5ck.r18942/30324
K 10
stamp-h.in
V 19
file 80.0.r1125/241
K 5
tests
V 22
dir 2g9.5ck.r15661/767
K 7
utility
V 22
dir 1c.5ck.r18922/3141
K 3
vms
V 21
dir u9.0.r11105/70719
K 5
win32
V 24
dir 2eu.5bk.r13732/30345
END
ENDREP
id: 3.5ck.r18942/36199
type: dir
pred: 3.5ck.r18941/7084
count: 14061
text: 18942 34888 1298 1298 393f63205c47e30ab134458ba6f3523d
props: 17175 3052 264 0 91336f1f63d2f606e65376614b5c72e4
cpath: /trunk
copyroot: 15280 /trunk

PLAIN
K 8
branches
V 20
dir 1.0.r18935/17220
K 4
tags
V 19
dir 2.0.r18763/5338
K 5
trunk
V 22
dir 3.5ck.r18942/36199
K 7
website
V 18
dir 3ge.0.r12388/0
END
ENDREP
id: 0.0.r18942/36589
type: dir
pred: 0.0.r18941/7471
count: 18942
text: 18942 36425 151 151 74563417ef7f1179eac812731a540000
cpath: /
copyroot: 0 /

uo.5ck.t18941-1 modify true false /trunk/common/connection.h

2lz.5ck.t18941-1 modify true false /trunk/server/commands.h

4u.5ck.t18941-1 modify true false /trunk/server/plrhand.c

2dx.5ck.t18941-1 modify true false /trunk/server/connecthand.h

4m0.5ck.t18941-1 modify true false /trunk/server/savegame2.c

4z.5ck.t18941-1 modify true false /trunk/server/stdinhand.c

4v.5ck.t18941-1 modify true false /trunk/server/plrhand.h

15.5ck.t18941-1 modify true false /trunk/server/sernet.c

39c.5ck.t18941-1 modify true false /trunk/server/auth.c

2ly.5ck.t18941-1 modify true false /trunk/server/commands.c

46.5ck.t18941-1 modify true false /trunk/common/player.h

2dw.5ck.t18941-1 modify true false /trunk/server/connecthand.c


36589 36738
