From f43dc63f9820ba0d3ff30efd2c45bf6dc5d2af51 Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Sun, 12 Feb 2012 00:08:53 +1000 Subject: New sendBack and sendForth global functions. --- LuaSL/src/LuaSL_utilities.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'LuaSL/src/LuaSL_utilities.c') diff --git a/LuaSL/src/LuaSL_utilities.c b/LuaSL/src/LuaSL_utilities.c index d73c06d..ab4ea65 100644 --- a/LuaSL/src/LuaSL_utilities.c +++ b/LuaSL/src/LuaSL_utilities.c @@ -66,6 +66,24 @@ char *getDateTime(struct tm **nowOut, char *dateOut, time_t *timeOut) return (dateTime); } +void sendBack(gameGlobals *game, Ecore_Con_Client *client, const char *SID, const char *message) +{ + char buf[PATH_MAX]; + + sprintf(buf, "%s.%s\n", SID, message); + ecore_con_client_send(client, buf, strlen(buf)); + ecore_con_client_flush(client); +} + +void sendForth(gameGlobals *game, const char *SID, const char *message) +{ + char buf[PATH_MAX]; + + snprintf(buf, sizeof(buf), "%s.%s\n", SID, message); + ecore_con_server_send(game->server, buf, strlen(buf)); + ecore_con_server_flush(game->server); +} + float timeDiff(struct timeval *now, struct timeval *then) { if (0 == gettimeofday(now, 0)) -- cgit v1.1