Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 471b5b56f8 | |||
| 392fcb3d17 | |||
| 205c09a338 |
@@ -15,7 +15,8 @@ using UpgradeTowerFields = std::tuple<
|
|||||||
sp::Field<std::uint16_t, 12>, //<- m_Tower
|
sp::Field<std::uint16_t, 12>, //<- m_Tower
|
||||||
sp::Field<std::uint8_t, 4> //<- m_Upgrade
|
sp::Field<std::uint8_t, 4> //<- m_Upgrade
|
||||||
>,
|
>,
|
||||||
sp::VarInt //<- just for testing
|
sp::VarInt, //<- just for testing
|
||||||
|
std::map<std::string, std::vector<int>>
|
||||||
>;
|
>;
|
||||||
|
|
||||||
DeclarePacket(UpgradeTower){
|
DeclarePacket(UpgradeTower){
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
namespace sp {
|
namespace sp {
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <sp/protocol/MessagePrinter.h>
|
#include <ostream>
|
||||||
|
#include <sp/protocol/Field.h>
|
||||||
|
|
||||||
namespace sp {
|
namespace sp {
|
||||||
|
|
||||||
@@ -56,11 +57,8 @@ class VarInt {
|
|||||||
* \param var The variable integer to deserialize
|
* \param var The variable integer to deserialize
|
||||||
*/
|
*/
|
||||||
friend DataBuffer& operator>>(DataBuffer& in, VarInt& var);
|
friend DataBuffer& operator>>(DataBuffer& in, VarInt& var);
|
||||||
|
|
||||||
|
friend std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<VarInt>& a_VarInt);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<>
|
|
||||||
inline std::string PrintData(const VarInt& a_VarInt) {
|
|
||||||
return PrintData(a_VarInt.GetValue());
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace sp
|
} // namespace sp
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ namespace io {
|
|||||||
*/
|
*/
|
||||||
class TcpListener : private NonCopyable {
|
class TcpListener : private NonCopyable {
|
||||||
public:
|
public:
|
||||||
|
using SocketHandle = TcpTag::SocketHandle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Starts listening for guests to connect
|
* \brief Starts listening for guests to connect
|
||||||
* \param port The port to listen to
|
* \param port The port to listen to
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
namespace sp {
|
namespace sp {
|
||||||
namespace io {
|
namespace io {
|
||||||
|
|
||||||
using SocketHandle = int;
|
struct TcpTag {
|
||||||
|
using SocketHandle = int;
|
||||||
struct TcpTag {};
|
};
|
||||||
|
|
||||||
class SocketError : public std::exception {
|
class SocketError : public std::exception {
|
||||||
private:
|
private:
|
||||||
@@ -25,6 +25,8 @@ class SocketError : public std::exception {
|
|||||||
template <>
|
template <>
|
||||||
class IOInterface<TcpTag> : private NonCopyable {
|
class IOInterface<TcpTag> : private NonCopyable {
|
||||||
public:
|
public:
|
||||||
|
using SocketHandle = TcpTag::SocketHandle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \enum Status
|
* \enum Status
|
||||||
* \brief Describes the state of a socket
|
* \brief Describes the state of a socket
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <sp/common/DataBuffer.h>
|
|
||||||
#include <sp/common/Templates.h>
|
#include <sp/common/Templates.h>
|
||||||
|
|
||||||
namespace sp {
|
namespace sp {
|
||||||
@@ -98,6 +97,19 @@ class Field {
|
|||||||
StorageType m_Value;
|
StorageType m_Value;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
class PrintableField {
|
||||||
|
public:
|
||||||
|
PrintableField(const T& a_Value) : m_Value(a_Value) {}
|
||||||
|
|
||||||
|
const T& GetValue() const {
|
||||||
|
return m_Value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
const T& m_Value;
|
||||||
|
};
|
||||||
|
|
||||||
namespace details {
|
namespace details {
|
||||||
|
|
||||||
template <typename... TFields>
|
template <typename... TFields>
|
||||||
|
|||||||
@@ -1,55 +1,61 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <sp/common/Templates.h>
|
#include <ostream>
|
||||||
|
#include <sp/protocol/Field.h>
|
||||||
|
#include <sp/protocol/message/OstreamFieldIterator.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace sp {
|
namespace sp {
|
||||||
|
|
||||||
template <typename T, std::enable_if_t<details::is_general_t<T>::value, bool> = true>
|
|
||||||
inline std::string PrintData(const T& a_Data);
|
|
||||||
|
|
||||||
template <typename T, std::enable_if_t<details::is_primitive<T>::value, bool> = true>
|
template <typename T, std::enable_if_t<details::is_primitive<T>::value, bool> = true>
|
||||||
inline std::string PrintData(T a_Data) {
|
std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<T>& a_Field) {
|
||||||
return std::to_string(a_Data);
|
return a_Stream << std::to_string(a_Field.GetValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
inline std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<long unsigned int>& a_Field) {
|
||||||
inline std::string PrintData(const std::string& a_Data) {
|
return a_Stream << a_Field.GetValue();
|
||||||
return "\"" + a_Data + "\"";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename K, typename V>
|
inline std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<std::string>& a_Field) {
|
||||||
std::string PrintData(const std::pair<K, V>& a_Data);
|
return a_Stream << "\"" << a_Field.GetValue() << "\"";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <typename K, typename V>
|
template <typename K, typename V>
|
||||||
std::string PrintData(const std::map<K, V>& a_Data);
|
std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<std::pair<K, V>>& a_Data);
|
||||||
|
|
||||||
|
template <typename K, typename V>
|
||||||
|
std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<std::map<K, V>>& a_Data);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::string PrintData(const std::vector<T>& a_Data);
|
std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<std::vector<T>>& a_Data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <typename K, typename V>
|
template <typename K, typename V>
|
||||||
std::string PrintData(const std::pair<K, V>& a_Data) {
|
std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<std::pair<K, V>>& a_Data) {
|
||||||
return "{" + PrintData(a_Data.first) + " => " + PrintData(a_Data.second) + "}";
|
return a_Stream << PrintableField<K>(a_Data.GetValue().first) << " => " << PrintableField<V>(a_Data.GetValue().second);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename K, typename V>
|
template <typename K, typename V>
|
||||||
std::string PrintData(const std::map<K, V>& a_Data) {
|
std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<std::map<K, V>>& a_Data) {
|
||||||
std::string result = "{";
|
a_Stream << "{";
|
||||||
for (const auto& pair : a_Data) {
|
std::copy(a_Data.GetValue().begin(), a_Data.GetValue().end(), OstreamFieldIterator<std::pair<K, V>>(std::cout, ", "));
|
||||||
result += PrintData(pair) + ", ";
|
return a_Stream << "}";
|
||||||
}
|
|
||||||
return result.substr(0, result.size() - 2) + "}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
std::string PrintData(const std::vector<T>& a_Data) {
|
std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<std::vector<T>>& a_Data) {
|
||||||
std::string result = "{";
|
a_Stream << "{";
|
||||||
for (const T& value : a_Data) {
|
std::copy(a_Data.GetValue().begin(), a_Data.GetValue().end(), OstreamFieldIterator<T>(std::cout, ", "));
|
||||||
result += PrintData(value) + ", ";
|
return a_Stream << "}";
|
||||||
}
|
|
||||||
return result.substr(0, result.size() - 2) + "}";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace sp
|
} // namespace sp
|
||||||
|
|||||||
@@ -133,12 +133,12 @@ class MessageInterfaceWriteIdBase : public TBase {
|
|||||||
template <typename TBase>
|
template <typename TBase>
|
||||||
class MessageInterfaceToStringBase : public TBase {
|
class MessageInterfaceToStringBase : public TBase {
|
||||||
public:
|
public:
|
||||||
std::string ToString() const {
|
friend std::ostream& operator<<(std::ostream& a_Stream, const MessageInterfaceToStringBase& a_Message) {
|
||||||
return ToStringImpl();
|
return a_Message.OpOutImpl(a_Stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual std::string ToStringImpl() const = 0;
|
virtual std::ostream& OpOutImpl(std::ostream& a_Stream) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace details
|
} // namespace details
|
||||||
|
|||||||
@@ -31,41 +31,49 @@ struct IdPrinter<option::StaticNumIdImpl<TId>, TOptions...> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
} // namespace details
|
||||||
|
|
||||||
template <typename... TFields>
|
template <typename... TFields>
|
||||||
std::string PrintFields(const std::tuple<TFields...>& a_Fields);
|
std::ostream& operator<<(std::ostream& a_Stream, const std::tuple<TFields...>& a_Fields);
|
||||||
|
|
||||||
template <typename TField, unsigned int IAlignment>
|
template <typename TField, unsigned int IAlignment>
|
||||||
struct FieldPrinter {
|
struct FieldPrinter {
|
||||||
static std::string PrintField(const sp::Field<TField, IAlignment>& a_Field) {
|
static std::ostream& PrintField(std::ostream& a_Stream, const sp::Field<TField, IAlignment>& a_Field) {
|
||||||
return Reflector<TField>::GetClassName() + "=" + PrintData(a_Field.GetValue());
|
return a_Stream << sp::Reflector<TField>::GetClassName() << "=" << PrintableField<TField>(a_Field.GetValue());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <unsigned int IAlignment, typename TContainer, typename... TFields>
|
template <unsigned int IAlignment, typename TContainer, typename... TFields>
|
||||||
struct FieldPrinter<BitField<TContainer, TFields...>, IAlignment> {
|
struct FieldPrinter<sp::BitField<TContainer, TFields...>, IAlignment> {
|
||||||
static std::string PrintField(const Field<BitField<TContainer, TFields...>, IAlignment>& a_Field) {
|
static std::ostream& PrintField(
|
||||||
return "BitField<" + Reflector<TContainer>::GetClassName() + ">[" + PrintFields(a_Field.GetValue().GetFields()) + "]";
|
std::ostream& a_Stream, const sp::Field<sp::BitField<TContainer, TFields...>, IAlignment>& a_Field) {
|
||||||
|
a_Stream << "BitField<" << sp::Reflector<TContainer>::GetClassName() << ">[";
|
||||||
|
a_Stream << a_Field.GetValue().GetFields() << "]";
|
||||||
|
return a_Stream;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename... TFields>
|
template <typename... TFields>
|
||||||
std::string PrintFields(const std::tuple<TFields...>& a_Fields) {
|
std::ostream& operator<<(std::ostream& a_Stream, const std::tuple<TFields...>& a_Fields) {
|
||||||
std::string concat;
|
bool first = true;
|
||||||
TupleForEach(
|
TupleForEach(
|
||||||
[&concat](const auto& a_Field) {
|
[&a_Stream, &first](const auto& a_Field) {
|
||||||
|
if (!first)
|
||||||
|
a_Stream << ", ";
|
||||||
using TField = typename std::decay<decltype(a_Field)>::type;
|
using TField = typename std::decay<decltype(a_Field)>::type;
|
||||||
constexpr std::size_t alignment = TField::AlignmentValue;
|
constexpr std::size_t alignment = TField::AlignmentValue;
|
||||||
concat += FieldPrinter<typename TField::StorageType, alignment>::PrintField(a_Field) + ", ";
|
FieldPrinter<typename TField::StorageType, alignment>::PrintField(a_Stream, a_Field);
|
||||||
|
first = false;
|
||||||
},
|
},
|
||||||
a_Fields);
|
a_Fields);
|
||||||
return concat.substr(0, concat.size() - 2);
|
return a_Stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename TBase, typename... TOptions>
|
template <typename TBase, typename... TOptions>
|
||||||
std::string PrintMessage(const MessageBase<TBase, TOptions...>& a_Message) {
|
std::ostream& operator<<(std::ostream& a_Stream, const sp::MessageBase<TBase, TOptions...>& a_Message) {
|
||||||
return sp::GetBasicClassName(a_Message) + sp::details::IdPrinter<TOptions...>::PrintMessageId() + "[" +
|
a_Stream << sp::GetBasicClassName(a_Message) << sp::details::IdPrinter<TOptions...>::PrintMessageId() << "["
|
||||||
sp::details::PrintFields(a_Message.GetFields()) + "]";
|
<< a_Message.GetFields() << "]";
|
||||||
|
return a_Stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace details
|
} // namespace sp
|
||||||
} // namespace sp
|
|
||||||
@@ -14,8 +14,8 @@ std::string PrintMessage(const MessageBase<TBase, TOptions...>& a_Message);
|
|||||||
template <typename TBase, typename TActual>
|
template <typename TBase, typename TActual>
|
||||||
class MessageImplToStringBase : public TBase {
|
class MessageImplToStringBase : public TBase {
|
||||||
protected:
|
protected:
|
||||||
virtual std::string ToStringImpl() const override {
|
virtual std::ostream& OpOutImpl(std::ostream& a_Stream) const override{
|
||||||
return PrintMessage(static_cast<const TActual&>(*this));
|
return a_Stream << static_cast<const TActual&>(*this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
56
include/sp/protocol/message/OstreamFieldIterator.h
Normal file
56
include/sp/protocol/message/OstreamFieldIterator.h
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
// infix_iterator.h
|
||||||
|
//
|
||||||
|
// Lifted from Jerry Coffin's 's prefix_ostream_iterator
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <ostream>
|
||||||
|
#include <sp/protocol/Field.h>
|
||||||
|
|
||||||
|
namespace sp {
|
||||||
|
|
||||||
|
template <class T, class charT = char, class traits = std::char_traits<charT>>
|
||||||
|
class OstreamFieldIterator {
|
||||||
|
private:
|
||||||
|
std::basic_ostream<charT, traits>* m_Os;
|
||||||
|
std::string m_Delimiter;
|
||||||
|
bool m_FirstElem;
|
||||||
|
|
||||||
|
public:
|
||||||
|
using iterator_category = std::output_iterator_tag;
|
||||||
|
using value_type = void;
|
||||||
|
using difference_type = void;
|
||||||
|
using pointer = void;
|
||||||
|
using reference = void;
|
||||||
|
|
||||||
|
using char_type = charT;
|
||||||
|
using traits_type = traits;
|
||||||
|
using ostream_type = std::basic_ostream<charT, traits>;
|
||||||
|
|
||||||
|
OstreamFieldIterator(ostream_type& a_Stream) : m_Os(&a_Stream), m_Delimiter(0), m_FirstElem(true) {}
|
||||||
|
OstreamFieldIterator(ostream_type& a_Stream, std::string&& a_Delimiter) :
|
||||||
|
m_Os(&a_Stream), m_Delimiter(std::move(a_Delimiter)), m_FirstElem(true) {}
|
||||||
|
|
||||||
|
auto& operator=(const T& item) {
|
||||||
|
// Here's the only real change from ostream_iterator:
|
||||||
|
// Normally, the '*m_Os << item;' would come before the 'if'.
|
||||||
|
if (!m_FirstElem && !m_Delimiter.empty())
|
||||||
|
*m_Os << m_Delimiter;
|
||||||
|
*m_Os << sp::PrintableField<T>(item);
|
||||||
|
m_FirstElem = false;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto& operator*() {
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto& operator++() {
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto& operator++(int) {
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace sp
|
||||||
@@ -49,4 +49,8 @@ DataBuffer& operator>>(DataBuffer& in, VarInt& var) {
|
|||||||
return in;
|
return in;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::ostream& operator<<(std::ostream& a_Stream, const PrintableField<VarInt>& a_VarInt) {
|
||||||
|
return a_Stream << a_VarInt.GetValue().GetValue();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace sp
|
} // namespace sp
|
||||||
|
|||||||
52
src/sp/extensions/SslContext.cpp
Normal file
52
src/sp/extensions/SslContext.cpp
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
#include <cstring>
|
||||||
|
#include <iostream>
|
||||||
|
#include <mbedtls/ctr_drbg.h>
|
||||||
|
#include <mbedtls/entropy.h>
|
||||||
|
#include <mbedtls/x509_crt.h>
|
||||||
|
#include <sp/common/DataBuffer.h>
|
||||||
|
#include <sp/common/NonCopyable.h>
|
||||||
|
|
||||||
|
namespace sp {
|
||||||
|
|
||||||
|
class SslContext : private NonCopyable {
|
||||||
|
public:
|
||||||
|
SslContext(unsigned int a_KeySizeBits) {
|
||||||
|
mbedtls_rsa_context rsaContext;
|
||||||
|
mbedtls_rsa_init(&rsaContext);
|
||||||
|
mbedtls_rsa_gen_key(&rsaContext, mbedtls_ctr_drbg_random, &m_CtrCrbg, a_KeySizeBits, 65537);
|
||||||
|
mbedtls_rsa_free(&rsaContext);
|
||||||
|
}
|
||||||
|
|
||||||
|
SslContext(const DataBuffer& a_Data) {
|
||||||
|
mbedtls_x509_crt_parse(&m_CaCert, (const unsigned char*)a_Data.data(), a_Data.GetSize()) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
SslContext(const std::string& a_CertFilePath) {
|
||||||
|
mbedtls_x509_crt_parse_file(&m_CaCert, a_CertFilePath.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
~SslContext() {
|
||||||
|
mbedtls_ctr_drbg_free(&m_CtrCrbg);
|
||||||
|
mbedtls_entropy_free(&m_Entropy);
|
||||||
|
mbedtls_x509_crt_free(&m_CaCert);
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void InitContext() {
|
||||||
|
int error = 0;
|
||||||
|
|
||||||
|
mbedtls_x509_crt_init(&m_CaCert);
|
||||||
|
mbedtls_ctr_drbg_init(&m_CtrCrbg);
|
||||||
|
|
||||||
|
mbedtls_entropy_init(&m_Entropy);
|
||||||
|
if ((error = mbedtls_ctr_drbg_seed(&m_CtrCrbg, mbedtls_entropy_func, &m_Entropy, nullptr, 0)) != 0) {
|
||||||
|
throw std::runtime_error("Failed to initialise random number generator. Returned error: " + std::to_string(error));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mbedtls_entropy_context m_Entropy;
|
||||||
|
mbedtls_ctr_drbg_context m_CtrCrbg;
|
||||||
|
mbedtls_x509_crt m_CaCert;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace sp
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
class KeepAliveHandler : public sp::PacketHandler {
|
class KeepAliveHandler : public sp::PacketHandler {
|
||||||
void Handle(const KeepAlivePacket& packet) {
|
void Handle(const KeepAlivePacket& packet) {
|
||||||
std::cout << "KeepAlive handled !!\n";
|
std::cout << "KeepAlive handled !!\n";
|
||||||
std::cout << packet.ToString() << std::endl;
|
std::cout << packet << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Handle(const DisconnectPacket& packet) {
|
void Handle(const DisconnectPacket& packet) {
|
||||||
@@ -22,7 +22,8 @@ class KeepAliveHandler : public sp::PacketHandler {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
auto upgradeTower = std::make_unique<UpgradeTowerPacket>(std::make_tuple(666, 9), 789);
|
std::map<std::string, std::vector<int>> yes = {{"woa", {5, 8}}, {"insane", {6, 9}}};
|
||||||
|
auto upgradeTower = std::make_unique<UpgradeTowerPacket>(std::make_tuple(666, 9), 789, yes);
|
||||||
auto keepAlive = std::make_unique<KeepAlivePacket>(6969);
|
auto keepAlive = std::make_unique<KeepAlivePacket>(6969);
|
||||||
|
|
||||||
sp::PacketMessage* msg = upgradeTower.get();
|
sp::PacketMessage* msg = upgradeTower.get();
|
||||||
@@ -39,7 +40,7 @@ int main() {
|
|||||||
auto upgradeTower2 = std::make_unique<UpgradeTowerPacket>();
|
auto upgradeTower2 = std::make_unique<UpgradeTowerPacket>();
|
||||||
upgradeTower2->Read(buffer);
|
upgradeTower2->Read(buffer);
|
||||||
|
|
||||||
std::cout << "Test : " << msg->ToString() << "\n";
|
std::cout << "Test : " << *msg << "\n";
|
||||||
|
|
||||||
sp::PacketFactory factory;
|
sp::PacketFactory factory;
|
||||||
auto packet = factory.CreateMessage(msgId);
|
auto packet = factory.CreateMessage(msgId);
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ local modules = {
|
|||||||
Deps = {},
|
Deps = {},
|
||||||
Includes = {"include/(sp/extensions/Tcp.h)", "include/(sp/extensions/tcp/*.h)"},
|
Includes = {"include/(sp/extensions/Tcp.h)", "include/(sp/extensions/tcp/*.h)"},
|
||||||
Sources = {"src/sp/extensions/Tcp*.cpp"}
|
Sources = {"src/sp/extensions/Tcp*.cpp"}
|
||||||
|
},
|
||||||
|
MbedTls = {
|
||||||
|
Option = "tls",
|
||||||
|
Deps = {"mbedtls"},
|
||||||
|
Includes = {"include/(sp/extensions/Ssl.h)", "include/(sp/extensions/Ssl/*.h)"},
|
||||||
|
Sources = {"src/sp/extensions/Ssl*.cpp"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user