Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #699485 ยป 0023-Tex-Copy-all-tiles-to-tex-map-once-map-generated-or-.patch

Marko Lindqvist, 2017-09-26 01:05 AM

View differences:

ai/classic/classicai.c
ai->funcs.module_close = cai_module_close;
/* ai->funcs.map_alloc = NULL; */
/* ai->funcs.map_ready = NULL; */
/* ai->funcs.map_free = NULL; */
/* ai->funcs.game_start = NULL; */
/* ai->funcs.game_free = NULL; */
ai/tex/texai.c
ai->funcs.module_close = texai_module_close;
ai->funcs.map_alloc = texai_map_alloc;
ai->funcs.map_ready = texai_whole_map_copy;
ai->funcs.map_free = texai_map_free;
ai->funcs.player_alloc = texwai_player_alloc;
ai/tex/texaiplayer.c
texai_send_msg(TEXAI_MSG_MAP_ALLOC, NULL, NULL);
}
/**************************************************************************
Send all tiles to tex thread
**************************************************************************/
void texai_whole_map_copy(void)
{
whole_map_iterate(&(wld.map), ptile) {
texai_tile_info(ptile);
} whole_map_iterate_end;
}
/**************************************************************************
Map allocation message received
**************************************************************************/
ai/tex/texaiplayer.h
bool texai_thread_running(void);
void texai_map_alloc(void);
void texai_whole_map_copy(void);
void texai_map_free(void);
void texai_player_alloc(struct ai_type *ait, struct player *pplayer);
void texai_player_free(struct ai_type *ait, struct player *pplayer);
common/ai.h
* structure below. When changing mandatory capability part, check that
* there's enough reserved_xx pointers in the end of the structure for
* taking to use without need to bump mandatory capability again. */
#define FC_AI_MOD_CAPSTR "+Freeciv-3.1-ai-module-2017.May.26"
#define FC_AI_MOD_CAPSTR "+Freeciv-3.1-ai-module-2017.Sep.26"
/* Timers for all AI activities. Define it to get statistics about the AI. */
#ifdef FREECIV_DEBUG
......
/* Called for every AI type when map tiles are allocated. */
void (*map_alloc)(void);
/* Called for every AI type when the game map is ready, either generated
* or, in case of scenario, loaded. */
void (*map_ready)(void);
/* Called for every AI type when map tiles are freed. */
void (*map_free)(void);
doc/README.AI_modules
-------------------
- Added 'tile_info', called when tile has changed
- Added 'map_alloc' and 'map_free', called when map tiles are allocated or freed
- Added 'map_ready', called when map has been generated or, in case of scenario, loaded
New in Freeciv 3.0:
server/srv_main.c
}
}
CALL_FUNC_EACH_AI(map_ready);
/* start the game */
set_server_state(S_S_RUNNING);
(void) send_server_info_to_metaserver(META_INFO);
    (1-1/1)