Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2002:
[Freeciv-Dev] Re: teamslite13
Home

[Freeciv-Dev] Re: teamslite13

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: teamslite13
From: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Date: Wed, 30 Oct 2002 21:17:36 +0100

On Wed, Oct 30, 2002 at 06:11:36PM +0000, Per I. Mathisen wrote:
> Changes
>   - sends team names only once, through control ruleset packet
>   - more api changes/cleanup (as requested)
>   - fundamental cleanup of team_remove_player()
>   - allow inter-team diplomacy
>   - remove tech sharing for now (will add in later patch)
> 
> Hopefully this can now go in.

> +/***************************************************************
> +  Returns the id of a team given its name, or TEAM_NONE if 
> +  not found.
> +***************************************************************/

> +Team_Type_id team_find_by_name(const char *name)

s/name/team_name/ to be similar to:

> +void team_add_player(struct player *pplayer, const char *team_name)

> +  Team_Type_id id;  /* equal to array index if active, else TEAM_NONE */

indent will place the comment other.

> +#define team_iterate(PI_team)                                                
>  \
> +{                                                                            
>  \
> +  struct team *PI_team;                                                  \
> +  Team_Type_id PI_p_itr;                                                     
>  \
> +  for (PI_p_itr = 0; PI_p_itr < game.team_count; PI_p_itr++) {               
>  \
> +    PI_team = team_get_by_id(PI_p_itr);

This will IMHO not work if there is a hole in the team allocation.

> +  if (has_capability("team", pc->capability)) {
> +    dio_put_uint8(&dout, pinfo->team);
> +  }

Why if the teams are static?

> +  if (has_capability("team", pc->capability)) {
> +    int i;

Missing newline;

> -void handle_chat_msg(struct connection *pconn,
> -                  struct packet_generic_message *packet)
> +void handle_chat_msg(struct connection *pconn, 
> +                     struct packet_generic_message *packet)

Noise.

> +      conn_list_iterate(aplayer->connections, dest_conn) {
> +        send_packet_generic_message(dest_conn, PACKET_CHAT_MSG, &genmsg);
> +      } conn_list_iterate_end;

Use lsend_...

> -void handle_chat_msg(struct connection *pconn,
> -                  struct packet_generic_message *packet);
> +#define ALLIESCHAT_COMMAND_PREFIX '.'
> +
> +void handle_chat_msg(struct connection *pconn, 
> +                     struct packet_generic_message *packet);

Noise.

> +  /* not all players have teams */
> +  if (section_file_lookup(file, "player%d.team", plrno)) {
> +    char tmp[MAX_LEN_NAME];

Missing newline.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "If at first you don't succeed... well so much for skydiving."


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