init
This commit is contained in:
37
Servers/游戏组件/房卡牛牛/GameProject.sln
Normal file
37
Servers/游戏组件/房卡牛牛/GameProject.sln
Normal file
@@ -0,0 +1,37 @@
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 2013
|
||||
VisualStudioVersion = 12.0.40629.0
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "游戏服务端", "游戏服务器\GameServer.vcxproj", "{CA071FF5-97BF-42C3-99AF-FE8F8A0F0AF2}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "控制服务器", "服务器控制\ServerControl.vcxproj", "{E30A6C9B-6B5E-4348-BC0E-67E1A22EEAAF}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug_Unicode|Win32 = Debug_Unicode|Win32
|
||||
Debug|Win32 = Debug|Win32
|
||||
Release_Unicode|Win32 = Release_Unicode|Win32
|
||||
Release|Win32 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{CA071FF5-97BF-42C3-99AF-FE8F8A0F0AF2}.Debug_Unicode|Win32.ActiveCfg = Debug_Unicode|Win32
|
||||
{CA071FF5-97BF-42C3-99AF-FE8F8A0F0AF2}.Debug_Unicode|Win32.Build.0 = Debug_Unicode|Win32
|
||||
{CA071FF5-97BF-42C3-99AF-FE8F8A0F0AF2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{CA071FF5-97BF-42C3-99AF-FE8F8A0F0AF2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{CA071FF5-97BF-42C3-99AF-FE8F8A0F0AF2}.Release_Unicode|Win32.ActiveCfg = Release_Unicode|Win32
|
||||
{CA071FF5-97BF-42C3-99AF-FE8F8A0F0AF2}.Release_Unicode|Win32.Build.0 = Release_Unicode|Win32
|
||||
{CA071FF5-97BF-42C3-99AF-FE8F8A0F0AF2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{CA071FF5-97BF-42C3-99AF-FE8F8A0F0AF2}.Release|Win32.Build.0 = Release|Win32
|
||||
{E30A6C9B-6B5E-4348-BC0E-67E1A22EEAAF}.Debug_Unicode|Win32.ActiveCfg = Debug_Unicode|Win32
|
||||
{E30A6C9B-6B5E-4348-BC0E-67E1A22EEAAF}.Debug_Unicode|Win32.Build.0 = Debug_Unicode|Win32
|
||||
{E30A6C9B-6B5E-4348-BC0E-67E1A22EEAAF}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{E30A6C9B-6B5E-4348-BC0E-67E1A22EEAAF}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{E30A6C9B-6B5E-4348-BC0E-67E1A22EEAAF}.Release_Unicode|Win32.ActiveCfg = Release_Unicode|Win32
|
||||
{E30A6C9B-6B5E-4348-BC0E-67E1A22EEAAF}.Release_Unicode|Win32.Build.0 = Release_Unicode|Win32
|
||||
{E30A6C9B-6B5E-4348-BC0E-67E1A22EEAAF}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{E30A6C9B-6B5E-4348-BC0E-67E1A22EEAAF}.Release|Win32.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
BIN
Servers/游戏组件/房卡牛牛/GameProject.v12.suo
Normal file
BIN
Servers/游戏组件/房卡牛牛/GameProject.v12.suo
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/ServerControl.exp
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/ServerControl.exp
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/ServerControl.lib
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/ServerControl.lib
Normal file
Binary file not shown.
28
Servers/游戏组件/房卡牛牛/服务器控制/Debug/ServerControl.log
Normal file
28
Servers/游戏组件/房卡牛牛/服务器控制/Debug/ServerControl.log
Normal file
@@ -0,0 +1,28 @@
|
||||
生成启动时间为 2020-04-06 21:58:03。
|
||||
1>项目“H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\服务器控制\ServerControl.vcxproj”在节点 3 上(Build 个目标)。
|
||||
1>ClCompile:
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D _AFXEXT /D _WINDLL /D _MBCS /D _AFXDLL /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yc"stdafx.h" /Fp"Debug\NiuNiuServerControl.pch" /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt stdafx.cpp
|
||||
stdafx.cpp
|
||||
1>c:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\afx.h(38): warning C4996: 'MBCS_Support_Deprecated_In_MFC': MBCS support in MFC is deprecated and may be removed in a future version of MFC.
|
||||
c:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\afx.h(33) : 参见“MBCS_Support_Deprecated_In_MFC”的声明
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D _AFXEXT /D _WINDLL /D _MBCS /D _AFXDLL /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yu"stdafx.h" /Fp"Debug\NiuNiuServerControl.pch" /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt GameLogic.cpp ServerControl.cpp ServerControlItemSink.cpp
|
||||
ServerControlItemSink.cpp
|
||||
ServerControl.cpp
|
||||
GameLogic.cpp
|
||||
正在生成代码...
|
||||
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(1186,5): warning MSB8012: TargetPath(H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\服务器控制\Debug\NiuNiuServerControl.dll) does not match the Linker's OutputFile property value (H:\git\wnmj\wnmj\运行\Debug\Ansi\NiuNiuServerControl.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
|
||||
Link:
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"../../../../运行/Debug/Ansi/NiuNiuServerControl.dll" /INCREMENTAL /NOLOGO /DEF:".\ServerControl.def" /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /manifestinput:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Include\Manifest\dpiaware.manifest" /DEBUG /PDB:"Debug\NiuNiuServerControl.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"Debug\ServerControl.lib" /MACHINE:X86 /SAFESEH /DLL Debug\ServerControl.res
|
||||
Debug\GameLogic.obj
|
||||
Debug\ServerControl.obj
|
||||
Debug\ServerControlItemSink.obj
|
||||
Debug\stdafx.obj
|
||||
1>GameLogic.obj : warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/SAFESEH”规范)
|
||||
正在创建库 Debug\ServerControl.lib 和对象 Debug\ServerControl.exp
|
||||
1>ServerControl.exp : warning LNK4070: .EXP 中的 /OUT:ServerControl.dll 指令与输出文件名“../../../../运行/Debug/Ansi/NiuNiuServerControl.dll”不同;忽略指令
|
||||
ServerControl.vcxproj -> H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\服务器控制\Debug\NiuNiuServerControl.dll
|
||||
1>已完成生成项目“H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\服务器控制\ServerControl.vcxproj”(Build 个目标)的操作。
|
||||
|
||||
生成成功。
|
||||
|
||||
已用时间 00:00:08.70
|
||||
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/ServerControl.res
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/ServerControl.res
Normal file
Binary file not shown.
3140
Servers/游戏组件/房卡牛牛/服务器控制/Debug/msado15.tlh
Normal file
3140
Servers/游戏组件/房卡牛牛/服务器控制/Debug/msado15.tlh
Normal file
File diff suppressed because it is too large
Load Diff
2126
Servers/游戏组件/房卡牛牛/服务器控制/Debug/msado15.tli
Normal file
2126
Servers/游戏组件/房卡牛牛/服务器控制/Debug/msado15.tli
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/CL.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/CL.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/CL.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/CL.write.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/cl.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/cl.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/link.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/link.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/link.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/link.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/link.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/link.write.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/rc.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/rc.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/rc.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/rc.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/rc.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/rc.write.1.tlog
Normal file
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit
|
||||
Debug|Win32|H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\|
|
||||
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/控制服务器.write.1u.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Debug/控制服务器.tlog/控制服务器.write.1u.tlog
Normal file
Binary file not shown.
284
Servers/游戏组件/房卡牛牛/服务器控制/GameLogic.cpp
Normal file
284
Servers/游戏组件/房卡牛牛/服务器控制/GameLogic.cpp
Normal file
@@ -0,0 +1,284 @@
|
||||
#include "StdAfx.h"
|
||||
#include "GameLogic.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//扑克数据
|
||||
BYTE CGameLogic::m_cbCardListData[52]=
|
||||
{
|
||||
//0x1C,0x1D,0x3B,0x3C,0x3D,0x09,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x0A,0x0B,0x0C,0x0D, //方块 A - K
|
||||
//0x3A,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B, //梅花 A - K
|
||||
//0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D, //红桃 A - K
|
||||
//0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39 //黑桃 A - K
|
||||
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D, //方块 A - K
|
||||
0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D, //梅花 A - K
|
||||
0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D, //红桃 A - K
|
||||
0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D //黑桃 A - K
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//构造函数
|
||||
CGameLogic::CGameLogic()
|
||||
{
|
||||
}
|
||||
|
||||
//析构函数
|
||||
CGameLogic::~CGameLogic()
|
||||
{
|
||||
}
|
||||
|
||||
//获取类型
|
||||
BYTE CGameLogic::GetCardType(BYTE cbCardData[], BYTE cbCardCount)
|
||||
{
|
||||
ASSERT(cbCardCount==MAX_COUNT);
|
||||
|
||||
////炸弹牌型
|
||||
//BYTE bSameCount = 0;
|
||||
//SortCardList(cbCardData,cbCardCount);
|
||||
//BYTE bSecondValue = GetCardValue(cbCardData[MAX_COUNT/2]);
|
||||
//for(BYTE i=0;i<cbCardCount;i++)
|
||||
//{
|
||||
// if(bSecondValue == GetCardValue(cbCardData[i]))
|
||||
// {
|
||||
// bSameCount++;
|
||||
// }
|
||||
//}
|
||||
//if(bSameCount==4)return OX_FOUR_SAME;
|
||||
|
||||
BYTE bKingCount=0,bTenCount=0;
|
||||
for(BYTE i=0;i<cbCardCount;i++)
|
||||
{
|
||||
if(GetCardValue(cbCardData[i])>10)
|
||||
{
|
||||
bKingCount++;
|
||||
}
|
||||
else if(GetCardValue(cbCardData[i])==10)
|
||||
{
|
||||
bTenCount++;
|
||||
}
|
||||
}
|
||||
if(bKingCount==MAX_COUNT) return OX_FIVEKING;
|
||||
else if(bKingCount==MAX_COUNT-1 && bTenCount==1) return OX_FOURKING;
|
||||
|
||||
////葫芦牌型
|
||||
//if(bSameCount==3)
|
||||
//{
|
||||
// if((bSecondValue!=GetCardValue(cbCardData[3]) && GetCardValue(cbCardData[3])==GetCardValue(cbCardData[4]))
|
||||
// ||(bSecondValue!=GetCardValue(cbCardData[1]) && GetCardValue(cbCardData[1])==GetCardValue(cbCardData[0])))
|
||||
// return OX_THREE_SAME;
|
||||
//}
|
||||
|
||||
BYTE bTemp[MAX_COUNT];
|
||||
BYTE bSum=0;
|
||||
for (BYTE i=0;i<cbCardCount;i++)
|
||||
{
|
||||
bTemp[i]=GetCardLogicValue(cbCardData[i]);
|
||||
bSum+=bTemp[i];
|
||||
}
|
||||
|
||||
for (BYTE i=0;i<cbCardCount-1;i++)
|
||||
{
|
||||
for (BYTE j=i+1;j<cbCardCount;j++)
|
||||
{
|
||||
if((bSum-bTemp[i]-bTemp[j])%10==0)
|
||||
{
|
||||
return ((bTemp[i]+bTemp[j])>10)?(bTemp[i]+bTemp[j]-10):(bTemp[i]+bTemp[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return OX_VALUE0;
|
||||
}
|
||||
|
||||
//获取倍数
|
||||
BYTE CGameLogic::GetTimes(BYTE cbCardData[], BYTE cbCardCount)
|
||||
{
|
||||
if(cbCardCount!=MAX_COUNT)return 0;
|
||||
|
||||
BYTE bTimes=GetCardType(cbCardData,MAX_COUNT);
|
||||
if(bTimes<7)return 1;
|
||||
else if(bTimes==7)return 2;
|
||||
else if(bTimes==8)return 3;
|
||||
else if(bTimes==9)return 4;
|
||||
else if(bTimes==10)return 5;
|
||||
else if(bTimes==OX_THREE_SAME)return 5;
|
||||
else if(bTimes==OX_FOUR_SAME)return 5;
|
||||
else if(bTimes==OX_FOURKING)return 5;
|
||||
else if(bTimes==OX_FIVEKING)return 5;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
//获取牛牛
|
||||
bool CGameLogic::GetOxCard(BYTE cbCardData[], BYTE cbCardCount)
|
||||
{
|
||||
ASSERT(cbCardCount==MAX_COUNT);
|
||||
|
||||
//设置变量
|
||||
BYTE bTemp[MAX_COUNT],bTempData[MAX_COUNT];
|
||||
CopyMemory(bTempData,cbCardData,sizeof(bTempData));
|
||||
BYTE bSum=0;
|
||||
for (BYTE i=0;i<cbCardCount;i++)
|
||||
{
|
||||
bTemp[i]=GetCardLogicValue(cbCardData[i]);
|
||||
bSum+=bTemp[i];
|
||||
}
|
||||
|
||||
//查找牛牛
|
||||
for (BYTE i=0;i<cbCardCount-1;i++)
|
||||
{
|
||||
for (BYTE j=i+1;j<cbCardCount;j++)
|
||||
{
|
||||
if((bSum-bTemp[i]-bTemp[j])%10==0)
|
||||
{
|
||||
BYTE bCount=0;
|
||||
for (BYTE k=0;k<cbCardCount;k++)
|
||||
{
|
||||
if(k!=i && k!=j)
|
||||
{
|
||||
cbCardData[bCount++] = bTempData[k];
|
||||
}
|
||||
}ASSERT(bCount==3);
|
||||
|
||||
cbCardData[bCount++] = bTempData[i];
|
||||
cbCardData[bCount++] = bTempData[j];
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//获取整数
|
||||
bool CGameLogic::IsIntValue(BYTE cbCardData[], BYTE cbCardCount)
|
||||
{
|
||||
BYTE sum=0;
|
||||
for(BYTE i=0;i<cbCardCount;i++)
|
||||
{
|
||||
sum+=GetCardLogicValue(cbCardData[i]);
|
||||
}
|
||||
ASSERT(sum>0);
|
||||
return (sum%10==0);
|
||||
}
|
||||
|
||||
//排列扑克
|
||||
void CGameLogic::SortCardList(BYTE cbCardData[], BYTE cbCardCount)
|
||||
{
|
||||
//转换数值
|
||||
BYTE cbLogicValue[MAX_COUNT];
|
||||
for (BYTE i=0;i<cbCardCount;i++) cbLogicValue[i]=GetCardValue(cbCardData[i]);
|
||||
|
||||
//排序操作
|
||||
bool bSorted=true;
|
||||
BYTE cbTempData,bLast=cbCardCount-1;
|
||||
do
|
||||
{
|
||||
bSorted=true;
|
||||
for (BYTE i=0;i<bLast;i++)
|
||||
{
|
||||
if ((cbLogicValue[i]<cbLogicValue[i+1])||
|
||||
((cbLogicValue[i]==cbLogicValue[i+1])&&(cbCardData[i]<cbCardData[i+1])))
|
||||
{
|
||||
//交换位置
|
||||
cbTempData=cbCardData[i];
|
||||
cbCardData[i]=cbCardData[i+1];
|
||||
cbCardData[i+1]=cbTempData;
|
||||
cbTempData=cbLogicValue[i];
|
||||
cbLogicValue[i]=cbLogicValue[i+1];
|
||||
cbLogicValue[i+1]=cbTempData;
|
||||
bSorted=false;
|
||||
}
|
||||
}
|
||||
bLast--;
|
||||
} while(bSorted==false);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//混乱扑克
|
||||
void CGameLogic::RandCardList(BYTE cbCardBuffer[], BYTE cbBufferCount)
|
||||
{
|
||||
//CopyMemory(cbCardBuffer,m_cbCardListData,cbBufferCount);
|
||||
//混乱准备
|
||||
BYTE cbCardData[CountArray(m_cbCardListData)];
|
||||
CopyMemory(cbCardData,m_cbCardListData,sizeof(m_cbCardListData));
|
||||
|
||||
//混乱扑克
|
||||
BYTE bRandCount=0,bPosition=0;
|
||||
do
|
||||
{
|
||||
bPosition=rand()%(CountArray(m_cbCardListData)-bRandCount);
|
||||
cbCardBuffer[bRandCount++]=cbCardData[bPosition];
|
||||
cbCardData[bPosition]=cbCardData[CountArray(m_cbCardListData)-bRandCount];
|
||||
} while (bRandCount<cbBufferCount);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//逻辑数值
|
||||
BYTE CGameLogic::GetCardLogicValue(BYTE cbCardData)
|
||||
{
|
||||
//扑克属性
|
||||
BYTE bCardColor=GetCardColor(cbCardData);
|
||||
BYTE bCardValue=GetCardValue(cbCardData);
|
||||
|
||||
//转换数值
|
||||
return (bCardValue>10)?(10):bCardValue;
|
||||
}
|
||||
|
||||
//对比扑克
|
||||
bool CGameLogic::CompareCard(BYTE cbFirstData[], BYTE cbNextData[], BYTE cbCardCount,BOOL FirstOX,BOOL NextOX)
|
||||
{
|
||||
if(FirstOX!=NextOX)return (FirstOX>NextOX);
|
||||
|
||||
//比较牛大小
|
||||
if(FirstOX==TRUE)
|
||||
{
|
||||
//获取点数
|
||||
BYTE cbNextType=GetCardType(cbNextData,cbCardCount);
|
||||
BYTE cbFirstType=GetCardType(cbFirstData,cbCardCount);
|
||||
|
||||
//点数判断
|
||||
if (cbFirstType!=cbNextType) return (cbFirstType>cbNextType);
|
||||
|
||||
switch(cbNextType)
|
||||
{
|
||||
case OX_FOUR_SAME: //炸弹牌型
|
||||
case OX_THREE_SAME: //葫芦牌型
|
||||
{
|
||||
//排序大小
|
||||
BYTE bFirstTemp[MAX_COUNT],bNextTemp[MAX_COUNT];
|
||||
CopyMemory(bFirstTemp,cbFirstData,cbCardCount);
|
||||
CopyMemory(bNextTemp,cbNextData,cbCardCount);
|
||||
SortCardList(bFirstTemp,cbCardCount);
|
||||
SortCardList(bNextTemp,cbCardCount);
|
||||
|
||||
return GetCardValue(bFirstTemp[MAX_COUNT/2])>GetCardValue(bNextTemp[MAX_COUNT/2]);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//排序大小
|
||||
BYTE bFirstTemp[MAX_COUNT],bNextTemp[MAX_COUNT];
|
||||
CopyMemory(bFirstTemp,cbFirstData,cbCardCount);
|
||||
CopyMemory(bNextTemp,cbNextData,cbCardCount);
|
||||
SortCardList(bFirstTemp,cbCardCount);
|
||||
SortCardList(bNextTemp,cbCardCount);
|
||||
|
||||
//比较数值
|
||||
BYTE cbNextMaxValue=GetCardValue(bNextTemp[0]);
|
||||
BYTE cbFirstMaxValue=GetCardValue(bFirstTemp[0]);
|
||||
if(cbNextMaxValue!=cbFirstMaxValue)return cbFirstMaxValue>cbNextMaxValue;
|
||||
|
||||
//比较颜色
|
||||
return GetCardColor(bFirstTemp[0]) > GetCardColor(bNextTemp[0]);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
89
Servers/游戏组件/房卡牛牛/服务器控制/GameLogic.h
Normal file
89
Servers/游戏组件/房卡牛牛/服务器控制/GameLogic.h
Normal file
@@ -0,0 +1,89 @@
|
||||
#ifndef GAME_LOGIC_HEAD_FILE
|
||||
#define GAME_LOGIC_HEAD_FILE
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Stdafx.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//宏定义
|
||||
|
||||
//数值掩码
|
||||
#define LOGIC_MASK_COLOR 0xF0 //花色掩码
|
||||
#define LOGIC_MASK_VALUE 0x0F //数值掩码
|
||||
|
||||
//扑克类型
|
||||
#define OX_VALUE0 0 //混合牌型
|
||||
#define OX_THREE_SAME 102 //三条牌型
|
||||
#define OX_FOUR_SAME 103 //四条牌型
|
||||
#define OX_FOURKING 104 //天王牌型
|
||||
#define OX_FIVEKING 105 //天王牌型
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//分析结构
|
||||
struct tagAnalyseResult
|
||||
{
|
||||
BYTE cbFourCount; //四张数目
|
||||
BYTE cbThreeCount; //三张数目
|
||||
BYTE cbDoubleCount; //两张数目
|
||||
BYTE cbSignedCount; //单张数目
|
||||
BYTE cbFourLogicVolue[1]; //四张列表
|
||||
BYTE cbThreeLogicVolue[1]; //三张列表
|
||||
BYTE cbDoubleLogicVolue[2]; //两张列表
|
||||
BYTE cbSignedLogicVolue[5]; //单张列表
|
||||
BYTE cbFourCardData[MAX_COUNT]; //四张列表
|
||||
BYTE cbThreeCardData[MAX_COUNT]; //三张列表
|
||||
BYTE cbDoubleCardData[MAX_COUNT]; //两张列表
|
||||
BYTE cbSignedCardData[MAX_COUNT]; //单张数目
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//游戏逻辑类
|
||||
class CGameLogic
|
||||
{
|
||||
//变量定义
|
||||
private:
|
||||
static BYTE m_cbCardListData[52]; //扑克定义
|
||||
|
||||
//函数定义
|
||||
public:
|
||||
//构造函数
|
||||
CGameLogic();
|
||||
//析构函数
|
||||
virtual ~CGameLogic();
|
||||
|
||||
//类型函数
|
||||
public:
|
||||
//获取类型
|
||||
BYTE GetCardType(BYTE cbCardData[], BYTE cbCardCount);
|
||||
//获取数值
|
||||
BYTE GetCardValue(BYTE cbCardData) { return cbCardData&LOGIC_MASK_VALUE; }
|
||||
//获取花色
|
||||
BYTE GetCardColor(BYTE cbCardData) { return cbCardData&LOGIC_MASK_COLOR; }
|
||||
//获取倍数
|
||||
BYTE GetTimes(BYTE cbCardData[], BYTE cbCardCount);
|
||||
//获取牛牛
|
||||
bool GetOxCard(BYTE cbCardData[], BYTE cbCardCount);
|
||||
//获取整数
|
||||
bool IsIntValue(BYTE cbCardData[], BYTE cbCardCount);
|
||||
|
||||
//控制函数
|
||||
public:
|
||||
//排列扑克
|
||||
void SortCardList(BYTE cbCardData[], BYTE cbCardCount);
|
||||
//混乱扑克
|
||||
void RandCardList(BYTE cbCardBuffer[], BYTE cbBufferCount);
|
||||
|
||||
//功能函数
|
||||
public:
|
||||
//逻辑数值
|
||||
BYTE GetCardLogicValue(BYTE cbCardData);
|
||||
//对比扑克
|
||||
bool CompareCard(BYTE cbFirstData[], BYTE cbNextData[], BYTE cbCardCount,BOOL FirstOX,BOOL NextOX);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
55
Servers/游戏组件/房卡牛牛/服务器控制/ReadMe.txt
Normal file
55
Servers/游戏组件/房卡牛牛/服务器控制/ReadMe.txt
Normal file
@@ -0,0 +1,55 @@
|
||||
========================================================================
|
||||
MICROSOFT 基础类库 : ServerControl 项目概况
|
||||
========================================================================
|
||||
|
||||
|
||||
应用程序向导已为您创建了此 ServerControl DLL。此 DLL 不仅
|
||||
说明了使用 Microsoft 基础类的基础,而且
|
||||
也是编写 DLL 的起点。
|
||||
|
||||
此文件包含组成 ServerControl DLL
|
||||
的每个文件的内容摘要。
|
||||
|
||||
ServerControl.vcproj
|
||||
这是用应用程序向导生成的 VC++ 项目的主项目文件。
|
||||
它包含有关生成此文件的 Visual C++ 版本的信息,以及
|
||||
有关使用应用程序向导选择的
|
||||
平台、配置和项目功能的信息。
|
||||
|
||||
ServerControl.cpp
|
||||
这是包含 DllMain()
|
||||
定义的主 DLL 源文件。
|
||||
ServerControl.rc
|
||||
这是程序使用的所有 Microsoft Windows 资源的列表。
|
||||
它包含存储在 RES 子目录下的图标、位图和光标。
|
||||
此文件可在 Microsoft Visual C++ 中直接编辑。
|
||||
|
||||
|
||||
res\ServerControl.rc2
|
||||
此文件包含不由 Microsoft
|
||||
Visual C++ 编辑的资源。您应将不能由
|
||||
资源编辑器编辑的所有资源放置在此文件中。
|
||||
|
||||
ServerControl.def
|
||||
此文件包含有关运行 Microsoft Windows
|
||||
所需的 DLL 的信息。
|
||||
它定义此 DLL 的名称和说明等参数。
|
||||
它还从此 DLL 导出函数。
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
其他标准文件:
|
||||
|
||||
StdAfx.h、StdAfx.cpp
|
||||
这些文件用于生成名为 ServerControl.pch
|
||||
的预编译头(PCH)文件以及名为 StdAfx.obj 的预编译类型文件。
|
||||
|
||||
Resource.h
|
||||
这是标准的头文件,它定义了新的资源 ID。
|
||||
Microsoft Visual C++ 读取和更新此文件。
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
其他注释:
|
||||
|
||||
应用程序向导使用 "TODO:" 注释指示应添加或自定义的源代码部分。
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
@@ -0,0 +1,23 @@
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\niuniuservercontrol.pch
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\vc120.pdb
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\stdafx.obj
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\servercontrolitemsink.obj
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\servercontrol.obj
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\gamelogic.obj
|
||||
h:\git\wnmj\wnmj\运行\release\unicode\niuniuservercontrol.dll
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\niuniuservercontrol.pdb
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\servercontrol.res
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\servercontrol.lib
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\servercontrol.exp
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\msado15.tli
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\msado15.tlh
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\控制服务器.tlog\cl.command.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\控制服务器.tlog\cl.read.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\控制服务器.tlog\cl.write.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\控制服务器.tlog\link.command.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\控制服务器.tlog\link.read.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\控制服务器.tlog\link.write.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\控制服务器.tlog\rc.command.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\控制服务器.tlog\rc.read.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\控制服务器.tlog\rc.write.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\服务器控制\release\控制服务器.tlog\控制服务器.write.1u.tlog
|
||||
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/ServerControl.exp
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/ServerControl.exp
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/ServerControl.lib
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/ServerControl.lib
Normal file
Binary file not shown.
27
Servers/游戏组件/房卡牛牛/服务器控制/Release/ServerControl.log
Normal file
27
Servers/游戏组件/房卡牛牛/服务器控制/Release/ServerControl.log
Normal file
@@ -0,0 +1,27 @@
|
||||
生成启动时间为 2020-04-04 20:08:45。
|
||||
1>项目“H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\服务器控制\ServerControl.vcxproj”在节点 3 上(Build 个目标)。
|
||||
1>ClCompile:
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /O2 /Oy- /D WIN32 /D _WINDOWS /D NDEBUG /D _AFXEXT /D _WINDLL /D _MBCS /D _AFXDLL /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yc"stdafx.h" /Fp"Release\NiuNiuServerControl.pch" /Fo"Release\\" /Fd"Release\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt stdafx.cpp
|
||||
stdafx.cpp
|
||||
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afx.h(38): warning C4996: 'MBCS_Support_Deprecated_In_MFC': MBCS support in MFC is deprecated and may be removed in a future version of MFC.
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afx.h(33) : 参见“MBCS_Support_Deprecated_In_MFC”的声明
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /O2 /Oy- /D WIN32 /D _WINDOWS /D NDEBUG /D _AFXEXT /D _WINDLL /D _MBCS /D _AFXDLL /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yu"stdafx.h" /Fp"Release\NiuNiuServerControl.pch" /Fo"Release\\" /Fd"Release\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt GameLogic.cpp ServerControl.cpp ServerControlItemSink.cpp
|
||||
GameLogic.cpp
|
||||
ServerControl.cpp
|
||||
ServerControlItemSink.cpp
|
||||
正在生成代码...
|
||||
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(1186,5): warning MSB8012: TargetPath(H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\服务器控制\Release\NiuNiuServerControl.dll) does not match the Linker's OutputFile property value (H:\git\wnmj\wnmj\运行\Release\Unicode\NiuNiuServerControl.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
|
||||
Link:
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"../../../../运行/Release/Unicode/NiuNiuServerControl.dll" /INCREMENTAL:NO /NOLOGO /DEF:".\ServerControl.def" /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /manifestinput:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Include\Manifest\dpiaware.manifest" /DEBUG /PDB:"Release\NiuNiuServerControl.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"Release\ServerControl.lib" /MACHINE:X86 /SAFESEH /DLL Release\ServerControl.res
|
||||
Release\GameLogic.obj
|
||||
Release\ServerControl.obj
|
||||
Release\ServerControlItemSink.obj
|
||||
Release\stdafx.obj
|
||||
正在创建库 Release\ServerControl.lib 和对象 Release\ServerControl.exp
|
||||
1>ServerControl.exp : warning LNK4070: .EXP 中的 /OUT:ServerControl.dll 指令与输出文件名“../../../../运行/Release/Unicode/NiuNiuServerControl.dll”不同;忽略指令
|
||||
ServerControl.vcxproj -> H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\服务器控制\Release\NiuNiuServerControl.dll
|
||||
1>已完成生成项目“H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\服务器控制\ServerControl.vcxproj”(Build 个目标)的操作。
|
||||
|
||||
生成成功。
|
||||
|
||||
已用时间 00:00:35.23
|
||||
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/ServerControl.res
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/ServerControl.res
Normal file
Binary file not shown.
3140
Servers/游戏组件/房卡牛牛/服务器控制/Release/msado15.tlh
Normal file
3140
Servers/游戏组件/房卡牛牛/服务器控制/Release/msado15.tlh
Normal file
File diff suppressed because it is too large
Load Diff
2126
Servers/游戏组件/房卡牛牛/服务器控制/Release/msado15.tli
Normal file
2126
Servers/游戏组件/房卡牛牛/服务器控制/Release/msado15.tli
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/CL.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/CL.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/CL.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/CL.write.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/cl.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/cl.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/link.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/link.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/link.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/link.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/link.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/link.write.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/rc.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/rc.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/rc.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/rc.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/rc.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/rc.write.1.tlog
Normal file
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit
|
||||
Release|Win32|H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\|
|
||||
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/控制服务器.write.1u.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/服务器控制/Release/控制服务器.tlog/控制服务器.write.1u.tlog
Normal file
Binary file not shown.
16
Servers/游戏组件/房卡牛牛/服务器控制/Resource.h
Normal file
16
Servers/游戏组件/房卡牛牛/服务器控制/Resource.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by ServerControl.RC
|
||||
//
|
||||
|
||||
// 新对象的下一些默认值
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
#define _APS_NEXT_RESOURCE_VALUE 5000
|
||||
#define _APS_NEXT_CONTROL_VALUE 5000
|
||||
#define _APS_NEXT_SYMED_VALUE 5000
|
||||
#define _APS_NEXT_COMMAND_VALUE 32771
|
||||
#endif
|
||||
#endif
|
||||
52
Servers/游戏组件/房卡牛牛/服务器控制/ServerControl.cpp
Normal file
52
Servers/游戏组件/房卡牛牛/服务器控制/ServerControl.cpp
Normal file
@@ -0,0 +1,52 @@
|
||||
// ServerControl.cpp : 定义 DLL 的初始化例程。
|
||||
//
|
||||
|
||||
#include "stdafx.h"
|
||||
#include <afxdllx.h>
|
||||
#include "ServerControlItemSink.h"
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define new DEBUG_NEW
|
||||
#endif
|
||||
|
||||
static AFX_EXTENSION_MODULE ServerControlDLL = { NULL, NULL };
|
||||
|
||||
extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
|
||||
{
|
||||
// 如果使用 lpReserved,请将此移除
|
||||
UNREFERENCED_PARAMETER(lpReserved);
|
||||
|
||||
if (dwReason == DLL_PROCESS_ATTACH)
|
||||
{
|
||||
TRACE0("ServerControl.DLL 正在初始化!\n");
|
||||
if (!AfxInitExtensionModule(ServerControlDLL, hInstance)) return 0;
|
||||
new CDynLinkLibrary(ServerControlDLL);
|
||||
|
||||
}
|
||||
else if (dwReason == DLL_PROCESS_DETACH)
|
||||
{
|
||||
TRACE0("ServerControl.DLL 正在终止!\n");
|
||||
AfxTermExtensionModule(ServerControlDLL);
|
||||
}
|
||||
return 1; // 确定
|
||||
}
|
||||
|
||||
//建立对象函数
|
||||
extern "C" __declspec(dllexport) void * __cdecl CreateServerControl()
|
||||
{
|
||||
//建立对象
|
||||
CServerControlItemSink * pServerControl = NULL;
|
||||
try
|
||||
{
|
||||
pServerControl = new CServerControlItemSink();
|
||||
if (pServerControl == NULL)
|
||||
throw TEXT("创建失败");
|
||||
|
||||
return pServerControl;
|
||||
}
|
||||
catch (...) {}
|
||||
|
||||
//清理对象
|
||||
SafeDelete(pServerControl);
|
||||
return NULL;
|
||||
}
|
||||
6
Servers/游戏组件/房卡牛牛/服务器控制/ServerControl.def
Normal file
6
Servers/游戏组件/房卡牛牛/服务器控制/ServerControl.def
Normal file
@@ -0,0 +1,6 @@
|
||||
; ServerControl.def : 声明 DLL 的模块参数。
|
||||
|
||||
LIBRARY "ServerControl"
|
||||
|
||||
EXPORTS
|
||||
; 此处可以是显式导出
|
||||
122
Servers/游戏组件/房卡牛牛/服务器控制/ServerControl.rc
Normal file
122
Servers/游戏组件/房卡牛牛/服务器控制/ServerControl.rc
Normal file
@@ -0,0 +1,122 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 中文(中华人民共和国) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
|
||||
#pragma code_page(936)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)\r\n"
|
||||
"LANGUAGE 4, 2\r\n"
|
||||
"#pragma code_page(936)\r\n"
|
||||
"#include ""res\\ServerControl.rc2"" // 不是由 Microsoft Visual C++ 编辑过的资源\r\n"
|
||||
"#include ""afxres.rc"" // 标准组件\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 6,7,0,1
|
||||
PRODUCTVERSION 6,7,0,1
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "080403a8"
|
||||
BEGIN
|
||||
VALUE "Comments", "深圳市网狐科技有限公司"
|
||||
VALUE "CompanyName", "深圳市网狐科技有限公司"
|
||||
VALUE "FileDescription", "牛牛控制服务器"
|
||||
VALUE "FileVersion", "6, 7, 0, 1"
|
||||
VALUE "InternalName", "OxNewServerControl.dll"
|
||||
VALUE "OriginalFilename", "OxNewServerControl.dll"
|
||||
VALUE "ProductName", "牛牛控制服务器"
|
||||
VALUE "ProductVersion", "6, 7, 0, 1"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x804, 936
|
||||
END
|
||||
END
|
||||
|
||||
#endif // 中文(中华人民共和国) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
|
||||
LANGUAGE 4, 2
|
||||
#pragma code_page(936)
|
||||
#include "res\ServerControl.rc2" // 不是由 Microsoft Visual C++ 编辑过的资源
|
||||
#include "afxres.rc" // 标准组件
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
260
Servers/游戏组件/房卡牛牛/服务器控制/ServerControl.vcxproj
Normal file
260
Servers/游戏组件/房卡牛牛/服务器控制/ServerControl.vcxproj
Normal file
@@ -0,0 +1,260 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug_Unicode|Win32">
|
||||
<Configuration>Debug_Unicode</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release_Unicode|Win32">
|
||||
<Configuration>Release_Unicode</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>控制服务器</ProjectName>
|
||||
<ProjectGuid>{E30A6C9B-6B5E-4348-BC0E-67E1A22EEAAF}</ProjectGuid>
|
||||
<Keyword>MFCDLLProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Unicode|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Unicode|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>Debug\</OutDir>
|
||||
<IntDir>Debug\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetName>NiuNiuServerControl</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>Release\</OutDir>
|
||||
<IntDir>Release\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>NiuNiuServerControl</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetName>NiuNiuServerControl</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Unicode|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>NiuNiuServerControl</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_AFXEXT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>../../../../运行/Debug/Ansi/NiuNiuServerControl.dll</OutputFile>
|
||||
<ModuleDefinitionFile>.\ServerControl.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(OutDir)ServerControl.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
</Midl>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0804</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_AFXEXT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>../../../../运行/Release/Unicode/NiuNiuServerControl.dll</OutputFile>
|
||||
<ModuleDefinitionFile>.\ServerControl.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)ServerControl.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
</Midl>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0804</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_AFXEXT;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>../../../../运行/Debug/Unicode/NiuNiuServerControl.dll</OutputFile>
|
||||
<ModuleDefinitionFile>.\ServerControl.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(OutDir)ServerControl.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
</Midl>
|
||||
<PostBuildEvent>
|
||||
<Command>mkdir ..\..\..\发布组件\服务器组件\Debug\Unicode
|
||||
copy /y ..\..\..\..\运行\Debug\Unicode\$(TargetFileName) ..\..\..\发布组件\服务器组件\Debug\Unicode\$(TargetFileName)
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0804</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Unicode|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_AFXEXT;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>../../../../运行/Release/Unicode/NiuNiuServerControl.dll</OutputFile>
|
||||
<ModuleDefinitionFile>.\ServerControl.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)ServerControl.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
</Midl>
|
||||
<PostBuildEvent>
|
||||
<Command>mkdir ..\..\..\发布组件\服务器组件\Release\Unicode\
|
||||
copy /y ..\..\..\..\运行\Release\Unicode\$(TargetFileName) ..\..\..\发布组件\服务器组件\Release\Unicode\$(TargetFileName)
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0804</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="GameLogic.cpp" />
|
||||
<ClCompile Include="ServerControl.cpp" />
|
||||
<ClCompile Include="ServerControlItemSink.cpp" />
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release_Unicode|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\ServerControl.rc2" />
|
||||
<None Include="ServerControl.def" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="GameLogic.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="ServerControlItemSink.h" />
|
||||
<ClInclude Include="stdafx.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="ServerControl.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
61
Servers/游戏组件/房卡牛牛/服务器控制/ServerControl.vcxproj.filters
Normal file
61
Servers/游戏组件/房卡牛牛/服务器控制/ServerControl.vcxproj.filters
Normal file
@@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="源文件">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="头文件">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="资源文件">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="GameLogic.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ServerControl.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="ServerControlItemSink.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="ServerControl.def">
|
||||
<Filter>源文件</Filter>
|
||||
</None>
|
||||
<None Include="res\ServerControl.rc2">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="GameLogic.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ServerControlItemSink.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="ServerControl.rc">
|
||||
<Filter>资源文件</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
119
Servers/游戏组件/房卡牛牛/服务器控制/ServerControlItemSink.cpp
Normal file
119
Servers/游戏组件/房卡牛牛/服务器控制/ServerControlItemSink.cpp
Normal file
@@ -0,0 +1,119 @@
|
||||
#include "StdAfx.h"
|
||||
#include "servercontrolitemsink.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//
|
||||
CServerControlItemSink::CServerControlItemSink(void)
|
||||
{
|
||||
}
|
||||
|
||||
CServerControlItemSink::~CServerControlItemSink( void )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
//返回控制区域
|
||||
bool __cdecl CServerControlItemSink::ControlResult(BYTE cbControlCardData[GAME_PLAYER][MAX_COUNT], ROOMUSERCONTROL Keyroomusercontrol)
|
||||
{
|
||||
ASSERT(Keyroomusercontrol.roomUserInfo.wChairID < GAME_PLAYER);
|
||||
|
||||
//变量定义
|
||||
BYTE bCardData[MAX_COUNT];
|
||||
BYTE bHandCardData[GAME_PLAYER][MAX_COUNT];
|
||||
ZeroMemory(bCardData, sizeof(bCardData));
|
||||
ZeroMemory(bHandCardData, sizeof(bHandCardData));
|
||||
|
||||
//最大玩家
|
||||
BYTE bMaxUser = INVALID_BYTE;
|
||||
//最小玩家
|
||||
BYTE bMinUser = INVALID_BYTE;
|
||||
|
||||
//控制胜利
|
||||
if (Keyroomusercontrol.userControl.control_type == CONTINUE_WIN)
|
||||
{
|
||||
for(BYTE i=0;i<GAME_PLAYER;i++)
|
||||
{
|
||||
CopyMemory(bHandCardData[i], cbControlCardData[i], sizeof(BYTE)*MAX_COUNT);
|
||||
|
||||
if(INVALID_BYTE == bMaxUser)
|
||||
{
|
||||
if(cbControlCardData[i][0] != 0)
|
||||
{
|
||||
bMaxUser = i;
|
||||
CopyMemory(bCardData,cbControlCardData[i],sizeof(bCardData));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//最大牌型
|
||||
BYTE i = bMaxUser + 1;
|
||||
for(;i<GAME_PLAYER;i++)
|
||||
{
|
||||
if(cbControlCardData[i][0] == 0)continue;
|
||||
|
||||
bool bFistOx=m_GameLogic.GetOxCard(bCardData,MAX_COUNT);
|
||||
bool bNextOx=m_GameLogic.GetOxCard(cbControlCardData[i],MAX_COUNT);
|
||||
|
||||
if(m_GameLogic.CompareCard(bCardData,cbControlCardData[i],MAX_COUNT,bFistOx,bNextOx) == false)
|
||||
{
|
||||
CopyMemory(bCardData,cbControlCardData[i],sizeof(bCardData));
|
||||
bMaxUser=i;
|
||||
}
|
||||
}
|
||||
|
||||
CopyMemory(cbControlCardData[Keyroomusercontrol.roomUserInfo.wChairID], bCardData, sizeof(bCardData));
|
||||
|
||||
if(Keyroomusercontrol.roomUserInfo.wChairID != bMaxUser)
|
||||
{
|
||||
CopyMemory(cbControlCardData[bMaxUser], bHandCardData[Keyroomusercontrol.roomUserInfo.wChairID], sizeof(bHandCardData[i]));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (Keyroomusercontrol.userControl.control_type == CONTINUE_LOST)
|
||||
{
|
||||
for(BYTE i=0;i<GAME_PLAYER;i++)
|
||||
{
|
||||
CopyMemory(bHandCardData[i], cbControlCardData[i], sizeof(BYTE)*MAX_COUNT);
|
||||
|
||||
if(INVALID_BYTE == bMinUser)
|
||||
{
|
||||
if(cbControlCardData[i][0] != 0)
|
||||
{
|
||||
bMinUser = i;
|
||||
CopyMemory(bCardData,cbControlCardData[i],sizeof(bCardData));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//最小牌型
|
||||
BYTE i = bMinUser + 1;
|
||||
for(;i<GAME_PLAYER;i++)
|
||||
{
|
||||
if(cbControlCardData[i][0] == 0)continue;
|
||||
|
||||
bool bFistOx=m_GameLogic.GetOxCard(cbControlCardData[i],MAX_COUNT);
|
||||
bool bNextOx=m_GameLogic.GetOxCard(bCardData,MAX_COUNT);
|
||||
|
||||
if(m_GameLogic.CompareCard(cbControlCardData[i],bCardData,MAX_COUNT,bFistOx,bNextOx) == false)
|
||||
{
|
||||
CopyMemory(bCardData,cbControlCardData[i],sizeof(bCardData));
|
||||
bMinUser=i;
|
||||
}
|
||||
}
|
||||
|
||||
CopyMemory(cbControlCardData[Keyroomusercontrol.roomUserInfo.wChairID], bCardData, sizeof(bCardData));
|
||||
|
||||
if(Keyroomusercontrol.roomUserInfo.wChairID != bMinUser)
|
||||
{
|
||||
CopyMemory(cbControlCardData[bMinUser], bHandCardData[Keyroomusercontrol.roomUserInfo.wChairID], sizeof(bHandCardData[i]));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
ASSERT(FALSE);
|
||||
|
||||
return false;
|
||||
}
|
||||
19
Servers/游戏组件/房卡牛牛/服务器控制/ServerControlItemSink.h
Normal file
19
Servers/游戏组件/房卡牛牛/服务器控制/ServerControlItemSink.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#include "../游戏服务器/ServerControl.h"
|
||||
#include "GameLogic.h"
|
||||
|
||||
|
||||
class CServerControlItemSink : public IServerControl
|
||||
{
|
||||
|
||||
CGameLogic m_GameLogic; //游戏逻辑
|
||||
|
||||
public:
|
||||
CServerControlItemSink(void);
|
||||
virtual ~CServerControlItemSink(void);
|
||||
|
||||
public:
|
||||
//返回控制区域
|
||||
virtual bool __cdecl ControlResult(BYTE cbControlCardData[GAME_PLAYER][MAX_COUNT], ROOMUSERCONTROL Keyroomusercontrol);
|
||||
|
||||
};
|
||||
13
Servers/游戏组件/房卡牛牛/服务器控制/res/ServerControl.rc2
Normal file
13
Servers/游戏组件/房卡牛牛/服务器控制/res/ServerControl.rc2
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// ServerControl.RC2 - Microsoft Visual C++ 不会直接编辑的资源
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 在此处添加手动编辑的资源...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
7
Servers/游戏组件/房卡牛牛/服务器控制/stdafx.cpp
Normal file
7
Servers/游戏组件/房卡牛牛/服务器控制/stdafx.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
// stdafx.cpp : 只包括标准包含文件的源文件
|
||||
// ServerControl.pch 将成为预编译头
|
||||
// stdafx.obj 将包含预编译类型信息
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
|
||||
55
Servers/游戏组件/房卡牛牛/服务器控制/stdafx.h
Normal file
55
Servers/游戏组件/房卡牛牛/服务器控制/stdafx.h
Normal file
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef VC_EXTRALEAN
|
||||
#define VC_EXTRALEAN
|
||||
#endif
|
||||
|
||||
#ifndef WINVER
|
||||
#define WINVER 0x0501
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0501
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_WINDOWS
|
||||
#define _WIN32_WINDOWS 0x0410
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32_IE
|
||||
#define _WIN32_IE 0x0400
|
||||
#endif
|
||||
|
||||
#define _ATL_ATTRIBUTES
|
||||
#define _AFX_ALL_WARNINGS
|
||||
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//MFC 文件
|
||||
#include <AfxWin.h>
|
||||
#include <AfxExt.h>
|
||||
#include <AfxCmn.h>
|
||||
#include <AfxDisp.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
#include "..\..\..\服务器组件\游戏服务\GameServiceHead.h"
|
||||
|
||||
#ifndef _DEBUG
|
||||
#ifndef _UNICODE
|
||||
#pragma comment (lib,"../../../链接库/Ansi/KernelEngine.lib")
|
||||
#else
|
||||
#pragma comment (lib,"../../../链接库/Unicode/KernelEngine.lib")
|
||||
#endif
|
||||
#else
|
||||
#ifndef _UNICODE
|
||||
#pragma comment (lib,"../../../链接库/Ansi/KernelEngineD.lib")
|
||||
#else
|
||||
#pragma comment (lib,"../../../链接库/Unicode/KernelEngineD.lib")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//组件头文件
|
||||
#include "..\消息定义\CMD_NiuNiu.h"
|
||||
301
Servers/游戏组件/房卡牛牛/消息定义/CMD_NiuNiu.h
Normal file
301
Servers/游戏组件/房卡牛牛/消息定义/CMD_NiuNiu.h
Normal file
@@ -0,0 +1,301 @@
|
||||
#ifndef CMD_NiuNiu_h__
|
||||
#define CMD_NiuNiu_h__
|
||||
|
||||
//公共宏定义;
|
||||
#define KIND_ID 2 //游戏ID;
|
||||
#define GAME_PLAYER 5 //游戏人数;
|
||||
#define GAME_NAME TEXT("房卡牛牛") //游戏名字;
|
||||
#define EXPORT_NAME TEXT("NiuNiu") //导出名称;
|
||||
#define VERSION_SERVER PROCESS_VERSION(6,0,3) //程序版本;
|
||||
#define VERSION_CLIENT PROCESS_VERSION(6,0,3) //程序版本;
|
||||
|
||||
//数量定义;
|
||||
#define MAX_COUNT 5 //手牌数量;
|
||||
#define FULL_COUNT 52 //牌库数量;
|
||||
|
||||
//扑克掩码;
|
||||
#define MASK_VALUE 0x0F //数值掩码;
|
||||
#define MASK_COLOR 0xF0 //花色掩码;
|
||||
|
||||
//牌型定义;
|
||||
#define NIU_TYPE_0 0 //无牛;
|
||||
#define NIU_TYPE_1 1 //牛一;
|
||||
#define NIU_TYPE_2 2 //牛二;
|
||||
#define NIU_TYPE_3 3 //牛三;
|
||||
#define NIU_TYPE_4 4 //牛四;
|
||||
#define NIU_TYPE_5 5 //牛五;
|
||||
#define NIU_TYPE_6 6 //牛六;
|
||||
#define NIU_TYPE_7 7 //牛七;
|
||||
#define NIU_TYPE_8 8 //牛八;
|
||||
#define NIU_TYPE_9 9 //牛九;
|
||||
#define NIU_TYPE_10 10 //牛牛;
|
||||
#define NIU_TYPE_WHN 11 //五花牛;
|
||||
#define NIU_TYPE_SHN 12 //四炸;
|
||||
#define NIU_TYPE_WXN 13 //五小牛;
|
||||
|
||||
#define MAX_NIU_TYPE 13 //最大牛类型;
|
||||
|
||||
//规则定义;
|
||||
#define RULE_HUA_NIU 0x01 //有花牛;
|
||||
#define RULE_SAN_ZHANG 0x02 //三张牛;
|
||||
#define RULE_FREE_CHIP 0x04 //自由下注;
|
||||
#define RULE_NIU_FAN 0x08 //有牛番;
|
||||
#define BANKER_OWNER 1 //房主坐庄;
|
||||
#define BANKER_TURNS 2 //轮流坐庄;
|
||||
#define BANKER_ROB 3 //经典抢庄;
|
||||
#define BANKER_ROB4 4 //翻4张抢庄;
|
||||
|
||||
enum eNNRuleEnum
|
||||
{
|
||||
eNNRuleEnum_CardAA = 1, //房卡AA;
|
||||
eNNRuleEnum_BANKER_OWNER = 1 << 1, //房主坐庄;;
|
||||
eNNRuleEnum_BANKER_TURNS = 1 << 2, //轮流坐庄;
|
||||
eNNRuleEnum_BANKER_ROB = 1 << 3, //经典抢庄;;
|
||||
eNNRuleEnum_BANKER_ROB4 = 1 << 4, //翻4张抢庄;
|
||||
eNNRuleEnum_NO_SPECIAL_NIU = 1 << 5, //无特殊牛;
|
||||
eNNRuleEnum_BAYONET = 1 << 6, //拼刺刀;
|
||||
eNNRuleEnum_WHN = 1 << 7, //五花牛;
|
||||
eNNRuleEnum_BOMB = 1 << 8, //炸弹;
|
||||
eNNRuleEnum_WXN = 1 << 9, //五小牛;
|
||||
};
|
||||
|
||||
#pragma pack(1)
|
||||
//规则配置参数;
|
||||
typedef struct tagGameRuleCfg
|
||||
{
|
||||
WORD wGameRule = 0; //游戏规则;
|
||||
WORD wBankerRule = 0; //坐庄规则;
|
||||
BYTE cbMinFreeChip = 0; //最小下注;
|
||||
BYTE cbMaxFreeChip = 0; //最大下注;
|
||||
} tagOpenRuleCfg;
|
||||
|
||||
//状态命令;
|
||||
#define GS_NN_FREE GAME_STATUS_FREE //空闲状态;
|
||||
#define GS_NN_SEND_CARD GAME_STATUS_PLAY //发牌状态;
|
||||
#define GS_NN_ROB_BANKER (GAME_STATUS_PLAY+1) //抢庄状态;
|
||||
#define GS_NN_USER_CHIP (GAME_STATUS_PLAY+2) //下注状态;
|
||||
#define GS_NN_OPEN_CARD (GAME_STATUS_PLAY+3) //开牌状态;
|
||||
#define GS_NN_SHOW_CARD (GAME_STATUS_PLAY+4) //亮牌状态;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//控制类型;
|
||||
typedef enum{ CONTINUE_WIN, CONTINUE_LOST, CONTINUE_CANCEL }CONTROL_TYPE;
|
||||
|
||||
//控制结果 控制成功 、控制失败 、控制取消成功 、控制取消无效;
|
||||
typedef enum{ CONTROL_SUCCEED, CONTROL_FAIL, CONTROL_CANCEL_SUCCEED, CONTROL_CANCEL_INVALID }CONTROL_RESULT;
|
||||
|
||||
//用户行为;
|
||||
typedef enum{ USER_SITDOWN, USER_STANDUP, USER_OFFLINE, USER_RECONNECT }USERACTION;
|
||||
|
||||
//控制信息;
|
||||
typedef struct
|
||||
{
|
||||
CONTROL_TYPE control_type; //控制类型;
|
||||
BYTE cbControlCount; //控制局数;
|
||||
bool bCancelControl; //取消标识;
|
||||
}USERCONTROL;
|
||||
|
||||
//房间用户信息;
|
||||
typedef struct
|
||||
{
|
||||
WORD wChairID; //椅子ID;
|
||||
WORD wTableID; //桌子ID;
|
||||
DWORD dwGameID; //GAMEID;
|
||||
bool bAndroid; //机器人标识;
|
||||
TCHAR szNickName[LEN_NICKNAME]; //用户昵称;
|
||||
BYTE cbUserStatus; //用户状态;
|
||||
BYTE cbGameStatus; //游戏状态;
|
||||
}ROOMUSERINFO;
|
||||
|
||||
//房间用户控制;
|
||||
typedef struct
|
||||
{
|
||||
ROOMUSERINFO roomUserInfo; //房间用户信息;
|
||||
USERCONTROL userControl; //用户控制;
|
||||
}ROOMUSERCONTROL;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//空闲状态;
|
||||
struct CMD_S_StatusFree
|
||||
{
|
||||
LONG lCellScore; //基础积分;
|
||||
LONG lMinFreeChip; //最小可下注;
|
||||
LONG lMaxFreeChip; //最大可下注;
|
||||
BYTE cbHandCardCount; //手牌数量;
|
||||
bool bActiveStatus[GAME_PLAYER]; //玩家状态;
|
||||
};
|
||||
|
||||
//发牌状态;
|
||||
struct CMD_S_StatusSend
|
||||
{
|
||||
CMD_S_StatusFree stStatusFree; //公共数据;
|
||||
WORD wBankerUser; //庄家用户;
|
||||
BYTE cbSendStatus; //发牌状态;
|
||||
BYTE cbHandCardData[MAX_COUNT]; //手牌数据;
|
||||
};
|
||||
|
||||
//抢庄状态;
|
||||
struct CMD_S_StatusRob
|
||||
{
|
||||
CMD_S_StatusFree stStatusFree; //公共数据;
|
||||
BYTE cbRobStatus[GAME_PLAYER]; //抢庄状态 0:没操作,1:不抢,2:抢;
|
||||
BYTE cbHandCardData[GAME_PLAYER][MAX_COUNT];//手牌数据;
|
||||
};
|
||||
|
||||
//下注状态;
|
||||
struct CMD_S_StatusChip
|
||||
{
|
||||
CMD_S_StatusFree stStatusFree; //公共数据;
|
||||
WORD wBankerUser; //庄家用户;
|
||||
BYTE cbChipStatus[GAME_PLAYER]; //下注状态;
|
||||
LONG lUserChipScore[GAME_PLAYER];//下注分数;
|
||||
BYTE cbHandCardData[MAX_COUNT]; //手牌数据;
|
||||
};
|
||||
|
||||
//等待开牌状态;
|
||||
struct CMD_S_StatusOpen
|
||||
{
|
||||
CMD_S_StatusFree stStatusFree; //公共数据;
|
||||
|
||||
WORD wBankerUser; //庄家用户;
|
||||
LONG lUserChipScore[GAME_PLAYER];//下注分数;
|
||||
|
||||
BYTE cbOpenStatus[GAME_PLAYER]; //开牌状态;
|
||||
BYTE cbHandCardType; //牌型;
|
||||
BYTE cbHandCardData[MAX_COUNT]; //手牌数据;
|
||||
};
|
||||
|
||||
//显示所有人牌状态;
|
||||
struct CMD_S_StatusAllOpen
|
||||
{
|
||||
CMD_S_StatusFree stStatusFree; //公共数据;
|
||||
|
||||
WORD wBankerUser; //庄家用户;
|
||||
|
||||
BYTE cbOpenStatus[GAME_PLAYER]; //开牌状态;
|
||||
LONG lUserChipScore[GAME_PLAYER];//下注分数;
|
||||
BYTE cbHandCardType[GAME_PLAYER];//牌型;
|
||||
BYTE cbHandCardData[GAME_PLAYER][MAX_COUNT];//手牌数据;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//服务器命令;
|
||||
#define SUB_S_GAME_START 100 //游戏开始;
|
||||
#define SUB_S_START_ROB 101 //开始抢庄;
|
||||
#define SUB_S_USER_ROB 102 //玩家抢庄;
|
||||
#define SUB_S_START_CHIP 103 //开始下注;
|
||||
#define SUB_S_USER_CHIP 104 //玩家下注;
|
||||
#define SUB_S_START_OPEN 105 //开始开牌;
|
||||
#define SUB_S_OPEN_CARD 106 //玩家开牌;
|
||||
#define SUB_S_GAME_END 107 //游戏结束;
|
||||
#define SUB_S_ALL_OPEN_CARD 108 //玩家开牌;
|
||||
|
||||
//游戏开始;
|
||||
struct CMD_S_GameStart
|
||||
{
|
||||
WORD wBankerUser; //庄家用户;
|
||||
bool bActiveStatus[GAME_PLAYER]; //玩家状态;
|
||||
BYTE cbHandCardCount; //手牌数量;
|
||||
BYTE cbHandCardData[MAX_COUNT]; //手牌数据;
|
||||
};
|
||||
|
||||
//玩家抢庄;
|
||||
struct CMD_S_UserRob
|
||||
{
|
||||
WORD wRobUser; //抢庄玩家;
|
||||
bool bRobResult; //是否抢庄;
|
||||
};
|
||||
|
||||
//开始下注;
|
||||
struct CMD_S_StartChip
|
||||
{
|
||||
WORD wBankerUser; //庄家用户;
|
||||
};
|
||||
|
||||
//玩家下注;
|
||||
struct CMD_S_UserChip
|
||||
{
|
||||
WORD wChipUser; //下注玩家;
|
||||
LONG lChipScore; //下注分数;
|
||||
};
|
||||
|
||||
//玩家开牌;
|
||||
struct CMD_S_OpenCard
|
||||
{
|
||||
WORD wOpenUser; //开牌玩家;
|
||||
BYTE cbCardType; //手牌类型;
|
||||
BYTE cbCardData[MAX_COUNT]; //开牌数据;
|
||||
};
|
||||
|
||||
//所有人开牌;
|
||||
struct CMD_S_AllOpenCard
|
||||
{
|
||||
bool bActiveStatus[GAME_PLAYER]; //玩家状态;
|
||||
BYTE cbCardType[GAME_PLAYER]; //手牌类型;
|
||||
BYTE cbHandCardData[GAME_PLAYER][MAX_COUNT];//手牌数据;
|
||||
};
|
||||
|
||||
//游戏结束;
|
||||
struct CMD_S_GameEnd
|
||||
{
|
||||
BYTE cbCardType[GAME_PLAYER]; //手牌类型;
|
||||
BYTE cbHandCardData[GAME_PLAYER][MAX_COUNT];//手牌数据;
|
||||
LONG lAllScore[GAME_PLAYER]; //游戏得分;
|
||||
LONG lGameScore[GAME_PLAYER]; //游戏得分;
|
||||
LONG lRevenue[GAME_PLAYER]; //税收;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//客户端命令;
|
||||
#define SUB_C_SEND_OVER 1 //发牌完成;
|
||||
#define SUB_C_ROB_BANKER 2 //玩家抢庄;
|
||||
#define SUB_C_CHIP_SCORE 3 //玩家下注;
|
||||
#define SUB_C_OPEN_CARD 4 //玩家开牌;
|
||||
|
||||
//用户叫庄;
|
||||
struct CMD_C_RobBanker
|
||||
{
|
||||
bool bRob; //是否抢庄;
|
||||
};
|
||||
|
||||
//用户加注;
|
||||
struct CMD_C_ChipScore
|
||||
{
|
||||
LONG lScore; //下注数目;
|
||||
};
|
||||
|
||||
enum EN_NN_RESULT_TYPE
|
||||
{
|
||||
NN_RT_ALL_WIN = 0, // 通杀;
|
||||
NN_RT_ALL_LOSE, // 通赔;
|
||||
NN_RT_NIUNIU, // 牛牛;
|
||||
NN_RT_WIN, // 赢;
|
||||
};
|
||||
|
||||
// 游戏解散结构;
|
||||
struct CMD_S_Private_End_Info
|
||||
{
|
||||
WORD wMainChairID; // 房主;
|
||||
BYTE cbFinishCout; // 完成局数;
|
||||
bool aryActiveStatus[GAME_PLAYER]; // 手牌状态;
|
||||
SCORE lAllScore[GAME_PLAYER]; // 总成绩;
|
||||
BYTE aryResultTypeCount[GAME_PLAYER][4]; //牌型数量;
|
||||
|
||||
void StreamValue(DataStream& kData, bool bSend)
|
||||
{
|
||||
if (bSend)
|
||||
{
|
||||
kData.pushValue(this, sizeof(CMD_S_Private_End_Info));
|
||||
}
|
||||
else
|
||||
{
|
||||
kData.popValue(this, sizeof(CMD_S_Private_End_Info));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif // CMD_NiuNiu_h__
|
||||
34
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/GameServer.log
Normal file
34
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/GameServer.log
Normal file
@@ -0,0 +1,34 @@
|
||||
生成启动时间为 2020-04-06 21:58:03。
|
||||
1>项目“H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\游戏服务器\GameServer.vcxproj”在节点 2 上(Build 个目标)。
|
||||
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(357,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
|
||||
1>ClCompile:
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D _AFXEXT /D _WINDLL /D _MBCS /D _AFXDLL /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yc"stdafx.h" /Fp"Debug\NiuNiuServer.pch" /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt Stdafx.cpp
|
||||
Stdafx.cpp
|
||||
1>c:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\afx.h(38): warning C4996: 'MBCS_Support_Deprecated_In_MFC': MBCS support in MFC is deprecated and may be removed in a future version of MFC.
|
||||
c:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\afx.h(33) : 参见“MBCS_Support_Deprecated_In_MFC”的声明
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D _AFXEXT /D _WINDLL /D _MBCS /D _AFXDLL /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yu"stdafx.h" /Fp"Debug\NiuNiuServer.pch" /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt DlgCustomRule.cpp GameLogic.cpp GameServer.cpp GameServerManager.cpp HistoryScore.cpp
|
||||
HistoryScore.cpp
|
||||
GameServerManager.cpp
|
||||
GameServer.cpp
|
||||
GameLogic.cpp
|
||||
DlgCustomRule.cpp
|
||||
正在生成代码...
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D _AFXEXT /D _WINDLL /D _MBCS /D _AFXDLL /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yu"stdafx.h" /Fp"Debug\NiuNiuServer.pch" /Fo"Debug\\" /Fd"Debug\vc120.pdb" /Gd /TP /wd4244 /analyze- /errorReport:prompt TableFrameSink.cpp
|
||||
TableFrameSink.cpp
|
||||
Link:
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"../../../../运行/Debug/Ansi/NiuNiuServer.DLL" /INCREMENTAL /NOLOGO /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /manifestinput:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Include\Manifest\dpiaware.manifest" /DEBUG /PDB:"..\..\..\..\运行\Debug\Ansi\NiuNiuServer.pdb" /SUBSYSTEM:WINDOWS /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"..\..\..\..\运行\Debug\Ansi\GameServer.lib" /MACHINE:X86 /SAFESEH /DLL Debug\GameServer.res
|
||||
Debug\DlgCustomRule.obj
|
||||
Debug\GameLogic.obj
|
||||
Debug\GameServer.obj
|
||||
Debug\GameServerManager.obj
|
||||
Debug\HistoryScore.obj
|
||||
Debug\Stdafx.obj
|
||||
Debug\TableFrameSink.obj
|
||||
1>DlgCustomRule.obj : warning LNK4075: 忽略“/EDITANDCONTINUE”(由于“/SAFESEH”规范)
|
||||
正在创建库 ..\..\..\..\运行\Debug\Ansi\GameServer.lib 和对象 ..\..\..\..\运行\Debug\Ansi\GameServer.exp
|
||||
GameServer.vcxproj -> H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\游戏服务器\..\..\..\..\运行\Debug\Ansi\NiuNiuServer.dll
|
||||
1>已完成生成项目“H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\游戏服务器\GameServer.vcxproj”(Build 个目标)的操作。
|
||||
|
||||
生成成功。
|
||||
|
||||
已用时间 00:00:09.00
|
||||
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/GameServer.res
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/GameServer.res
Normal file
Binary file not shown.
3140
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/msado15.tlh
Normal file
3140
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/msado15.tlh
Normal file
File diff suppressed because it is too large
Load Diff
2126
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/msado15.tli
Normal file
2126
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/msado15.tli
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/CL.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/CL.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/CL.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/CL.write.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/cl.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/cl.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/link.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/link.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/link.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/link.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/link.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/link.write.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/rc.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/rc.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/rc.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/rc.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/rc.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/rc.write.1.tlog
Normal file
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit
|
||||
Debug|Win32|H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\|
|
||||
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/游戏服务端.write.1u.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Debug/游戏服务端.tlog/游戏服务端.write.1u.tlog
Normal file
Binary file not shown.
169
Servers/游戏组件/房卡牛牛/游戏服务器/DlgCustomRule.cpp
Normal file
169
Servers/游戏组件/房卡牛牛/游戏服务器/DlgCustomRule.cpp
Normal file
@@ -0,0 +1,169 @@
|
||||
#include "Stdafx.h"
|
||||
#include "Resource.h"
|
||||
#include "DlgCustomRule.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
BEGIN_MESSAGE_MAP(CDlgCustomRule, CDialog)
|
||||
END_MESSAGE_MAP()
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//构造函数
|
||||
CDlgCustomRule::CDlgCustomRule() : CDialog(IDD_CUSTOM_RULE)
|
||||
{
|
||||
//设置变量
|
||||
ZeroMemory(&m_CustomRule,sizeof(m_CustomRule));
|
||||
|
||||
m_CustomRule.lRoomStorageStart = 100000;
|
||||
m_CustomRule.lRoomStorageDeduct = 0;
|
||||
m_CustomRule.lRoomStorageMax1 = 1000000;
|
||||
m_CustomRule.lRoomStorageMul1 = 50;
|
||||
m_CustomRule.lRoomStorageMax2 = 5000000;
|
||||
m_CustomRule.lRoomStorageMul2 = 80;
|
||||
|
||||
//机器人存款取款
|
||||
m_CustomRule.lRobotScoreMin = 100000;
|
||||
m_CustomRule.lRobotScoreMax = 1000000;
|
||||
m_CustomRule.lRobotBankGet = 1000000;
|
||||
m_CustomRule.lRobotBankGetBanker = 10000000;
|
||||
m_CustomRule.lRobotBankStoMul = 10;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//析构函数
|
||||
CDlgCustomRule::~CDlgCustomRule()
|
||||
{
|
||||
}
|
||||
|
||||
//配置函数
|
||||
BOOL CDlgCustomRule::OnInitDialog()
|
||||
{
|
||||
__super::OnInitDialog();
|
||||
|
||||
//设置控件
|
||||
((CEdit *)GetDlgItem(IDC_EDIT_ROOMSTORAGE_START))->LimitText(9);
|
||||
((CEdit *)GetDlgItem(IDC_EDIT_ROOMSTORAGE_DEDUCT))->LimitText(3);
|
||||
((CEdit *)GetDlgItem(IDC_EDIT_ROOMSTORAGE_MAX1))->LimitText(9);
|
||||
((CEdit *)GetDlgItem(IDC_EDIT_ROOMSTORAGE_MUL1))->LimitText(2);
|
||||
((CEdit *)GetDlgItem(IDC_EDIT_ROOMSTORAGE_MAX2))->LimitText(9);
|
||||
((CEdit *)GetDlgItem(IDC_EDIT_ROOMSTORAGE_MUL2))->LimitText(2);
|
||||
|
||||
((CEdit *)GetDlgItem(IDC_ROBOT_SCOREMIN))->LimitText(9);
|
||||
((CEdit *)GetDlgItem(IDC_ROBOT_BANKERGETBANKER))->LimitText(9);
|
||||
((CEdit *)GetDlgItem(IDC_ROBOT_SCOREMAX))->LimitText(9);
|
||||
((CEdit *)GetDlgItem(IDC_ROBOT_BANKGET))->LimitText(9);
|
||||
((CEdit *)GetDlgItem(IDC_ROBOT_STOMUL))->LimitText(2);
|
||||
|
||||
//更新参数
|
||||
FillDataToControl();
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
//确定函数
|
||||
VOID CDlgCustomRule::OnOK()
|
||||
{
|
||||
//投递消息
|
||||
GetParent()->PostMessage(WM_COMMAND,MAKELONG(IDOK,0),0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//取消消息
|
||||
VOID CDlgCustomRule::OnCancel()
|
||||
{
|
||||
//投递消息
|
||||
GetParent()->PostMessage(WM_COMMAND,MAKELONG(IDCANCEL,0),0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//更新控件
|
||||
bool CDlgCustomRule::FillDataToControl()
|
||||
{
|
||||
//设置数据
|
||||
SetDlgItemInt(IDC_EDIT_ROOMSTORAGE_START, m_CustomRule.lRoomStorageStart);
|
||||
SetDlgItemInt(IDC_EDIT_ROOMSTORAGE_DEDUCT, m_CustomRule.lRoomStorageDeduct);
|
||||
SetDlgItemInt(IDC_EDIT_ROOMSTORAGE_MAX1, m_CustomRule.lRoomStorageMax1);
|
||||
SetDlgItemInt(IDC_EDIT_ROOMSTORAGE_MUL1, m_CustomRule.lRoomStorageMul1);
|
||||
SetDlgItemInt(IDC_EDIT_ROOMSTORAGE_MAX2, m_CustomRule.lRoomStorageMax2);
|
||||
SetDlgItemInt(IDC_EDIT_ROOMSTORAGE_MUL2, m_CustomRule.lRoomStorageMul2);
|
||||
|
||||
//机器人控制
|
||||
SetDlgItemInt(IDC_ROBOT_SCOREMIN, m_CustomRule.lRobotScoreMin);
|
||||
SetDlgItemInt(IDC_ROBOT_SCOREMAX, m_CustomRule.lRobotScoreMax);
|
||||
SetDlgItemInt(IDC_ROBOT_BANKERGETBANKER, m_CustomRule.lRobotBankGetBanker);
|
||||
SetDlgItemInt(IDC_ROBOT_BANKGET, m_CustomRule.lRobotBankGet);
|
||||
SetDlgItemInt(IDC_ROBOT_STOMUL, m_CustomRule.lRobotBankStoMul);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//更新数据
|
||||
bool CDlgCustomRule::FillControlToData()
|
||||
{
|
||||
//设置数据
|
||||
m_CustomRule.lRoomStorageStart = (SCORE)GetDlgItemInt(IDC_EDIT_ROOMSTORAGE_START);
|
||||
m_CustomRule.lRoomStorageDeduct = (SCORE)GetDlgItemInt(IDC_EDIT_ROOMSTORAGE_DEDUCT);
|
||||
m_CustomRule.lRoomStorageMax1 = (SCORE)GetDlgItemInt(IDC_EDIT_ROOMSTORAGE_MAX1);
|
||||
m_CustomRule.lRoomStorageMul1 = (SCORE)GetDlgItemInt(IDC_EDIT_ROOMSTORAGE_MUL1);
|
||||
m_CustomRule.lRoomStorageMax2 = (SCORE)GetDlgItemInt(IDC_EDIT_ROOMSTORAGE_MAX2);
|
||||
m_CustomRule.lRoomStorageMul2 = (SCORE)GetDlgItemInt(IDC_EDIT_ROOMSTORAGE_MUL2);
|
||||
|
||||
//机器人控制
|
||||
m_CustomRule.lRobotScoreMin = (SCORE)GetDlgItemInt(IDC_ROBOT_SCOREMIN);
|
||||
m_CustomRule.lRobotScoreMax = (SCORE)GetDlgItemInt(IDC_ROBOT_SCOREMAX);
|
||||
m_CustomRule.lRobotBankGetBanker = (SCORE)GetDlgItemInt(IDC_ROBOT_BANKERGETBANKER);
|
||||
m_CustomRule.lRobotBankGet = (SCORE)GetDlgItemInt(IDC_ROBOT_BANKGET);
|
||||
m_CustomRule.lRobotBankStoMul = (SCORE)GetDlgItemInt(IDC_ROBOT_STOMUL);
|
||||
|
||||
//数据校验
|
||||
if ((m_CustomRule.lRoomStorageMax1 > m_CustomRule.lRoomStorageMax2))
|
||||
{
|
||||
AfxMessageBox(TEXT("库存封顶值1应小于库存封顶值2,请重新设置!"),MB_ICONSTOP);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((m_CustomRule.lRoomStorageMul1 > m_CustomRule.lRoomStorageMul2))
|
||||
{
|
||||
AfxMessageBox(TEXT("赢分概率1应小于赢分概率2,请重新设置!"),MB_ICONSTOP);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((m_CustomRule.lRobotScoreMin > m_CustomRule.lRobotScoreMax))
|
||||
{
|
||||
AfxMessageBox(TEXT("机器人分数最小值应小于最大值,请重新设置!"),MB_ICONSTOP);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//读取配置
|
||||
bool CDlgCustomRule::GetCustomRule(tagCustomRule & CustomRule)
|
||||
{
|
||||
//读取参数
|
||||
if (FillControlToData()==true)
|
||||
{
|
||||
CustomRule=m_CustomRule;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//设置配置
|
||||
bool CDlgCustomRule::SetCustomRule(tagCustomRule & CustomRule)
|
||||
{
|
||||
//设置变量
|
||||
m_CustomRule=CustomRule;
|
||||
|
||||
//更新参数
|
||||
if (m_hWnd!=NULL) FillDataToControl();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
72
Servers/游戏组件/房卡牛牛/游戏服务器/DlgCustomRule.h
Normal file
72
Servers/游戏组件/房卡牛牛/游戏服务器/DlgCustomRule.h
Normal file
@@ -0,0 +1,72 @@
|
||||
#ifndef GAME_DLG_CUSTOM_RULE_HEAD_FILE
|
||||
#define GAME_DLG_CUSTOM_RULE_HEAD_FILE
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Stdafx.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//配置结构
|
||||
struct tagCustomRule
|
||||
{
|
||||
SCORE lRoomStorageStart; //库存起始值
|
||||
SCORE lRoomStorageDeduct; //衰减值
|
||||
SCORE lRoomStorageMax1; //库存封顶值1
|
||||
SCORE lRoomStorageMul1; //赢分百分比1
|
||||
SCORE lRoomStorageMax2; //库存封顶值1
|
||||
SCORE lRoomStorageMul2; //赢分百分比1
|
||||
|
||||
//机器人存款取款
|
||||
SCORE lRobotScoreMin;
|
||||
SCORE lRobotScoreMax;
|
||||
SCORE lRobotBankGet;
|
||||
SCORE lRobotBankGetBanker;
|
||||
SCORE lRobotBankStoMul;
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//配置窗口
|
||||
class CDlgCustomRule : public CDialog
|
||||
{
|
||||
//配置变量
|
||||
protected:
|
||||
tagCustomRule m_CustomRule; //配置结构
|
||||
|
||||
//函数定义
|
||||
public:
|
||||
//构造函数
|
||||
CDlgCustomRule();
|
||||
//析构函数
|
||||
virtual ~CDlgCustomRule();
|
||||
|
||||
//重载函数
|
||||
protected:
|
||||
//配置函数
|
||||
virtual BOOL OnInitDialog();
|
||||
//确定函数
|
||||
virtual VOID OnOK();
|
||||
//取消消息
|
||||
virtual VOID OnCancel();
|
||||
|
||||
//功能函数
|
||||
public:
|
||||
//更新控件
|
||||
bool FillDataToControl();
|
||||
//更新数据
|
||||
bool FillControlToData();
|
||||
|
||||
//配置函数
|
||||
public:
|
||||
//读取配置
|
||||
bool GetCustomRule(tagCustomRule & CustomRule);
|
||||
//设置配置
|
||||
bool SetCustomRule(tagCustomRule & CustomRule);
|
||||
|
||||
DECLARE_MESSAGE_MAP()
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
319
Servers/游戏组件/房卡牛牛/游戏服务器/GameLogic.cpp
Normal file
319
Servers/游戏组件/房卡牛牛/游戏服务器/GameLogic.cpp
Normal file
@@ -0,0 +1,319 @@
|
||||
#include "StdAfx.h"
|
||||
#include "GameLogic.h"
|
||||
|
||||
BYTE CGameLogic::m_cbCardList[FULL_COUNT] = {
|
||||
0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C,0x0D, //方块
|
||||
0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C,0x1D, //梅花
|
||||
0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D, //红桃
|
||||
0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C,0x3D, //黑桃
|
||||
};
|
||||
|
||||
bool CGameLogic::IsValidCard(BYTE cbCard)
|
||||
{
|
||||
const BYTE cbColor = GetCardColor(cbCard);
|
||||
const BYTE cbValue = GetCardValue(cbCard);
|
||||
return (cbColor<=3 && cbValue>=0x01 && cbValue<=0x0D) ? true : false;
|
||||
}
|
||||
|
||||
BYTE CGameLogic::GetLogicValue(BYTE cbCard)
|
||||
{
|
||||
ASSERT(IsValidCard(cbCard));
|
||||
const BYTE cbValue = GetCardValue(cbCard);
|
||||
return (cbValue>10) ? 10 : cbValue;
|
||||
}
|
||||
|
||||
void CGameLogic::SortCardList(BYTE cbCardData[], BYTE cbCardCount)
|
||||
{
|
||||
ASSERT((MAX_COUNT-2)==cbCardCount || MAX_COUNT==cbCardCount);
|
||||
if ((MAX_COUNT-2)!=cbCardCount && MAX_COUNT!=cbCardCount) return;
|
||||
|
||||
BYTE cbCardValue[MAX_COUNT] = { 0 };
|
||||
for (BYTE i=0; i<cbCardCount; ++i)
|
||||
{
|
||||
cbCardValue[i] = GetCardValue(cbCardData[i]);
|
||||
}
|
||||
|
||||
bool bSorted = true;
|
||||
BYTE cbTempData = 0;
|
||||
BYTE cbLast = cbCardCount - 1;
|
||||
do
|
||||
{
|
||||
bSorted = true;
|
||||
for (BYTE i=0; i<cbLast; ++i)
|
||||
{
|
||||
if ((cbCardValue[i]<cbCardValue[i+1]) || (cbCardValue[i]==cbCardValue[i+1]&&cbCardData[i]<cbCardData[i+1]))
|
||||
{
|
||||
cbTempData = cbCardData[i];
|
||||
cbCardData[i] = cbCardData[i+1];
|
||||
cbCardData[i+1] = cbTempData;
|
||||
cbTempData = cbCardValue[i];
|
||||
cbCardValue[i] = cbCardValue[i+1];
|
||||
cbCardValue[i+1] = cbTempData;
|
||||
bSorted = false;
|
||||
}
|
||||
}
|
||||
cbLast--;
|
||||
} while (!bSorted);
|
||||
}
|
||||
|
||||
void CGameLogic::RandCardList(BYTE cbCardData[], BYTE cbCardCount, bool bNoHuaCard)
|
||||
{
|
||||
BYTE cbRemoveCount = 0;
|
||||
const BYTE cbFullCount = CountArray(m_cbCardList);
|
||||
BYTE cbTempList[cbFullCount] = { 0 };
|
||||
CopyMemory(cbTempList, m_cbCardList, sizeof(m_cbCardList));
|
||||
ZeroMemory(m_cbRepertoryCard, sizeof(m_cbRepertoryCard));
|
||||
|
||||
BYTE cbRandCount = 0, cbPosition = 0;
|
||||
do
|
||||
{
|
||||
cbPosition = rand() % (cbFullCount - cbRandCount);
|
||||
m_cbRepertoryCard[cbRandCount++] = cbTempList[cbPosition];
|
||||
cbTempList[cbPosition] = cbTempList[cbFullCount - cbRandCount];
|
||||
} while (cbRandCount < cbFullCount);
|
||||
|
||||
if (bNoHuaCard)
|
||||
{
|
||||
cbRemoveCount = 12;
|
||||
BYTE cbHuaCard[12] = { 0x0B, 0x1B, 0x2B, 0x3B, 0x0C, 0x1C, 0x2C, 0x3C, 0x0D, 0x1D, 0x2D, 0x3D };
|
||||
RemoveCard(m_cbRepertoryCard, cbFullCount, cbHuaCard, cbRemoveCount);
|
||||
}
|
||||
|
||||
for (BYTE i = 0; i < cbCardCount; ++i)
|
||||
{
|
||||
cbCardData[i] = m_cbRepertoryCard[cbFullCount - cbRemoveCount - i - 1];
|
||||
}
|
||||
}
|
||||
|
||||
bool CGameLogic::RemoveCard(BYTE cbCardData[], BYTE cbCardCount, BYTE cbRemoveCard[], BYTE cbRemoveCount)
|
||||
{
|
||||
ASSERT(cbRemoveCount <= cbCardCount);
|
||||
if (cbRemoveCount > cbCardCount) return false;
|
||||
|
||||
BYTE cbDeleteCount = 0, cbDeleteCard[FULL_COUNT] = { 0 };
|
||||
ASSERT(cbCardCount <= sizeof(cbDeleteCard) / sizeof(cbDeleteCard[0]));
|
||||
if (cbCardCount > sizeof(cbDeleteCard) / sizeof(cbDeleteCard[0])) return false;
|
||||
CopyMemory(cbDeleteCard, cbCardData, sizeof(cbCardData[0])*cbCardCount);
|
||||
|
||||
for (BYTE i = 0; i < cbRemoveCount; ++i)
|
||||
{
|
||||
for (BYTE j = 0; j < cbCardCount; ++j)
|
||||
{
|
||||
if (cbRemoveCard[i] == cbDeleteCard[j])
|
||||
{
|
||||
cbDeleteCount++;
|
||||
cbDeleteCard[j] = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ASSERT(cbDeleteCount == cbRemoveCount);
|
||||
if (cbDeleteCount != cbRemoveCount) return false;
|
||||
|
||||
BYTE cbCardPos = 0;
|
||||
for (BYTE i = 0; i < cbCardCount; ++i)
|
||||
{
|
||||
if (0 != cbDeleteCard[i])
|
||||
{
|
||||
cbCardData[cbCardPos++] = cbDeleteCard[i];
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
BYTE CGameLogic::GetCardType(const BYTE cbCardData[], const BYTE cbCardCount, BYTE cbSortCard[], bool IsHasWHN, bool IsHasBomb, bool IsHasWXN)
|
||||
{
|
||||
ASSERT((MAX_COUNT-2)==cbCardCount || MAX_COUNT==cbCardCount);
|
||||
|
||||
BYTE cbTempData[MAX_COUNT] = { 0 };
|
||||
CopyMemory(cbTempData, cbCardData, sizeof(BYTE)*cbCardCount);
|
||||
|
||||
// 有特殊牛;
|
||||
//if (IsSpeical)
|
||||
{
|
||||
if (IsHasWHN && (MAX_COUNT == cbCardCount) && IsWuHuaNiu(cbTempData, cbCardCount))
|
||||
{
|
||||
if (nullptr != cbSortCard)
|
||||
{
|
||||
CopyMemory(cbSortCard, cbCardData, sizeof(BYTE)*cbCardCount);
|
||||
}
|
||||
return NIU_TYPE_WHN;
|
||||
}
|
||||
|
||||
if (IsHasWXN && (MAX_COUNT == cbCardCount) && IsWuXiaoNiu(cbTempData, cbCardCount))
|
||||
{
|
||||
if (nullptr != cbSortCard)
|
||||
{
|
||||
CopyMemory(cbSortCard, cbCardData, sizeof(BYTE)*cbCardCount);
|
||||
}
|
||||
return NIU_TYPE_WXN;
|
||||
}
|
||||
|
||||
if (IsHasBomb && (MAX_COUNT == cbCardCount) && IsZhaDan(cbTempData, cbCardCount))
|
||||
{
|
||||
if (nullptr != cbSortCard)
|
||||
{
|
||||
CopyMemory(cbSortCard, cbCardData, sizeof(BYTE)*cbCardCount);
|
||||
}
|
||||
return NIU_TYPE_SHN;
|
||||
}
|
||||
}
|
||||
|
||||
BYTE cbValueSum = 0;
|
||||
BYTE cbLogicValue[MAX_COUNT] = { 0 };
|
||||
for (BYTE i=0; i<cbCardCount; ++i)
|
||||
{
|
||||
cbLogicValue[i] = GetLogicValue(cbTempData[i]);
|
||||
cbValueSum += cbLogicValue[i];
|
||||
}
|
||||
|
||||
if ((MAX_COUNT-2) == cbCardCount)
|
||||
{
|
||||
for (BYTE i=0; i<cbCardCount; ++i)
|
||||
{
|
||||
if (0 == (cbValueSum-cbLogicValue[i])%10)
|
||||
{
|
||||
if (nullptr != cbSortCard)
|
||||
{
|
||||
CopyMemory(cbSortCard, cbTempData, sizeof(BYTE)*cbCardCount);
|
||||
VERIFY_RETURN(RemoveCard(cbSortCard,cbCardCount,&cbTempData[i],1),0);
|
||||
cbSortCard[cbCardCount - 1] = cbTempData[i];
|
||||
}
|
||||
return cbLogicValue[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (BYTE i=0; i<cbCardCount-1; ++i)
|
||||
{
|
||||
for (BYTE j=i+1; j<cbCardCount; ++j)
|
||||
{
|
||||
BYTE cbCowValue = cbLogicValue[i] + cbLogicValue[j];
|
||||
if (0 == (cbValueSum-cbCowValue)%10)
|
||||
{
|
||||
if (nullptr != cbSortCard)
|
||||
{
|
||||
BYTE cbDeleteCard[2] = { cbTempData[i],cbTempData[j] };
|
||||
CopyMemory(cbSortCard, cbTempData, sizeof(BYTE)*cbCardCount);
|
||||
VERIFY_RETURN(RemoveCard(cbSortCard,cbCardCount,cbDeleteCard,2),0);
|
||||
cbSortCard[cbCardCount-2] = cbTempData[i];
|
||||
cbSortCard[cbCardCount-1] = cbTempData[j];
|
||||
}
|
||||
return (cbCowValue>10) ? cbCowValue-10 : cbCowValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nullptr != cbSortCard)
|
||||
{
|
||||
CopyMemory(cbSortCard, cbCardData, sizeof(BYTE)*cbCardCount);
|
||||
}
|
||||
return NIU_TYPE_0;
|
||||
}
|
||||
|
||||
BYTE CGameLogic::GetWinNiuFan(const BYTE cbCardType)
|
||||
{
|
||||
switch (cbCardType)
|
||||
{
|
||||
case NIU_TYPE_WXN:
|
||||
return 6;
|
||||
case NIU_TYPE_SHN:
|
||||
return 5;
|
||||
case NIU_TYPE_WHN:
|
||||
return 4;
|
||||
case NIU_TYPE_10:
|
||||
return 3;
|
||||
case NIU_TYPE_9:
|
||||
case NIU_TYPE_8:
|
||||
case NIU_TYPE_7:
|
||||
return 2;
|
||||
}
|
||||
|
||||
ASSERT(cbCardType >= NIU_TYPE_0 && cbCardType < NIU_TYPE_7);
|
||||
return 1;
|
||||
}
|
||||
|
||||
BYTE CGameLogic::GetMaxCard(const BYTE cbCardData[], const BYTE cbCardCount)
|
||||
{
|
||||
BYTE cbTempData[MAX_COUNT] = { 0 };
|
||||
CopyMemory(cbTempData, cbCardData, sizeof(BYTE)*cbCardCount);
|
||||
SortCardList(cbTempData, cbCardCount);
|
||||
return cbTempData[0];
|
||||
}
|
||||
|
||||
bool CGameLogic::CompareCard(const tagOpenCardRlt stFirstData, const tagOpenCardRlt stNextData)
|
||||
{
|
||||
if (stFirstData.cbCardType != stNextData.cbCardType)
|
||||
{
|
||||
return (stFirstData.cbCardType > stNextData.cbCardType) ? true : false;
|
||||
}
|
||||
BYTE cbFirstValue = GetCardValue(stFirstData.cbMaxCard);
|
||||
BYTE cbNextValue = GetCardValue(stNextData.cbMaxCard);
|
||||
if (cbFirstValue != cbNextValue)
|
||||
{
|
||||
return (cbFirstValue > cbNextValue) ? true : false;
|
||||
}
|
||||
BYTE cbFirstColor = GetCardColor(stFirstData.cbMaxCard);
|
||||
BYTE cbNextColor = GetCardColor(stNextData.cbMaxCard);
|
||||
return (cbFirstColor > cbNextColor) ? true : false;
|
||||
}
|
||||
|
||||
bool CGameLogic::IsWuHuaNiu(const BYTE cbCardData[], const BYTE cbCardCount)
|
||||
{
|
||||
ASSERT(MAX_COUNT==cbCardCount || (MAX_COUNT-2)==cbCardCount);
|
||||
if (MAX_COUNT!=cbCardCount && (MAX_COUNT-2)!=cbCardCount) return false;
|
||||
|
||||
for (BYTE i=0; i<cbCardCount; ++i)
|
||||
{
|
||||
BYTE cbCardValue = GetCardValue(cbCardData[i]);
|
||||
if (cbCardValue < 11) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CGameLogic::IsWuXiaoNiu(const BYTE cbCardData[], const BYTE cbCardCount)
|
||||
{
|
||||
ASSERT(MAX_COUNT==cbCardCount || (MAX_COUNT-2)==cbCardCount);
|
||||
if (MAX_COUNT!=cbCardCount && (MAX_COUNT-2)!=cbCardCount) return false;
|
||||
|
||||
BYTE cbValueSum = 0;
|
||||
for (BYTE i=0; i<cbCardCount; ++i)
|
||||
{
|
||||
BYTE cbCardValue = GetCardValue(cbCardData[i]);
|
||||
if (cbCardValue >= 5)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
cbValueSum += cbCardValue;
|
||||
}
|
||||
|
||||
return (cbValueSum<=10) ? true : false;
|
||||
}
|
||||
|
||||
//是否是炸弹;
|
||||
bool CGameLogic::IsZhaDan(const BYTE cbCardData[], const BYTE cbCardCount)
|
||||
{
|
||||
ASSERT(MAX_COUNT == cbCardCount || (MAX_COUNT - 2) == cbCardCount);
|
||||
if (MAX_COUNT != cbCardCount && (MAX_COUNT - 2) != cbCardCount) return false;
|
||||
|
||||
BYTE aryCardCount[14] = {0};
|
||||
|
||||
for (BYTE i = 0; i < cbCardCount; ++i)
|
||||
{
|
||||
BYTE cbCardValue = GetCardValue(cbCardData[i]);
|
||||
aryCardCount[cbCardValue]++;
|
||||
}
|
||||
|
||||
for (BYTE j = 0; j < 14; j++)
|
||||
{
|
||||
if (4 == aryCardCount[j])
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
64
Servers/游戏组件/房卡牛牛/游戏服务器/GameLogic.h
Normal file
64
Servers/游戏组件/房卡牛牛/游戏服务器/GameLogic.h
Normal file
@@ -0,0 +1,64 @@
|
||||
#ifndef GameLogic_h__
|
||||
#define GameLogic_h__
|
||||
#pragma once
|
||||
#include "Stdafx.h"
|
||||
|
||||
//开牌结果
|
||||
struct tagOpenCardRlt
|
||||
{
|
||||
BYTE cbMaxCard; //最大牌
|
||||
BYTE cbCardType; //牌类型
|
||||
BYTE cbSortCard[MAX_COUNT]; //排序的牌
|
||||
};
|
||||
|
||||
//游戏逻辑类
|
||||
class CGameLogic
|
||||
{
|
||||
private:
|
||||
BYTE m_cbRepertoryCard[FULL_COUNT];
|
||||
static BYTE m_cbCardList[FULL_COUNT];
|
||||
|
||||
public:
|
||||
//构造函数
|
||||
CGameLogic() { }
|
||||
//析构函数
|
||||
virtual ~CGameLogic() { }
|
||||
|
||||
public:
|
||||
//有效判断
|
||||
static bool IsValidCard(const BYTE cbCard);
|
||||
//获取数值
|
||||
static BYTE GetCardValue(const BYTE cbCard) { return cbCard&MASK_VALUE; }
|
||||
//获取花色
|
||||
static BYTE GetCardColor(const BYTE cbCard) { return (cbCard&MASK_COLOR)>>4; }
|
||||
|
||||
public:
|
||||
//逻辑数值
|
||||
BYTE GetLogicValue(BYTE cbCard);
|
||||
//排列扑克
|
||||
void SortCardList(BYTE cbCardData[], BYTE cbCardCount);
|
||||
//混乱扑克
|
||||
void RandCardList(BYTE cbCardData[], BYTE cbCardCount, bool bNoHuaCard);
|
||||
//删除扑克
|
||||
bool RemoveCard(BYTE cbCardData[], BYTE cbCardCount, BYTE cbRemoveCard[], BYTE cbRemoveCount);
|
||||
|
||||
public:
|
||||
//获取赢的番数
|
||||
BYTE GetWinNiuFan(const BYTE cbCardType);
|
||||
//获取最大牌
|
||||
BYTE GetMaxCard(const BYTE cbCardData[], const BYTE cbCardCount);
|
||||
//获取类型
|
||||
BYTE GetCardType(const BYTE cbCardData[], const BYTE cbCardCount, BYTE cbSortCard[], bool IsHasWHN, bool IsHasBomb, bool IsHasWXN);
|
||||
//对比扑克
|
||||
bool CompareCard(const tagOpenCardRlt stFirstData, const tagOpenCardRlt stNextData);
|
||||
|
||||
private:
|
||||
//是否是五花牛
|
||||
bool IsWuHuaNiu(const BYTE cbCardData[], const BYTE cbCardCount);
|
||||
//是否是五小牛
|
||||
bool IsWuXiaoNiu(const BYTE cbCardData[], const BYTE cbCardCount);
|
||||
//是否是炸弹;
|
||||
bool IsZhaDan(const BYTE cbCardData[], const BYTE cbCardCount);
|
||||
};
|
||||
|
||||
#endif // GameLogic_h__
|
||||
24
Servers/游戏组件/房卡牛牛/游戏服务器/GameServer.cpp
Normal file
24
Servers/游戏组件/房卡牛牛/游戏服务器/GameServer.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "Stdafx.h"
|
||||
#include <afxdllx.h>
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
static AFX_EXTENSION_MODULE GameServerDLL={NULL,NULL};
|
||||
|
||||
//DLL µ¼³öÖ÷º¯Êý
|
||||
extern "C" int APIENTRY DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(lpReserved);
|
||||
if (dwReason==DLL_PROCESS_ATTACH)
|
||||
{
|
||||
if (!AfxInitExtensionModule(GameServerDLL, hInstance)) return 0;
|
||||
new CDynLinkLibrary(GameServerDLL);
|
||||
}
|
||||
else if (dwReason==DLL_PROCESS_DETACH)
|
||||
{
|
||||
AfxTermExtensionModule(GameServerDLL);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
179
Servers/游戏组件/房卡牛牛/游戏服务器/GameServer.rc
Normal file
179
Servers/游戏组件/房卡牛牛/游戏服务器/GameServer.rc
Normal file
@@ -0,0 +1,179 @@
|
||||
// Microsoft Visual C++ generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 中文(简体,中国) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
|
||||
LANGUAGE LANG_CHINESE, SUBLANG_CHINESE_SIMPLIFIED
|
||||
#pragma code_page(936)
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE
|
||||
BEGIN
|
||||
"#define _AFX_NO_SPLITTER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_OLE_RESOURCES\r\n"
|
||||
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
|
||||
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
|
||||
"\r\n"
|
||||
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)\r\n"
|
||||
"LANGUAGE 4, 2\r\n"
|
||||
"#pragma code_page(936)\r\n"
|
||||
"#include ""res\\GameServer.rc2"" // 不是由 Microsoft Visual C++ 编辑过的资源\r\n"
|
||||
"#include ""afxres.rc"" // 标准组件\r\n"
|
||||
"#endif\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Version
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 6,6,0,3
|
||||
PRODUCTVERSION 6,6,0,3
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
#else
|
||||
FILEFLAGS 0x0L
|
||||
#endif
|
||||
FILEOS 0x4L
|
||||
FILETYPE 0x2L
|
||||
FILESUBTYPE 0x0L
|
||||
BEGIN
|
||||
BLOCK "StringFileInfo"
|
||||
BEGIN
|
||||
BLOCK "080403a8"
|
||||
BEGIN
|
||||
VALUE "Comments", "科技有限公司"
|
||||
VALUE "CompanyName", "科技有限公司"
|
||||
VALUE "FileDescription", "牛牛服务器"
|
||||
VALUE "FileVersion", "6.6.0.3"
|
||||
VALUE "InternalName", "OxNewServer.dll"
|
||||
VALUE "LegalCopyright", "深圳市网狐科技有限公司"
|
||||
VALUE "OriginalFilename", "OxNewServer.dll"
|
||||
VALUE "ProductName", "牛牛客户端"
|
||||
VALUE "ProductVersion", "6.6.0.3"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
BEGIN
|
||||
VALUE "Translation", 0x804, 936
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_CUSTOM_RULE DIALOGEX 0, 0, 369, 218
|
||||
STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU
|
||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||
BEGIN
|
||||
GROUPBOX "库存控制",IDC_STATIC,19,19,331,73
|
||||
EDITTEXT IDC_EDIT_ROOMSTORAGE_START,91,38,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "房间库存起始值:",IDC_STATIC,22,41,65,9
|
||||
LTEXT "房间库存衰减值:",IDC_STATIC,182,41,64,9
|
||||
LTEXT "房间库存封顶值1:",IDC_STATIC,22,57,65,9
|
||||
LTEXT "房间库存封顶值2:",IDC_STATIC,22,72,65,9
|
||||
LTEXT "赢分概率1:",IDC_STATIC,182,57,64,9
|
||||
LTEXT "赢分概率2:",IDC_STATIC,182,72,64,9
|
||||
GROUPBOX "机器人控制",IDC_STATIC,19,100,331,101
|
||||
EDITTEXT IDC_EDIT_ROOMSTORAGE_DEDUCT,250,38,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_EDIT_ROOMSTORAGE_MAX1,91,54,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_EDIT_ROOMSTORAGE_MUL1,250,54,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_EDIT_ROOMSTORAGE_MAX2,91,69,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_EDIT_ROOMSTORAGE_MUL2,250,69,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
LTEXT "机器人的分数最小值:",IDC_STATIC,32,122,80,9
|
||||
LTEXT "机器人的分数最大值:",IDC_STATIC,31,135,80,9
|
||||
LTEXT "取款最小数额:",IDC_STATIC,31,149,80,9
|
||||
LTEXT "取款最大数额:",IDC_STATIC,31,162,80,9
|
||||
LTEXT "存款百分比:",IDC_STATIC,31,175,80,9
|
||||
LTEXT "%",IDC_STATIC,211,174,12,11
|
||||
LTEXT "%",IDC_STATIC,332,70,12,11
|
||||
LTEXT "%",IDC_STATIC,332,55,12,11
|
||||
EDITTEXT IDC_ROBOT_SCOREMIN,113,119,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_ROBOT_BANKERGETBANKER,113,159,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_ROBOT_SCOREMAX,113,132,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_ROBOT_BANKGET,113,146,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
EDITTEXT IDC_ROBOT_STOMUL,113,172,79,12,ES_AUTOHSCROLL | ES_NUMBER
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO
|
||||
BEGIN
|
||||
IDD_CUSTOM_RULE, DIALOG
|
||||
BEGIN
|
||||
LEFTMARGIN, 7
|
||||
RIGHTMARGIN, 362
|
||||
TOPMARGIN, 7
|
||||
BOTTOMMARGIN, 211
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
#endif // 中文(简体,中国) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
#define _AFX_NO_SPLITTER_RESOURCES
|
||||
#define _AFX_NO_OLE_RESOURCES
|
||||
#define _AFX_NO_TRACKER_RESOURCES
|
||||
#define _AFX_NO_PROPERTY_RESOURCES
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_CHS)
|
||||
LANGUAGE 4, 2
|
||||
#pragma code_page(936)
|
||||
#include "res\GameServer.rc2" // 不是由 Microsoft Visual C++ 编辑过的资源
|
||||
#include "afxres.rc" // 标准组件
|
||||
#endif
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
||||
269
Servers/游戏组件/房卡牛牛/游戏服务器/GameServer.vcxproj
Normal file
269
Servers/游戏组件/房卡牛牛/游戏服务器/GameServer.vcxproj
Normal file
@@ -0,0 +1,269 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug_Unicode|Win32">
|
||||
<Configuration>Debug_Unicode</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release_Unicode|Win32">
|
||||
<Configuration>Release_Unicode</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectName>游戏服务端</ProjectName>
|
||||
<ProjectGuid>{CA071FF5-97BF-42C3-99AF-FE8F8A0F0AF2}</ProjectGuid>
|
||||
<Keyword>MFCDLLProj</Keyword>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Unicode|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v120</PlatformToolset>
|
||||
<UseOfMfc>Dynamic</UseOfMfc>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release_Unicode|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>..\..\..\..\运行\Debug\Ansi</OutDir>
|
||||
<IntDir>Debug\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetName>NiuNiuServer</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>..\..\..\..\运行\Release\Ansi</OutDir>
|
||||
<IntDir>Release\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>NiuNiuServer</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<TargetName>NiuNiuServer</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release_Unicode|Win32'">
|
||||
<OutDir>$(Configuration)\</OutDir>
|
||||
<IntDir>$(Configuration)\</IntDir>
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<TargetName>NiuNiuServer</TargetName>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_AFXEXT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>../../../../运行/Debug/Ansi/NiuNiuServer.DLL</OutputFile>
|
||||
<ModuleDefinitionFile />
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(OutDir)GameServer.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
</Midl>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0804</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_AFXEXT;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>../../../../运行/Release/Ansi/NiuNiuServer.DLL</OutputFile>
|
||||
<ModuleDefinitionFile />
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)GameServer.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
</Midl>
|
||||
<PostBuildEvent>
|
||||
<Command>
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0804</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_AFXEXT;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>../../../../运行/Debug/Unicode/NiuNiuServer.DLL</OutputFile>
|
||||
<ModuleDefinitionFile />
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(OutDir)GameServer.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
</Midl>
|
||||
<PostBuildEvent>
|
||||
<Command>mkdir ..\..\..\发布组件\服务器组件\Debug\Unicode
|
||||
copy /y ..\..\..\..\运行\Debug\Unicode\$(TargetFileName) ..\..\..\发布组件\服务器组件\Debug\Unicode\$(TargetFileName)
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0804</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release_Unicode|Win32'">
|
||||
<ClCompile>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_AFXEXT;_UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<OutputFile>../../../../运行/Release/Unicode/NiuNiuServer.DLL</OutputFile>
|
||||
<ModuleDefinitionFile />
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<ImportLibrary>$(OutDir)GameServer.lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
<Midl>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MkTypLibCompatible>false</MkTypLibCompatible>
|
||||
</Midl>
|
||||
<PostBuildEvent>
|
||||
<Command>mkdir ..\..\..\发布组件\服务器组件\Release\Unicode\
|
||||
copy /y ..\..\..\..\运行\Release\Unicode\$(TargetFileName) ..\..\..\发布组件\服务器组件\Release\Unicode\$(TargetFileName)
|
||||
</Command>
|
||||
</PostBuildEvent>
|
||||
<ResourceCompile>
|
||||
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<Culture>0x0804</Culture>
|
||||
<AdditionalIncludeDirectories>$(IntDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ResourceCompile>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DlgCustomRule.cpp" />
|
||||
<ClCompile Include="GameLogic.cpp" />
|
||||
<ClCompile Include="GameServer.cpp" />
|
||||
<ClCompile Include="GameServerManager.cpp" />
|
||||
<ClCompile Include="HistoryScore.cpp" />
|
||||
<ClCompile Include="Stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release_Unicode|Win32'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TableFrameSink.cpp">
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug_Unicode|Win32'">4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<DisableSpecificWarnings Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\消息定义\CMD_NiuNiu.h" />
|
||||
<ClInclude Include="DlgCustomRule.h" />
|
||||
<ClInclude Include="GameLogic.h" />
|
||||
<ClInclude Include="GameServerManager.h" />
|
||||
<ClInclude Include="HistoryScore.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="Stdafx.h" />
|
||||
<ClInclude Include="TableFrameSink.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="GameServer.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\GameServer.rc2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
79
Servers/游戏组件/房卡牛牛/游戏服务器/GameServer.vcxproj.filters
Normal file
79
Servers/游戏组件/房卡牛牛/游戏服务器/GameServer.vcxproj.filters
Normal file
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="源文件">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="头文件">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="资源文件">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="DlgCustomRule.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GameLogic.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GameServer.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="GameServerManager.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="HistoryScore.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Stdafx.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="TableFrameSink.cpp">
|
||||
<Filter>源文件</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="DlgCustomRule.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GameLogic.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GameServerManager.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="HistoryScore.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Stdafx.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="TableFrameSink.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\消息定义\CMD_NiuNiu.h">
|
||||
<Filter>头文件</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="GameServer.rc">
|
||||
<Filter>资源文件</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="res\GameServer.rc2">
|
||||
<Filter>资源文件</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="ReadMe.txt" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
8
Servers/游戏组件/房卡牛牛/游戏服务器/GameServer.vcxproj.user
Normal file
8
Servers/游戏组件/房卡牛牛/游戏服务器/GameServer.vcxproj.user
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<LocalDebuggerCommand>H:\git\wnmj\wnmj\运行\Debug\Ansi\GameServer.exe</LocalDebuggerCommand>
|
||||
<LocalDebuggerWorkingDirectory>..\..\..\..\运行\Debug\Ansi</LocalDebuggerWorkingDirectory>
|
||||
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
225
Servers/游戏组件/房卡牛牛/游戏服务器/GameServerManager.cpp
Normal file
225
Servers/游戏组件/房卡牛牛/游戏服务器/GameServerManager.cpp
Normal file
@@ -0,0 +1,225 @@
|
||||
#include "StdAfx.h"
|
||||
#include "Resource.h"
|
||||
#include "Tableframesink.h"
|
||||
#include "GameServerManager.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//机器定义
|
||||
#ifndef _DEBUG
|
||||
#define ANDROID_SERVICE_DLL_NAME TEXT("NiuNiuAndroid.dll") //组件名字
|
||||
#else
|
||||
#define ANDROID_SERVICE_DLL_NAME TEXT("NiuNiuAndroid.dll") //组件名字
|
||||
#endif
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
//构造函数
|
||||
CGameServiceManager::CGameServiceManager(void)
|
||||
{
|
||||
//设置属性
|
||||
m_GameServiceAttrib.wKindID=KIND_ID;
|
||||
m_GameServiceAttrib.wChairCount=GAME_PLAYER;
|
||||
m_GameServiceAttrib.wSupporType=(GAME_GENRE_GOLD|GAME_GENRE_SCORE|GAME_GENRE_MATCH|GAME_GENRE_EDUCATE);
|
||||
|
||||
//功能标志
|
||||
m_GameServiceAttrib.cbDynamicJoin = TRUE;
|
||||
m_GameServiceAttrib.cbAndroidUser=TRUE;
|
||||
m_GameServiceAttrib.cbOffLineTrustee=FALSE;
|
||||
|
||||
//服务属性
|
||||
m_GameServiceAttrib.dwServerVersion=VERSION_SERVER;
|
||||
m_GameServiceAttrib.dwClientVersion=VERSION_CLIENT;
|
||||
lstrcpyn(m_GameServiceAttrib.szGameName,GAME_NAME,CountArray(m_GameServiceAttrib.szGameName));
|
||||
lstrcpyn(m_GameServiceAttrib.szDataBaseName,szTreasureDB,CountArray(m_GameServiceAttrib.szDataBaseName));
|
||||
lstrcpyn(m_GameServiceAttrib.szClientEXEName,TEXT("NiuNiu.exe"),CountArray(m_GameServiceAttrib.szClientEXEName));
|
||||
lstrcpyn(m_GameServiceAttrib.szServerDLLName,TEXT("NiuNiuServer.dll"),CountArray(m_GameServiceAttrib.szServerDLLName));
|
||||
|
||||
m_pDlgCustomRule=NULL;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//析构函数
|
||||
CGameServiceManager::~CGameServiceManager(void)
|
||||
{
|
||||
//删除对象
|
||||
SafeDelete(m_pDlgCustomRule);
|
||||
}
|
||||
|
||||
//接口查询
|
||||
VOID * CGameServiceManager::QueryInterface(const IID & Guid, DWORD dwQueryVer)
|
||||
{
|
||||
QUERYINTERFACE(IGameServiceManager,Guid,dwQueryVer);
|
||||
QUERYINTERFACE(IGameServiceCustomRule,Guid,dwQueryVer);
|
||||
QUERYINTERFACE_IUNKNOWNEX(IGameServiceManager,Guid,dwQueryVer);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//创建游戏桌
|
||||
VOID * CGameServiceManager::CreateTableFrameSink(REFGUID Guid, DWORD dwQueryVer)
|
||||
{
|
||||
//建立对象
|
||||
CTableFrameSink * pTableFrameSink=NULL;
|
||||
try
|
||||
{
|
||||
pTableFrameSink=new CTableFrameSink();
|
||||
if (pTableFrameSink==NULL) throw TEXT("创建失败");
|
||||
void * pObject=pTableFrameSink->QueryInterface(Guid,dwQueryVer);
|
||||
if (pObject==NULL) throw TEXT("接口查询失败");
|
||||
return pObject;
|
||||
}
|
||||
catch (...) {}
|
||||
|
||||
//清理对象
|
||||
SafeDelete(pTableFrameSink);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//获取属性
|
||||
bool CGameServiceManager::GetServiceAttrib(tagGameServiceAttrib & GameServiceAttrib)
|
||||
{
|
||||
GameServiceAttrib=m_GameServiceAttrib;
|
||||
return true;
|
||||
}
|
||||
|
||||
//参数修改
|
||||
bool CGameServiceManager::RectifyParameter(tagGameServiceOption & GameServiceOption)
|
||||
{
|
||||
//效验参数
|
||||
ASSERT(&GameServiceOption!=NULL);
|
||||
if (&GameServiceOption==NULL) return false;
|
||||
|
||||
//单元积分
|
||||
GameServiceOption.lCellScore=__max(1L,GameServiceOption.lCellScore);
|
||||
|
||||
////积分下限
|
||||
//if (GameServiceOption.wServerType!=GAME_GENRE_SCORE)
|
||||
//{
|
||||
// GameServiceOption.lMinTableScore=__max(GameServiceOption.lCellScore*50L,GameServiceOption.lMinTableScore);
|
||||
//}
|
||||
|
||||
CTableFrameSink::ReadServerConfig(&GameServiceOption);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//获取配置
|
||||
bool CGameServiceManager::SaveCustomRule(LPBYTE pcbCustomRule, WORD wCustonSize)
|
||||
{
|
||||
//效验状态
|
||||
ASSERT(m_pDlgCustomRule!=NULL);
|
||||
if (m_pDlgCustomRule==NULL) return false;
|
||||
|
||||
//变量定义
|
||||
ASSERT(wCustonSize>=sizeof(tagCustomRule));
|
||||
tagCustomRule * pCustomRule=(tagCustomRule *)pcbCustomRule;
|
||||
|
||||
//获取配置
|
||||
if (m_pDlgCustomRule->GetCustomRule(*pCustomRule)==false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//默认配置
|
||||
bool CGameServiceManager::DefaultCustomRule(LPBYTE pcbCustomRule, WORD wCustonSize)
|
||||
{
|
||||
//变量定义
|
||||
ASSERT(wCustonSize>=sizeof(tagCustomRule));
|
||||
tagCustomRule * pCustomRule=(tagCustomRule *)pcbCustomRule;
|
||||
|
||||
//设置变量
|
||||
pCustomRule->lRoomStorageStart = 100000;
|
||||
pCustomRule->lRoomStorageDeduct = 0;
|
||||
pCustomRule->lRoomStorageMax1 = 1000000;
|
||||
pCustomRule->lRoomStorageMul1 = 50;
|
||||
pCustomRule->lRoomStorageMax2 = 5000000;
|
||||
pCustomRule->lRoomStorageMul2 = 80;
|
||||
|
||||
//机器人存款取款
|
||||
pCustomRule->lRobotScoreMin = 100000;
|
||||
pCustomRule->lRobotScoreMax = 1000000;
|
||||
pCustomRule->lRobotBankGet = 1000000;
|
||||
pCustomRule->lRobotBankGetBanker = 10000000;
|
||||
pCustomRule->lRobotBankStoMul = 10;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//创建窗口
|
||||
HWND CGameServiceManager::CreateCustomRule(CWnd * pParentWnd, CRect rcCreate, LPBYTE pcbCustomRule, WORD wCustonSize)
|
||||
{
|
||||
//创建窗口
|
||||
if (m_pDlgCustomRule==NULL)
|
||||
{
|
||||
m_pDlgCustomRule=new CDlgCustomRule;
|
||||
}
|
||||
|
||||
//创建窗口
|
||||
if (m_pDlgCustomRule->m_hWnd==NULL)
|
||||
{
|
||||
//设置资源
|
||||
AfxSetResourceHandle(GetModuleHandle(m_GameServiceAttrib.szServerDLLName));
|
||||
|
||||
//创建窗口
|
||||
m_pDlgCustomRule->Create(IDD_CUSTOM_RULE,pParentWnd);
|
||||
|
||||
//还原资源
|
||||
AfxSetResourceHandle(GetModuleHandle(NULL));
|
||||
}
|
||||
|
||||
//设置变量
|
||||
ASSERT(wCustonSize>=sizeof(tagCustomRule));
|
||||
m_pDlgCustomRule->SetCustomRule(*((tagCustomRule *)pcbCustomRule));
|
||||
|
||||
//显示窗口
|
||||
m_pDlgCustomRule->SetWindowPos(NULL,rcCreate.left,rcCreate.top,rcCreate.Width(),rcCreate.Height(),SWP_NOZORDER|SWP_SHOWWINDOW);
|
||||
|
||||
return m_pDlgCustomRule->GetSafeHwnd();
|
||||
}
|
||||
|
||||
//创建机器
|
||||
VOID * CGameServiceManager::CreateAndroidUserItemSink(REFGUID Guid, DWORD dwQueryVer)
|
||||
{
|
||||
try
|
||||
{
|
||||
//创建组件
|
||||
if (m_AndroidServiceHelper.GetInterface() == NULL)
|
||||
{
|
||||
m_AndroidServiceHelper.SetModuleCreateInfo(ANDROID_SERVICE_DLL_NAME, "CreateGameServiceManager");
|
||||
|
||||
if (!m_AndroidServiceHelper.CreateInstance()) throw 0;
|
||||
}
|
||||
|
||||
//创建机器人
|
||||
VOID *pAndroidObject = m_AndroidServiceHelper->CreateAndroidUserItemSink(Guid, dwQueryVer);
|
||||
if (pAndroidObject == NULL)
|
||||
{
|
||||
CTraceService::TraceString(TEXT("CGameServiceManager创建机器人失败"), TraceLevel_Exception);
|
||||
throw TEXT("创建机器人失败");
|
||||
}
|
||||
return pAndroidObject;
|
||||
}
|
||||
catch (...) {}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//创建数据
|
||||
VOID * CGameServiceManager::CreateGameDataBaseEngineSink(REFGUID Guid, DWORD dwQueryVer)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//建立对象函数
|
||||
extern "C" __declspec(dllexport) VOID * CreateGameServiceManager(REFGUID Guid, DWORD dwInterfaceVer)
|
||||
{
|
||||
static CGameServiceManager GameServiceManager;
|
||||
return GameServiceManager.QueryInterface(Guid,dwInterfaceVer);
|
||||
}
|
||||
65
Servers/游戏组件/房卡牛牛/游戏服务器/GameServerManager.h
Normal file
65
Servers/游戏组件/房卡牛牛/游戏服务器/GameServerManager.h
Normal file
@@ -0,0 +1,65 @@
|
||||
#ifndef GAME_SERVER_MANAGER_HEAD_FILE
|
||||
#define GAME_SERVER_MANAGER_HEAD_FILE
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Stdafx.h"
|
||||
#include "DlgCustomRule.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//游戏服务器管理类
|
||||
class CGameServiceManager : public IGameServiceManager, public IGameServiceCustomRule
|
||||
{
|
||||
//变量定义
|
||||
protected:
|
||||
tagGameServiceAttrib m_GameServiceAttrib; //服务属性
|
||||
//组件变量
|
||||
CGameServiceManagerHelper m_AndroidServiceHelper; //机器人服务
|
||||
|
||||
CDlgCustomRule * m_pDlgCustomRule; //自定规则
|
||||
|
||||
//函数定义
|
||||
public:
|
||||
//构造函数
|
||||
CGameServiceManager(void);
|
||||
//析构函数
|
||||
virtual ~CGameServiceManager(void);
|
||||
|
||||
|
||||
//基础接口
|
||||
public:
|
||||
//释放对象
|
||||
virtual VOID Release() { return; }
|
||||
//接口查询
|
||||
virtual VOID * QueryInterface(const IID & Guid, DWORD dwQueryVer);
|
||||
|
||||
//创建接口
|
||||
public:
|
||||
//创建桌子
|
||||
virtual VOID * CreateTableFrameSink(REFGUID Guid, DWORD dwQueryVer);
|
||||
//创建机器
|
||||
virtual VOID * CreateAndroidUserItemSink(REFGUID Guid, DWORD dwQueryVer);
|
||||
//创建数据
|
||||
virtual VOID * CreateGameDataBaseEngineSink(REFGUID Guid, DWORD dwQueryVer);
|
||||
|
||||
//参数接口
|
||||
public:
|
||||
//组件属性
|
||||
virtual bool GetServiceAttrib(tagGameServiceAttrib & GameServiceAttrib);
|
||||
//调整参数
|
||||
virtual bool RectifyParameter(tagGameServiceOption & GameServiceOption);
|
||||
|
||||
//配置接口
|
||||
public:
|
||||
//默认配置
|
||||
virtual bool DefaultCustomRule(LPBYTE pcbCustomRule, WORD wCustonSize);
|
||||
//获取配置
|
||||
virtual bool SaveCustomRule(LPBYTE pcbCustomRule, WORD wCustonSize);
|
||||
//创建窗口
|
||||
virtual HWND CreateCustomRule(CWnd * pParentWnd, CRect rcCreate, LPBYTE pcbCustomRule, WORD wCustonSize);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
82
Servers/游戏组件/房卡牛牛/游戏服务器/HistoryScore.cpp
Normal file
82
Servers/游戏组件/房卡牛牛/游戏服务器/HistoryScore.cpp
Normal file
@@ -0,0 +1,82 @@
|
||||
#include "Stdafx.h"
|
||||
#include "HistoryScore.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//构造函数
|
||||
CHistoryScore::CHistoryScore()
|
||||
{
|
||||
//设置变量
|
||||
ZeroMemory(m_HistoryScore,sizeof(m_HistoryScore));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//析构函数
|
||||
CHistoryScore::~CHistoryScore()
|
||||
{
|
||||
}
|
||||
|
||||
//重置数据
|
||||
VOID CHistoryScore::ResetData()
|
||||
{
|
||||
//设置变量
|
||||
ZeroMemory(m_HistoryScore,sizeof(m_HistoryScore));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//获取积分
|
||||
tagHistoryScore * CHistoryScore::GetHistoryScore(WORD wChairID)
|
||||
{
|
||||
//效验参数
|
||||
ASSERT(wChairID<GAME_PLAYER);
|
||||
if (wChairID>=GAME_PLAYER) return NULL;
|
||||
|
||||
//获取积分
|
||||
return &m_HistoryScore[wChairID];
|
||||
}
|
||||
|
||||
//用户进入
|
||||
VOID CHistoryScore::OnEventUserEnter(WORD wChairID)
|
||||
{
|
||||
//效验椅子
|
||||
ASSERT(wChairID<GAME_PLAYER);
|
||||
if (wChairID>=GAME_PLAYER) return;
|
||||
|
||||
//设置变量
|
||||
m_HistoryScore[wChairID].lTurnScore=0;
|
||||
m_HistoryScore[wChairID].lCollectScore=0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//用户离开
|
||||
VOID CHistoryScore::OnEventUserLeave(WORD wChairID)
|
||||
{
|
||||
//效验椅子
|
||||
ASSERT(wChairID<GAME_PLAYER);
|
||||
if (wChairID>=GAME_PLAYER) return;
|
||||
|
||||
//设置变量
|
||||
m_HistoryScore[wChairID].lTurnScore=0;
|
||||
m_HistoryScore[wChairID].lCollectScore=0;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//用户积分
|
||||
VOID CHistoryScore::OnEventUserScore(WORD wChairID, LONGLONG lGameScore)
|
||||
{
|
||||
//效验参数
|
||||
ASSERT(wChairID<GAME_PLAYER);
|
||||
if (wChairID>=GAME_PLAYER) return;
|
||||
|
||||
//设置变量
|
||||
m_HistoryScore[wChairID].lTurnScore=lGameScore;
|
||||
m_HistoryScore[wChairID].lCollectScore+=lGameScore;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
53
Servers/游戏组件/房卡牛牛/游戏服务器/HistoryScore.h
Normal file
53
Servers/游戏组件/房卡牛牛/游戏服务器/HistoryScore.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#ifndef HISTORY_SCORE_HEAD_FILE
|
||||
#define HISTORY_SCORE_HEAD_FILE
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Stdafx.h"
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//结构定义
|
||||
|
||||
//积分信息
|
||||
struct tagHistoryScore
|
||||
{
|
||||
LONGLONG lTurnScore; //积分信息
|
||||
LONGLONG lCollectScore; //积分信息
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//历史积分
|
||||
class CHistoryScore
|
||||
{
|
||||
//变量定义
|
||||
protected:
|
||||
tagHistoryScore m_HistoryScore[GAME_PLAYER]; //积分信息
|
||||
|
||||
//函数定义
|
||||
public:
|
||||
//构造函数
|
||||
CHistoryScore();
|
||||
//析构函数
|
||||
virtual ~CHistoryScore();
|
||||
|
||||
//功能函数
|
||||
public:
|
||||
//重置数据
|
||||
VOID ResetData();
|
||||
//获取积分
|
||||
tagHistoryScore * GetHistoryScore(WORD wChairID);
|
||||
|
||||
//事件函数
|
||||
public:
|
||||
//用户进入
|
||||
VOID OnEventUserEnter(WORD wChairID);
|
||||
//用户离开
|
||||
VOID OnEventUserLeave(WORD wChairID);
|
||||
//用户积分
|
||||
VOID OnEventUserScore(WORD wChairID, LONGLONG lGameScore);
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#endif
|
||||
55
Servers/游戏组件/房卡牛牛/游戏服务器/ReadMe.txt
Normal file
55
Servers/游戏组件/房卡牛牛/游戏服务器/ReadMe.txt
Normal file
@@ -0,0 +1,55 @@
|
||||
========================================================================
|
||||
MICROSOFT 基础类库 : GameServer 项目概况
|
||||
========================================================================
|
||||
|
||||
|
||||
应用程序向导已为您创建了此 GameServer DLL。此 DLL 不仅
|
||||
说明了使用 Microsoft 基础类的基础,而且
|
||||
也是编写 DLL 的起点。
|
||||
|
||||
此文件包含组成 GameServer DLL
|
||||
的每个文件的内容摘要。
|
||||
|
||||
GameServer.vcproj
|
||||
这是用应用程序向导生成的 VC++ 项目的主项目文件。
|
||||
它包含有关生成此文件的 Visual C++ 版本的信息,以及
|
||||
有关使用应用程序向导选择的
|
||||
平台、配置和项目功能的信息。
|
||||
|
||||
GameServer.cpp
|
||||
这是包含 DllMain()
|
||||
定义的主 DLL 源文件。
|
||||
GameServer.rc
|
||||
这是程序使用的所有 Microsoft Windows 资源的列表。
|
||||
它包含存储在 RES 子目录下的图标、位图和光标。
|
||||
此文件可在 Microsoft Visual C++ 中直接编辑。
|
||||
|
||||
|
||||
res\GameServer.rc2
|
||||
此文件包含不由 Microsoft
|
||||
Visual C++ 编辑的资源。您应将不能由
|
||||
资源编辑器编辑的所有资源放置在此文件中。
|
||||
|
||||
GameServer.def
|
||||
此文件包含有关运行 Microsoft Windows
|
||||
所需的 DLL 的信息。
|
||||
它定义此 DLL 的名称和说明等参数。
|
||||
它还从此 DLL 导出函数。
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
其他标准文件:
|
||||
|
||||
StdAfx.h、StdAfx.cpp
|
||||
这些文件用于生成名为 GameServer.pch
|
||||
的预编译头(PCH)文件以及名为 StdAfx.obj 的预编译类型文件。
|
||||
|
||||
Resource.h
|
||||
这是标准的头文件,它定义了新的资源 ID。
|
||||
Microsoft Visual C++ 读取和更新此文件。
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
其他注释:
|
||||
|
||||
应用程序向导使用 "TODO:" 注释指示应添加或自定义的源代码部分。
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
32
Servers/游戏组件/房卡牛牛/游戏服务器/Release/GameServer.log
Normal file
32
Servers/游戏组件/房卡牛牛/游戏服务器/Release/GameServer.log
Normal file
@@ -0,0 +1,32 @@
|
||||
生成启动时间为 2020-04-04 20:08:45。
|
||||
1>项目“H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\游戏服务器\GameServer.vcxproj”在节点 2 上(Build 个目标)。
|
||||
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(357,5): warning MSB8004: Output Directory does not end with a trailing slash. This build instance will add the slash as it is required to allow proper evaluation of the Output Directory.
|
||||
1>ClCompile:
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /O2 /Oy- /D WIN32 /D _WINDOWS /D NDEBUG /D _AFXEXT /D _WINDLL /D _MBCS /D _AFXDLL /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yc"stdafx.h" /Fp"Release\NiuNiuServer.pch" /Fo"Release\\" /Fd"Release\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt Stdafx.cpp
|
||||
Stdafx.cpp
|
||||
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afx.h(38): warning C4996: 'MBCS_Support_Deprecated_In_MFC': MBCS support in MFC is deprecated and may be removed in a future version of MFC.
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\atlmfc\include\afx.h(33) : 参见“MBCS_Support_Deprecated_In_MFC”的声明
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /O2 /Oy- /D WIN32 /D _WINDOWS /D NDEBUG /D _AFXEXT /D _WINDLL /D _MBCS /D _AFXDLL /Gm- /EHsc /MD /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yu"stdafx.h" /Fp"Release\NiuNiuServer.pch" /Fo"Release\\" /Fd"Release\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt DlgCustomRule.cpp GameLogic.cpp GameServer.cpp GameServerManager.cpp HistoryScore.cpp TableFrameSink.cpp
|
||||
DlgCustomRule.cpp
|
||||
GameLogic.cpp
|
||||
GameServer.cpp
|
||||
GameServerManager.cpp
|
||||
HistoryScore.cpp
|
||||
TableFrameSink.cpp
|
||||
正在生成代码...
|
||||
Link:
|
||||
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"../../../../运行/Release/Ansi/NiuNiuServer.DLL" /INCREMENTAL:NO /NOLOGO /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /manifestinput:"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\Include\Manifest\dpiaware.manifest" /DEBUG /PDB:"..\..\..\..\运行\Release\Ansi\NiuNiuServer.pdb" /SUBSYSTEM:WINDOWS /OPT:REF /OPT:ICF /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"..\..\..\..\运行\Release\Ansi\GameServer.lib" /MACHINE:X86 /SAFESEH /DLL Release\GameServer.res
|
||||
Release\DlgCustomRule.obj
|
||||
Release\GameLogic.obj
|
||||
Release\GameServer.obj
|
||||
Release\GameServerManager.obj
|
||||
Release\HistoryScore.obj
|
||||
Release\Stdafx.obj
|
||||
Release\TableFrameSink.obj
|
||||
正在创建库 ..\..\..\..\运行\Release\Ansi\GameServer.lib 和对象 ..\..\..\..\运行\Release\Ansi\GameServer.exp
|
||||
GameServer.vcxproj -> H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\游戏服务器\..\..\..\..\运行\Release\Ansi\NiuNiuServer.dll
|
||||
1>已完成生成项目“H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\游戏服务器\GameServer.vcxproj”(Build 个目标)的操作。
|
||||
|
||||
生成成功。
|
||||
|
||||
已用时间 00:00:34.93
|
||||
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/GameServer.res
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/GameServer.res
Normal file
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\niuniuserver.pch
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\vc120.pdb
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\stdafx.obj
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\tableframesink.obj
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\historyscore.obj
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\gameservermanager.obj
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\gameserver.obj
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\gamelogic.obj
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\dlgcustomrule.obj
|
||||
h:\git\wnmj\wnmj\运行\release\ansi\niuniuserver.dll
|
||||
h:\git\wnmj\wnmj\运行\release\ansi\niuniuserver.pdb
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\gameserver.res
|
||||
h:\git\wnmj\wnmj\运行\release\ansi\gameserver.lib
|
||||
h:\git\wnmj\wnmj\运行\release\ansi\gameserver.exp
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\msado15.tli
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\msado15.tlh
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\..\..\..\..\运行\release\ansi\niuniuserver.dll
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\游戏服务端.tlog\cl.command.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\游戏服务端.tlog\cl.read.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\游戏服务端.tlog\cl.write.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\游戏服务端.tlog\link.command.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\游戏服务端.tlog\link.read.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\游戏服务端.tlog\link.write.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\游戏服务端.tlog\rc.command.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\游戏服务端.tlog\rc.read.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\游戏服务端.tlog\rc.write.1.tlog
|
||||
h:\git\wnmj\wnmj\servers\游戏组件\房卡牛牛\游戏服务器\release\游戏服务端.tlog\游戏服务端.write.1u.tlog
|
||||
3140
Servers/游戏组件/房卡牛牛/游戏服务器/Release/msado15.tlh
Normal file
3140
Servers/游戏组件/房卡牛牛/游戏服务器/Release/msado15.tlh
Normal file
File diff suppressed because it is too large
Load Diff
2126
Servers/游戏组件/房卡牛牛/游戏服务器/Release/msado15.tli
Normal file
2126
Servers/游戏组件/房卡牛牛/游戏服务器/Release/msado15.tli
Normal file
File diff suppressed because it is too large
Load Diff
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/CL.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/CL.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/CL.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/CL.write.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/cl.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/cl.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/link.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/link.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/link.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/link.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/link.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/link.write.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/rc.command.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/rc.command.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/rc.read.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/rc.read.1.tlog
Normal file
Binary file not shown.
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/rc.write.1.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/rc.write.1.tlog
Normal file
Binary file not shown.
@@ -0,0 +1,2 @@
|
||||
#TargetFrameworkVersion=v4.0:PlatformToolSet=v120:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit
|
||||
Release|Win32|H:\git\wnmj\wnmj\Servers\游戏组件\房卡牛牛\|
|
||||
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/游戏服务端.write.1u.tlog
Normal file
BIN
Servers/游戏组件/房卡牛牛/游戏服务器/Release/游戏服务端.tlog/游戏服务端.write.1u.tlog
Normal file
Binary file not shown.
13
Servers/游戏组件/房卡牛牛/游戏服务器/Res/GameServer.rc2
Normal file
13
Servers/游戏组件/房卡牛牛/游戏服务器/Res/GameServer.rc2
Normal file
@@ -0,0 +1,13 @@
|
||||
//
|
||||
// GameServer.RC2 - Microsoft Visual C++ 不会直接编辑的资源
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#error this file is not editable by Microsoft Visual C++
|
||||
#endif //APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// 在此处添加手动编辑的资源...
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
27
Servers/游戏组件/房卡牛牛/游戏服务器/Resource.h
Normal file
27
Servers/游戏组件/房卡牛牛/游戏服务器/Resource.h
Normal file
@@ -0,0 +1,27 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by GameServer.rc
|
||||
//
|
||||
#define IDD_CUSTOM_RULE 9
|
||||
#define IDC_EDIT_ROOMSTORAGE_START 201
|
||||
#define IDC_EDIT_ROOMSTORAGE_DEDUCT 202
|
||||
#define IDC_EDIT_ROOMSTORAGE_MAX1 203
|
||||
#define IDC_EDIT_ROOMSTORAGE_MUL1 204
|
||||
#define IDC_EDIT_ROOMSTORAGE_MAX2 205
|
||||
#define IDC_EDIT_ROOMSTORAGE_MUL2 206
|
||||
#define IDC_ROBOT_SCOREMIN 207
|
||||
#define IDC_ROBOT_BANKERGETBANKER 208
|
||||
#define IDC_ROBOT_SCOREMAX 209
|
||||
#define IDC_ROBOT_BANKGET 210
|
||||
#define IDC_ROBOT_STOMUL 211
|
||||
|
||||
// Next default values for new objects
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 202
|
||||
#define _APS_NEXT_COMMAND_VALUE 32768
|
||||
#define _APS_NEXT_CONTROL_VALUE 208
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
||||
13
Servers/游戏组件/房卡牛牛/游戏服务器/ServerControl.h
Normal file
13
Servers/游戏组件/房卡牛牛/游戏服务器/ServerControl.h
Normal file
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
//游戏控制基类
|
||||
class IServerControl
|
||||
{
|
||||
public:
|
||||
IServerControl(void){};
|
||||
virtual ~IServerControl(void){};
|
||||
|
||||
public:
|
||||
//返回控制区域
|
||||
virtual bool __cdecl ControlResult(BYTE cbControlCardData[GAME_PLAYER][MAX_COUNT], ROOMUSERCONTROL Keyroomusercontrol) = NULL;
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user