6f0ba8e896
Co-authored-by: 3kynox <thierry.prost@gmail.com> Co-authored-by: nox <nox@noxen.net> Co-authored-by: Ludwig <sudlud@users.noreply.github.com>
44 lines
1.2 KiB
C
44 lines
1.2 KiB
C
#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
|