|
|
@@ -75,8 +75,19 @@ int join_session(int sid, int fd);
|
|
|
|
|
|
int get_user_info(int fd, struct vcc_request *);
|
|
|
int incr_score(int fd, struct vcc_request *);
|
|
|
+int monitor_info(int fd, struct vcc_request *);
|
|
|
|
|
|
int relay_new_msg(int fd, void *);
|
|
|
+int send_to(int fd, const char *restrict msg, int is_only_visible, const struct vcc_relay_header *restrict hdr,
|
|
|
+ int size);
|
|
|
+
|
|
|
+static inline int relay_send_msg(int fd, const char *restrict msg, const char *restrict usrname) {
|
|
|
+ struct vcc_relay_header hdr;
|
|
|
+
|
|
|
+ strcpy(hdr.usrname, usrname);
|
|
|
+ return send_to(fd, msg, 1, &hdr, strlen(msg));
|
|
|
+}
|
|
|
+
|
|
|
int relay_broadcast(const char *restrict msg, int expect,
|
|
|
const struct vcc_relay_header *restrict hdr);
|
|
|
int relay_send_to(const char *restrict msg, const char *restrict visible, int expect_fd,
|