project_files/frontlib/ipc.h
author Medo <smaxein@googlemail.com>
Fri, 08 Jun 2012 19:52:24 +0200
changeset 7177 bf6cf4dd847a
parent 7175 038e3415100a
permissions -rw-r--r--
Implemented public API for letting the engine render maps
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7173
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
     1
#ifndef IPC_H_
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
     2
#define IPC_H_
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
     3
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
     4
#include "buffer.h"
7177
bf6cf4dd847a Implemented public API for letting the engine render maps
Medo <smaxein@googlemail.com>
parents: 7175
diff changeset
     5
#include "model/weapon.h"
7173
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
     6
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
     7
#include <stddef.h>
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
     8
#include <stdint.h>
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
     9
#include <stdbool.h>
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    10
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    11
struct _flib_ipc;
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    12
typedef struct _flib_ipc *flib_ipc;
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    13
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    14
typedef enum {
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    15
	GAME_END_FINISHED,
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    16
	GAME_END_INTERRUPTED,
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    17
	GAME_END_HALTED
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    18
} flib_GameEndType;
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    19
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    20
flib_ipc flib_ipc_create(bool recordDemo, const char *localPlayerName);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    21
void flib_ipc_destroy(flib_ipc *ipcptr);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    22
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    23
void flib_ipc_onConnect(flib_ipc ipc, void (*callback)(void* context), void* context);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    24
void flib_ipc_onDisconnect(flib_ipc ipc, void (*callback)(void* context), void* context);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    25
void flib_ipc_onConfigQuery(flib_ipc ipc, void (*callback)(void* context), void* context);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    26
void flib_ipc_onEngineError(flib_ipc ipc, void (*callback)(void* context, const uint8_t *error), void* context);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    27
void flib_ipc_onGameEnd(flib_ipc ipc, void (*callback)(void* context, int gameEndType), void* context);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    28
void flib_ipc_onChat(flib_ipc ipc, void (*callback)(void* context, const uint8_t *messagestr, int teamchat), void* context);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    29
void flib_ipc_onEngineMessage(flib_ipc ipc, void (*callback)(void* context, const uint8_t *message, int len), void* context);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    30
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    31
int flib_ipc_send_raw(flib_ipc ipc, void *data, size_t len);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    32
int flib_ipc_send_message(flib_ipc ipc, void *data, size_t len);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    33
int flib_ipc_send_messagestr(flib_ipc ipc, char *data);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    34
7175
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    35
// Configuration
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    36
int flib_ipc_send_seed(flib_ipc ipc, const char *seed);
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    37
int flib_ipc_send_script(flib_ipc ipc, const char *scriptpath);
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    38
int flib_ipc_send_map_regular(flib_ipc ipc, const char *theme, int templateFilter);
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    39
int flib_ipc_send_map_maze(flib_ipc ipc, const char *theme, int mazeType);
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    40
int flib_ipc_send_map_drawn(flib_ipc ipc, const char *theme, void *drawnMapData, size_t drawnMapDataLen);
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    41
int flib_ipc_send_map_named(flib_ipc ipc, const char *mappath);
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    42
int flib_ipc_send_gamemods(flib_ipc ipc, uint32_t modflags);
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    43
int flib_ipc_send_gamesetting(flib_ipc ipc, const char *settingname, int modflags);
7177
bf6cf4dd847a Implemented public API for letting the engine render maps
Medo <smaxein@googlemail.com>
parents: 7175
diff changeset
    44
int flib_ipc_send_weaponset(flib_ipc ipc, flib_weaponset *set);
7175
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    45
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    46
int flib_ipc_send_conf_end(flib_ipc ipc);
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    47
038e3415100a Added ini reading/writing for game schemes to the frontend lib
Medo <smaxein@googlemail.com>
parents: 7173
diff changeset
    48
7173
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    49
uint16_t flib_ipc_port(flib_ipc ipc);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    50
flib_constbuffer flib_ipc_getdemo(flib_ipc ipc);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    51
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    52
void flib_ipc_tick(flib_ipc ipc);
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    53
7c2eb284f9f1 Frontlib: Work on the callback mechanisms for IPC
Medo <smaxein@googlemail.com>
parents:
diff changeset
    54
#endif /* IPC_H_ */