#ifndef __GT_CORE_STRUCT_H__
#define __GT_CORE_STRUCT_H__

#define MAX_COMM_LINE_SIZE 12

#define MAX_MTU 5120


typedef struct __stCommAttr
{
    unsigned char ucType;//线路类型，0－VPDN，1－PSTN，2－ADSL，3－GPRS，4－CDMA，5－LAN，，6－培训模式，7－WCDMA，8－CDMA2000
    unsigned char ucLineID;//通信线路标记
    unsigned char ucValid;//此线路是否允许使用
    unsigned char unused;
    char strName[32];//线路名称
    char strDialNum[32];//接入号码
    char strUser[32];//接入用户
    char strPassword[16];//接入密码
    char strDns1[16];//DNS1
    char strDns2[16];//DNS2
    char strDomainName[32];//域名/APN
    char strIP1[16];//接入通信地址1
    char strIP2[16];//接入通信地址2
    char strIP3[16];//接入通信地址3
    char strIP4[16];//接入通信地址4
    unsigned int unPort1;//接入端口1
    unsigned int unPort2;//接入端口2
    unsigned int unPort3;//接入端口3
    unsigned int unPort4;//接入端口4
}stCommAttr;

typedef struct _stTerminal
{
    char strTerminalID[32];//终端站点编号
    char strTerminalCert[64];//终端认证码
    unsigned char ucTerminalAuthType;//终端认证方式，0－不认证，1－虚拟的物理机号，2－SAM卡认证方式，3－CA数字证书认证
    unsigned char ucCommLineNo;//默认的通信线路编号
    unsigned char ucOfflineMode;//离线模式
    char unused;
    stCommAttr commAttr[MAX_COMM_LINE_SIZE];//通信线路属性
}stTerminal;

typedef struct __stRuntime
{
    unsigned char ucUserID;//操作员ID
    unsigned char ucUserLevel;//操作员权限级别
    unsigned char ucUserAuthType;//操作员认证方式0－不认证，1－密码认证，2－IC卡认证，3－指纹认证
    unsigned char ucCommEncryptType;//通信加密类型
    char strUserPassword[32];//操作员密码
    double dBalance;//账户余额
    double dCredit;//账户信用额度
}stRuntime;

typedef struct __stCtrlInfo
{
    unsigned char ucBackupFlag;
    unsigned char ucFileDownload;
    unsigned char ucMsgDownload;
    unsigned char ucPaperMarkMode;
    unsigned char ucPrnCashBill;
    unsigned char ucPrnCancelBill;
    unsigned char ucPrnSPCancelBill;
    unsigned char ucHalfTicketCtrl;
    unsigned char ucTicketControl;
    unsigned char ucEnterLevel;
    unsigned char ucHeartBeatControl;
    unsigned char ucConnLine;
    unsigned char ucUserAuthType;
    unsigned char ucTerminalAuthType;
    unsigned char ucUnused[2];
    unsigned int unHeartbeatTime;
    char strAdminPwd[32];
    long lServerTime;
    double dTicketCtrlMoney;
}stCtrlInfo;

typedef struct __stGameRuntimeAttr
{
    char strGameName[256];//游戏名称
    unsigned int unGameID;//游戏ID
    unsigned char ucIsValid;//游戏有效性
    unsigned char ucIsAllowSale;//游戏销售权限
    unsigned char ucIsAllowCash;//游戏兑奖权限
    unsigned char ucIsAllowCancel;//游戏注销权限
    unsigned long ulIssue;//游戏期号
    unsigned long ulDrawTime;//游戏开奖时间
    unsigned long ulSSaleTime;//游戏开始销售时间
    unsigned long ulESaleTime;//游戏结束销售时间
    unsigned long ulGameTSN;//游戏当前流水号
}stGameRuntimeAttr;

typedef struct __stGameRuntime
{
    unsigned int unGameCount;//游戏总数
    unsigned int strGameSN[256];//和GameID对应的GameSN游戏序号数值
    stGameRuntimeAttr gameAttr[128];//游戏属性
}stGameRuntime;

typedef struct __stLastTicket
{
    unsigned long ulKey;
    unsigned long ulIndex;
    unsigned long ulIssue;
    unsigned long ulTerminalID;
    unsigned long ulTicketSN;
    unsigned long ulFrontSN;
    unsigned int unGameID;
}stLastTicket;

#endif
