diff options
author | tomsmeding <tom.smeding@gmail.com> | 2017-05-08 22:06:47 +0200 |
---|---|---|
committer | tomsmeding <tom.smeding@gmail.com> | 2017-05-08 22:08:56 +0200 |
commit | a7a0ce278e661bf5d3f2b47556d8c30469d2bd6c (patch) | |
tree | def6c7b56df0b21351c4f1b0766163426ee47649 /broadcast.c | |
parent | 886fc77026a2a805e5d166b2f87bd24720ad9ea4 (diff) |
server: Add event system
Diffstat (limited to 'broadcast.c')
-rw-r--r-- | broadcast.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/broadcast.c b/broadcast.c index 0517dc3..2970b54 100644 --- a/broadcast.c +++ b/broadcast.c @@ -1,8 +1,10 @@ #include <string.h> #include "broadcast.h" #include "db.h" +#include "event.h" #include "net.h" #include "user_data.h" +#include "util.h" // Returns whether value was new and therefore inserted into the list. @@ -72,6 +74,8 @@ void broadcast_online_change(i64 userid){ i64 numonline; (void)userdata_online(userid,&numonline); + event_emit_online(make_timestamp(),name,numonline); + char *buf; i64 len=asprintf(&buf,"_push online %" PRIi64 " %s\n",numonline,name); free(name); |