2020-08-18 20:42:30 +00:00
|
|
|
/*
|
2021-03-17 19:07:40 +00:00
|
|
|
* core/CNShared.hpp
|
2020-10-19 17:26:14 +00:00
|
|
|
* There's some data shared between the Login Server and the Shard Server. Of course all of this needs to be thread-safe. No mucking about on this one!
|
|
|
|
*/
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2020-08-23 17:14:54 +00:00
|
|
|
#pragma once
|
2020-08-18 20:42:30 +00:00
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "Player.hpp"
|
|
|
|
|
2022-07-31 01:16:07 +00:00
|
|
|
/*
|
|
|
|
* Connecions time out after 15 minutes, checked every 30 seconds.
|
|
|
|
*/
|
|
|
|
#define CNSHARED_TIMEOUT 900000
|
|
|
|
#define CNSHARED_PERIOD 30000
|
2022-07-23 22:16:04 +00:00
|
|
|
|
|
|
|
struct LoginMetadata {
|
|
|
|
uint64_t FEKey;
|
2022-12-06 00:07:21 +00:00
|
|
|
int32_t playerId;
|
2022-07-23 22:16:04 +00:00
|
|
|
time_t timestamp;
|
|
|
|
};
|
2020-08-18 20:42:30 +00:00
|
|
|
|
2022-07-23 22:16:04 +00:00
|
|
|
namespace CNShared {
|
|
|
|
void storeLoginMetadata(int64_t sk, LoginMetadata *lm);
|
|
|
|
LoginMetadata* getLoginMetadata(int64_t sk);
|
|
|
|
void pruneLoginMetadata(CNServer *serv, time_t currTime);
|
2020-08-18 20:42:30 +00:00
|
|
|
}
|