diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2008-11-01 01:08:10 +0000 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2008-11-01 01:08:10 +0000 |
commit | eda2022859e7cfde9197a34d9318a9ccec50d841 (patch) | |
tree | be51b862c06475932086c81cf43397008d773211 /signet/protocol/Packet.cpp | |
parent | ff3295a0ede441caef7a133d2f4f4a472b5b7cde (diff) | |
download | sigen-eda2022859e7cfde9197a34d9318a9ccec50d841.tar.gz sigen-eda2022859e7cfde9197a34d9318a9ccec50d841.tar.xz sigen-eda2022859e7cfde9197a34d9318a9ccec50d841.zip |
[FIX] Code for challenge-based login complete
[FIX] Protocol is getting started
[FIX] Removed the kdegames dependency until it's actually here
[FIX] Using QCA2 for hashing
git-svn-id: https://pokegen.svn.sourceforge.net/svnroot/pokegen/trunk@289 6ecfd1a5-f3ed-3746-8530-beee90d26b22
Diffstat (limited to 'signet/protocol/Packet.cpp')
-rw-r--r-- | signet/protocol/Packet.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/signet/protocol/Packet.cpp b/signet/protocol/Packet.cpp new file mode 100644 index 00000000..34e6d125 --- /dev/null +++ b/signet/protocol/Packet.cpp @@ -0,0 +1,52 @@ +/* + * Copyright 2008 Ben Boeckel <MathStuf@gmail.com> + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +// Header include +#include "Packet.h" + +// Qt include +#include <QtCore/QIODevice> + +Signet::Protocol::Packet::Packet(const Type type) : + m_type(type) +{ +} + +void Signet::Protocol::Packet::determineType() +{ +} + +Signet::Protocol::Packet::Type Signet::Protocol::Packet::type() const +{ + return m_type; +} + +bool Signet::Protocol::Packet::isValid() const +{ + return m_type == Invalid; +} + +void Signet::Protocol::Packet::write(const QByteArray& data) +{ + if ((m_type == RawData) || (m_type == Invalid)) + m_rawData.append(data); +} + +void Signet::Protocol::Packet::dump(QIODevice* device) const +{ + device->write(m_rawData); +} |