Monobit Unity Networking ver.2.8.0 Server API Reference (C++)
MunRoomInfo.hpp
Go to the documentation of this file.
1 
7 #ifndef __MUN_ROOM_INFO_HPP__
8 #define __MUN_ROOM_INFO_HPP__
9 
10 #include <vector>
11 #include <list>
12 #include <mrs.hpp>
13 #include <stream/MunStream.hpp>
15 
20 {
21 protected:
23  uint64 m_Id;
24 
26  int32 m_HostId;
27 
29  std::list<MunRoomPlayerInfo> m_PlayersInRoom;
30 
33 
34 public:
39  uint64 GetId() { return m_Id; }
40 
45  int32 GetHostId() { return m_HostId; }
46 
51  void SetHostId(int32 hostId) { m_HostId = hostId; }
52 
57  std::list<MunRoomPlayerInfo>* GetPlayersInRoom() { return &m_PlayersInRoom; }
58 
59 public:
65  MunRoomInfo( uint64 id = 0, bool isNeedHostPlayer = true );
66 
70  virtual ~MunRoomInfo();
71 
83  void AddPlayer( MrsConnection connection, int32 playerId, std::string playerName, uint32 clientIdForMaster, uint64 clientUidForProxyServer, uint64 roomId, STREAM::KeyValue* pParameters, uint16 parametersLen );
84 
91  void ChangePlayerParameters(int32 playerId, STREAM::KeyValue* pParameters, uint16 parametersLen );
92 
97  void ChangePlayerName( int32 playerId, std::string playerName );
98 
104  bool RemovePlayer( int32 playerId );
105 
106  void Update(){
107  for ( std::list<MunRoomPlayerInfo>::iterator itr = m_PlayersInRoom.begin(); m_PlayersInRoom.end() != itr; ++itr ){
108  itr->Update();
109  }
110  }
111 };
112 
113 #endif /* __MUN_ROOM_INFO_HPP__ */
std::list< MunRoomPlayerInfo > m_PlayersInRoom
ルーム内プレイヤー情報.
Definition: MunRoomInfo.hpp:29
uint64 m_Id
ルームID.
Definition: MunRoomInfo.hpp:23
void AddPlayer(MrsConnection connection, int32 playerId, std::string playerName, uint32 clientIdForMaster, uint64 clientUidForProxyServer, uint64 roomId, STREAM::KeyValue *pParameters, uint16 parametersLen)
ルーム内プレイヤー情報の追加.
Definition: MunRoomInfo.cpp:36
void SetHostId(int32 hostId)
ホストIDの設定.
Definition: MunRoomInfo.hpp:51
mun_roomサーバ内のルーム内プレイヤー情報.
MUNにおける通信データ情報.
virtual ~MunRoomInfo()
デストラクタ.
Definition: MunRoomInfo.cpp:24
任意のKey-Valueペア.
Definition: MunStream.hpp:602
int32 GetHostId()
ホストIDの取得.
Definition: MunRoomInfo.hpp:45
ルーム情報クラス.
Definition: MunRoomInfo.hpp:19
bool RemovePlayer(int32 playerId)
ルーム内プレイヤー情報の削除.
Definition: MunRoomInfo.cpp:86
MunRoomInfo(uint64 id=0, bool isNeedHostPlayer=true)
コンストラクタ.
Definition: MunRoomInfo.cpp:14
void ChangePlayerName(int32 playerId, std::string playerName)
ルーム内プレイヤー名の追加.
Definition: MunRoomInfo.cpp:70
bool m_IsNeedHostPlayer
ホストプレイヤーが必要かどうかのフラグ.
Definition: MunRoomInfo.hpp:32
int32 m_HostId
ホストID.
Definition: MunRoomInfo.hpp:26
std::list< MunRoomPlayerInfo > * GetPlayersInRoom()
ルーム内プレイヤー情報の取得.
Definition: MunRoomInfo.hpp:57
void ChangePlayerParameters(int32 playerId, STREAM::KeyValue *pParameters, uint16 parametersLen)
ルーム内プレイヤー情報の更新.
Definition: MunRoomInfo.cpp:55
uint64 GetId()
ルームIDの取得.
Definition: MunRoomInfo.hpp:39