-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge v1.2.0 prerelease to master (#19)
* Releases/ios v1.2.0 prerelease (#17) * merge partysample 1.2 * update cppsdk for ios 1.2 * update network manager for ios 1.2 * update iOS partysample app for 1.2 * merge partysample 1.2 (#18)
- Loading branch information
1 parent
c740cb5
commit 54933a2
Showing
459 changed files
with
245,034 additions
and
21,051 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82 changes: 41 additions & 41 deletions
82
android/PartySample/demo/src/main/cpp/NetworkStateChangeManager.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
class NetworkStateChangeManager : public PartySample::INetworkStateChangeManager | ||
{ | ||
public: | ||
|
||
NetworkStateChangeManager(); | ||
|
||
// Called when a chat control has been destroyed | ||
void onPlayerLeft( | ||
PartyString playerId | ||
); | ||
|
||
// Called when an endpoint message is received from another chat control. | ||
// Used to send the user display name to other chat controls. Replaces the onPlayerJoin functionality. | ||
void | ||
ProcessEndpointMessage( | ||
std::string& sender, | ||
std::string& message | ||
); | ||
|
||
// Called when a text chat message is sent to the chat control. | ||
void ProcessTextMessage( | ||
std::string& sender, | ||
std::string &message | ||
); | ||
|
||
// Called when a voice transcription is sent to the chat control. | ||
void ProcessVoiceMessage( | ||
std::string& sender, | ||
std::string &message | ||
); | ||
|
||
std::map<const std::string, const std::string>* | ||
GetUserMap(); | ||
|
||
private: | ||
|
||
std::map<const std::string, const std::string> m_userMap; | ||
|
||
const std::string GetUserName( | ||
const std::string& sender | ||
); | ||
class NetworkStateChangeManager : public PartySample::INetworkStateChangeManager | ||
{ | ||
public: | ||
|
||
NetworkStateChangeManager(); | ||
|
||
// Called when a chat control has been destroyed | ||
void onPlayerLeft( | ||
PartyString playerId | ||
); | ||
|
||
// Called when an endpoint message is received from another chat control. | ||
// Used to send the user display name to other chat controls. Replaces the onPlayerJoin functionality. | ||
void | ||
ProcessEndpointMessage( | ||
std::string& sender, | ||
std::string& message | ||
); | ||
|
||
// Called when a text chat message is sent to the chat control. | ||
void ProcessTextMessage( | ||
std::string& sender, | ||
std::string &message | ||
); | ||
|
||
// Called when a voice transcription is sent to the chat control. | ||
void ProcessVoiceMessage( | ||
std::string& sender, | ||
std::string &message | ||
); | ||
|
||
std::map<const std::string, const std::string>* | ||
GetUserMap(); | ||
|
||
private: | ||
|
||
std::map<const std::string, const std::string> m_userMap; | ||
|
||
const std::string GetUserName( | ||
const std::string& sender | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
#include <jni.h> | ||
#include <memory> | ||
#include <thread> | ||
#include <errno.h> | ||
|
||
#include "PartyPal.h" | ||
#include "Party.h" | ||
|
||
#include "NetworkManager.h" | ||
#include "NetworkStateChangeManager.h" | ||
#include "Managers.h" | ||
#include "LanguageOptions.h" | ||
|
||
#define RETURN_VOID_IF(expr) \ | ||
do { \ | ||
if (expr) \ | ||
{ \ | ||
return; \ | ||
} \ | ||
} while (false) \ | ||
|
||
|
||
#define RETURN_VOID_IF_FALSE(expr) \ | ||
do { \ | ||
if (!(expr)) \ | ||
{ \ | ||
return; \ | ||
} \ | ||
} while (false) \ | ||
|
||
#define RETURN_IF(expression, retVal) \ | ||
do { \ | ||
bool expr = (expression); \ | ||
if (expr) \ | ||
{ \ | ||
return (retVal); \ | ||
} \ | ||
} while (false) \ | ||
|
||
#ifndef __APPLE__ | ||
typedef int errno_t; | ||
#endif | ||
|
||
inline errno_t fopen_s(FILE **file, const char *filename, const char *mode) | ||
{ | ||
*file = fopen(filename, mode); | ||
return *file == nullptr ? errno : 0; | ||
#include <jni.h> | ||
#include <memory> | ||
#include <thread> | ||
#include <errno.h> | ||
|
||
#include "PartyPal.h" | ||
#include "Party.h" | ||
|
||
#include "NetworkManager.h" | ||
#include "NetworkStateChangeManager.h" | ||
#include "Managers.h" | ||
#include "LanguageOptions.h" | ||
|
||
#define RETURN_VOID_IF(expr) \ | ||
do { \ | ||
if (expr) \ | ||
{ \ | ||
return; \ | ||
} \ | ||
} while (false) \ | ||
|
||
|
||
#define RETURN_VOID_IF_FALSE(expr) \ | ||
do { \ | ||
if (!(expr)) \ | ||
{ \ | ||
return; \ | ||
} \ | ||
} while (false) \ | ||
|
||
#define RETURN_IF(expression, retVal) \ | ||
do { \ | ||
bool expr = (expression); \ | ||
if (expr) \ | ||
{ \ | ||
return (retVal); \ | ||
} \ | ||
} while (false) \ | ||
|
||
#ifndef __APPLE__ | ||
typedef int errno_t; | ||
#endif | ||
|
||
inline errno_t fopen_s(FILE **file, const char *filename, const char *mode) | ||
{ | ||
*file = fopen(filename, mode); | ||
return *file == nullptr ? errno : 0; | ||
} |
Oops, something went wrong.