diff --git a/src/lib/net/client.cpp b/src/lib/net/client.cpp new file mode 100644 index 0000000..143a4fc --- /dev/null +++ b/src/lib/net/client.cpp @@ -0,0 +1,16 @@ +// Copyright 2022, FOSS-VG Developers and Contributers +// +// Author(s): +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied +// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// version 3 along with this program. +// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html diff --git a/src/lib/net/client.hpp b/src/lib/net/client.hpp new file mode 100644 index 0000000..143a4fc --- /dev/null +++ b/src/lib/net/client.hpp @@ -0,0 +1,16 @@ +// Copyright 2022, FOSS-VG Developers and Contributers +// +// Author(s): +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied +// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// version 3 along with this program. +// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html diff --git a/src/lib/net/packet.hpp b/src/lib/net/packet.hpp new file mode 100644 index 0000000..9e270e6 --- /dev/null +++ b/src/lib/net/packet.hpp @@ -0,0 +1,41 @@ +// Copyright 2022, FOSS-VG Developers and Contributers +// +// Author(s): +// BodgeMaster +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied +// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// version 3 along with this program. +// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html + +#include +#include + +namespace Packet { + struct DataContainer { + uint32_t typeID; + std::vector payload; + } + + namespace TypeID { + // These are guessed names for what the package IDs could mean. + // Some package IDs are used multiple times. I assume the different + // connection states (handshaking, status, login, and play) play a role + // in identifying what kind of package has been received. + + // State: handshaking + const uint32_t HANDSHAKE = 0; + + // State: status + const uint32_t STATUS = 0; + const uint32_t PING = 1; + } +} diff --git a/src/lib/net/server.cpp b/src/lib/net/server.cpp new file mode 100644 index 0000000..143a4fc --- /dev/null +++ b/src/lib/net/server.cpp @@ -0,0 +1,16 @@ +// Copyright 2022, FOSS-VG Developers and Contributers +// +// Author(s): +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied +// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// version 3 along with this program. +// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html diff --git a/src/lib/net/server.hpp b/src/lib/net/server.hpp new file mode 100644 index 0000000..143a4fc --- /dev/null +++ b/src/lib/net/server.hpp @@ -0,0 +1,16 @@ +// Copyright 2022, FOSS-VG Developers and Contributers +// +// Author(s): +// +// This program is free software: you can redistribute it and/or modify it +// under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, version 3. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied +// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// version 3 along with this program. +// If not, see https://www.gnu.org/licenses/agpl-3.0.en.html