core, web_service: Changes to announce service

Separated registering and updating to correspond to the new announce API endpoint. Also added a verify_UID for JWT audience verification.
This commit is contained in:
zhupengfei
2018-10-27 15:40:15 +08:00
parent 1a8841f96e
commit ab335ccf1b
5 changed files with 135 additions and 49 deletions

View File

@@ -4,6 +4,7 @@
#pragma once
#include <atomic>
#include <functional>
#include <memory>
#include <mutex>
@@ -13,6 +14,10 @@
#include "common/common_types.h"
#include "common/thread.h"
namespace Network {
class Room;
}
namespace Core {
/**
@@ -39,6 +44,9 @@ public:
*/
void UnbindErrorCallback(CallbackHandle handle);
/// Registers a room to web services
void Register();
/**
* Starts the announce of a room to web services
*/
@@ -65,6 +73,9 @@ private:
/// Backend interface that logs fields
std::unique_ptr<AnnounceMultiplayerRoom::Backend> backend;
std::atomic_bool registered = false; ///< Whether the room has been registered
void UpdateBackendData(std::shared_ptr<Network::Room> room);
void AnnounceMultiplayerLoop();
};