251 lines
7.2 KiB
C
251 lines
7.2 KiB
C
|
|
#ifndef GLOBAL_USER_INFO_HEAD_FILE
|
|||
|
|
#define GLOBAL_USER_INFO_HEAD_FILE
|
|||
|
|
|
|||
|
|
#pragma once
|
|||
|
|
|
|||
|
|
#include "Define.h"
|
|||
|
|
#include "Types.h"
|
|||
|
|
#include "Struct.h"
|
|||
|
|
#include "CMD_LogonServer.h"
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|||
|
|
//结构定义
|
|||
|
|
|
|||
|
|
#define PI (3.1415926f)
|
|||
|
|
#define EARTH_RADIUS (6378.137f) //地球近似半径
|
|||
|
|
#define DOUBLE_TO_SCORE (1000000.f) //
|
|||
|
|
|
|||
|
|
//用户信息
|
|||
|
|
struct tagGlobalUserData
|
|||
|
|
{
|
|||
|
|
tagGlobalUserData()
|
|||
|
|
{
|
|||
|
|
zeromemory(szUserChannel,sizeof(szUserChannel));
|
|||
|
|
zeromemory(szLogonIP,sizeof(szLogonIP));
|
|||
|
|
}
|
|||
|
|
//基本资料
|
|||
|
|
uint32 dwUserID; //用户 I D
|
|||
|
|
uint32 dwGameID; //游戏 I D
|
|||
|
|
uint32 dwUserMedal; //用户奖牌
|
|||
|
|
uint32 dwExperience; //用户经验
|
|||
|
|
uint32 dwLoveLiness; //用户魅力
|
|||
|
|
uint32 dwSpreaderID; //推广ID
|
|||
|
|
char szAccounts[LEN_ACCOUNTS]; //登录帐号
|
|||
|
|
char szNickName[LEN_NICKNAME]; //用户昵称
|
|||
|
|
char szPassword[LEN_PASSWORD]; //登录密码
|
|||
|
|
char szDynamicPass[LEN_PASSWORD]; //动态密码
|
|||
|
|
char szLogonIP[LEN_ACCOUNTS]; //登录IP
|
|||
|
|
char szUserChannel[LEN_NICKNAME]; //渠道号
|
|||
|
|
|
|||
|
|
//用户成绩
|
|||
|
|
SCORE lUserScore; //用户游戏币
|
|||
|
|
SCORE lUserInsure; //银行游戏币
|
|||
|
|
SCORE lGrade; //私人场经验
|
|||
|
|
double dUserBeans; //用户游戏豆
|
|||
|
|
uint8 cbWXShareTimes; //微信分享次数
|
|||
|
|
|
|||
|
|
//扩展资料
|
|||
|
|
uint8 cbGender; //用户性别
|
|||
|
|
uint8 cbMoorMachine; //锁定机器
|
|||
|
|
char szUnderWrite[LEN_UNDER_WRITE]; //个性签名
|
|||
|
|
|
|||
|
|
//社团资料
|
|||
|
|
uint32 dwGroupID; //社团索引
|
|||
|
|
char szGroupName[LEN_GROUP_NAME]; //社团名字
|
|||
|
|
|
|||
|
|
//会员资料
|
|||
|
|
uint8 cbMemberOrder; //会员等级
|
|||
|
|
systemtime MemberOverDate; //到期时间
|
|||
|
|
|
|||
|
|
//头像信息
|
|||
|
|
uint16 wFaceID; //头像索引
|
|||
|
|
uint32 dwCustomID; //自定标识
|
|||
|
|
tagCustomFaceInfo CustomFaceInfo; //自定头像
|
|||
|
|
char szHeadHttp[LEN_HEAD_HTTP]; //http头像
|
|||
|
|
|
|||
|
|
//配置信息
|
|||
|
|
uint8 cbInsureEnabled; //银行使能
|
|||
|
|
|
|||
|
|
uint32 dwWinCount; //胜利盘数
|
|||
|
|
uint32 dwLostCount; //失败盘数
|
|||
|
|
uint32 dwDrawCount; //和局盘数
|
|||
|
|
uint32 dwFleeCount; //逃跑盘数
|
|||
|
|
|
|||
|
|
bool isLottery; //今天是否参与摇奖;false不可抽奖,true可以抽奖;
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//扩展资料
|
|||
|
|
struct tagIndividualUserData
|
|||
|
|
{
|
|||
|
|
//用户信息
|
|||
|
|
char szUserNote[LEN_USER_NOTE]; //用户说明
|
|||
|
|
char szCompellation[LEN_COMPELLATION]; //真实名字
|
|||
|
|
|
|||
|
|
//电话号码
|
|||
|
|
char szSeatPhone[LEN_SEAT_PHONE]; //固定电话
|
|||
|
|
char szMobilePhone[LEN_MOBILE_PHONE]; //移动电话
|
|||
|
|
|
|||
|
|
//联系资料
|
|||
|
|
char szQQ[LEN_QQ]; //Q Q 号码
|
|||
|
|
char szEMail[LEN_EMAIL]; //电子邮件
|
|||
|
|
char szDwellingPlace[LEN_DWELLING_PLACE];//联系地址
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//银行信息
|
|||
|
|
// struct tagUserInsureInfo
|
|||
|
|
// {
|
|||
|
|
// uint16 wRevenueTake; //税收比例
|
|||
|
|
// uint16 wRevenueTransfer; //税收比例
|
|||
|
|
// uint16 wServerID; //房间标识
|
|||
|
|
// SCORE lUserScore; //用户游戏币
|
|||
|
|
// SCORE lUserInsure; //银行游戏币
|
|||
|
|
// SCORE lUserIngot; //用户元宝
|
|||
|
|
// double dUserBeans; //用户游戏逗
|
|||
|
|
// SCORE lTransferPrerequisite; //转账条件
|
|||
|
|
// uint8 cbInsureEnabled; //银行使能条件
|
|||
|
|
// };
|
|||
|
|
|
|||
|
|
//银行信息
|
|||
|
|
struct tagUserInsureInfo
|
|||
|
|
{
|
|||
|
|
uint16 wRevenueTake; //税收比例
|
|||
|
|
uint16 wRevenueTransfer; //税收比例
|
|||
|
|
uint16 wRevenueTransferMember; //税收比例
|
|||
|
|
uint16 wServerID; //房间标识
|
|||
|
|
SCORE lUserScore; //用户游戏币
|
|||
|
|
SCORE lUserInsure; //银行游戏币
|
|||
|
|
SCORE lTransferPrerequisite; //转帐条件
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
// 玩家位置
|
|||
|
|
struct tagUserAddr
|
|||
|
|
{
|
|||
|
|
bool isInit; // 是否获取到改信息;
|
|||
|
|
|
|||
|
|
float latitude; // 经度
|
|||
|
|
float longitude; // 纬度
|
|||
|
|
float accuracy; // 精度
|
|||
|
|
|
|||
|
|
std::string strProvider; // 提供者
|
|||
|
|
std::string strAddress; // 地理位置
|
|||
|
|
|
|||
|
|
tagUserAddr()
|
|||
|
|
{
|
|||
|
|
ResetData();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
void ResetData()
|
|||
|
|
{
|
|||
|
|
isInit = false;
|
|||
|
|
latitude = 0.f;
|
|||
|
|
longitude = 0.f;
|
|||
|
|
accuracy = 0.f;
|
|||
|
|
strProvider = "";
|
|||
|
|
strAddress = "";
|
|||
|
|
}
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
class GlobalUserInfoSink
|
|||
|
|
{
|
|||
|
|
public:
|
|||
|
|
GlobalUserInfoSink(){}
|
|||
|
|
~GlobalUserInfoSink(){}
|
|||
|
|
public:
|
|||
|
|
virtual void upPlayerInfo() = 0;
|
|||
|
|
virtual void LoginSucess() = 0;
|
|||
|
|
};
|
|||
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
//用户信息
|
|||
|
|
class CGlobalUserInfo
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
//用户信息
|
|||
|
|
protected:
|
|||
|
|
tagGlobalUserData m_GlobalUserData; //用户资料
|
|||
|
|
tagIndividualUserData m_IndividualUserData; //扩展资料
|
|||
|
|
//tagUserInsureInfo m_UserInsureInfo; //银行资料
|
|||
|
|
tagUserAddr m_UserAddr; //用户信息
|
|||
|
|
|
|||
|
|
tagGrowLevelParameter m_GrowLevelParameter; //用户等级信息
|
|||
|
|
|
|||
|
|
static GlobalUserInfoSink* m_pUserInfoSink;
|
|||
|
|
|
|||
|
|
bool m_IsShowLottery; //是否显示抽奖信息(从游戏界面返回控制抽奖界面显示)
|
|||
|
|
|
|||
|
|
//附加变量
|
|||
|
|
protected:
|
|||
|
|
uint32 m_dwUserRight; //用户权限
|
|||
|
|
uint32 m_dwMasterRight; //管理权限
|
|||
|
|
|
|||
|
|
//静态变量
|
|||
|
|
protected:
|
|||
|
|
static CGlobalUserInfo * m_pGlobalUserInfo; //用户信息
|
|||
|
|
|
|||
|
|
//函数定义
|
|||
|
|
public:
|
|||
|
|
//构造函数
|
|||
|
|
CGlobalUserInfo();
|
|||
|
|
//析构函数
|
|||
|
|
virtual ~CGlobalUserInfo();
|
|||
|
|
|
|||
|
|
//功能函数
|
|||
|
|
public:
|
|||
|
|
//重置资料
|
|||
|
|
void ResetUserInfoData();
|
|||
|
|
//用户资料
|
|||
|
|
tagGlobalUserData * GetGlobalUserData() { return &m_GlobalUserData; }
|
|||
|
|
//扩展资料
|
|||
|
|
tagIndividualUserData * GetIndividualUserData() { return &m_IndividualUserData; }
|
|||
|
|
//银行资料
|
|||
|
|
//tagUserInsureInfo * GetUserInsureInfo() { return &m_UserInsureInfo; }
|
|||
|
|
//用户等级
|
|||
|
|
tagGrowLevelParameter *GetUserGrowLevelParameter(){
|
|||
|
|
return &m_GrowLevelParameter;
|
|||
|
|
}
|
|||
|
|
std::string getPhoneNumber();
|
|||
|
|
|
|||
|
|
//是否显示抽奖信息(从游戏界面返回控制抽奖界面显示)
|
|||
|
|
void SetShowNotice(bool isShow) { m_IsShowLottery = isShow; }
|
|||
|
|
bool GetShowNotice() { return m_IsShowLottery; }
|
|||
|
|
|
|||
|
|
// 权限;
|
|||
|
|
void SetUserRight(uint32 dwUserRight){ m_dwUserRight = dwUserRight; }
|
|||
|
|
void SetMasterRight(uint32 dwMasterRight){ m_dwMasterRight = dwMasterRight; }
|
|||
|
|
uint32 GetUserRigh(){ return m_dwUserRight; }
|
|||
|
|
uint32 GetMasterRight(){ return m_dwMasterRight; }
|
|||
|
|
|
|||
|
|
// 地里位置;
|
|||
|
|
void onLocationChanaged(std::string strJson);
|
|||
|
|
double GetDistance(double latitude, double longitude);
|
|||
|
|
tagUserAddr* GetUserAddr();
|
|||
|
|
double radian(double d);
|
|||
|
|
|
|||
|
|
public:
|
|||
|
|
static void setNickName(std::string kName);
|
|||
|
|
static void setAccounts(std::string kAccounts);
|
|||
|
|
static void setUserScore(SCORE lScore);
|
|||
|
|
static void setUserInsure(SCORE lScore);
|
|||
|
|
static uint32 getUserID();
|
|||
|
|
static uint32 getGameID();
|
|||
|
|
static char* getPassword();
|
|||
|
|
static uint8 getGender();
|
|||
|
|
static std::string getNickName();
|
|||
|
|
static std::string getHeadHttp();
|
|||
|
|
static std::string getUserChannel();
|
|||
|
|
static std::string getAccounts();
|
|||
|
|
static SCORE getUserScore();
|
|||
|
|
static SCORE getUserInsure();
|
|||
|
|
|
|||
|
|
static void setSink(GlobalUserInfoSink* pSink);
|
|||
|
|
static void upPlayerInfo();
|
|||
|
|
static void LoginSucess();
|
|||
|
|
//静态函数
|
|||
|
|
public:
|
|||
|
|
//获取对象
|
|||
|
|
static CGlobalUserInfo * GetInstance() { return m_pGlobalUserInfo; }
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
//////////////////////////////////////////////////////////////////////////////////
|
|||
|
|
|
|||
|
|
#endif
|