Creating session id for rejoin (ticket #5). Next step is storing this session id on the client in a file.

This commit is contained in:
lotodore
2011-02-09 22:09:29 +00:00
parent 372c2466e8
commit 8ac6a3f7f5
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -47,6 +47,7 @@
#include <boost/lambda/lambda.hpp>
#include <boost/filesystem.hpp>
#include <boost/bind.hpp>
#include <boost/uuid/uuid.hpp>
#include <gsasl.h>
#define SERVER_MAX_NUM_SESSIONS 512 // Maximum number of idle users in lobby.
@@ -1665,6 +1666,11 @@ ServerLobbyThread::EstablishSession(SessionWrapper session)
boost::shared_ptr<NetPacket> ack(new NetPacket(NetPacket::Alloc));
ack->GetMsg()->present = PokerTHMessage_PR_initAckMessage;
InitAckMessage_t *netInitAck = &ack->GetMsg()->choice.initAckMessage;
boost::uuids::uuid sessionId(m_sessionIdGenerator());
OCTET_STRING_fromBuf(
&netInitAck->yourSessionId,
(char *)&sessionId,
boost::uuids::uuid::static_size());
// initAckData.sessionId = session.sessionData->GetId(); // TODO: currently unused.
netInitAck->yourPlayerId = session.playerData->GetUniqueId();
GetSender().Send(session.sessionData, ack);