X-Git-Url: http://git.tdb.fi/?p=libs%2Fnet.git;a=blobdiff_plain;f=source%2Fnet%2Fprotocol.cpp;h=4d3f9628f9d1eddbc4a9bc81f9547bba6dbf153b;hp=d862ed82f72a37d7416160307dac7b7069d749bf;hb=df1b7561be0d4a57e964c783c01060c54864ec60;hpb=400f3e031834eee9d96dbd5cda25655102b75805 diff --git a/source/net/protocol.cpp b/source/net/protocol.cpp index d862ed8..4d3f962 100644 --- a/source/net/protocol.cpp +++ b/source/net/protocol.cpp @@ -1,12 +1,13 @@ #include #include +#include #include +#include #include #include "protocol.h" using namespace std; - namespace Msp { namespace Net { @@ -63,10 +64,12 @@ unsigned Protocol::get_packet_size(const char *buf, unsigned size) const return header.length; } -unsigned Protocol::get_hash() const +UInt64 Protocol::get_hash() const { - // TODO - return 123; + string description; + for(PacketMap::const_iterator i=packet_id_defs.begin(); i!=packet_id_defs.end(); ++i) + description += format("%d:%s\n", i->first, i->second->describe()); + return hash64(description); }