project_files/frontlib/ipc/demo.h
author Medo <smaxein@googlemail.com>
Sat, 09 Jun 2012 03:28:38 +0200
changeset 7179 f84805e6df03
parent 7177 bf6cf4dd847a
permissions -rw-r--r--
Implemented game launching API for the frontlib. It is still buggy though, and not all game settings can be conveniently created/modified yet.

/**
 * Demo recording functions. Only used by the ipc game code.
 */

#ifndef DEMO_H_
#define DEMO_H_

#include "../util/buffer.h"

/**
 * Record a message sent from the engine to the frontend.
 * Returns 0 for OK, a negative value on error.
 * Don't pass NULL.
 */
int flib_demo_record_from_engine(flib_vector demoBuffer, const uint8_t *message, const char *playerName);

/**
 * Record a message sent from the frontend to the engine.
 * Returns 0 for OK, a negative value on error.
 * Don't pass NULL.
 */
int flib_demo_record_to_engine(flib_vector demoBuffer, const uint8_t *message, size_t len);

/**
 * Replace game mode messages ("TL", "TD", "TS", "TN") in the recording to mirror
 * the intended use. Pass 'S' for savegames, 'D' for demos.
 */
void flib_demo_replace_gamemode(flib_buffer buf, char gamemode);

#endif /* DEMO_H_ */