Elaztek Developer Hub
Blamite Game Engine - blam!  00406.12.10.23.1457.blamite
The core library for the Blamite Game Engine.
lobby_manager.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "types.h"
4 
5 namespace discord {
6 
7 class LobbyManager final {
8 public:
9  ~LobbyManager() = default;
10 
14  UserId userId,
15  LobbyMemberTransaction* transaction);
16  void CreateLobby(LobbyTransaction const& transaction,
17  std::function<void(Result, Lobby const&)> callback);
18  void UpdateLobby(LobbyId lobbyId,
19  LobbyTransaction const& transaction,
20  std::function<void(Result)> callback);
21  void DeleteLobby(LobbyId lobbyId, std::function<void(Result)> callback);
22  void ConnectLobby(LobbyId lobbyId,
23  LobbySecret secret,
24  std::function<void(Result, Lobby const&)> callback);
25  void ConnectLobbyWithActivitySecret(LobbySecret activitySecret,
26  std::function<void(Result, Lobby const&)> callback);
27  void DisconnectLobby(LobbyId lobbyId, std::function<void(Result)> callback);
28  Result GetLobby(LobbyId lobbyId, Lobby* lobby);
29  Result GetLobbyActivitySecret(LobbyId lobbyId, char secret[128]);
30  Result GetLobbyMetadataValue(LobbyId lobbyId, MetadataKey key, char value[4096]);
31  Result GetLobbyMetadataKey(LobbyId lobbyId, std::int32_t index, char key[256]);
33  Result MemberCount(LobbyId lobbyId, std::int32_t* count);
34  Result GetMemberUserId(LobbyId lobbyId, std::int32_t index, UserId* userId);
35  Result GetMemberUser(LobbyId lobbyId, UserId userId, User* user);
37  UserId userId,
38  MetadataKey key,
39  char value[4096]);
40  Result GetMemberMetadataKey(LobbyId lobbyId, UserId userId, std::int32_t index, char key[256]);
41  Result MemberMetadataCount(LobbyId lobbyId, UserId userId, std::int32_t* count);
42  void UpdateMember(LobbyId lobbyId,
43  UserId userId,
44  LobbyMemberTransaction const& transaction,
45  std::function<void(Result)> callback);
46  void SendLobbyMessage(LobbyId lobbyId,
47  std::uint8_t* data,
48  std::uint32_t dataLength,
49  std::function<void(Result)> callback);
51  void Search(LobbySearchQuery const& query, std::function<void(Result)> callback);
52  void LobbyCount(std::int32_t* count);
53  Result GetLobbyId(std::int32_t index, LobbyId* lobbyId);
54  void ConnectVoice(LobbyId lobbyId, std::function<void(Result)> callback);
55  void DisconnectVoice(LobbyId lobbyId, std::function<void(Result)> callback);
56  Result ConnectNetwork(LobbyId lobbyId);
59  Result OpenNetworkChannel(LobbyId lobbyId, std::uint8_t channelId, bool reliable);
61  UserId userId,
62  std::uint8_t channelId,
63  std::uint8_t* data,
64  std::uint32_t dataLength);
65 
74 
75 private:
76  friend class Core;
77 
78  LobbyManager() = default;
79  LobbyManager(LobbyManager const& rhs) = delete;
80  LobbyManager& operator=(LobbyManager const& rhs) = delete;
81  LobbyManager(LobbyManager&& rhs) = delete;
82  LobbyManager& operator=(LobbyManager&& rhs) = delete;
83 
84  IDiscordLobbyManager* internal_;
85  static IDiscordLobbyEvents events_;
86 };
87 
88 } // namespace discord
discord::LobbyManager::LobbyCount
void LobbyCount(std::int32_t *count)
Definition: lobby_manager.cpp:469
discord
Definition: achievement_manager.cpp:12
discord::LobbyEvents::OnLobbyUpdate
static void DISCORD_CALLBACK OnLobbyUpdate(void *callbackData, int64_t lobbyId)
Definition: lobby_manager.cpp:16
EDiscordResult
EDiscordResult
Definition: ffi.h:45
DiscordLobbySecret
char DiscordLobbySecret[128]
Definition: ffi.h:236
DiscordMetadataKey
char DiscordMetadataKey[256]
Definition: ffi.h:237
discord::LobbyMemberTransaction
Definition: types.h:538
discord::LobbyManager::SendNetworkMessage
Result SendNetworkMessage(LobbyId lobbyId, UserId userId, std::uint8_t channelId, std::uint8_t *data, std::uint32_t dataLength)
Definition: lobby_manager.cpp:543
discord::LobbyManager::GetLobbyMetadataValue
Result GetLobbyMetadataValue(LobbyId lobbyId, MetadataKey key, char value[4096])
Definition: lobby_manager.cpp:293
discord::LobbyManager::OnLobbyMessage
Event< std::int64_t, std::int64_t, std::uint8_t *, std::uint32_t > OnLobbyMessage
Definition: lobby_manager.h:71
discord::LobbyManager::ConnectNetwork
Result ConnectNetwork(LobbyId lobbyId)
Definition: lobby_manager.cpp:518
IDiscordLobbyEvents
Definition: ffi.h:569
discord::LobbyEvents::OnMemberUpdate
static void DISCORD_CALLBACK OnMemberUpdate(void *callbackData, int64_t lobbyId, int64_t userId)
Definition: lobby_manager.cpp:51
discord::LobbyManager::UpdateLobby
void UpdateLobby(LobbyId lobbyId, LobbyTransaction const &transaction, std::function< void(Result)> callback)
Definition: lobby_manager.cpp:184
discord::LobbySecret
char const * LobbySecret
Definition: types.h:203
discord::LobbyManager::SendLobbyMessage
void SendLobbyMessage(LobbyId lobbyId, std::uint8_t *data, std::uint32_t dataLength, std::function< void(Result)> callback)
Definition: lobby_manager.cpp:424
discord::LobbyManager::GetMemberUserId
Result GetMemberUserId(LobbyId lobbyId, std::int32_t index, UserId *userId)
Definition: lobby_manager.cpp:336
discord::Core
Definition: core.h:19
discord::User
Definition: types.h:223
discord::LobbyManager::GetMemberUpdateTransaction
Result GetMemberUpdateTransaction(LobbyId lobbyId, UserId userId, LobbyMemberTransaction *transaction)
Definition: lobby_manager.cpp:153
discord::LobbyManager::UpdateMember
void UpdateMember(LobbyId lobbyId, UserId userId, LobbyMemberTransaction const &transaction, std::function< void(Result)> callback)
Definition: lobby_manager.cpp:401
discord::LobbyManager::OnNetworkMessage
Event< std::int64_t, std::int64_t, std::uint8_t, std::uint8_t *, std::uint32_t > OnNetworkMessage
Definition: lobby_manager.h:73
discord::LobbyMemberTransaction::Receive
IDiscordLobbyMemberTransaction ** Receive()
Definition: types.h:543
uint8_t
unsigned char uint8_t
Definition: stdint.h:15
discord::LobbyManager::GetLobbyMetadataKey
Result GetLobbyMetadataKey(LobbyId lobbyId, std::int32_t index, char key[256])
Definition: lobby_manager.cpp:304
discord::LobbyManager::GetLobbyId
Result GetLobbyId(std::int32_t index, LobbyId *lobbyId)
Definition: lobby_manager.cpp:478
discord::LobbyManager::LobbyMetadataCount
Result LobbyMetadataCount(LobbyId lobbyId, std::int32_t *count)
Definition: lobby_manager.cpp:315
IDiscordLobbyManager
Definition: ffi.h:592
DiscordUser
Definition: ffi.h:256
discord::LobbyManager::GetLobbyActivitySecret
Result GetLobbyActivitySecret(LobbyId lobbyId, char secret[128])
Definition: lobby_manager.cpp:282
discord::LobbyManager::GetLobbyUpdateTransaction
Result GetLobbyUpdateTransaction(LobbyId lobbyId, LobbyTransaction *transaction)
Definition: lobby_manager.cpp:142
discord::LobbyManager::GetSearchQuery
Result GetSearchQuery(LobbySearchQuery *query)
Definition: lobby_manager.cpp:443
discord::LobbyManager::GetMemberUser
Result GetMemberUser(LobbyId lobbyId, UserId userId, User *user)
Definition: lobby_manager.cpp:347
types.h
DiscordLobby
Definition: ffi.h:335
discord::LobbyManager::~LobbyManager
~LobbyManager()=default
discord::LobbyManager::DisconnectLobby
void DisconnectLobby(LobbyId lobbyId, std::function< void(Result)> callback)
Definition: lobby_manager.cpp:257
core.h
int32_t
int int32_t
Definition: stdint.h:13
discord::Result
Result
Definition: types.h:12
discord::LobbyManager::DisconnectVoice
void DisconnectVoice(LobbyId lobbyId, std::function< void(Result)> callback)
Definition: lobby_manager.cpp:503
lobby_manager.h
discord::LobbyManager::ConnectLobbyWithActivitySecret
void ConnectLobbyWithActivitySecret(LobbySecret activitySecret, std::function< void(Result, Lobby const &)> callback)
Definition: lobby_manager.cpp:238
discord::LobbyManager::DeleteLobby
void DeleteLobby(LobbyId lobbyId, std::function< void(Result)> callback)
Definition: lobby_manager.cpp:205
Internal
Definition: socket.cpp:16
discord::LobbyManager::OnSpeaking
Event< std::int64_t, std::int64_t, bool > OnSpeaking
Definition: lobby_manager.h:72
int64_t
long long int64_t
Definition: stdint.h:14
DiscordMetadataValue
char DiscordMetadataValue[4096]
Definition: ffi.h:238
discord::LobbyManager::GetLobbyCreateTransaction
Result GetLobbyCreateTransaction(LobbyTransaction *transaction)
Definition: lobby_manager.cpp:132
discord::LobbyManager::DisconnectNetwork
Result DisconnectNetwork(LobbyId lobbyId)
Definition: lobby_manager.cpp:524
DISCORD_CALLBACK
#define DISCORD_CALLBACK
Definition: ffi.h:19
discord::LobbyManager::MemberCount
Result MemberCount(LobbyId lobbyId, std::int32_t *count)
Definition: lobby_manager.cpp:326
discord::LobbyManager::GetMemberMetadataKey
Result GetMemberMetadataKey(LobbyId lobbyId, UserId userId, std::int32_t index, char key[256])
Definition: lobby_manager.cpp:376
uint32_t
unsigned int uint32_t
Definition: stdint.h:17
discord::LobbyManager::Search
void Search(LobbySearchQuery const &query, std::function< void(Result)> callback)
Definition: lobby_manager.cpp:453
discord::LobbyManager::FlushNetwork
Result FlushNetwork()
Definition: lobby_manager.cpp:530
discord::LobbyEvents::OnMemberDisconnect
static void DISCORD_CALLBACK OnMemberDisconnect(void *callbackData, int64_t lobbyId, int64_t userId)
Definition: lobby_manager.cpp:62
discord::LobbyManager::GetLobby
Result GetLobby(LobbyId lobbyId, Lobby *lobby)
Definition: lobby_manager.cpp:272
discord::LobbyManager::CreateLobby
void CreateLobby(LobbyTransaction const &transaction, std::function< void(Result, Lobby const &)> callback)
Definition: lobby_manager.cpp:166
discord::LobbyId
Snowflake LobbyId
Definition: types.h:202
reason
ARPHIC PUBLIC LICENSE Ltd Yung Chi Taiwan All rights reserved except as specified below Everyone is permitted to copy and distribute verbatim copies of this license but changing it is forbidden Preamble The licenses for most software are designed to take away your freedom to share and change it By the ARPHIC PUBLIC LICENSE specifically permits and encourages you to use this provided that you give the recipients all the rights that we gave you and make sure they can get the modifications of this software Legal Terms Font means the TrueType fonts AR PL Mingti2L AR PL KaitiM AR PL KaitiM and the derivatives of those fonts created through any modification including modifying reordering converting changing font or adding deleting some characters in from glyph table PL means Public License Copyright Holder means whoever is named in the copyright or copyrights for the Font You means the or person redistributing or modifying the Font Freely Available means that you have the freedom to copy or modify the Font as well as redistribute copies of the Font under the same conditions you not price If you you can charge for this service Copying &Distribution You may copy and distribute verbatim copies of this Font in any without provided that you retain this license including modifying reordering converting changing font or adding deleting some characters in from glyph and copy and distribute such modifications under the terms of Section provided that the following conditions are such as by offering access to copy the modifications from a designated or distributing the modifications on a medium customarily used for software interchange c If the modified fonts normally reads commands interactively when you must cause when started running for such interactive use in the most ordinary to print or display an announcement including an appropriate copyright notice and a notice that there is no and telling the user how to view a copy of this License These requirements apply to the modified work as a whole If identifiable sections of that work are not derived from the and can be reasonably considered independent and separate works in then this License and its do not apply to those sections when you distribute them as separate works mere aggregation of another work not based on the Font with the Font on a volume of a storage or distribution medium does not bring the other work under the scope of this License Condition Subsequent You may not or distribute the Font except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Font will automatically retroactively void your rights under this License parties who have received copies or rights from you under this License will keep their licenses valid so long as such parties remain in full compliance Acceptance You are not required to accept this since you have not signed it nothing else grants you permission to sublicense or distribute the Font These actions are prohibited by law if you do not accept this License by sublicensing or distributing the you indicate your acceptance of this License and all its terms and conditions Automatic Receipt Each time you redistribute the the recipient automatically receives a license from the original licensor to distribute or modify the Font subject to these terms and conditions You may not impose any further restrictions on the recipients exercise of the rights granted herein You are not responsible for enforcing compliance by third parties to this License Contradiction as a consequence of a court judgment or allegation of patent infringement or for any other reason(not limited to patent issues)
discord::LobbyEvents::OnSpeaking
static void DISCORD_CALLBACK OnSpeaking(void *callbackData, int64_t lobbyId, int64_t userId, bool speaking)
Definition: lobby_manager.cpp:90
discord::Core::LobbyManager
discord::LobbyManager & LobbyManager()
Definition: core.cpp:119
discord::LobbyManager::OnLobbyUpdate
Event< std::int64_t > OnLobbyUpdate
Definition: lobby_manager.h:66
discord::LobbyManager
Definition: lobby_manager.h:7
discord::LobbyTransaction::Receive
IDiscordLobbyTransaction ** Receive()
Definition: types.h:531
discord::LobbyTransaction
Definition: types.h:522
discord::LobbyEvents::OnMemberConnect
static void DISCORD_CALLBACK OnMemberConnect(void *callbackData, int64_t lobbyId, int64_t userId)
Definition: lobby_manager.cpp:38
discord::LobbyEvents::OnLobbyMessage
static void DISCORD_CALLBACK OnLobbyMessage(void *callbackData, int64_t lobbyId, int64_t userId, uint8_t *data, uint32_t dataLength)
Definition: lobby_manager.cpp:75
discord::LobbyManager::MemberMetadataCount
Result MemberMetadataCount(LobbyId lobbyId, UserId userId, std::int32_t *count)
Definition: lobby_manager.cpp:390
value
Offset font vertically by altering the io Font DisplayOffset value
Definition: README.txt:67
discord::LobbyManager::ConnectLobby
void ConnectLobby(LobbyId lobbyId, LobbySecret secret, std::function< void(Result, Lobby const &)> callback)
Definition: lobby_manager.cpp:220
discord::Lobby
Definition: types.h:393
discord::LobbyManager::OnLobbyDelete
Event< std::int64_t, std::uint32_t > OnLobbyDelete
Definition: lobby_manager.h:67
discord::LobbyEvents::OnNetworkMessage
static void DISCORD_CALLBACK OnNetworkMessage(void *callbackData, int64_t lobbyId, int64_t userId, uint8_t channelId, uint8_t *data, uint32_t dataLength)
Definition: lobby_manager.cpp:104
discord::Event< std::int64_t >
discord::LobbyManager::OnMemberUpdate
Event< std::int64_t, std::int64_t > OnMemberUpdate
Definition: lobby_manager.h:69
discord::MetadataKey
char const * MetadataKey
Definition: types.h:204
discord::LobbyEvents
Definition: lobby_manager.cpp:14
discord::LobbyManager::OnMemberConnect
Event< std::int64_t, std::int64_t > OnMemberConnect
Definition: lobby_manager.h:68
discord::LobbyManager::OnMemberDisconnect
Event< std::int64_t, std::int64_t > OnMemberDisconnect
Definition: lobby_manager.h:70
discord::LobbySearchQuery::Receive
IDiscordLobbySearchQuery ** Receive()
Definition: types.h:560
discord::LobbyManager::ConnectVoice
void ConnectVoice(LobbyId lobbyId, std::function< void(Result)> callback)
Definition: lobby_manager.cpp:488
discord::UserId
Snowflake UserId
Definition: types.h:199
discord::LobbyManager::OpenNetworkChannel
Result OpenNetworkChannel(LobbyId lobbyId, std::uint8_t channelId, bool reliable)
Definition: lobby_manager.cpp:536
discord::Result::InternalError
@ InternalError
discord::LobbyManager::GetMemberMetadataValue
Result GetMemberMetadataValue(LobbyId lobbyId, UserId userId, MetadataKey key, char value[4096])
Definition: lobby_manager.cpp:358
discord::LobbyEvents::OnLobbyDelete
static void DISCORD_CALLBACK OnLobbyDelete(void *callbackData, int64_t lobbyId, uint32_t reason)
Definition: lobby_manager.cpp:27
discord::LobbySearchQuery
Definition: types.h:550