From bd5ff8d65e0c3459f14c20192bf847112659e796 Mon Sep 17 00:00:00 2001
From: Cerapter <cerap@protonmail.com>
Date: Sat, 13 Mar 2021 15:22:06 +0100
Subject: [PATCH] Document AOPacket, link docs for network protocol to relevant
 classes

---
 include/advertiser.h |  3 +++
 include/aopacket.h   | 37 +++++++++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/include/advertiser.h b/include/advertiser.h
index 6517790..071be89 100644
--- a/include/advertiser.h
+++ b/include/advertiser.h
@@ -27,6 +27,9 @@
 
 /**
  * @brief A communicator class to update the master server on the server's status.
+ *
+ * @see https://github.com/AttorneyOnline/docs/blob/master/docs/development/network.md#master-server-protocol
+ * for more explanation about how to communicate with the master server.
  */
 class Advertiser : public QObject {
     Q_OBJECT
diff --git a/include/aopacket.h b/include/aopacket.h
index c66eb88..3510687 100644
--- a/include/aopacket.h
+++ b/include/aopacket.h
@@ -23,14 +23,51 @@
 #include <QString>
 #include <QStringList>
 
+/**
+ * @brief An Attorney Online 2 compatible packet.
+ *
+ * @see https://github.com/AttorneyOnline/docs/blob/master/docs/development/network.md for a general explanation
+ * on Attorney Online 2's network protocol.
+ */
 class AOPacket {
   public:
+    /**
+     * @brief Creates an AOPacket with the given header and contents.
+     *
+     * @param p_header The header for the packet.
+     * @param p_contents The contents of the packet.
+     */
     AOPacket(QString p_header, QStringList p_contents);
+
+    /**
+     * @brief AOPacket Interprets a string of a full (header + content) packet into an AOPacket.
+     *
+     * @param packet The string to interpret.
+     */
     AOPacket(QString packet);
+
+    /**
+     * @brief Returns the string representation of the packet.
+     *
+     * @return See brief description.
+     */
     QString toString();
+
+    /**
+     * @brief Convenience function over AOPacket::toString() + QString::toUtf8().
+     *
+     * @return A UTF-8 representation of the packet.
+     */
     QByteArray toUtf8();
 
+    /**
+     * @brief The string that indentifies the type of the packet.
+     */
     QString header;
+
+    /**
+     * @brief The list of parameters for the packet. Can be empty.
+     */
     QStringList contents;
 };