woaidaima2016 发表于 2017-6-13 11:56:45

扯旋【源码】

http://img.woaidaima.com//upload/image/20170510/1494378171926042255.jpghttp://img.woaidaima.com//upload/image/20170510/1494378173628010686.jpg#include "StdAfx.h"
#include "Tableframesink.h"
#include "GameServerManager.h"

//////////////////////////////////////////////////////////////////////////

//全局变量
static CGameServiceManager            g_GameServiceManager;                //管理变量

//////////////////////////////////////////////////////////////////////////


//构造函数
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("CheXuan.EXE"),CountArray(m_GameServiceAttrib.szClientEXEName));
    lstrcpyn(m_GameServiceAttrib.szServerDLLName,TEXT("CheXuanServer.DLL"),CountArray(m_GameServiceAttrib.szServerDLLName));

    return;
}

//析构函数
CGameServiceManager::~CGameServiceManager(void)
{
}

//接口查询
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;
}

//创建数据
VOID * CGameServiceManager::CreateGameDataBaseEngineSink(REFGUID Guid, DWORD dwQueryVer)
{
    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*5L,GameServiceOption.lMinTableScore);
    }

    //输分限制(原来的积分上限)
    if (GameServiceOption.lRestrictScore!=0L)
    {
      GameServiceOption.lRestrictScore=__max(GameServiceOption.lRestrictScore,GameServiceOption.lMinTableScore);
    }

    //积分上限
    if (GameServiceOption.wServerType!=GAME_GENRE_SCORE)
    {
      if(GameServiceOption.lMaxEnterScore<=GameServiceOption.lMinTableScore)
            GameServiceOption.lMaxEnterScore=0L;
      else if(GameServiceOption.lRestrictScore>0)
            GameServiceOption.lMaxEnterScore=__min(GameServiceOption.lMaxEnterScore,GameServiceOption.lRestrictScore);
    }

    return true;
}

//获取配置
bool CGameServiceManager::SaveCustomRule(LPBYTE pcbCustomRule, WORD wCustonSize)
{

    return true;
}

//默认配置
bool CGameServiceManager::DefaultCustomRule(LPBYTE pcbCustomRule, WORD wCustonSize)
{

    return true;
}

//创建窗口
HWND CGameServiceManager::CreateCustomRule(CWnd * pParentWnd, CRect rcCreate, LPBYTE pcbCustomRule, WORD wCustonSize)
{
    return NULL;
}

//////////////////////////////////////////////////////////////////////////////////

//建立对象函数
extern "C" __declspec(dllexport) VOID * CreateGameServiceManager(const GUID & Guid, DWORD dwInterfaceVer)
{
    static CGameServiceManager GameServiceManager;
    return GameServiceManager.QueryInterface(Guid,dwInterfaceVer);
}

//创建机器
VOID *CGameServiceManager::CreateAndroidUserItemSink(REFGUID Guid, DWORD dwQueryVer)
{
    //try
    //{
    //    //创建组件
    //    if( m_AndroidServiceHelper.GetInterface() == NULL )
    //    {
    //      m_AndroidServiceHelper.SetModuleCreateInfo(TEXT("ZodiacBattleAndroid.dll"),TEXT("CreateAndroidService"));

    //      if( !m_AndroidServiceHelper.CreateInstance() ) throw 0;
    //    }

    //    //创建机器人
    //    VOID *pAndroidObject = m_AndroidServiceHelper->CreateAndroidUserItemSink(Guid,dwQueryVer);
    //    if( pAndroidObject == NULL ) throw TEXT("创建机器人失败");

    //    return pAndroidObject;
    //}
    //catch(...) {}

    return NULL;
}

//////////////////////////////////////////////////////////////////////////





11718677 发表于 2021-12-24 14:19:28

怎么卖的啊

11718677 发表于 2021-12-24 14:19:51

留个联系方式吧

18673992227 发表于 2023-7-19 18:11:56

大神,有意出售吗?可以的话私聊一下

x1247551682 发表于 2023-10-16 15:40:14

朋友 方便留个联系方式吗?
页: [1]
查看完整版本: 扯旋【源码】