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
No known key found for this signature in database
GPG key ID: DD129E108BD09378
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();
};