From 0287f62578cb4aa643649a9d62dc753586b16b30 Mon Sep 17 00:00:00 2001 From: Dusan Durech Date: Sun, 12 Apr 2009 23:00:24 +0200 Subject: fix bad preFixs --- src/base/arena.c | 10 +++---- src/base/arena.h | 2 +- src/base/arenaFile.c | 72 +++++++++++++++++++++++----------------------- src/base/arenaFile.h | 30 +++++++++---------- src/base/checkFront.c | 10 +++---- src/base/checkFront.h | 10 +++---- src/base/downServer.c | 10 +++---- src/base/downServer.h | 8 +++--- src/base/gun.c | 8 +++--- src/base/homeDirector.c | 4 +-- src/base/homeDirector.h | 4 +-- src/base/item.c | 42 +++++++++++++-------------- src/base/main.c | 2 +- src/base/modules.c | 14 ++++----- src/base/modules.h | 8 +++--- src/base/net_multiplayer.c | 10 +++---- src/base/net_multiplayer.h | 10 +++---- src/base/proto.c | 52 ++++++++++++++++----------------- src/base/server.c | 40 +++++++++++++------------- src/base/serverSendMsg.c | 4 +-- src/base/serverSendMsg.h | 2 +- src/base/shareFunction.c | 8 +++--- src/base/shareFunction.h | 8 +++--- src/base/shot.c | 4 +-- src/base/tcp_server.c | 22 +++++++------- src/base/tcp_server.h | 14 ++++----- src/base/textFile.c | 12 ++++---- src/base/textFile.h | 10 +++---- src/base/tux.c | 34 +++++++++++----------- src/base/udp_server.c | 16 +++++------ src/base/udp_server.h | 12 ++++---- 31 files changed, 246 insertions(+), 246 deletions(-) (limited to 'src/base') diff --git a/src/base/arena.c b/src/base/arena.c index e58f8f3..08ee226 100644 --- a/src/base/arena.c +++ b/src/base/arena.c @@ -77,12 +77,12 @@ void arena_init() printf("SCREEN_SPLIT_HORIZONTAL\n"); } - hotKey_register(SDLK_F3, hotkey_splitArena); + hot_key_register(SDLK_F3, hotkey_splitArena); } void arena_quit() { - unhotKey_register(SDLK_F3); + unhot_key_register(SDLK_F3); } #endif @@ -127,7 +127,7 @@ arena_conflict_space(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int return (x1 < x2 + w2 && x2 < x1 + w1 && y1 < y2 + h2 && y2 < y1 + h1); } -int arena__is_free_space(arena_t * arena, int x, int y, int w, int h) +int arena_is_free_space(arena_t * arena, int x, int y, int w, int h) { if (x < 0 || y < 0 || x + w > arena->w || y + h > arena->h) { return 0; @@ -162,7 +162,7 @@ void arena_find_free_space(arena_t * arena, int *x, int *y, int w, int h) do { z_x = random() % (arena->w - w); z_y = random() % (arena->h - h); - } while (arena__is_free_space(arena, z_x, z_y, w, h) == 0); + } while (arena_is_free_space(arena, z_x, z_y, w, h) == 0); *x = z_x; *y = z_y; @@ -336,7 +336,7 @@ void drawSimpleArena(arena_t * arena) void arena_draw(arena_t * arena) { if (isBigArena(arena) && - netMultiplayer_get_game_type() == NET_GAME_TYPE_NONE && !setting_is_ai()) { + net_multiplayer_get_game_type() == NET_GAME_TYPE_NONE && !setting_is_ai()) { tux_t *tux1; tux_t *tux2; diff --git a/src/base/arena.h b/src/base/arena.h index fbbaede..153fb3b 100644 --- a/src/base/arena.h +++ b/src/base/arena.h @@ -45,7 +45,7 @@ extern void arena_quit(); extern arena_t *arena_new(int w, int h); extern int arena_conflict_space(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2); -extern int arena__is_free_space(arena_t * arena, int x, int y, int w, int h); +extern int arena_is_free_space(arena_t * arena, int x, int y, int w, int h); extern void arena_find_free_space(arena_t * arena, int *x, int *y, int w, int h); extern void arena_get_center_screen(int *screen_x, int *screen_y, int x, int y, int screen_size_x, int screen_size_y); diff --git a/src/base/arenaFile.c b/src/base/arenaFile.c index a5fa709..4e6ef6f 100644 --- a/src/base/arenaFile.c +++ b/src/base/arenaFile.c @@ -29,12 +29,12 @@ static list_t *listArenaFile; static bool_t isArenaFileInit = FALSE; -bool_t arenaFile_is_inicialized() +bool_t arena_file_is_inicialized() { return isArenaFileInit; } -int arenaFile_get_value(char *line, char *env, char *val, int len) +int arena_file_get_value(char *line, char *env, char *val, int len) { char *offset_env; char *offset_val_begin; @@ -73,7 +73,7 @@ int arenaFile_get_value(char *line, char *env, char *val, int len) #ifndef PUBLIC_SERVER -image_t *arenaFile_load_image(arenaFile_t * arenaFile, char *filename, char *group, char *name, int alpha) +image_t *arena_file_load_image(arenaFile_t * arenaFile, char *filename, char *group, char *name, int alpha) { char *extractFile; image_t *image; @@ -103,13 +103,13 @@ static void cmd_arena(arena_t ** arena, char *line) char str_w[STR_SIZE]; char str_h[STR_SIZE]; - if (arenaFile_get_value(line, "background", str_image, STR_SIZE) != 0) + if (arena_file_get_value(line, "background", str_image, STR_SIZE) != 0) return; - if (arenaFile_get_value(line, "w", str_w, STR_SIZE) != 0) + if (arena_file_get_value(line, "w", str_w, STR_SIZE) != 0) return; - if (arenaFile_get_value(line, "h", str_h, STR_SIZE) != 0) + if (arena_file_get_value(line, "h", str_h, STR_SIZE) != 0) return; (*arena) = arena_new(atoi(str_w), atoi(str_h)); @@ -127,7 +127,7 @@ static void cmd_module_load(char *line) { char str_file[STR_SIZE]; - if (arenaFile_get_value(line, "file", str_file, STR_SIZE) != 0) + if (arena_file_get_value(line, "file", str_file, STR_SIZE) != 0) return; module_load(str_file); @@ -141,17 +141,17 @@ static void cmd_loadImage(arenaFile_t * arenaFile, char *line) char str_name[STR_SIZE]; char str_alpha[STR_SIZE]; - if (arenaFile_get_value(line, "file", str_file, STR_SIZE) != 0) + if (arena_file_get_value(line, "file", str_file, STR_SIZE) != 0) return; - if (arenaFile_get_value(line, "name", str_name, STR_SIZE) != 0) + if (arena_file_get_value(line, "name", str_name, STR_SIZE) != 0) return; - if (arenaFile_get_value(line, "alpha", str_alpha, STR_SIZE) != 0) + if (arena_file_get_value(line, "alpha", str_alpha, STR_SIZE) != 0) return; //printf("str_file=%s str_name=%s str_alpha=%s\n", str_file, str_name, str_alpha); - arenaFile_load_image(arenaFile, str_file, IMAGE_GROUP_USER, str_name, isYesOrNO(str_alpha)); + arena_file_load_image(arenaFile, str_file, IMAGE_GROUP_USER, str_name, isYesOrNO(str_alpha)); //image_add(str_file, isYesOrNO(str_alpha), str_name, IMAGE_GROUP_USER); } @@ -161,10 +161,10 @@ static void cmd_loadMusic(arenaFile_t * arenaFile, char *line) char str_file[STR_SIZE]; char str_name[STR_SIZE]; - if (arenaFile_get_value(line, "file", str_file, STR_SIZE) != 0) + if (arena_file_get_value(line, "file", str_file, STR_SIZE) != 0) return; - if (arenaFile_get_value(line, "name", str_name, STR_SIZE) != 0) + if (arena_file_get_value(line, "name", str_name, STR_SIZE) != 0) return; #ifndef NO_SOUND @@ -177,19 +177,19 @@ static void cmd_music_play(arena_t * arena, char *line) { char str_music[STR_SIZE]; - if (arenaFile_get_value(line, "music", str_music, STR_SIZE) != 0) + if (arena_file_get_value(line, "music", str_music, STR_SIZE) != 0) return; strcpy(arena->music, str_music); } #endif -int arenaFile_get_count() +int arena_file_get_count() { return listArenaFile->count; } -static char *arenaFile_get_arenaStatus(textFile_t * ts, char *s) +static char *arena_file_get_arenaStatus(textFile_t * ts, char *s) { int len; int i; @@ -208,23 +208,23 @@ static char *arenaFile_get_arenaStatus(textFile_t * ts, char *s) return NULL; } -char *arenaFile_get_name(arenaFile_t * arenaFile) +char *arena_file_get_name(arenaFile_t * arenaFile) { char *ret; - ret = arenaFile_get_arenaStatus(arenaFile->map, "name"); + ret = arena_file_get_arenaStatus(arenaFile->map, "name"); return (ret != NULL ? ret : "arena_no_name"); } -char *arenaFile_get_net_name(arenaFile_t * arenaFile) +char *arena_file_get_net_name(arenaFile_t * arenaFile) { char *ret; - ret = arenaFile_get_arenaStatus(arenaFile->map, "netName"); + ret = arena_file_get_arenaStatus(arenaFile->map, "netName"); return (ret != NULL ? ret : "arena_no_net_name"); } -arenaFile_t *arenaFile_get_file_format_net_name(char *s) +arenaFile_t *arena_file_get_file_format_net_name(char *s) { int i; @@ -233,24 +233,24 @@ arenaFile_t *arenaFile_get_file_format_net_name(char *s) arenaFile = (arenaFile_t *) listArenaFile->list[i]; - if (strcmp(arenaFile_get_net_name(arenaFile), s) == 0) + if (strcmp(arena_file_get_net_name(arenaFile), s) == 0) return arenaFile; } return NULL; } -char *arenaFile_get_image(arenaFile_t * arenaFile) +char *arena_file_get_image(arenaFile_t * arenaFile) { - return arenaFile_get_arenaStatus(arenaFile->map, "screen"); + return arena_file_get_arenaStatus(arenaFile->map, "screen"); } -arenaFile_t *arenaFile_get(int n) +arenaFile_t *arena_file_get(int n) { return (arenaFile_t *) listArenaFile->list[n]; } -int arenaFile_get_id(arenaFile_t * arenaFile) +int arena_file_get_id(arenaFile_t * arenaFile) { int i; @@ -267,7 +267,7 @@ int arenaFile_get_id(arenaFile_t * arenaFile) return -1; } -arena_t *arenaFile_get_arena(arenaFile_t * arenaFile) +arena_t *arena_file_get_arena(arenaFile_t * arenaFile) { textFile_t *ts; arena_t *arena = NULL; // no warninng @@ -301,7 +301,7 @@ arena_t *arenaFile_get_arena(arenaFile_t * arenaFile) return arena; } -arenaFile_t *arenaFile_new(char *path) +arenaFile_t *arena_file_new(char *path) { arenaFile_t *new; char *extractFile; @@ -310,7 +310,7 @@ arenaFile_t *arenaFile_new(char *path) new->path = strdup(path); extractFile = archive_extract_file(path, "arena.map"); - new->map = textFile_load(extractFile); + new->map = text_file_load(extractFile); archive_delete_file(extractFile); return new; @@ -318,14 +318,14 @@ arenaFile_t *arenaFile_new(char *path) void arena_destroyFile(arenaFile_t * p) { - textFile_destroy(p->map); + text_file_destroy(p->map); free(p->path); free(p); } -void arenaFile_load(char *path) +void arena_file_load(char *path) { - list_add(listArenaFile, arenaFile_new(path)); + list_add(listArenaFile, arena_file_new(path)); } static void load_arenaFromDirector(char *director) @@ -360,7 +360,7 @@ static void load_arenaFromDirector(char *director) DEBUG_MSG(_("Loading arena: %s\n"), line); accessExistFile(path); - arenaFile_load(path); + arena_file_load(path); } } @@ -369,7 +369,7 @@ static void load_arenaFromDirector(char *director) } -void arenaFile_init() +void arena_file_init() { #ifndef PUBLIC_SERVER assert(image_is_inicialized() == TRUE); @@ -380,11 +380,11 @@ void arenaFile_init() load_arenaFromDirector(PATH_ARENA); #ifndef PUBLIC_SERVER - load_arenaFromDirector(homeDirector_get()); + load_arenaFromDirector(home_director_get()); #endif } -void arenaFile_quit() +void arena_file_quit() { isArenaFileInit = FALSE; list_destroy_item(listArenaFile, arena_destroyFile); diff --git a/src/base/arenaFile.h b/src/base/arenaFile.h index d146664..7de4f3f 100644 --- a/src/base/arenaFile.h +++ b/src/base/arenaFile.h @@ -13,23 +13,23 @@ typedef struct { textFile_t *map; } arenaFile_t; -extern bool_t arenaFile_is_inicialized(); -extern int arenaFile_get_value(char *line, char *env, char *val, int len); -extern int arenaFile_get_count(); -extern char *arenaFile_get_name(arenaFile_t * arenaFile); -extern char *arenaFile_get_net_name(arenaFile_t * arenaFile); -extern arenaFile_t *arenaFile_get_file_format_net_name(char *s); -extern char *arenaFile_get_image(arenaFile_t * arenaFile); +extern bool_t arena_file_is_inicialized(); +extern int arena_file_get_value(char *line, char *env, char *val, int len); +extern int arena_file_get_count(); +extern char *arena_file_get_name(arenaFile_t * arenaFile); +extern char *arena_file_get_net_name(arenaFile_t * arenaFile); +extern arenaFile_t *arena_file_get_file_format_net_name(char *s); +extern char *arena_file_get_image(arenaFile_t * arenaFile); # ifndef PUBLIC_SERVER -extern image_t *arenaFile_load_image(arenaFile_t * arenaFile, char *filename, +extern image_t *arena_file_load_image(arenaFile_t * arenaFile, char *filename, char *group, char *name, int alpha); # endif -extern arenaFile_t *arenaFile_get(int n); -extern int arenaFile_get_id(arenaFile_t * arenaFile); -extern arena_t *arenaFile_get_arena(arenaFile_t * arenaFile); -extern arenaFile_t *arenaFile_new(char *path); -extern void arenaFile_load(char *path); -extern void arenaFile_init(); -extern void arenaFile_quit(); +extern arenaFile_t *arena_file_get(int n); +extern int arena_file_get_id(arenaFile_t * arenaFile); +extern arena_t *arena_file_get_arena(arenaFile_t * arenaFile); +extern arenaFile_t *arena_file_new(char *path); +extern void arena_file_load(char *path); +extern void arena_file_init(); +extern void arena_file_quit(); #endif diff --git a/src/base/checkFront.c b/src/base/checkFront.c index 846c3a6..47adda2 100644 --- a/src/base/checkFront.c +++ b/src/base/checkFront.c @@ -43,12 +43,12 @@ static void destroyCheck(checkfront_t * p) free(p); } -list_t *checkFront_new() +list_t *check_front_new() { return list_new(); } -void checkFront_add_msg(list_t * list, char *msg, int type, int id) +void check_front_add_msg(list_t * list, char *msg, int type, int id) { if (type == CHECK_FRONT_TYPE_CHECK) id_inc(id); @@ -56,7 +56,7 @@ void checkFront_add_msg(list_t * list, char *msg, int type, int id) list_add(list, newCheck(msg, type, id)); } -void checkFront_event(client_t * client) +void check_front_event(client_t * client) { my_time_t currentTime; int i; @@ -93,7 +93,7 @@ void checkFront_event(client_t * client) } } -void checkFront_del_msg(list_t * listCheckFront, int id) +void check_front_del_msg(list_t * listCheckFront, int id) { int i; @@ -110,7 +110,7 @@ void checkFront_del_msg(list_t * listCheckFront, int id) } } -void checkFront_destroy(list_t * p) +void check_front_destroy(list_t * p) { assert(p != NULL); list_destroy_item(p, destroyCheck); diff --git a/src/base/checkFront.h b/src/base/checkFront.h index 4e7781d..2fc73b0 100644 --- a/src/base/checkFront.h +++ b/src/base/checkFront.h @@ -12,10 +12,10 @@ # include "list.h" # include "server.h" -extern list_t *checkFront_new(); -extern void checkFront_add_msg(list_t * list, char *msg, int type, int id); -extern void checkFront_event(client_t * client); -extern void checkFront_del_msg(list_t * listCheckFront, int id); -extern void checkFront_destroy(list_t * p); +extern list_t *check_front_new(); +extern void check_front_add_msg(list_t * list, char *msg, int type, int id); +extern void check_front_event(client_t * client); +extern void check_front_del_msg(list_t * listCheckFront, int id); +extern void check_front_destroy(list_t * p); #endif diff --git a/src/base/downServer.c b/src/base/downServer.c index 8575fa5..13bd0ab 100644 --- a/src/base/downServer.c +++ b/src/base/downServer.c @@ -65,7 +65,7 @@ static void proto_getarena(client_ds_t *client, char *msg) arenaName = msg+9; //printf("arena = >>%s<<\n", arenaName); - arenaFile = arenaFile_get_file_format_net_name(arenaName); + arenaFile = arena_file_get_file_format_net_name(arenaName); if( arenaFile == NULL ) { @@ -125,7 +125,7 @@ static void destroyClient(client_ds_t *client) free(client); } -int downServer_init(char *ip4, int port4) +int down_server_init(char *ip4, int port4) { sock_server_tcp = sock_tcp_bind(ip4, port4); @@ -142,7 +142,7 @@ int downServer_init(char *ip4, int port4) return 0; } -int downServer_set_select() +int down_server_set_select() { int i; @@ -264,7 +264,7 @@ static void sendFile(client_ds_t *client) client->send += count; } -int downServer_select_socket() +int down_server_select_socket() { int i; @@ -303,7 +303,7 @@ int downServer_select_socket() return 0; } -int downServer_quit() +int down_server_quit() { sock_tcp_close(sock_server_tcp); list_destroy_item(listClient, destroyClient); diff --git a/src/base/downServer.h b/src/base/downServer.h index 6dea645..da5a698 100644 --- a/src/base/downServer.h +++ b/src/base/downServer.h @@ -7,9 +7,9 @@ #include "tcp.h" #include "buffer.h" -extern int downServer_init(char *ip4, int port4); -extern int downServer_set_select(); -extern int downServer_select_socket(); -extern int downServer_quit(); +extern int down_server_init(char *ip4, int port4); +extern int down_server_set_select(); +extern int down_server_select_socket(); +extern int down_server_quit(); #endif diff --git a/src/base/gun.c b/src/base/gun.c index 653a180..6a4ed36 100644 --- a/src/base/gun.c +++ b/src/base/gun.c @@ -84,7 +84,7 @@ static void addShot(tux_t * tux, int x, int y, int px, int py) { int gun; - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) return; if (tux->gun == GUN_BOMBBALL) @@ -236,17 +236,17 @@ static void putInGunMine(tux_t * tux) arena = arena_get_current(); - if (arena__is_free_space(arena_get_current(), x, y, ITEM_MINE_WIDTH, ITEM_MINE_HEIGHT)) { + if (arena_is_free_space(arena_get_current(), x, y, ITEM_MINE_WIDTH, ITEM_MINE_HEIGHT)) { item_t *item; #ifndef NO_SOUND sound_play("put_mine", SOUND_GROUP_BASE); #endif tux->shot[tux->gun]--; - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { item = item_new(x, y, ITEM_MINE, tux->id); - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_additem_server(PROTO_SEND_ALL, NULL, item); space_add(arena->spaceItem, item); diff --git a/src/base/homeDirector.c b/src/base/homeDirector.c index f78d820..2a7cbfc 100644 --- a/src/base/homeDirector.c +++ b/src/base/homeDirector.c @@ -10,7 +10,7 @@ static char homeDirector[STR_PATH_SIZE]; -void homeDirector_create() +void home_director_create() { char *envHome; #ifndef __WIN32__ @@ -40,7 +40,7 @@ void homeDirector_create() } } -char *homeDirector_get() +char *home_director_get() { return homeDirector; } diff --git a/src/base/homeDirector.h b/src/base/homeDirector.h index f28c7a4..5a9cc98 100644 --- a/src/base/homeDirector.h +++ b/src/base/homeDirector.h @@ -5,6 +5,6 @@ # include "main.h" -extern void homeDirector_create(); -extern char *homeDirector_get(); +extern void home_director_create(); +extern char *home_director_get(); #endif diff --git a/src/base/item.c b/src/base/item.c index 0ebeae2..7abdde4 100644 --- a/src/base/item.c +++ b/src/base/item.c @@ -180,13 +180,13 @@ void item_add_new_item(space_t * spaceItem, int author_id) int type; #ifdef PUBLIC_SERVER - if (getCountWeaponOrBonusItem(spaceItem) >= atoi(publicServer_get_setting("MAX_ITEM", "--max-item", "100"))) { + if (getCountWeaponOrBonusItem(spaceItem) >= atoi(public_server_get_setting("MAX_ITEM", "--max-item", "100"))) { return; } #endif #ifndef PUBLIC_SERVER - if (setting_is_any_item() == FALSE || netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) { + if (setting_is_any_item() == FALSE || net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) { return; } #endif @@ -239,16 +239,16 @@ void item_add_new_item(space_t * spaceItem, int author_id) } #ifndef PUBLIC_SERVER } while (setting_is_item(type) == FALSE || - (netMultiplayer_get_game_type() == NET_GAME_TYPE_NONE && type == BONUS_HIDDEN)); + (net_multiplayer_get_game_type() == NET_GAME_TYPE_NONE && type == BONUS_HIDDEN)); #endif item = item_new(new_x, new_y, type, author_id); space_add(spaceItem, item); - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_additem_server(PROTO_SEND_ALL, NULL, item); #ifndef PUBLIC_SERVER - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) radar_add(item->id, new_x, new_y, RADAR_TYPE_ITEM); #endif } @@ -326,7 +326,7 @@ void item_event(space_t * spaceItem) static void mineExplosion(space_t * spaceItem, item_t * item) { - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { int x, y; item_t *item_explosion; @@ -334,16 +334,16 @@ static void mineExplosion(space_t * spaceItem, item_t * item) y = (item->y + item->h / 2) - ITEM_BIG_EXPLOSION_HEIGHT / 2; item_explosion = item_new(x, y, ITEM_BIG_EXPLOSION, item->author_id); - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_additem_server(PROTO_SEND_ALL, NULL, item_explosion); space_add(spaceItem, item_explosion); } - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_del_server(PROTO_SEND_ALL, NULL, item->id); - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) space_del_with_item(spaceItem, item, item_destroy); } @@ -355,7 +355,7 @@ static void action_item(space_t * space, item_t * item, int *isDel) switch (item->type) { case ITEM_MINE: - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) mineExplosion(space, item); break; case ITEM_EXPLOSION: @@ -373,7 +373,7 @@ static void action_shot(space_t * space, shot_t * shot, space_t * spaceItem) shot->x, shot->y, shot->w, shot->h); if (isDel) { - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id); space_del_with_item(space, shot, shot_destroy); @@ -382,7 +382,7 @@ static void action_shot(space_t * space, shot_t * shot, space_t * spaceItem) void item_event_conglicts_shot_with_item(arena_t * arena) { - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) return; space_action(arena->spaceShot, action_shot, arena->spaceItem); @@ -401,7 +401,7 @@ static void tux_event_tux_is_deadWithItem(tux_t * tux, item_t * item) if (item->author_id == tux->id) { tux->score--; - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux); } @@ -413,7 +413,7 @@ static void tux_event_tux_is_deadWithItem(tux_t * tux, item_t * item) if (author != NULL) { author->score++; - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_newtux_server(PROTO_SEND_ALL, NULL, author); } } @@ -430,11 +430,11 @@ static void tuxGiveBonus(tux_t * tux, item_t * item) tux->bonus = item->type; tux->bonus_time = TUX_MAX_BONUS; - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux); #ifndef PUBLIC_SERVER - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) radar_del(item->id); #endif } @@ -448,11 +448,11 @@ static void tuxGiveGun(tux_t * tux, item_t * item) tux->shot[item->type] += GUN_MAX_SHOT; tux->gun = item->type; - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux); #ifndef PUBLIC_SERVER - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) radar_del(item->id); #endif } @@ -468,7 +468,7 @@ static void action_giveitem(space_t * space, item_t * item, tux_t * tux) case GUN_BOMBBALL: tuxGiveGun(tux, item); - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_del_server(PROTO_SEND_ALL, NULL, item->id); space_del_with_item(space, item, item_destroy); @@ -494,7 +494,7 @@ static void action_giveitem(space_t * space, item_t * item, tux_t * tux) case BONUS_HIDDEN: tuxGiveBonus(tux, item); - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) proto_send_del_server(PROTO_SEND_ALL, NULL, item->id); space_del_with_item(space, item, item_destroy); @@ -512,7 +512,7 @@ void item_tux_give_list_item(tux_t * tux, space_t * spaceItem) assert(spaceItem != NULL); assert(tux != NULL); - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) return; if (tux->status == TUX_STATUS_DEAD) diff --git a/src/base/main.c b/src/base/main.c index b208f2e..9d8600a 100644 --- a/src/base/main.c +++ b/src/base/main.c @@ -170,7 +170,7 @@ int main(int argc, char *argv[]) #endif #ifdef PUBLIC_SERVER - publicServer_start(); + public_server_start(); #endif return 0; diff --git a/src/base/modules.c b/src/base/modules.c index 9f2afae..7b0b7c2 100644 --- a/src/base/modules.c +++ b/src/base/modules.c @@ -30,11 +30,11 @@ static export_fce_t export_fce = { .fce_image_get = image_get, #endif .fce_module_load_dep = module_load_dep, - .fce_shareFunction_add = shareFunction_add, - .fce_shareFunction_get = shareFunction_get, + .fce_share_function_add = share_function_add, + .fce_share_function_get = share_function_get, - .fce_getValue = arenaFile_get_value, - .fce_netMultiplayer_get_game_type = netMultiplayer_get_game_type, + .fce_getValue = arena_file_get_value, + .fce_net_multiplayer_get_game_type = net_multiplayer_get_game_type, .fce_tux_get_proportion = tux_get_proportion, .fce_tux_set_proportion = tux_set_proportion, .fce_tux_action = tux_action, @@ -43,7 +43,7 @@ static export_fce_t export_fce = { .fce_arena_get_current = arena_get_current, .fce_arena_conflict_space = arena_conflict_space, - .fce_arena__is_free_space = arena__is_free_space, + .fce_arena_is_free_space = arena_is_free_space, .fce_arena_find_free_space = arena_find_free_space, .fce_proto_send_module_server = proto_send_module_server, @@ -189,7 +189,7 @@ static int destroyModule(module_t * p) void module_init() { listModule = list_new(); - shareFunction_init(); + share_function_init(); } int isModuleLoaded(char *name) @@ -304,5 +304,5 @@ int module_recv_msg(char *msg) void module_quit() { list_destroy_item(listModule, destroyModule); - shareFunction_quit(); + share_function_quit(); } diff --git a/src/base/modules.h b/src/base/modules.h index 95d6e98..152ce14 100644 --- a/src/base/modules.h +++ b/src/base/modules.h @@ -28,10 +28,10 @@ typedef struct export_fce_s { int w, int h, int player); # endif - int (*fce_netMultiplayer_get_game_type) (); + int (*fce_net_multiplayer_get_game_type) (); int (*fce_module_load_dep) (char *name); - void (*fce_shareFunction_add) (char *name, void *function); - void *(*fce_shareFunction_get) (char *name); + void (*fce_share_function_add) (char *name, void *function); + void *(*fce_share_function_get) (char *name); void (*fce_tux_get_proportion) (tux_t * tux, int *x, int *y, int *w, int *h); void (*fce_tux_set_proportion) (tux_t * tux, int x, int y); @@ -41,7 +41,7 @@ typedef struct export_fce_s { arena_t *(*fce_arena_get_current) (); int (*fce_arena_conflict_space) (int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2); - int (*fce_arena__is_free_space) (arena_t * arena, int x, int y, int w, int h); + int (*fce_arena_is_free_space) (arena_t * arena, int x, int y, int w, int h); void (*fce_arena_find_free_space) (arena_t * arena, int *x, int *y, int w, int h); void (*fce_proto_send_module_server) (int type, client_t * client, char *msg); diff --git a/src/base/net_multiplayer.c b/src/base/net_multiplayer.c index 62f298b..68b19d7 100644 --- a/src/base/net_multiplayer.c +++ b/src/base/net_multiplayer.c @@ -24,12 +24,12 @@ static int netGameType; -int netMultiplayer_get_game_type() +int net_multiplayer_get_game_type() { return netGameType; } -int netMultiplayer_init_for_game_server(char *ip4, int port4, char *ip6, int port6) +int net_multiplayer_init_for_game_server(char *ip4, int port4, char *ip6, int port6) { int ret; @@ -42,7 +42,7 @@ int netMultiplayer_init_for_game_server(char *ip4, int port4, char *ip6, int por return ret; } -int netMultiplayer_init(int type, char *ip, int port, int proto) +int net_multiplayer_init(int type, char *ip, int port, int proto) { netGameType = type; @@ -86,7 +86,7 @@ int netMultiplayer_init(int type, char *ip, int port, int proto) return 0; } -void netMultiplayer_event() +void net_multiplayer_event() { switch (netGameType) { case NET_GAME_TYPE_NONE: @@ -107,7 +107,7 @@ void netMultiplayer_event() } } -void netMultiplayer_quit() +void net_multiplayer_quit() { switch (netGameType) { case NET_GAME_TYPE_NONE: diff --git a/src/base/net_multiplayer.h b/src/base/net_multiplayer.h index c11a168..8d5ab46 100644 --- a/src/base/net_multiplayer.h +++ b/src/base/net_multiplayer.h @@ -28,12 +28,12 @@ # define NET_MASTER_PORT 6800 # ifdef PUBLIC_SERVER -extern int netMultiplayer_init_for_game_server(char *ip4, int port4, char *ip6, int port6); +extern int net_multiplayer_init_for_game_server(char *ip4, int port4, char *ip6, int port6); # endif -extern int netMultiplayer_init(int type, char *ip, int port, int proto); -extern int netMultiplayer_get_game_type(); -extern void netMultiplayer_event(); -extern void netMultiplayer_quit(); +extern int net_multiplayer_init(int type, char *ip, int port, int proto); +extern int net_multiplayer_get_game_type(); +extern void net_multiplayer_event(); +extern void net_multiplayer_quit(); #endif diff --git a/src/base/proto.c b/src/base/proto.c index be54593..326e92d 100644 --- a/src/base/proto.c +++ b/src/base/proto.c @@ -44,7 +44,7 @@ void proto_send_error_server(int type, client_t * client, int errorcode) snprintf(msg, STR_PROTO_SIZE, "error %d\n", errorcode); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); } #ifndef PUBLIC_SERVER @@ -157,7 +157,7 @@ void proto_recv_hello_server(client_t * client, char *msg) if (space_get_count(arena_get_current()->spaceTux) + 1 > server_get_max_clients()) { proto_send_error_server(PROTO_SEND_ONE, client, PROTO_ERROR_LIMIT_MAX_CLIENT); - checkFront_event(client); + check_front_event(client); client->status = NET_STATUS_ZOMBIE; return; } @@ -167,7 +167,7 @@ void proto_recv_hello_server(client_t * client, char *msg) #ifdef PUBLIC_SERVER if (supportVersion == NULL) { - supportVersion = publicServer_get_setting("SUPPORT_CLIENTS", "--support-clients", TUXANCI_VERSION); + supportVersion = public_server_get_setting("SUPPORT_CLIENTS", "--support-clients", TUXANCI_VERSION); } #endif @@ -185,7 +185,7 @@ void proto_recv_hello_server(client_t * client, char *msg) if (strstr(supportVersion, version) == NULL) { proto_send_error_server(PROTO_SEND_ONE, client, PROTO_ERROR_CODE_BAD_VERSION); - checkFront_event(client); + check_front_event(client); client->status = NET_STATUS_ZOMBIE; return; } @@ -219,14 +219,14 @@ void proto_send_status_server(int type, client_t * client) #endif #ifdef PUBLIC_SERVER - name = publicServer_get_setting("NAME", "--name", "noname"); + name = public_server_get_setting("NAME", "--name", "noname"); #endif version = TUXANCI_VERSION; clients = arena_get_current()->spaceTux->listIndex->count; maxclients = server_get_max_clients(); uptime = (unsigned int) server_get_update(); - arena = arenaFile_get_net_name(choiceArena_get()); + arena = arena_file_get_net_name(choice_arena_get()); snprintf(msg, STR_PROTO_SIZE, "name: %s\n" @@ -236,7 +236,7 @@ void proto_send_status_server(int type, client_t * client) "uptime: %d\n" "arena: %s\n", name, version, clients, maxclients, uptime, arena); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); //proto_send(type, client, msg); } @@ -257,7 +257,7 @@ void proto_send_listscore_server(int type, client_t * client, int max) strcpy(msg, ""); for (i = 0; i < max; i++) { - str = highScore_get_table(i); + str = high_score_get_table(i); if (str == NULL) { break; @@ -268,7 +268,7 @@ void proto_send_listscore_server(int type, client_t * client, int max) } //proto_send(type, client, msg); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); free(msg); } @@ -317,7 +317,7 @@ void proto_recv_check_server(client_t * client, char *msg) return; } - checkFront_del_msg(client->listSendMsg, id); + check_front_del_msg(client->listSendMsg, id); } void proto_send_init_server(int type, client_t * client, client_t * client2) @@ -331,17 +331,17 @@ void proto_send_init_server(int type, client_t * client, client_t * client2) count = WORLD_COUNT_ROUND_UNLIMITED; #ifndef PUBLIC_SERVER - publicServer_get_settingCountRound(&count); + public_server_get_settingCountRound(&count); #endif check_id = id_get_newcount(0); snprintf(msg, STR_PROTO_SIZE, "init %d %d %d %d %s %d\n", client2->tux->id, client2->tux->x, client2->tux->y, - count, arenaFile_get_net_name(choiceArena_get()), check_id); + count, arena_file_get_net_name(choice_arena_get()), check_id); //proto_send(type, client, msg); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id); } #ifndef PUBLIC_SERVER @@ -372,7 +372,7 @@ void proto_recv_init_client(char *msg) return; } - word_set_arena(arenaFile_get_file_format_net_name(arena_name)); + word_set_arena(arena_file_get_file_format_net_name(arena_name)); arena = arena_get_current(); arena->max_countRound = n; @@ -384,7 +384,7 @@ void proto_recv_init_client(char *msg) tux->control = TUX_CONTROL_KEYBOARD_RIGHT; word_set_control_tux(tux, TUX_CONTROL_KEYBOARD_RIGHT); - publicServer_get_settingNameRight(tux->name); + public_server_get_settingNameRight(tux->name); space_add(arena->spaceTux, tux); } @@ -399,7 +399,7 @@ proto_send_event_server(int type, client_t * client, tux_t * tux, int action) snprintf(msg, STR_PROTO_SIZE, "event %d %d\n", tux->id, action); //proto_send(type, client, msg); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); } #ifndef PUBLIC_SERVER @@ -491,7 +491,7 @@ void proto_send_newtux_server(int type, client_t * client, tux_t * tux) tux->shot[GUN_BOMBBALL], tux->bonus_time, tux->pickup_time); //proto_send(type, client, msg); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); } @@ -578,7 +578,7 @@ void proto_send_kill_server(int type, client_t * client, tux_t * tux) snprintf(msg, STR_PROTO_SIZE, "kill %d\n", tux->id); //proto_send(type, client, msg); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); } #ifndef PUBLIC_SERVER @@ -616,7 +616,7 @@ void proto_send_del_server(int type, client_t * client, int id) snprintf(msg, STR_PROTO_SIZE, "del %d %d\n", id, check_id); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id); //proto_check(type, client, msg, check_id); } @@ -704,7 +704,7 @@ void proto_send_additem_server(int type, client_t * client, item_t * p) //proto_send(type, client, msg); //proto_check(type, client, msg, check_id); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_CHECK, check_id); } #ifndef PUBLIC_SERVER @@ -764,7 +764,7 @@ void proto_send_shot_server(int type, client_t * client, shot_t * p) //proto_send(type, client, msg); //proto_check(type, client, msg, check_id); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); } #ifndef PUBLIC_SERVER @@ -836,7 +836,7 @@ void proto_recv_chat_server(client_t * client, char *msg) void proto_send_chat_server(int type, client_t * client, char *msg) { - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); #ifndef PUBLIC_SERVER proto_recv_chat_client(msg); @@ -892,7 +892,7 @@ void proto_send_module_server(int type, client_t * client, char *msg) strcat(out, "\n"); */ - sendMsg_to_client(type, client, out, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, out, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); } #ifndef PUBLIC_SERVER @@ -924,7 +924,7 @@ void proto_send_ping_server(int type, client_t * client) char msg[STR_PROTO_SIZE]; snprintf(msg, STR_PROTO_SIZE, "ping\n"); //proto_send(type, client, msg); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); } #ifndef PUBLIC_SERVER @@ -946,7 +946,7 @@ void proto_send_echo_server(int type, client_t * client, char *s) snprintf(msg, STR_PROTO_SIZE, "echo%s", s); //proto_send(type, client, msg); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); } void proto_send_end_server(int type, client_t * client) @@ -955,7 +955,7 @@ void proto_send_end_server(int type, client_t * client) snprintf(msg, STR_PROTO_SIZE, "end\n"); //proto_send(type, client, msg); - sendMsg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); + send_msg_to_client(type, client, msg, CHECK_FRONT_TYPE_SIMPLE, CHECK_FRONT_ID_NONE); } #ifndef PUBLIC_SERVER diff --git a/src/base/server.c b/src/base/server.c index ec1a920..16162d0 100644 --- a/src/base/server.c +++ b/src/base/server.c @@ -117,7 +117,7 @@ client_t *server_new_any_client() new->status = NET_STATUS_OK; new->listRecvMsg = list_new(); - new->listSendMsg = checkFront_new(); + new->listSendMsg = check_front_new(); new->listSeesShot = list_new(); new->protect = newProtect(); @@ -128,10 +128,10 @@ void server_destroy_any_client(client_t * p) { assert(p != NULL); - //checkFront_event(p); + //check_front_event(p); list_destroy_item(p->listRecvMsg, free); list_destroy_item(p->listSeesShot, free); - checkFront_destroy(p->listSendMsg); + check_front_destroy(p->listSendMsg); destroyProtect(p->protect); @@ -153,7 +153,7 @@ static void eventDelClientFromListClient(client_t * client) assert(offset != -1); - list_del_item(listClient, offset, serverUdp_destroy_client); + list_del_item(listClient, offset, server_udp_destroy_client); } static void delZombieCLient(void *p_nothink) @@ -169,7 +169,7 @@ static void delZombieCLient(void *p_nothink) if (isDown(thisClient->protect) == TRUE) { proto_send_end_server(PROTO_SEND_ONE, thisClient); - checkFront_event(thisClient); + check_front_event(thisClient); thisClient->status = NET_STATUS_ZOMBIE; } @@ -239,7 +239,7 @@ int server_init(char *ip4, int port4, char *ip6, int port6) server_set_time(); //printf("%s %d %s %d\n", ip4, port4, ip6, port6); - ret = serverUdp_init(ip4, port4, ip6, port6); + ret = server_udp_init(ip4, port4, ip6, port6); if (ret == 0) { return -1; @@ -247,11 +247,11 @@ int server_init(char *ip4, int port4, char *ip6, int port6) if( ip4 != NULL ) { - downServer_init(ip4, port4); + down_server_init(ip4, port4); } else if( ip6 != NULL ) { - downServer_init(ip6, port6); + down_server_init(ip6, port6); } return ret; @@ -334,7 +334,7 @@ static void porcesListClients() thisClient = (client_t *) listClient->list[i]; client_eventWorkRecvList(thisClient); - checkFront_event(thisClient); + check_front_event(thisClient); } } @@ -346,13 +346,13 @@ void server_event() do { select_restart(); - serverUdp_set_select(); - downServer_set_select(); + server_udp_set_select(); + down_server_set_select(); select_action(); - count = serverUdp_select_sock(); - downServer_select_socket(); + count = server_udp_select_sock(); + down_server_select_socket(); } while (count > 0); #endif @@ -361,14 +361,14 @@ void server_event() select_restart(); - serverUdp_set_select(); - downServer_set_select(); + server_udp_set_select(); + down_server_set_select(); ret = select_action(); if (ret > 0) { - serverUdp_select_sock(); - downServer_select_socket(); + server_udp_select_sock(); + down_server_select_socket(); } #endif @@ -382,11 +382,11 @@ void server_quit() assert(listClient != NULL); - list_destroy_item(listClient, serverUdp_destroy_client); + list_destroy_item(listClient, server_udp_destroy_client); timer_destroy(listServerTimer); - serverUdp_quit(); + server_udp_quit(); - downServer_quit(); + down_server_quit(); } diff --git a/src/base/serverSendMsg.c b/src/base/serverSendMsg.c index 53afb8b..b1a9559 100644 --- a/src/base/serverSendMsg.c +++ b/src/base/serverSendMsg.c @@ -20,7 +20,7 @@ static void addMsgClient(client_t * p, char *msg, int type, int id) assert(msg != NULL); if (p->status != NET_STATUS_ZOMBIE) { - checkFront_add_msg(p->listSendMsg, msg, type, id); + check_front_add_msg(p->listSendMsg, msg, type, id); } } @@ -106,7 +106,7 @@ static void addMsgAllClientSeesTux(char *msg, tux_t * tux, int type, int id) list_destroy(listHelp); } -void sendMsg_to_client(int type, client_t * client, char *msg, int type2, int id) +void send_msg_to_client(int type, client_t * client, char *msg, int type2, int id) { assert(msg != NULL); diff --git a/src/base/serverSendMsg.h b/src/base/serverSendMsg.h index 8239c7d..a4506cd 100644 --- a/src/base/serverSendMsg.h +++ b/src/base/serverSendMsg.h @@ -10,7 +10,7 @@ # define PROTO_SEND_BUT 3 # define PROTO_SEND_ALL_SEES_TUX 4 -extern void sendMsg_to_client(int type, client_t * client, char *msg, int type2, +extern void send_msg_to_client(int type, client_t * client, char *msg, int type2, int id); #endif diff --git a/src/base/shareFunction.c b/src/base/shareFunction.c index 5d16dd0..52fc48a 100644 --- a/src/base/shareFunction.c +++ b/src/base/shareFunction.c @@ -31,19 +31,19 @@ static void destroyShareFce(share_fce_item_t * p) free(p); } -void shareFunction_init() +void share_function_init() { listShareFce = list_new(); } -void shareFunction_add(char *name, void *function) +void share_function_add(char *name, void *function) { DEBUG_MSG(_("Adding \"%s\" to share function.\n"), name); list_add(listShareFce, newShareFceItem(name, function)); } -void *shareFunction_get(char *name) +void *share_function_get(char *name) { int i; @@ -59,7 +59,7 @@ void *shareFunction_get(char *name) return NULL; } -void shareFunction_quit() +void share_function_quit() { list_destroy_item(listShareFce, destroyShareFce); } diff --git a/src/base/shareFunction.h b/src/base/shareFunction.h index 80384a4..43d2ff3 100644 --- a/src/base/shareFunction.h +++ b/src/base/shareFunction.h @@ -2,8 +2,8 @@ #ifndef SHARE_FUNCTION_H # define SHARE_FUNCTION_H -extern void shareFunction_init(); -extern void shareFunction_add(char *name, void *function); -extern void *shareFunction_get(char *name); -extern void shareFunction_quit(); +extern void share_function_init(); +extern void share_function_add(char *name, void *function); +extern void *share_function_get(char *name); +extern void share_function_quit(); #endif diff --git a/src/base/shot.c b/src/base/shot.c index 38ebe5e..5d55f82 100644 --- a/src/base/shot.c +++ b/src/base/shot.c @@ -213,7 +213,7 @@ void shot_bound_bombBall(shot_t * shot) shot->py = getRandomCourse(shot->py, +10); shot->isCanKillAuthor = 1; - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { proto_send_shot_server(PROTO_SEND_ALL, NULL, shot); } } @@ -309,7 +309,7 @@ void shot_check_is_tux_screen(arena_t * arena) list_t *listClient; int i; - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_SERVER) { return; } diff --git a/src/base/tcp_server.c b/src/base/tcp_server.c index 6910b10..1635c1a 100644 --- a/src/base/tcp_server.c +++ b/src/base/tcp_server.c @@ -46,7 +46,7 @@ static sock_tcp_t *sock_server_tcp; static sock_tcp_t *sock_server_tcp_second; -client_t *serverTcp_new_client(sock_tcp_t * sock_tcp) +client_t *server_tcp_new_client(sock_tcp_t * sock_tcp) { client_t *new; @@ -71,7 +71,7 @@ client_t *serverTcp_new_client(sock_tcp_t * sock_tcp) return new; } -void serverTcp_send_client_buffer(client_t * client) +void server_tcp_send_client_buffer(client_t * client) { void *data; int len; @@ -96,10 +96,10 @@ void serverTcp_send_client_buffer(client_t * client) buffer_cut(client->sendBuffer, res); } -void serverTcp_destroy_client(client_t * client) +void server_tcp_destroy_client(client_t * client) { - checkFront_event(client); - serverTcp_send_client_buffer(client); + check_front_event(client); + server_tcp_send_client_buffer(client); #ifdef PUBLIC_SERVER char str_log[STR_LOG_SIZE]; @@ -118,7 +118,7 @@ void serverTcp_destroy_client(client_t * client) server_destroy_any_client(client); } -int serverTcp_init(char *ip4, int port4, char *ip6, int port6) +int server_tcp_init(char *ip4, int port4, char *ip6, int port6) { int ret; @@ -167,7 +167,7 @@ static void eventNewClient(sock_tcp_t * server_sock) sock_tcp_diable_nagle(sock); sock_tcp_set_non_block(sock); - client = serverTcp_new_client(sock); + client = server_tcp_new_client(sock); list_add(listClient, client); } @@ -196,7 +196,7 @@ static void eventTcpClient(client_t * client) } } -void serverTcp_set_select() +void server_tcp_set_select() { list_t *listClient; int i; @@ -224,7 +224,7 @@ void serverTcp_set_select() } } -int serverTcp_select_sock() +int server_tcp_select_sock() { list_t *listClient; int count; @@ -266,7 +266,7 @@ int serverTcp_select_sock() if( select_is_change_sock_for_write(client->socket_tcp->sock) ) { //printf("select_is_change_sock_for_write\n"); - serverTcp_send_client_buffer(client); + server_tcp_send_client_buffer(client); count++; } */ @@ -275,7 +275,7 @@ int serverTcp_select_sock() return count; } -void serverTcp_quit() +void server_tcp_quit() { if (sock_server_tcp != NULL) { DEBUG_MSG(_("Closing port: \"%d\"\n"), sock_tcp_get_port(sock_server_tcp)); diff --git a/src/base/tcp_server.h b/src/base/tcp_server.h index 8fdbedf..e206402 100644 --- a/src/base/tcp_server.h +++ b/src/base/tcp_server.h @@ -8,12 +8,12 @@ # define SERVER_TCP_BUFFER_LIMIT 4096 -extern client_t *serverTcp_new_client(sock_tcp_t * sock_tcp); -extern void serverTcp_destroy_client(client_t * p); -extern int serverTcp_init(char *ip4, int port4, char *ip6, int port6); -extern void serverTcp_set_select(); -extern int serverTcp_select_sock(); -extern void serverTcp_send_client_buffer(client_t * p); -extern void serverTcp_quit(); +extern client_t *server_tcp_new_client(sock_tcp_t * sock_tcp); +extern void server_tcp_destroy_client(client_t * p); +extern int server_tcp_init(char *ip4, int port4, char *ip6, int port6); +extern void server_tcp_set_select(); +extern int server_tcp_select_sock(); +extern void server_tcp_send_client_buffer(client_t * p); +extern void server_tcp_quit(); #endif diff --git a/src/base/textFile.c b/src/base/textFile.c index 5420e34..c09c879 100644 --- a/src/base/textFile.c +++ b/src/base/textFile.c @@ -9,7 +9,7 @@ #include "main.h" #include "textFile.h" -textFile_t *textFile_new(char *s) +textFile_t *text_file_new(char *s) { textFile_t *new; char path[STR_PATH_SIZE]; @@ -68,7 +68,7 @@ static void createLine(list_t * list, char *p, int len) * Nacita subor *s a vrati ho f * formatovany v type textFile_t* */ -textFile_t *textFile_load(char *s) +textFile_t *text_file_load(char *s) { FILE *file; textFile_t *ret; @@ -99,7 +99,7 @@ textFile_t *textFile_load(char *s) fclose(file); - ret = textFile_new(s); + ret = text_file_new(s); createLine(ret->text, p, file_length); free(p); @@ -111,7 +111,7 @@ textFile_t *textFile_load(char *s) * Zobrazi text ulozeny v *p * do stdout */ -void textFile_print(textFile_t * p) +void text_file_print(textFile_t * p) { int i; @@ -124,7 +124,7 @@ void textFile_print(textFile_t * p) } } -void textFile_save(textFile_t * p) +void text_file_save(textFile_t * p) { int i; FILE *file; @@ -144,7 +144,7 @@ void textFile_save(textFile_t * p) * Uvolni text ulozeny v type textFile_t* * z pamate. */ -void textFile_destroy(textFile_t * p) +void text_file_destroy(textFile_t * p) { assert(p != NULL); diff --git a/src/base/textFile.h b/src/base/textFile.h index 5af95e9..1ccad7e 100644 --- a/src/base/textFile.h +++ b/src/base/textFile.h @@ -14,11 +14,11 @@ typedef struct str_textFile_t { list_t *text; } textFile_t; -extern textFile_t *textFile_new(char *s); -extern textFile_t *textFile_load(char *s); -extern void textFile_print(textFile_t * p); -extern void textFile_save(textFile_t * p); -extern void textFile_destroy(textFile_t * p); +extern textFile_t *text_file_new(char *s); +extern textFile_t *text_file_load(char *s); +extern void text_file_print(textFile_t * p); +extern void text_file_save(textFile_t * p); +extern void text_file_destroy(textFile_t * p); #endif diff --git a/src/base/tux.c b/src/base/tux.c index 26f8cbb..aafc4fd 100644 --- a/src/base/tux.c +++ b/src/base/tux.c @@ -169,7 +169,7 @@ void tux_draw(tux_t * tux) assert(tux != NULL); if (tux->bonus == BONUS_HIDDEN && - netMultiplayer_get_game_type() != NET_GAME_TYPE_NONE && + net_multiplayer_get_game_type() != NET_GAME_TYPE_NONE && tux->control == TUX_CONTROL_NET) { return; } @@ -268,7 +268,7 @@ static void timer_spawnTux(void *p) item_add_new_item(arena->spaceItem, ID_UNKNOWN); - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux); } } @@ -327,12 +327,12 @@ void tux_event_tux_is_dead(tux_t * tux) tux->isCanShot = TRUE; tux->isCanSwitchGun = TRUE; - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { timer_add_task(arena_get_current()->listTimer, TIMER_ONE, timer_spawnTux, newInt(tux->id), TUX_TIME_SPAWN); } - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { proto_send_kill_server(PROTO_SEND_ALL, NULL, tux); } } @@ -342,7 +342,7 @@ static void tux_event_tux_is_deadWIthShot(tux_t * tux, shot_t * shot) if (shot->author_id == tux->id) { tux->score--; - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux); } } @@ -355,7 +355,7 @@ static void tux_event_tux_is_deadWIthShot(tux_t * tux, shot_t * shot) if (author != NULL) { author->score++; - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { proto_send_newtux_server(PROTO_SEND_ALL, NULL, author); } } @@ -374,13 +374,13 @@ void tux_teleport(tux_t * tux) sound_play("teleport", SOUND_GROUP_BASE); #endif - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { arena_find_free_space(arena_get_current(), &x, &y, TUX_WIDTH, TUX_HEIGHT); space_move_object(arena_get_current()->spaceTux, tux, x, y); //tux_set_proportion(tux, x, y); } - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux); } } @@ -397,7 +397,7 @@ static void bombBallExplosion(shot_t * shot) space_add(arena_get_current()->spaceItem, item); - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id); proto_send_additem_server(PROTO_SEND_ALL, NULL, item); } @@ -422,19 +422,19 @@ static void action_tux(space_t * space, tux_t * tux, shot_t * shot) } if (shot->gun == GUN_BOMBBALL) { - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { bombBallExplosion(shot); } return; } - if (netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { + if (net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { tux_event_tux_is_deadWIthShot(tux, shot); } } - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { proto_send_del_server(PROTO_SEND_ALL, NULL, shot->id); } @@ -448,7 +448,7 @@ static void action_shot(space_t * space, shot_t * shot, space_t * spaceTux) void tux_conflict_woth_shot(arena_t * arena) { - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) { // na skusku + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_CLIENT) { // na skusku return; } @@ -607,7 +607,7 @@ static void pickUpGun(tux_t * tux) tux->pickup_time++; } - if (tux->pickup_time == TUX_MAX_PICKUP && netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { + if (tux->pickup_time == TUX_MAX_PICKUP && net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { #ifndef NO_SOUND sound_play("switch_gun", SOUND_GROUP_BASE); #endif @@ -616,7 +616,7 @@ static void pickUpGun(tux_t * tux) tux->shot[tux->gun] = GUN_MAX_SHOT; tux->pickup_time = 0; - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux); } } @@ -630,7 +630,7 @@ static void eventBonus(tux_t * tux) tux->bonus_time--; } - if (tux->bonus_time == 0 && netMultiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { + if (tux->bonus_time == 0 && net_multiplayer_get_game_type() != NET_GAME_TYPE_CLIENT) { if (tux->bonus == BONUS_GHOST) { int x, y, w, h; tux_get_proportion(tux, &x, &y, &w, &h); @@ -646,7 +646,7 @@ static void eventBonus(tux_t * tux) tux->bonus = BONUS_NONE; - if (netMultiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { + if (net_multiplayer_get_game_type() == NET_GAME_TYPE_SERVER) { proto_send_newtux_server(PROTO_SEND_ALL, NULL, tux); } } diff --git a/src/base/udp_server.c b/src/base/udp_server.c index 3128992..5033162 100644 --- a/src/base/udp_server.c +++ b/src/base/udp_server.c @@ -46,7 +46,7 @@ static sock_udp_t *sock_server_udp; static sock_udp_t *sock_server_udp_second; -client_t *serverUdp_new_client(sock_udp_t * sock_udp) +client_t *server_udp_new_client(sock_udp_t * sock_udp) { client_t *new; @@ -68,9 +68,9 @@ client_t *serverUdp_new_client(sock_udp_t * sock_udp) return new; } -void serverUdp_destroy_client(client_t * p) +void server_udp_destroy_client(client_t * p) { - checkFront_event(p); + check_front_event(p); #ifdef PUBLIC_SERVER char str_log[STR_LOG_SIZE]; @@ -86,7 +86,7 @@ void serverUdp_destroy_client(client_t * p) server_destroy_any_client(p); } -int serverUdp_init(char *ip4, int port4, char *ip6, int port6) +int server_udp_init(char *ip4, int port4, char *ip6, int port6) { int ret; @@ -126,7 +126,7 @@ static void eventCreateNewUdpClient(sock_udp_t * socket_udp) listClient = server_get_list_clients(); - client = serverUdp_new_client(socket_udp); + client = server_udp_new_client(socket_udp); list_add(listClient, client); } @@ -196,7 +196,7 @@ static void client_eventUdpSelect(sock_udp_t * sock_server) list_add(client->listRecvMsg, strdup(listRecvMsg)); } -void serverUdp_set_select() +void server_udp_set_select() { if (sock_server_udp != NULL) { select_add_sock_for_read(sock_server_udp->sock); @@ -207,7 +207,7 @@ void serverUdp_set_select() } } -int serverUdp_select_sock() +int server_udp_select_sock() { int count; @@ -230,7 +230,7 @@ int serverUdp_select_sock() return count; } -void serverUdp_quit() +void server_udp_quit() { if (sock_server_udp != NULL) { DEBUG_MSG(_("Closing port: \"%d\"\n"), sock_udp_get_port(sock_server_udp)); diff --git a/src/base/udp_server.h b/src/base/udp_server.h index 4d0245c..9565aee 100644 --- a/src/base/udp_server.h +++ b/src/base/udp_server.h @@ -6,11 +6,11 @@ # include "server.h" # include "udp.h" -extern client_t *serverUdp_new_client(sock_udp_t * sock_udp); -extern void serverUdp_destroy_client(client_t * p); -extern int serverUdp_init(char *ip4, int port4, char *ip6, int port6); -extern void serverUdp_set_select(); -extern int serverUdp_select_sock(); -extern void serverUdp_quit(); +extern client_t *server_udp_new_client(sock_udp_t * sock_udp); +extern void server_udp_destroy_client(client_t * p); +extern int server_udp_init(char *ip4, int port4, char *ip6, int port6); +extern void server_udp_set_select(); +extern int server_udp_select_sock(); +extern void server_udp_quit(); #endif -- cgit v1.2.3