]> jfr.im git - solanum.git/blobdiff - modules/m_pong.c
Add ACCOUNTEXTBAN ISUPPORT token
[solanum.git] / modules / m_pong.c
index b09b68f5619d0f62d63d82ab29a4bcaf8ae99ba3..a56ab7e522faa4e8b609d1ab7fdba0e8abbe99b7 100644 (file)
 #include "hash.h"
 #include "modules.h"
 
-static int mr_pong(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
-static int ms_pong(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static const char pong_desc[] = "Provides the PONG command to respond to a PING message";
+
+static void mr_pong(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
+static void ms_pong(struct MsgBuf *, struct Client *, struct Client *, int, const char **);
 
 struct Message pong_msgtab = {
        "PONG", 0, 0, 0, 0,
@@ -47,9 +49,10 @@ struct Message pong_msgtab = {
 };
 
 mapi_clist_av1 pong_clist[] = { &pong_msgtab, NULL };
-DECLARE_MODULE_AV2(pong, NULL, NULL, pong_clist, NULL, NULL, NULL, NULL, NULL);
 
-static int
+DECLARE_MODULE_AV2(pong, NULL, NULL, pong_clist, NULL, NULL, NULL, NULL, pong_desc);
+
+static void
 ms_pong(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct Client *target_p;
@@ -76,7 +79,7 @@ ms_pong(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
                        if(!IsDigit(*destination))
                                sendto_one_numeric(source_p, ERR_NOSUCHSERVER,
                                                   form_str(ERR_NOSUCHSERVER), destination);
-                       return 0;
+                       return;
                }
        }
 
@@ -84,7 +87,7 @@ ms_pong(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
        if(IsServer(source_p) && !HasSentEob(source_p))
        {
                if(MyConnect(source_p))
-                       sendto_realops_snomask(SNO_GENERAL, L_ALL,
+                       sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
                                             "End of burst (emulated) from %s (%d seconds)",
                                             source_p->name,
                                             (signed int) (rb_current_time() - source_p->localClient->firsttime));
@@ -92,18 +95,16 @@ ms_pong(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
                eob_count++;
                call_hook(h_server_eob, source_p);
        }
-
-       return 0;
 }
 
-static int
+static void
 mr_pong(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        if(parc == 2 && !EmptyString(parv[1]))
        {
                if(ConfigFileEntry.ping_cookie && source_p->flags & FLAGS_SENTUSER && source_p->name[0])
                {
-                       unsigned long incoming_ping = strtoul(parv[1], NULL, 16);
+                       uint32_t incoming_ping = strtoul(parv[1], NULL, 16);
                        if(incoming_ping)
                        {
                                if(source_p->localClient->random_ping == incoming_ping)
@@ -116,7 +117,7 @@ mr_pong(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
                                        sendto_one(source_p, form_str(ERR_WRONGPONG),
                                                   me.name, source_p->name,
                                                   source_p->localClient->random_ping);
-                                       return 0;
+                                       return;
                                }
                        }
                }
@@ -126,6 +127,4 @@ mr_pong(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_
                sendto_one(source_p, form_str(ERR_NOORIGIN), me.name, source_p->name);
 
        source_p->flags &= ~FLAGS_PINGSENT;
-
-       return 0;
 }