00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #undef DEF_ACTION
00013 #define DEF_ACTION(name,code,args,prepfn,NETPREPFN,dofn,checkfn,ARGDECL,doc) \
00014 extern int NETPREPFN ARGDECL;
00015
00016 #include "action.def"
00017
00018 #undef DEF_TASK
00019 #define DEF_TASK(name,dname,code,argtypes,dofn,createfn,setfn,NETSETFN,pushfn,NETPUSHFN,ARGDECL) \
00020 extern void NETSETFN ARGDECL; \
00021 extern void NETPUSHFN ARGDECL;
00022
00023 #include "task.def"
00024
00025
00026
00027 #define MAXPACKETS 32767
00028
00029
00030
00031
00032
00033 extern void net_set_side_ai(Side *side, char *aitype);
00034
00035
00036
00037 extern void net_set_variant_value(int which, int v1, int v2, int v3);
00038
00039
00040
00041 extern int net_add_side_and_player(void);
00042 extern int net_remove_side_and_player(int s);
00043 extern void net_set_player_advantage(int n, int newadv);
00044 extern void net_rename_side_for_player(int n, int which);
00045 extern void net_set_ai_for_player(int n, char *aitype);
00046 extern int net_exchange_players(int n, int n2);
00047
00048
00049
00050 extern void net_request_additional_side(char *playerspec);
00051
00052
00053
00054 extern int net_run_game(int maxactions);
00055 extern void net_finish_turn(Side *side);
00056 extern void net_resign_game(Side *side, Side *side2);
00057
00058
00059
00060 extern void net_set_side_name(Side *side, Side *side2, char *newname);
00061 extern void net_set_side_longname(Side *side, Side *side2, char *newname);
00062 extern void net_set_side_shortname(Side *side, Side *side2, char *newname);
00063 extern void net_set_side_noun(Side *side, Side *side2, char *newname);
00064 extern void net_set_side_pluralnoun(Side *side, Side *side2, char *newname);
00065 extern void net_set_side_adjective(Side *side, Side *side2, char *newname);
00066 extern void net_set_side_emblemname(Side *side, Side *side2, char *newname);
00067 extern void net_set_side_colorscheme(Side *side, Side *side2, char *newname);
00068 extern void net_become_designer(Side *side);
00069 extern void net_become_nondesigner(Side *side);
00070 extern void net_set_trust(Side *side, Side *side2, int val);
00071 extern void net_set_autofinish(Side *side, int value);
00072 extern void net_set_autoresearch(Side *side, int value);
00073 extern void net_set_willing_to_save(Side *side, int flag);
00074 extern void net_set_willing_to_draw(Side *side, int flag);
00075 extern void net_send_message(Side *side, SideMask sidemask, char *str);
00076 extern void net_set_side_self_unit(Side *side, struct a_unit *unit);
00077 extern void net_set_doctrine(Side *side, char *spec);
00078 extern void net_set_controlled_by(Side *side, Side *side2, int val);
00079 extern void net_set_side_research_topic(Side *side, int a);
00080 extern void net_set_side_research_goal(Side *side, int a);
00081 extern void net_set_side_startx(Side *side, int x);
00082 extern void net_set_side_starty(Side *side, int y);
00083
00084 #ifdef DESIGNERS
00085 extern void net_paint_view(Side *side, int x, int y, int r, int tview, int uview);
00086 #endif
00087
00088
00089
00090 extern void net_set_unit_plan_type(Side *side, Unit *unit, int type);
00091 extern void net_set_unit_asleep(Side *side, Unit *unit, int flag, int recurse);
00092 extern void net_set_unit_reserve(Side *side, Unit *unit, int flag, int recurse);
00093 extern void net_set_unit_ai_control(Side *side, Unit *unit, int flag, int recurse);
00094 extern void net_set_unit_main_goal(Side *side, Unit *unit, Goal *goal);
00095 extern void net_set_unit_curadvance(Side *side, Unit *unit, int a);
00096 extern void net_set_unit_researchdone(Side *side, Unit *unit, int flag);
00097 extern void net_set_unit_waiting_for_transport(Side *side, Unit *unit, int flag);
00098 extern void net_wake_unit(Side *side, Unit *unit, int wakeocc);
00099 extern void net_wake_area(Side *side, int x, int y, int n, int occs);
00100 extern void net_set_formation(Unit *unit, Unit *leader, int x, int y, int dist, int flex);
00101 extern void net_delay_unit(Unit *unit, int flag);
00102 extern int net_clear_task_agenda(Side *side, Unit *unit);
00103 extern int net_clear_task_outcome(Side *side, Unit *unit);
00104 extern void net_force_replan(Unit *unit);
00105
00106
00107
00108 extern void net_set_unit_name(Side *side, Unit *unit, char *newname);
00109 extern int net_disband_unit(Side *side, Unit *unit);
00110
00111 #ifdef DESIGNERS
00112 extern Unit *net_designer_create_unit(Side *side, int u, int s, int x, int y);
00113 extern int net_designer_teleport(Unit *unit, int x, int y, Unit *other);
00114 extern int net_designer_change_side(Unit *unit, Side *side);
00115 extern int net_designer_disband(Unit *unit);
00116 #endif
00117
00118
00119
00120 extern void net_add_task(Unit *unit, int pos, Task *task);
00121
00122
00123
00124 extern Feature *net_create_feature(char *feattype, char *name);
00125 extern void net_set_feature_type_name(Feature *feature, char *feattype);
00126 extern void net_set_feature_name(Feature *feature, char *name);
00127 extern void net_destroy_feature(Feature *feature);
00128 extern void net_renumber_features(void);
00129
00130 #ifdef DESIGNERS
00131 extern void net_paint_cell(Side *side, int x, int y, int r, int t);
00132 extern void net_paint_border(Side *side, int x, int y, int dir, int t, int mode);
00133 extern void net_paint_connection(Side *side, int x, int y, int dir, int t, int mode);
00134 extern void net_paint_coating(Side *side, int x, int y, int r, int t, int depth);
00135 extern void net_paint_people(Side *side, int x, int y, int r, int s);
00136 extern void net_paint_control(Side *side, int x, int y, int r, int s);
00137 extern void net_paint_feature(Side *side, int x, int y, int r, int f);
00138 extern void net_paint_elevation(Side *side, int x, int y, int r, int code, int elev, int vary);
00139 extern void net_paint_temperature(Side *side, int x, int y, int r, int temp);
00140 extern void net_paint_material(Side *side, int x, int y, int r, int m, int amt);
00141 extern void net_paint_clouds(Side *side, int x, int y, int r, int cloudtype, int bot, int hgt);
00142 extern void net_paint_winds(Side *side, int x, int y, int r, int dir, int force);
00143
00144
00145
00146 extern void fix_elevations(void);
00147
00148 #endif
00149
00150
00151
00152 extern void net_toggle_user_at(int u, int x, int y);
00153
00154
00155
00156 extern int send_join(char *str);
00157 extern void receive_data(int timeout, int lim);
00158 extern int host_the_game(char *hostport);
00159 extern int try_join_game(char *hostport);
00160 extern void net_save_game(char *fname);
00161
00162
00163
00164 extern void send_version(int rid);
00165 extern void broadcast_game_module(void);
00166 extern void net_send_chat(int rid, char *str);
00167 extern int game_checksum(void);
00168 extern void send_quit(void);
00169 extern void flush_outgoing_queue(void);
00170
00171 extern void (*update_variant_callback)(int which);
00172 extern void (*update_assignment_callback)(int n);
00173
00174
00175
00176 extern void net_update_player(Player *player);
00177
00178
00179
00180
00181 extern void download_to_player(Player *player);
00182
00183
00184
00185 extern void broadcast_randstate(void);
00186
00187
00188
00189 extern void add_remote_locally(int rid, char *str);
00190 extern void send_chat(int rid, char *str);
00191 extern void make_default_player_spec(void);