project_files/frontlib/ipc/gameconn.c
changeset 7482 d70a5b0d1190
parent 7320 e704706008d4
child 7576 65d29988fd3d
--- a/project_files/frontlib/ipc/gameconn.c	Sun Aug 12 22:21:09 2012 +0200
+++ b/project_files/frontlib/ipc/gameconn.c	Sun Aug 12 22:37:57 2012 +0200
@@ -117,14 +117,14 @@
 	return result;
 }
 
-flib_gameconn *flib_gameconn_create_playdemo(const uint8_t *demo, size_t size) {
-	if(log_badargs_if(demo==NULL && size>0)) {
+flib_gameconn *flib_gameconn_create_playdemo(const uint8_t *demoFileContent, size_t size) {
+	if(log_badargs_if(demoFileContent==NULL && size>0)) {
 		return NULL;
 	}
 	flib_gameconn *result = NULL;
 	flib_gameconn *tempConn = flib_gameconn_create_partial(false, "Player", false);
 	if(tempConn) {
-		if(!flib_vector_append(tempConn->configBuffer, demo, size)) {
+		if(!flib_vector_append(tempConn->configBuffer, demoFileContent, size)) {
 			result = tempConn;
 			tempConn = NULL;
 		}
@@ -133,14 +133,14 @@
 	return result;
 }
 
-flib_gameconn *flib_gameconn_create_loadgame(const char *playerName, const uint8_t *save, size_t size) {
-	if(log_badargs_if(save==NULL && size>0)) {
+flib_gameconn *flib_gameconn_create_loadgame(const char *playerName, const uint8_t *saveFileContent, size_t size) {
+	if(log_badargs_if(saveFileContent==NULL && size>0)) {
 		return NULL;
 	}
 	flib_gameconn *result = NULL;
 	flib_gameconn *tempConn = flib_gameconn_create_partial(true, playerName, false);
 	if(tempConn) {
-		if(!flib_vector_append(tempConn->configBuffer, save, size)) {
+		if(!flib_vector_append(tempConn->configBuffer, saveFileContent, size)) {
 			result = tempConn;
 			tempConn = NULL;
 		}
@@ -280,6 +280,18 @@
 	return -1;
 }
 
+int flib_gameconn_send_quit(flib_gameconn *conn) {
+	if(log_badargs_if(conn==NULL)) {
+		return -1;
+	}
+	const char *msg = "\x07""efinish";
+	if(!flib_ipcbase_send_raw(conn->ipcBase, msg, msg[0]+1)) {
+		demo_append(conn, msg, msg[0]+1);
+		return 0;
+	}
+	return -1;
+}
+
 /**
  * This macro generates a callback setter function. It uses the name of the callback to
  * automatically generate the function name and the fields to set, so a consistent naming