~ubuntu-branches/ubuntu/precise/pokerth/precise-proposed

« back to all changes in this revision

Viewing changes to src/net/sessionmanager.h

  • Committer: Bazaar Package Importer
  • Author(s): Evgeni Golov
  • Date: 2009-06-26 00:23:56 UTC
  • mfrom: (1.1.7 upstream) (5.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090626002356-p3nrzdhhqwk5gpf0
Tags: 0.7.1-1
* New upstream release.
* debian/control:
  + Build-Depend on unversioned boost packages again.
    Closes: #531119, #534086
  + Improve pokerth-server description, one does not need the package
    for one-table games.
  + Standards-Version: 3.8.2, no changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
#ifndef _SESSIONMANAGER_H_
22
22
#define _SESSIONMANAGER_H_
23
23
 
 
24
#include <boost/function.hpp>
 
25
#include <map>
 
26
 
24
27
#include <net/sessiondata.h>
25
28
#include <playerdata.h>
26
29
#include <core/thread.h>
27
30
 
28
 
#include <boost/function.hpp>
29
 
#include <map>
30
 
#include <string>
31
 
 
32
 
class SenderInterface;
33
31
class NetPacket;
 
32
class SenderHelper;
34
33
 
35
34
struct SessionWrapper
36
35
{
54
53
        void SetSessionPlayerData(SessionId session, boost::shared_ptr<PlayerData> playerData);
55
54
        void RemoveSession(SessionId session);
56
55
 
57
 
        SessionWrapper Select(unsigned timeoutMsec);
58
56
        SessionWrapper GetSessionById(SessionId id) const;
59
57
        SessionWrapper GetSessionByPlayerName(const std::string playerName) const;
60
58
        SessionWrapper GetSessionByUniquePlayerId(unsigned uniqueId) const;
61
59
 
62
 
        bool GetSocketForSession(SessionId session, SOCKET &outSocket);
63
 
 
64
60
        PlayerDataList GetPlayerDataList() const;
65
61
        PlayerIdList GetPlayerIdList() const;
66
62
        bool IsPlayerConnected(const std::string &playerName) const;
74
70
        void Clear();
75
71
        unsigned GetRawSessionCount();
76
72
 
77
 
        void SendToAllSessions(boost::shared_ptr<NetPacket> packet, SessionData::State state);
78
 
        void SendLobbyMsgToAllSessions(boost::shared_ptr<NetPacket> packet, SessionData::State state);
79
 
        void SendToAllButOneSessions(boost::shared_ptr<NetPacket> packet, SessionId except, SessionData::State state);
 
73
        void SendToAllSessions(SenderHelper &sender, boost::shared_ptr<NetPacket> packet, SessionData::State state);
 
74
        void SendLobbyMsgToAllSessions(SenderHelper &sender, boost::shared_ptr<NetPacket> packet, SessionData::State state);
 
75
        void SendToAllButOneSessions(SenderHelper &sender, boost::shared_ptr<NetPacket> packet, SessionId except, SessionData::State state);
80
76
 
81
77
protected:
82
78