OpenFusion/src/core/CNShared.hpp

30 lines
677 B
C++
Raw Normal View History

2020-08-18 20:42:30 +00:00
/*
* core/CNShared.hpp
* 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
#pragma once
2020-08-18 20:42:30 +00:00
#include <map>
#include <string>
#include "Player.hpp"
/*
* Connecions time out after 5 minutes, checked every 30 seconds.
*/
#define CNSHARED_TIMEOUT 300000
#define CNSHARED_PERIOD 30000
struct LoginMetadata {
uint64_t FEKey;
int32_t playerId;
time_t timestamp;
};
2020-08-18 20:42:30 +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
}