feat(Core): Add clustering support (#16832)
Co-authored-by: 3kynox <thierry.prost@gmail.com> Co-authored-by: nox <nox@noxen.net> Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
f23ac046ab
commit
6f0ba8e896
+43
@@ -0,0 +1,43 @@
|
||||
#ifndef __PLAYER_MONEY_API__
|
||||
#define __PLAYER_MONEY_API__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum PlayerMoneyErrorCode {
|
||||
PlayerMoneyErrorCodeNoError = 0,
|
||||
PlayerMoneyErrorCodeNoHandler = 1,
|
||||
PlayerMoneyErrorCodePlayerNotFound = 2,
|
||||
PlayerMoneyErrorCodeTooMuchMoney = 3,
|
||||
} PlayerMoneyErrorCode;
|
||||
|
||||
// GetMoneyForPlayer request.
|
||||
typedef struct {
|
||||
int errorCode;
|
||||
uint32_t money;
|
||||
} GetMoneyForPlayerResponse;
|
||||
|
||||
typedef GetMoneyForPlayerResponse (*GetMoneyForPlayerHandler) (uint64_t /*player_guid*/);
|
||||
void SetGetMoneyForPlayerHandler(GetMoneyForPlayerHandler h);
|
||||
GetMoneyForPlayerResponse CallGetMoneyForPlayerHandler(uint64_t player_guid);
|
||||
|
||||
// ModifyMoneyForPlayer request.
|
||||
typedef struct {
|
||||
int errorCode;
|
||||
uint32_t newMoneyValue;
|
||||
} ModifyMoneyForPlayerResponse;
|
||||
|
||||
typedef ModifyMoneyForPlayerResponse (*ModifyMoneyForPlayerHandler) (uint64_t /*player_guid*/, int32_t /*amount*/);
|
||||
void SetModifyMoneyForPlayerHandler(ModifyMoneyForPlayerHandler h);
|
||||
ModifyMoneyForPlayerResponse CallModifyMoneyForPlayerHandler(uint64_t player_guid, int32_t amount);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user