project_files/frontlib/extra/jnacontrol.c
changeset 10017 de822cd3df3a
parent 7691 55c0a856ecd0
equal deleted inserted replaced
10015:4feced261c68 10017:de822cd3df3a
    96 
    96 
    97 /*
    97 /*
    98  * Below here are the copypasted method declarations from the JNA bindings
    98  * Below here are the copypasted method declarations from the JNA bindings
    99  */
    99  */
   100 
   100 
   101 	// frontlib.h
   101     // frontlib.h
   102     int flib_init();
   102     int flib_init();
   103     void flib_quit();
   103     void flib_quit();
   104 
   104 
   105     // hwconsts.h
   105     // hwconsts.h
   106     int flib_get_teamcolor_count();
   106     int flib_get_teamcolor_count();
   107     int flib_get_hedgehogs_per_team();
   107     int flib_get_hedgehogs_per_team();
   108     int flib_get_weapons_count();
   108     int flib_get_weapons_count();
   109 	MetaschemePtr flib_get_metascheme();
   109     MetaschemePtr flib_get_metascheme();
   110 
   110 
   111     // net/netconn.h
   111     // net/netconn.h
   112 	NetconnPtr flib_netconn_create(String playerName, String dataDirPath, String host, int port);
   112     NetconnPtr flib_netconn_create(String playerName, String dataDirPath, String host, int port);
   113 	void flib_netconn_destroy(NetconnPtr conn);
   113     void flib_netconn_destroy(NetconnPtr conn);
   114 
   114 
   115 	void flib_netconn_tick(NetconnPtr conn);
   115     void flib_netconn_tick(NetconnPtr conn);
   116 	boolean flib_netconn_is_chief(NetconnPtr conn);
   116     boolean flib_netconn_is_chief(NetconnPtr conn);
   117 	String flib_netconn_get_playername(NetconnPtr conn);
   117     String flib_netconn_get_playername(NetconnPtr conn);
   118 	GameSetupPtr flib_netconn_create_gamesetup(NetconnPtr conn);
   118     GameSetupPtr flib_netconn_create_gamesetup(NetconnPtr conn);
   119 	int flib_netconn_send_quit(NetconnPtr conn, String quitmsg);
   119     int flib_netconn_send_quit(NetconnPtr conn, String quitmsg);
   120 	int flib_netconn_send_chat(NetconnPtr conn, String chat);
   120     int flib_netconn_send_chat(NetconnPtr conn, String chat);
   121 	int flib_netconn_send_teamchat(NetconnPtr conn, String msg);
   121     int flib_netconn_send_teamchat(NetconnPtr conn, String msg);
   122 	int flib_netconn_send_password(NetconnPtr conn, String passwd);
   122     int flib_netconn_send_password(NetconnPtr conn, String passwd);
   123 	int flib_netconn_send_nick(NetconnPtr conn, String nick);
   123     int flib_netconn_send_nick(NetconnPtr conn, String nick);
   124 	int flib_netconn_send_request_roomlist(NetconnPtr conn);
   124     int flib_netconn_send_request_roomlist(NetconnPtr conn);
   125 	int flib_netconn_send_joinRoom(NetconnPtr conn, String room);
   125     int flib_netconn_send_joinRoom(NetconnPtr conn, String room);
   126 	int flib_netconn_send_createRoom(NetconnPtr conn, String room);
   126     int flib_netconn_send_createRoom(NetconnPtr conn, String room);
   127 	int flib_netconn_send_renameRoom(NetconnPtr conn, String roomName);
   127     int flib_netconn_send_renameRoom(NetconnPtr conn, String roomName);
   128 	int flib_netconn_send_leaveRoom(NetconnPtr conn, String msg);
   128     int flib_netconn_send_leaveRoom(NetconnPtr conn, String msg);
   129 	int flib_netconn_send_toggleReady(NetconnPtr conn);
   129     int flib_netconn_send_toggleReady(NetconnPtr conn);
   130 	int flib_netconn_send_addTeam(NetconnPtr conn, TeamPtr team);
   130     int flib_netconn_send_addTeam(NetconnPtr conn, TeamPtr team);
   131 	int flib_netconn_send_removeTeam(NetconnPtr conn, String teamname);
   131     int flib_netconn_send_removeTeam(NetconnPtr conn, String teamname);
   132 	int flib_netconn_send_engineMessage(NetconnPtr conn, ByteArrayPtr message, NativeSizeT size);
   132     int flib_netconn_send_engineMessage(NetconnPtr conn, ByteArrayPtr message, NativeSizeT size);
   133 	int flib_netconn_send_teamHogCount(NetconnPtr conn, String teamname, int hogcount);
   133     int flib_netconn_send_teamHogCount(NetconnPtr conn, String teamname, int hogcount);
   134 	int flib_netconn_send_teamColor(NetconnPtr conn, String teamname, int colorIndex);
   134     int flib_netconn_send_teamColor(NetconnPtr conn, String teamname, int colorIndex);
   135 	int flib_netconn_send_weaponset(NetconnPtr conn, WeaponsetPtr weaponset);
   135     int flib_netconn_send_weaponset(NetconnPtr conn, WeaponsetPtr weaponset);
   136 	int flib_netconn_send_map(NetconnPtr conn, MapRecipePtr map);
   136     int flib_netconn_send_map(NetconnPtr conn, MapRecipePtr map);
   137 	int flib_netconn_send_mapName(NetconnPtr conn, String mapName);
   137     int flib_netconn_send_mapName(NetconnPtr conn, String mapName);
   138 	int flib_netconn_send_mapGen(NetconnPtr conn, int mapGen);
   138     int flib_netconn_send_mapGen(NetconnPtr conn, int mapGen);
   139 	int flib_netconn_send_mapTemplate(NetconnPtr conn, int templateFilter);
   139     int flib_netconn_send_mapTemplate(NetconnPtr conn, int templateFilter);
   140 	int flib_netconn_send_mapMazeSize(NetconnPtr conn, int mazeSize);
   140     int flib_netconn_send_mapMazeSize(NetconnPtr conn, int mazeSize);
   141 	int flib_netconn_send_mapSeed(NetconnPtr conn, String seed);
   141     int flib_netconn_send_mapSeed(NetconnPtr conn, String seed);
   142 	int flib_netconn_send_mapTheme(NetconnPtr conn, String theme);
   142     int flib_netconn_send_mapTheme(NetconnPtr conn, String theme);
   143 	int flib_netconn_send_mapDrawdata(NetconnPtr conn, ByteArrayPtr drawData, NativeSizeT size);
   143     int flib_netconn_send_mapDrawdata(NetconnPtr conn, ByteArrayPtr drawData, NativeSizeT size);
   144 	int flib_netconn_send_script(NetconnPtr conn, String scriptName);
   144     int flib_netconn_send_script(NetconnPtr conn, String scriptName);
   145 	int flib_netconn_send_scheme(NetconnPtr conn, SchemePtr scheme);
   145     int flib_netconn_send_scheme(NetconnPtr conn, SchemePtr scheme);
   146 	int flib_netconn_send_roundfinished(NetconnPtr conn, boolean withoutError);
   146     int flib_netconn_send_roundfinished(NetconnPtr conn, boolean withoutError);
   147 	int flib_netconn_send_ban(NetconnPtr conn, String playerName);
   147     int flib_netconn_send_ban(NetconnPtr conn, String playerName);
   148 	int flib_netconn_send_kick(NetconnPtr conn, String playerName);
   148     int flib_netconn_send_kick(NetconnPtr conn, String playerName);
   149 	int flib_netconn_send_playerInfo(NetconnPtr conn, String playerName);
   149     int flib_netconn_send_playerInfo(NetconnPtr conn, String playerName);
   150 	int flib_netconn_send_playerFollow(NetconnPtr conn, String playerName);
   150     int flib_netconn_send_playerFollow(NetconnPtr conn, String playerName);
   151 	int flib_netconn_send_startGame(NetconnPtr conn);
   151     int flib_netconn_send_startGame(NetconnPtr conn);
   152 	int flib_netconn_send_toggleRestrictJoins(NetconnPtr conn);
   152     int flib_netconn_send_toggleRestrictJoins(NetconnPtr conn);
   153 	int flib_netconn_send_toggleRestrictTeams(NetconnPtr conn);
   153     int flib_netconn_send_toggleRestrictTeams(NetconnPtr conn);
   154 	int flib_netconn_send_clearAccountsCache(NetconnPtr conn);
   154     int flib_netconn_send_clearAccountsCache(NetconnPtr conn);
   155 	int flib_netconn_send_setServerVar(NetconnPtr conn, String name, String value);
   155     int flib_netconn_send_setServerVar(NetconnPtr conn, String name, String value);
   156 	int flib_netconn_send_getServerVars(NetconnPtr conn);
   156     int flib_netconn_send_getServerVars(NetconnPtr conn);
   157 
   157 
   158 	void flib_netconn_onMessage(NetconnPtr conn, IntStrCallback callback, Pointer context);
   158     void flib_netconn_onMessage(NetconnPtr conn, IntStrCallback callback, Pointer context);
   159 	void flib_netconn_onClientFlags(NetconnPtr conn, StrStrBoolCallback callback, Pointer context);
   159     void flib_netconn_onClientFlags(NetconnPtr conn, StrStrBoolCallback callback, Pointer context);
   160 	void flib_netconn_onChat(NetconnPtr conn, StrStrCallback callback, Pointer context);
   160     void flib_netconn_onChat(NetconnPtr conn, StrStrCallback callback, Pointer context);
   161 	void flib_netconn_onConnected(NetconnPtr conn, VoidCallback callback, Pointer context);
   161     void flib_netconn_onConnected(NetconnPtr conn, VoidCallback callback, Pointer context);
   162 	void flib_netconn_onDisconnected(NetconnPtr conn, IntStrCallback callback, Pointer context);
   162     void flib_netconn_onDisconnected(NetconnPtr conn, IntStrCallback callback, Pointer context);
   163 	void flib_netconn_onRoomlist(NetconnPtr conn, RoomListCallback callback, Pointer context);
   163     void flib_netconn_onRoomlist(NetconnPtr conn, RoomListCallback callback, Pointer context);
   164 	void flib_netconn_onRoomAdd(NetconnPtr conn, RoomCallback callback, Pointer context);
   164     void flib_netconn_onRoomAdd(NetconnPtr conn, RoomCallback callback, Pointer context);
   165 	void flib_netconn_onRoomDelete(NetconnPtr conn, StrCallback callback, Pointer context);
   165     void flib_netconn_onRoomDelete(NetconnPtr conn, StrCallback callback, Pointer context);
   166 	void flib_netconn_onRoomUpdate(NetconnPtr conn, StrRoomCallback callback, Pointer context);
   166     void flib_netconn_onRoomUpdate(NetconnPtr conn, StrRoomCallback callback, Pointer context);
   167 	void flib_netconn_onLobbyJoin(NetconnPtr conn, StrCallback callback, Pointer context);
   167     void flib_netconn_onLobbyJoin(NetconnPtr conn, StrCallback callback, Pointer context);
   168 	void flib_netconn_onLobbyLeave(NetconnPtr conn, StrStrCallback callback, Pointer context);
   168     void flib_netconn_onLobbyLeave(NetconnPtr conn, StrStrCallback callback, Pointer context);
   169 	void flib_netconn_onNickTaken(NetconnPtr conn, StrCallback callback, Pointer context);
   169     void flib_netconn_onNickTaken(NetconnPtr conn, StrCallback callback, Pointer context);
   170 	void flib_netconn_onPasswordRequest(NetconnPtr conn, StrCallback callback, Pointer context);
   170     void flib_netconn_onPasswordRequest(NetconnPtr conn, StrCallback callback, Pointer context);
   171 	void flib_netconn_onEnterRoom(NetconnPtr conn, BoolCallback callback, Pointer context);
   171     void flib_netconn_onEnterRoom(NetconnPtr conn, BoolCallback callback, Pointer context);
   172 	void flib_netconn_onLeaveRoom(NetconnPtr conn, IntStrCallback callback, Pointer context);
   172     void flib_netconn_onLeaveRoom(NetconnPtr conn, IntStrCallback callback, Pointer context);
   173 	void flib_netconn_onTeamAdd(NetconnPtr conn, TeamCallback callback, Pointer context);
   173     void flib_netconn_onTeamAdd(NetconnPtr conn, TeamCallback callback, Pointer context);
   174 	void flib_netconn_onTeamDelete(NetconnPtr conn, StrCallback callback, Pointer context);
   174     void flib_netconn_onTeamDelete(NetconnPtr conn, StrCallback callback, Pointer context);
   175 	void flib_netconn_onRoomJoin(NetconnPtr conn, StrCallback callback, Pointer context);
   175     void flib_netconn_onRoomJoin(NetconnPtr conn, StrCallback callback, Pointer context);
   176 	void flib_netconn_onRoomLeave(NetconnPtr conn, StrStrCallback callback, Pointer context);
   176     void flib_netconn_onRoomLeave(NetconnPtr conn, StrStrCallback callback, Pointer context);
   177 	void flib_netconn_onRunGame(NetconnPtr conn, VoidCallback callback, Pointer context);
   177     void flib_netconn_onRunGame(NetconnPtr conn, VoidCallback callback, Pointer context);
   178 	void flib_netconn_onTeamAccepted(NetconnPtr conn, StrCallback callback, Pointer context);
   178     void flib_netconn_onTeamAccepted(NetconnPtr conn, StrCallback callback, Pointer context);
   179 	void flib_netconn_onHogCountChanged(NetconnPtr conn, StrIntCallback callback, Pointer context);
   179     void flib_netconn_onHogCountChanged(NetconnPtr conn, StrIntCallback callback, Pointer context);
   180 	void flib_netconn_onTeamColorChanged(NetconnPtr conn, StrIntCallback callback, Pointer context);
   180     void flib_netconn_onTeamColorChanged(NetconnPtr conn, StrIntCallback callback, Pointer context);
   181 	void flib_netconn_onEngineMessage(NetconnPtr conn, BytesCallback callback, Pointer context);
   181     void flib_netconn_onEngineMessage(NetconnPtr conn, BytesCallback callback, Pointer context);
   182 	void flib_netconn_onSchemeChanged(NetconnPtr conn, SchemeCallback callback, Pointer context);
   182     void flib_netconn_onSchemeChanged(NetconnPtr conn, SchemeCallback callback, Pointer context);
   183 	void flib_netconn_onMapChanged(NetconnPtr conn, MapIntCallback callback, Pointer context);
   183     void flib_netconn_onMapChanged(NetconnPtr conn, MapIntCallback callback, Pointer context);
   184 	void flib_netconn_onScriptChanged(NetconnPtr conn, StrCallback callback, Pointer context);
   184     void flib_netconn_onScriptChanged(NetconnPtr conn, StrCallback callback, Pointer context);
   185 	void flib_netconn_onWeaponsetChanged(NetconnPtr conn, WeaponsetCallback callback, Pointer context);
   185     void flib_netconn_onWeaponsetChanged(NetconnPtr conn, WeaponsetCallback callback, Pointer context);
   186 	void flib_netconn_onServerVar(NetconnPtr conn, StrStrCallback callback, Pointer context);
   186     void flib_netconn_onServerVar(NetconnPtr conn, StrStrCallback callback, Pointer context);
   187 
   187 
   188 	// ipc/gameconn.h
   188     // ipc/gameconn.h
   189 
   189 
   190 	GameconnPtr flib_gameconn_create(String playerName, GameSetupPtr setup, boolean netgame);
   190     GameconnPtr flib_gameconn_create(String playerName, GameSetupPtr setup, boolean netgame);
   191 	GameconnPtr flib_gameconn_create_playdemo(ByteArrayPtr demo, NativeSizeT size);
   191     GameconnPtr flib_gameconn_create_playdemo(ByteArrayPtr demo, NativeSizeT size);
   192 	GameconnPtr flib_gameconn_create_loadgame(String playerName, ByteArrayPtr save, NativeSizeT size);
   192     GameconnPtr flib_gameconn_create_loadgame(String playerName, ByteArrayPtr save, NativeSizeT size);
   193 	GameconnPtr flib_gameconn_create_campaign(String playerName, String seed, String script);
   193     GameconnPtr flib_gameconn_create_campaign(String playerName, String seed, String script);
   194 
   194 
   195 	void flib_gameconn_destroy(GameconnPtr conn);
   195     void flib_gameconn_destroy(GameconnPtr conn);
   196 	int flib_gameconn_getport(GameconnPtr conn);
   196     int flib_gameconn_getport(GameconnPtr conn);
   197 	void flib_gameconn_tick(GameconnPtr conn);
   197     void flib_gameconn_tick(GameconnPtr conn);
   198 
   198 
   199 	int flib_gameconn_send_enginemsg(GameconnPtr conn, ByteArrayPtr data, NativeSizeT len);
   199     int flib_gameconn_send_enginemsg(GameconnPtr conn, ByteArrayPtr data, NativeSizeT len);
   200 	int flib_gameconn_send_textmsg(GameconnPtr conn, int msgtype, String msg);
   200     int flib_gameconn_send_textmsg(GameconnPtr conn, int msgtype, String msg);
   201 	int flib_gameconn_send_chatmsg(GameconnPtr conn, String playername, String msg);
   201     int flib_gameconn_send_chatmsg(GameconnPtr conn, String playername, String msg);
   202 	int flib_gameconn_send_quit(GameconnPtr conn);
   202     int flib_gameconn_send_quit(GameconnPtr conn);
   203 	int flib_gameconn_send_cmd(GameconnPtr conn, String cmdString);
   203     int flib_gameconn_send_cmd(GameconnPtr conn, String cmdString);
   204 
   204 
   205 	void flib_gameconn_onConnect(GameconnPtr conn, VoidCallback callback, Pointer context);
   205     void flib_gameconn_onConnect(GameconnPtr conn, VoidCallback callback, Pointer context);
   206 	void flib_gameconn_onDisconnect(GameconnPtr conn, IntCallback callback, Pointer context);
   206     void flib_gameconn_onDisconnect(GameconnPtr conn, IntCallback callback, Pointer context);
   207 	void flib_gameconn_onErrorMessage(GameconnPtr conn, StrCallback callback, Pointer context);
   207     void flib_gameconn_onErrorMessage(GameconnPtr conn, StrCallback callback, Pointer context);
   208 	void flib_gameconn_onChat(GameconnPtr conn, StrBoolCallback callback, Pointer context);
   208     void flib_gameconn_onChat(GameconnPtr conn, StrBoolCallback callback, Pointer context);
   209 	void flib_gameconn_onGameRecorded(GameconnPtr conn, BytesBoolCallback callback, Pointer context);
   209     void flib_gameconn_onGameRecorded(GameconnPtr conn, BytesBoolCallback callback, Pointer context);
   210 	void flib_gameconn_onEngineMessage(GameconnPtr conn, BytesCallback callback, Pointer context);
   210     void flib_gameconn_onEngineMessage(GameconnPtr conn, BytesCallback callback, Pointer context);
   211 
   211 
   212 	// ipc/mapconn.h
   212     // ipc/mapconn.h
   213 	MapconnPtr flib_mapconn_create(MapRecipePtr mapdesc);
   213     MapconnPtr flib_mapconn_create(MapRecipePtr mapdesc);
   214 	void flib_mapconn_destroy(MapconnPtr conn);
   214     void flib_mapconn_destroy(MapconnPtr conn);
   215 	int flib_mapconn_getport(MapconnPtr conn);
   215     int flib_mapconn_getport(MapconnPtr conn);
   216 	void flib_mapconn_onSuccess(MapconnPtr conn, MapimageCallback callback, Pointer context);
   216     void flib_mapconn_onSuccess(MapconnPtr conn, MapimageCallback callback, Pointer context);
   217 	void flib_mapconn_onFailure(MapconnPtr conn, StrCallback callback, Pointer context);
   217     void flib_mapconn_onFailure(MapconnPtr conn, StrCallback callback, Pointer context);
   218 	void flib_mapconn_tick(MapconnPtr conn);
   218     void flib_mapconn_tick(MapconnPtr conn);
   219 
   219 
   220 	// model/schemelist.h
   220     // model/schemelist.h
   221 	SchemelistPtr flib_schemelist_from_ini(String filename);
   221     SchemelistPtr flib_schemelist_from_ini(String filename);
   222 	int flib_schemelist_to_ini(String filename, SchemelistPtr list);
   222     int flib_schemelist_to_ini(String filename, SchemelistPtr list);
   223 	void flib_schemelist_destroy(SchemelistPtr list);
   223     void flib_schemelist_destroy(SchemelistPtr list);
   224 
   224 
   225 	// model/team.h
   225     // model/team.h
   226 	TeamPtr flib_team_from_ini(String filename);
   226     TeamPtr flib_team_from_ini(String filename);
   227 	int flib_team_to_ini(String filename, TeamPtr team);
   227     int flib_team_to_ini(String filename, TeamPtr team);
   228 	void flib_team_destroy(TeamPtr team);
   228     void flib_team_destroy(TeamPtr team);
   229 
   229 
   230 	// model/weapon.h
   230     // model/weapon.h
   231 	WeaponsetListPtr flib_weaponsetlist_from_ini(String filename);
   231     WeaponsetListPtr flib_weaponsetlist_from_ini(String filename);
   232 	int flib_weaponsetlist_to_ini(String filename, WeaponsetListPtr weaponsets);
   232     int flib_weaponsetlist_to_ini(String filename, WeaponsetListPtr weaponsets);
   233 	void flib_weaponsetlist_destroy(WeaponsetListPtr list);
   233     void flib_weaponsetlist_destroy(WeaponsetListPtr list);
   234 
   234 
   235 	// model/gamesetup.h
   235     // model/gamesetup.h
   236 	void flib_gamesetup_destroy(GameSetupPtr gamesetup);
   236     void flib_gamesetup_destroy(GameSetupPtr gamesetup);
   237 
   237 
   238 	// util/logging.h
   238     // util/logging.h
   239     void flib_log_setLevel(int level);
   239     void flib_log_setLevel(int level);
   240     void flib_log_setCallback(LogCallback callback);
   240     void flib_log_setCallback(LogCallback callback);