4.0.8 & convert utf8

This commit is contained in:
2026-10-13 17:03:09 +08:00
parent 7fa081911b
commit 57b2f5192b
31 changed files with 1277 additions and 1142 deletions
+79 -79
View File
@@ -1,4 +1,4 @@
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
@@ -17,11 +17,11 @@
#define COLOR_BETTING TColor(0x00CDFAFF) //F5F0FF
#define COLOR_BETTED TColor(0x00E1E4FF)
#define COLOR_RESULT TColor(0x00D7B95C) //2FFFAD 5CB9D7
#define RD_6B 0 //六珠路
#define RD_BIG 1 //大路
#define RD_EYE 2 //大眼路
#define RD_LIT 3 //小路
#define RD_COC 4 //小强路
#define RD_6B 0 //六珠路
#define RD_BIG 1 //大路
#define RD_EYE 2 //大眼路
#define RD_LIT 3 //小路
#define RD_COC 4 //小强路
#define TIP_TYPE_BET 0
#define TIP_TYPE_RES 1
@@ -31,11 +31,11 @@ __fastcall TTableFrame::TTableFrame(TComponent* Owner)
: TFrame(Owner)
{
m_sgBets->Canvas->Font = m_sgBets->Font;
m_sgBets->Cells[0][0] = "序号";
m_sgBets->Cells[1][0] = "下注";
m_sgBets->Cells[2][0] = "金额";
m_sgBets->Cells[3][0] = "输赢";
m_sgBets->Cells[4][0] = "赢利";
m_sgBets->Cells[0][0] = "序号";
m_sgBets->Cells[1][0] = "下注";
m_sgBets->Cells[2][0] = "金额";
m_sgBets->Cells[3][0] = "输赢";
m_sgBets->Cells[4][0] = "赢利";
m_sgBets->ColWidths[0] = 32;//DPIX(32);
m_sgBets->ColWidths[1] = 32;//DPIX(32);
m_sgBets->ColWidths[2] = 36;//DPIX(36);
@@ -172,7 +172,7 @@ void __fastcall TTableFrame::UpdateStatus()
m_panBet->Enabled = true;
}
m_lbCards->Caption = "开始下注 ";
m_lbCards->Caption = "开始下注 ";
m_lbTimeout->Caption = IntToStr(m_pGame->timeout);
}
else if(m_pGame->gmstatus==11 || m_pGame->gmstatus==12){
@@ -181,11 +181,11 @@ void __fastcall TTableFrame::UpdateStatus()
m_pBetChipLabels[i]->Hide();
}
m_lbCards->Caption = m_pGame->gmstatus==11 ? "洗牌中..." : "维护中...";
m_lbCards->Caption = m_pGame->gmstatus==11 ? "洗牌中..." : "维护中...";
}
else if(m_pGame->gmstatus==2){
if(m_pGame->bcard.IsEmpty() && m_pGame->pcard.IsEmpty()){
m_lbCards->Caption = "开牌中...";
m_lbCards->Caption = "开牌中...";
memset(m_aManChips, 0, sizeof(m_aManChips));
for(int i=0; i<3; i++)
@@ -196,7 +196,7 @@ void __fastcall TTableFrame::UpdateStatus()
m_btnBetCancel->Enabled = false;
if(m_panBet->Visible){
ShowTip("停止下注", TIP_TYPE_BET);
ShowTip("停止下注", TIP_TYPE_BET);
}
}
else{
@@ -218,7 +218,7 @@ void __fastcall TTableFrame::UpdateStatus()
m_lbCards->Caption = c;
}
else
m_lbCards->Caption = "结算中...";
m_lbCards->Caption = "结算中...";
}
m_lbRCount->Caption = IntToStr(m_pGame->winCount[0]);
@@ -275,7 +275,7 @@ void __fastcall TTableFrame::RoadDrawCell(TObject *Sender, System::LongInt ACol,
TColor rPC = pen->Color;
int rPW = pen->Width;
if(iRoad==RD_6B || iRoad==RD_LIT){ //珠仔路/小路为实心圆
if(iRoad==RD_6B || iRoad==RD_LIT){ //珠仔路/小路为实心圆
if( c==1 )
brush->Color = clRed;
else if( c==2 )
@@ -283,7 +283,7 @@ void __fastcall TTableFrame::RoadDrawCell(TObject *Sender, System::LongInt ACol,
else if( c==3 )
brush->Color = clWebLightSeaGreen;
}
else{ //大路/大眼路/小强路
else{ //大路/大眼路/小强路
pen->Width = iRoad==RD_COC ? dpi7 : dpi3;
if( c==1 )
pen->Color = clRed;
@@ -299,7 +299,7 @@ void __fastcall TTableFrame::RoadDrawCell(TObject *Sender, System::LongInt ACol,
if(t>0)
pen->Color = clWebLightSeaGreen;
if(iRoad==RD_COC || t>0){ //绘制斜条
if(iRoad==RD_COC || t>0){ //绘制斜条
canvas->MoveTo(rc.left, rc.bottom);
canvas->LineTo(rc.right, rc.top);
}
@@ -365,9 +365,9 @@ void __fastcall TTableFrame::BetsDrawCell(TObject *Sender, System::LongInt ACol,
int x=Rect.left,y=Rect.top;
TSize szTxt = pSG->Canvas->TextExtent(strText);
if( ARow==0 ){ //画下框线
x += (Rect.Width() - szTxt.cx) / 2; // -- 水平居中
y += (Rect.Height() - szTxt.cy) / 2;// -- 垂直居中
if( ARow==0 ){ //画下框线
x += (Rect.Width() - szTxt.cx) / 2; // -- 水平居中
y += (Rect.Height() - szTxt.cy) / 2;// -- 垂直居中
TBrushStyle rBS = pSG->Canvas->Brush->Style;
TColor rCl = pSG->Canvas->Brush->Color;
@@ -394,12 +394,12 @@ void __fastcall TTableFrame::BetsDrawCell(TObject *Sender, System::LongInt ACol,
pSG->Canvas->Pen->Style = rPS;
}
else{
if(ACol==1 || ACol==3)//水平居中
if(ACol==1 || ACol==3)//水平居中
x += (Rect.Width() - szTxt.cx) / 2;
else //水平靠右
else //水平靠右
x += (Rect.Width() - szTxt.cx) - DPIX(4);
y += (Rect.Height() - szTxt.cy) / 2;// -- 垂直居中
y += (Rect.Height() - szTxt.cy) / 2;// -- 垂直居中
bool bEven = ARow % 2;
@@ -424,17 +424,17 @@ void __fastcall TTableFrame::BetsDrawCell(TObject *Sender, System::LongInt ACol,
pSG->Canvas->Brush->Color = bEven ? clWhite : COLOR_OVEN;
if(ACol==0){
if(strText=="爆缆")
if(strText=="爆缆")
pSG->Canvas->Font->Color = clRed;
else if(strText=="新局")
else if(strText=="新局")
pSG->Canvas->Font->Color = clGreen;
}
else if(ACol==3){
if(strText=="赢")
if(strText=="赢")
pSG->Canvas->Font->Color = clRed;
else if(strText=="输")
else if(strText=="输")
pSG->Canvas->Font->Color = clBlue;
else if(strText=="和")
else if(strText=="和")
pSG->Canvas->Font->Color = clGreen;
}
@@ -543,7 +543,7 @@ void __fastcall TTableFrame::UMLogUpdate(TMessage &msg)
ClearLogsClick(NULL);
m_logRows++;
m_sgBets->Cells[0][m_logRows] = "新局";
m_sgBets->Cells[0][m_logRows] = "新局";
UpdateLogs();
}
else if(iState==ST_NOBET){
@@ -555,9 +555,9 @@ void __fastcall TTableFrame::UMLogUpdate(TMessage &msg)
else if(iState==ST_BETSET||iState==ST_BETTING){
m_logRows++;
m_sgBets->Cells[0][m_logRows] = m_pGame->iBetSeq & 0xFFFF;
m_sgBets->Cells[1][m_logRows] = m_pGame->iBet==1 ? "庄"
: m_pGame->iBet==2 ? "闲"
: "和";
m_sgBets->Cells[1][m_logRows] = m_pGame->iBet==1 ? "庄"
: m_pGame->iBet==2 ? "闲"
: "和";
m_sgBets->Cells[2][m_logRows] = m_pGame->nChip;
UpdateLogs();
}
@@ -571,89 +571,89 @@ void __fastcall TTableFrame::UMLogUpdate(TMessage &msg)
int res = msg.LParam;
m_sgBets->Cells[3][m_logRows] = "X";
// if(iState==ST_QUASH) //注单撤销
// m_sgBets->Cells[4][m_logRows] = "撤销";
// if(iState==ST_QUASH) //注单撤销
// m_sgBets->Cells[4][m_logRows] = "撤销";
// else
if(res==26)
m_sgBets->Cells[4][m_logRows] = "余额";
m_sgBets->Cells[4][m_logRows] = "余额";
else if(res==25)
m_sgBets->Cells[4][m_logRows] = "超时";
m_sgBets->Cells[4][m_logRows] = "超时";
else if(res==10 || res==11)
m_sgBets->Cells[4][m_logRows] = "限红";
m_sgBets->Cells[4][m_logRows] = "限红";
else if(res==2)
m_sgBets->Cells[4][m_logRows] = "维护";
m_sgBets->Cells[4][m_logRows] = "维护";
else if(res==3)
m_sgBets->Cells[4][m_logRows] = "网络";
m_sgBets->Cells[4][m_logRows] = "网络";
else if(res==4)
m_sgBets->Cells[4][m_logRows] = "违规";
m_sgBets->Cells[4][m_logRows] = "违规";
else{
m_sgBets->Cells[4][m_logRows] = "未知";
DebugPrint("%s 下注失败 %d", ((AnsiString)m_pGame->vid).c_str(), res);
m_sgBets->Cells[4][m_logRows] = "未知";
DebugPrint("%s 下注失败 %d", ((AnsiString)m_pGame->vid).c_str(), res);
}
m_sgBets->Invalidate();
}
else if((iState==ST_CANCELED || iState==ST_QUASH) && m_logRows>0){ //注单取消或撤销
else if((iState==ST_CANCELED || iState==ST_QUASH) && m_logRows>0){ //注单取消或撤销
for(int i=0; i<5; i++)
m_sgBets->Cells[i][m_logRows] = "";
m_logRows--;
UpdateLogs();
}
else if(iState==ST_PAID){ //显示输赢结果日志
else if(iState==ST_PAID){ //显示输赢结果日志
int ret = msg.LParam & 0xFFFF;
int dead = (msg.LParam >> 16) & 0xFF;
int stop = msg.LParam >> 24;
if(ret==0){ //有错误发生
if(ret==0){ //有错误发生
m_sgBets->Cells[3][m_logRows] = "X";
m_sgBets->Cells[4][m_logRows] = "结算";
m_sgBets->Cells[4][m_logRows] = "结算";
}
else{
m_sgBets->Cells[3][m_logRows] = ret==1 ? "赢" : ret==2 ? "输" : "和";
m_sgBets->Cells[3][m_logRows] = ret==1 ? "赢" : ret==2 ? "输" : "和";
m_sgBets->Cells[4][m_logRows] = FormatFloat("0", m_pGame->profit);
}
if(g_bGameOn && (dead || stop)){
int pause = 0;
if(dead && (m_pGame->bIndPolicy || !g_aGames.pRankChip)){ //独立策略或非全局注码
if(dead && (m_pGame->bIndPolicy || !g_aGames.pRankChip)){ //独立策略或非全局注码
m_logRows++;
m_sgBets->Cells[0][m_logRows] = "爆缆";
m_sgBets->Cells[0][m_logRows] = "爆缆";
if(dead==3){
int iCP = m_pGame->bIndPolicy ? m_pGame->iChipPolicy : g_iChipPolicy;
TChipPolicy* pCP = (TChipPolicy*)g_aChipPolicies[iCP];
m_sgBets->Cells[1][m_logRows] = pCP->deadPause ? "暂停" : "重启";
m_sgBets->Cells[1][m_logRows] = pCP->deadPause ? "暂停" : "重启";
if(pause<pCP->deadPause)
pause = pCP->deadPause;
}
else if(dead==2)
m_sgBets->Cells[1][m_logRows] = "局停";
m_sgBets->Cells[1][m_logRows] = "局停";
else if(dead==1)
m_sgBets->Cells[1][m_logRows] = "停止";
m_sgBets->Cells[1][m_logRows] = "停止";
}
if(stop){
m_logRows++;
m_sgBets->Cells[0][m_logRows] = ret==1 ? "止赢" : "止损";
m_sgBets->Cells[0][m_logRows] = ret==1 ? "止赢" : "止损";
if(stop==3){
int nPause = ret==1 ? g_settings.nTableWinPause : g_settings.nTableLosPause;
m_sgBets->Cells[1][m_logRows] = nPause ? "暂停" : "重启";
m_sgBets->Cells[1][m_logRows] = nPause ? "暂停" : "重启";
if(pause<nPause)
pause = nPause;
}
else if(stop==2)
m_sgBets->Cells[1][m_logRows] = "局停";
m_sgBets->Cells[1][m_logRows] = "局停";
else if(stop==1)
m_sgBets->Cells[1][m_logRows] = "停止";
m_sgBets->Cells[1][m_logRows] = "停止";
}
UpdateLogs();
if(dead==1 && (m_pGame->bIndPolicy || !g_aGames.pRankChip) || stop==1){ //本桌停止
if(dead==1 && (m_pGame->bIndPolicy || !g_aGames.pRankChip) || stop==1){ //本桌停止
SetRun(false);
}
else if(pause){ //暂停
else if(pause){ //暂停
m_pGame->Pause(true);
ClearPauseTimer();
@@ -669,12 +669,12 @@ void __fastcall TTableFrame::UMLogUpdate(TMessage &msg)
if(!g_aGames.bFloat){
if(ret==1)
m_lbSeq->Caption = "连赢:" + IntToStr(m_pGame->seqCount[0]);
m_lbSeq->Caption = "连赢:" + IntToStr(m_pGame->seqCount[0]);
else if(ret==2)
m_lbSeq->Caption = "连输:" + IntToStr(m_pGame->seqCount[1]);
m_lbSeq->Caption = "连输:" + IntToStr(m_pGame->seqCount[1]);
}
m_lbProfit->Caption = "赢利: " + FormatFloat("0", m_pGame->profit);
m_lbProfit->Caption = "赢利: " + FormatFloat("0", m_pGame->profit);
}
}
//---------------------------------------------------------------------------
@@ -700,7 +700,7 @@ void __fastcall TTableFrame::UMUpdate(TMessage &msg)
int res = msg.LParam;
if(m_panBet->Visible){
String tip = res==0 ? "下注成功" : res==26 ? "余额不足" : "下注失败";
String tip = res==0 ? "下注成功" : res==26 ? "余额不足" : "下注失败";
ShowTip(tip, TIP_TYPE_BET);
}
@@ -743,11 +743,11 @@ void __fastcall TTableFrame::UMUpdate(TMessage &msg)
else if(type==UPDATE_RESET){
int type = msg.LParam;
if(type==0)
m_lbProfit->Caption = "赢利: ";
m_lbProfit->Caption = "赢利: ";
else if(type==1)
m_lbSeq->Caption = "连赢:";
m_lbSeq->Caption = "连赢:";
else if(type==2)
m_lbSeq->Caption = "连输:";
m_lbSeq->Caption = "连输:";
else if(type==3)
ClearPauseTimer();
}
@@ -851,9 +851,9 @@ void __fastcall TTableFrame::BetOkClick(TObject *Sender)
}
if(!g_bTesting && tot>g_fBalance)
ShowTip("余额不足", TIP_TYPE_BET);
ShowTip("余额不足", TIP_TYPE_BET);
else if(tot>g_MaxOnBet)
ShowTip("超出限红", TIP_TYPE_BET);
ShowTip("超出限红", TIP_TYPE_BET);
else if(tot>0 && m_pGame)
m_pGame->ManualBetOn(m_aManChips);
}
@@ -966,34 +966,34 @@ void __fastcall TTableFrame::IPClick(TObject *Sender)
}
//---------------------------------------------------------------------------
char* u_sRoad[5] = {"六珠路","大路","大眼路","小路","小强路"}; //路珠名称
char* u_sRoad[5] = {"六珠路","大路","大眼路","小路","小强路"}; //路珠名称
void __fastcall TTableFrame::UpdateIP()
{
String hint;
if(m_pGame->bIndPolicy){
hint = "独立策略(点击修改设置)";
hint = "独立策略(点击修改设置)";
if(m_pGame->iBetPolicy<0)
hint += "\n打法:全局策略";
hint += "\n打法:全局策略";
else
hint += "\n打法:" + g_aBetPolicies[m_pGame->iBetPolicy]->name;
hint += "\n打法:" + g_aBetPolicies[m_pGame->iBetPolicy]->name;
hint += "\n路单:" + String(u_sRoad[m_pGame->iRoad<0 ? g_iRoad : m_pGame->iRoad]);
hint += "\n路单:" + String(u_sRoad[m_pGame->iRoad<0 ? g_iRoad : m_pGame->iRoad]);
if(m_pGame->iChipPolicy<0)
hint += "\n注码:全局策略";
hint += "\n注码:全局策略";
else{
TBasePolicy* pPolicy = g_aChipPolicies[m_pGame->iChipPolicy];
hint += "\n注码:" + pPolicy->name;
hint += "\n注码:" + pPolicy->name;
if(pPolicy->kind!=KIND_CHIP_COM)
hint += "\n倍数:" + IntToStr(m_pGame->nChipMul);
hint += "\n倍数:" + IntToStr(m_pGame->nChipMul);
}
}
else{
hint = "全局策略(点击设置独立策略)";
hint = "全局策略(点击设置独立策略)";
if(m_pGame->iRoad>=0){
hint += "\n路单:" + String(u_sRoad[m_pGame->iRoad]);
hint += "\n路单:" + String(u_sRoad[m_pGame->iRoad]);
}
}