예제 #1
0
// 下分
void OnPollScore(char Id) {
	struct stUserInfo *pUser = GetUserInfo(Id);
	int LocalTotal = GetIntValue(UD_TOTALSCORE+Id);
	int Total = LocalTotal - pUser->TotalBetScore;
	// 正在退币,不能下分
	if (IsPollingCoin(Id)) {
		return;
	}

	// 没开锁
	if (!(ConstDownKey[Id] & KEY_LOCK)) {
		return;
	}
	
	// 减总分
	if (Total > GetIntValue(UD_POLLSCORE_RATIO)) {
		Total -= GetIntValue(UD_POLLSCORE_RATIO);
		LocalTotal -= GetIntValue(UD_POLLSCORE_RATIO);
		SetIntValue(UD_TOTALSCORE+Id, LocalTotal);														// 保存总分
		SetIntValue(UD_POLLSCORE+Id, GetIntValue(UD_POLLSCORE+Id)+GetIntValue(UD_POLLSCORE_RATIO));		// 保存下分
	} else {
		LocalTotal -= Total;
		SetIntValue(UD_TOTALSCORE+Id, LocalTotal);								// 保存总分
		SetIntValue(UD_POLLSCORE+Id, GetIntValue(UD_POLLSCORE+Id)+Total);		// 保存下分
	}
}
예제 #2
0
void nsPrinterFeatures::SetPaperRecord(PRInt32 aIndex, const char *aPaperName, PRInt32 aWidthMM, PRInt32 aHeightMM, PRBool aIsInch)
{
  SetCharValue(nsPrintfCString(256, "paper.%d.name",      aIndex).get(), aPaperName);
  SetIntValue( nsPrintfCString(256, "paper.%d.width_mm",  aIndex).get(), aWidthMM);
  SetIntValue( nsPrintfCString(256, "paper.%d.height_mm", aIndex).get(), aHeightMM);
  SetBoolValue(nsPrintfCString(256, "paper.%d.is_inch",   aIndex).get(), aIsInch);
}
예제 #3
0
// 接收投退币个数
// ***退币流程*** //
// 1.押分板按下退币,发送消息
// 2.主卡从接收到消息开始倒计时5S
// 3.押分板每次退一个币就发送一条消息到主卡
// 4.主卡每接收到退币个数即重新倒计时
// 5.如果在倒计时内不接收到来自押分板的退币个数消息,即表示退币完毕
// 6.在倒计时内不可押分
void Process_CoinInfo(unsigned char Id, unsigned char *Data) {
	short PushCoinCount,PollCoinCount;
	int TotalScore = GetIntValue(UD_TOTALSCORE + Id);
	int PushScore, PollScore;
	
	PushCoinCount = GET_U16(Data);	Data += 2;	// 投币个数
	PollCoinCount = GET_U16(Data);	Data += 2;	// 退币个数
	PushScore = PushCoinCount*GetIntValue(UD_PUSHCOIN_RATIO);
	PollScore = PollCoinCount*GetIntValue(UD_POLLCOIN_RATIO);
	// 处理投币
	if (PushScore > 0) {
		SetIntValue(UD_PUSHSCORE + Id, GetIntValue(UD_PUSHSCORE + Id) + PushScore);
		SetIntValue(UD_TOTALSCORE + Id, TotalScore+PushScore);
	}

	// 处理退币
	if (PollScore > 0) {
		if (TotalScore >= PollScore) {
			SetIntValue(UD_POLLSCORE + Id, GetIntValue(UD_POLLSCORE + Id) + PollScore);
			SetIntValue(UD_TOTALSCORE + Id, TotalScore - PollScore);
		}

		// 重新设置退币倒计时
		UpdatePollingCoinTime(Id, 5);
	}
	
	// 更新总分
	if (TotalScore != GetIntValue(UD_TOTALSCORE + Id)) {
		Set_Score(Id);
	}
}
예제 #4
0
void InitUserData(void) 
{
	char Idx;
	for (Idx = 0; Idx < PLAYER_COUNT; Idx++) {
		ALLBITS |= (1<<Idx);
	}

	if (READINTVALUE(UD_FIRSTRUN_FLAG) == FIRSTRUN_FLAG) {
		ReadUserData();
		if (GetCharValue(UD_START_SAVE)) {
			RecoverPlayerData();
		}
		if (GetCharValue(UD_UNSAVE_SCORE)) {
			SaveBetWinScore();
		}
	} else {
		ClearUserData();
		SetIntValue(UD_FIRSTRUN_FLAG, FIRSTRUN_FLAG);
	}
#ifdef _NO_PRINT
	SetCharValue(UD_IF_PRINT, 0);
#endif

#ifdef _TEST_
#define Debug lite_printf
	//ClearUserData();
	//SetIntValue(UD_FIRSTRUN_FLAG, FIRSTRUN_FLAG);-
	SetCharValue(UD_IF_PRINT, 0);
	//SetCharValue(UD_BETTIME, 5);
	//SetCharValue(UD_EXTRA_CODE_DIFFICULT, 1);	// 外5门设定难度
	//SetIntValue(UD_ROUNDLOSS_BOOM, 1000000);		// 当轮输爆机
	//SetIntValue(UD_STAGEWIN_BOOM, 20000000);		// 当期max loss
	//SetIntValue(UD_STAGELOSS_BOOM, 300000000);		// 当期max win
//	for (Idx = 0; Idx < UD_MAXCHAR_STATE; Idx++) {
//		Debug("%p = %d/%d\n", UserDataCharArray + Idx, READCHARVALUE(Idx), UserDataCharArray[Idx]);
//	}
//	for (Idx = 0; Idx < UD_MAXSHORT_STATE; Idx++) {
//		Debug("%p = %d/%d\n", UserDataShortArray + Idx, READSHORTVALUE(Idx), UserDataShortArray[Idx]);
//	}
	for (Idx = 0; Idx < UD_MAXINT_STATE; Idx++) {
		Debug("%p = %d/%d\n", UserDataIntArray + Idx, READINTVALUE(Idx), UserDataIntArray[Idx]);
	}
//	for (Idx = 0; Idx < UD_MAXLONGLONG_STATE; Idx++) {
//		Debug("%p = %d/", UserDataLongLongArray + Idx, READLONGLONGVALUE(Idx));
//		Debug("%d\n", UserDataLongLongArray[Idx]);
//	}
Debug("UUID:\n");
	for (Idx = 0; Idx < USB_PLAYER_COUNT; Idx++) {
		Debug("%p:%d/%d\n", UserDataIntArray+UD_INVALID_INT+Idx, GetIntValue(UD_USB_UUID+Idx), READINTVALUE(UD_USB_UUID+Idx));
	}
	
	SetIntValue(UD_USB_UUID + 5, 123456);
	SetIntValue(UD_USB_UUID + 6, 876543210);
#endif
}
void IntArrayElement::ReadAttributes(const DOMNode* node)
{
	_ASSERTE(node != NULL);

	DOMNamedNodeMap* attr = node->getAttributes();
	if( attr == NULL ) { return; }

	SetUIntValue( attrCount, Get_count_Attribute( attr ) );
	SetStringValue( attrId, Get_id_Attribute( attr ) );
	SetStringValue( attrName, Get_name_Attribute( attr ) );
	SetIntValue( attrMinInclusive, Get_MinInclusive_Attribute( attr ) );
	SetIntValue( attrMaxInclusive, Get_MaxInclusive_Attribute( attr ) );
}
예제 #6
0
// 上分
void OnPushScore(char Id) {
	struct stUserInfo *pUser = GetUserInfo(Id);
	int Total = GetIntValue(UD_TOTALSCORE+Id);
	
	// 没开锁
	if (!(ConstDownKey[Id] & KEY_LOCK)) {
		return;
	}
	
	Total += GetIntValue(UD_PUSHSCORE_RATIO);
	// 总分
	SetIntValue(UD_TOTALSCORE+Id, Total);
	
	// 上分
	SetIntValue(UD_PUSHSCORE+Id, GetIntValue(UD_PUSHSCORE+Id)+GetIntValue(UD_PUSHSCORE_RATIO));
}
예제 #7
0
void CGUISliderControl::SetFloatValue(float fValue, RangeSelector selector /* = RangeSelectorLower */, bool updateCurrent /* = false */)
{
  if (m_iType == SPIN_CONTROL_TYPE_FLOAT)
  {
    if (fValue > m_fEnd) fValue = m_fEnd;
    else if (fValue < m_fStart) fValue = m_fStart;

    float fValueLower = selector == RangeSelectorLower ? fValue : m_floatValues[0];
    float fValueUpper = selector == RangeSelectorUpper ? fValue : m_floatValues[1];

    if (!m_rangeSelection || fValueLower <= fValueUpper)
    {
      m_floatValues[0] = fValueLower;
      m_floatValues[1] = fValueUpper;
      if (updateCurrent)
        m_currentSelector = selector;
    }
    else
    {
      m_floatValues[0] = fValueUpper;
      m_floatValues[1] = fValueLower;
      if (updateCurrent)
        m_currentSelector = (selector == RangeSelectorLower ? RangeSelectorUpper : RangeSelectorLower);
    }
  }
  else if (m_iType == SPIN_CONTROL_TYPE_INT)
    SetIntValue((int)fValue);
  else
    SetPercentage((int)fValue);
}
예제 #8
0
void CGUISliderControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  bool dirty = false;

  dirty |= m_guiBackground.SetPosition( m_posX, m_posY );
  int infoCode = m_iInfoCode;
  if (m_action && (!m_dragging || m_action->fireOnDrag))
    infoCode = m_action->infoCode;
  if (infoCode)
  {
    int val;
    if (g_infoManager.GetInt(val, infoCode))
      SetIntValue(val);
  }

  float fScaleY = m_height == 0 ? 1.0f : m_height / m_guiBackground.GetTextureHeight();

  dirty |= m_guiBackground.SetHeight(m_height);
  dirty |= m_guiBackground.SetWidth(m_width);
  dirty |= m_guiBackground.Process(currentTime);

  CGUITexture &nibLower = (m_bHasFocus && !IsDisabled() && m_currentSelector == RangeSelectorLower) ? m_guiSelectorLowerFocus : m_guiSelectorLower;
  dirty |= ProcessSelector(nibLower, currentTime, fScaleY, RangeSelectorLower);
  if (m_rangeSelection)
  {
    CGUITexture &nibUpper = (m_bHasFocus && !IsDisabled() && m_currentSelector == RangeSelectorUpper) ? m_guiSelectorUpperFocus : m_guiSelectorUpper;
    dirty |= ProcessSelector(nibUpper, currentTime, fScaleY, RangeSelectorUpper);
  }

  if (dirty)
    MarkDirtyRegion();

  CGUIControl::Process(currentTime, dirtyregions);
}
예제 #9
0
// 恢复玩家信息
void RecoverPlayerData(void) {
	int idx;
	int address;
	
	address = UD_MAXCHAR_STATE + UD_MAXSHORT_STATE*2 + UD_MAXINT_STATE*4 + UD_MAXLONGLONG_STATE*8 + UD_MAXBUFFER_STATE;
	// 上分
	for (idx = 0; idx < PLAYER_COUNT; idx++, address += 4) {
		SetIntValue(UD_PUSHSCORE + idx, RdFMint(address));
	}
	// 下分
	for (idx = 0; idx < PLAYER_COUNT; idx++, address += 4) {
		SetIntValue(UD_POLLSCORE + idx, RdFMint(address));
	}
	// 桌面分
	for (idx = 0; idx < PLAYER_COUNT; idx++, address += 4) {
		SetIntValue(UD_TOTALSCORE + idx, RdFMint(address));
	}
	// 玩家盈利
	for (idx = 0; idx < PLAYER_COUNT; idx++, address += 4) {
		SetIntValue(UD_PLAYER_PROFIT + idx, RdFMint(address));
	}
	// 上局押分
	for (idx = 0; idx < PLAYER_COUNT; idx++, address += 4) {
		SetIntValue(UD_LAST_TOTAL_BET + idx, RdFMint(address));
	}
	// 上局得分
	for (idx = 0; idx < PLAYER_COUNT; idx++, address += 4) {
		SetIntValue(UD_LAST_WON_SCORE + idx, RdFMint(address));
	}
	
	// 外5门永久盈利
	SetIntValue(UD_EXTRA_ALLPROFIT, RdFMint(address));			address += 4;
	// 外5门抽水池
	SetIntValue(UD_EXTRA_CHOUSHUI_POOL, RdFMint(address));		address += 4;
	// 外5门公司当前盈利
	SetIntValue(UD_EXTRA_COMPANY_PROFIT_POOL, RdFMint(address));address += 4;
	// 客户当前盈利
	SetIntValue(UD_CLIENT_PROFIT_POOL, RdFMint(address));		address += 4;	
	// 外5门总押分
	SetLongLongValue(UD_EXTRA_ALLBET, RdFMlonglong(address));	address += 8;
	
	// 标志复位
	SetCharValue(UD_START_SAVE, 0);
}
예제 #10
0
// 重新计算上局押分
void SaveBetWinScore(void) {
	char ID;
	for (ID = 0; ID < PLAYER_COUNT; ID++) {
		if (GetIntValue(UD_TOTALSCORE+ID) >= GetIntValue(UD_LAST_TOTAL_BET+ID) && GetIntValue(UD_LAST_WON_SCORE+ID) >= 0) {
			SetIntValue(UD_TOTALSCORE+ID, GetIntValue(UD_TOTALSCORE+ID)+GetIntValue(UD_LAST_WON_SCORE+ID)-GetIntValue(UD_LAST_TOTAL_BET+ID));
		}
		// 如果某个玩家的分数为负,则清0
		if (GetIntValue(UD_TOTALSCORE+ID) < 0) {
			SetIntValue(UD_TOTALSCORE+ID, GetIntValue(UD_PLAYER_PROFIT+ID) + GetIntValue(UD_POLLSCORE+ID) - GetIntValue(UD_PUSHSCORE+ID));
			if (GetIntValue(UD_TOTALSCORE+ID) < 0) {
				SetIntValue(UD_TOTALSCORE+ID, 0);
			}
		}
		SetIntValue(UD_LAST_WON_SCORE+ID, 0);
		SetIntValue(UD_LAST_TOTAL_BET+ID, 0);
	}

	// 复位标志
	SetCharValue(UD_UNSAVE_SCORE, 0);	
}
예제 #11
0
bool BayesianClassifier::Save(xmlNodePtr classifierNode)
{
  int i;
  bool retCode = true;
  xmlNodePtr modelNode;

  SetIntValue(classifierNode, DIMENSION_STR, mNumDimensions);
  SetIntValue(classifierNode, CLASSES_STR, mNumClasses);
  SetStringValue(classifierNode, FEATURE_STR, mFeatureString);

  for (i = 0; (i < mNumClasses) && retCode; i++)
  {
    modelNode = xmlNewNode(NULL, (const xmlChar*)GMM_STR);
    xmlAddChild(classifierNode, modelNode);
    SetDoubleValue(modelNode, WEIGHT_STR, mClassWeights[i]);
    retCode = mModels[i].Save(modelNode);
    if ( !retCode )
      fprintf(stderr, "BayesianClassifier::Save - Failed saviing GMM %d\n", i);
  }

  return retCode;
}
예제 #12
0
파일: DialogCCD.cpp 프로젝트: dusong7/NULL
void CDialogCCD::OnBnClickedCheckMirror()
{
	if (m_bIsMirror)
	{
		m_bIsMirror = FALSE;
	}
	else
	{
		m_bIsMirror = TRUE;
	}

	SetIntValue(PK_Mirror, m_bIsMirror);
}
예제 #13
0
파일: DialogCCD.cpp 프로젝트: dusong7/NULL
void CDialogCCD::OnBnClickedCheckOpenConveyorBelt()
{
	if (m_bOpenConveyorBelt)
	{
		m_bOpenConveyorBelt = FALSE;
	}
	else
	{
		m_bOpenConveyorBelt = TRUE;
	}

	SetIntValue(PK_ConveyorBelt, m_bOpenConveyorBelt);
}
예제 #14
0
void CGUISliderControl::SetFromPosition(const CPoint &point, bool guessSelector /* = false */)
{

  float fPercent;
  if (m_orientation == HORIZONTAL)
    fPercent = (point.x - m_guiBackground.GetXPosition()) / m_guiBackground.GetWidth();
  else
    fPercent = (m_guiBackground.GetYPosition() + m_guiBackground.GetHeight() - point.y) / m_guiBackground.GetHeight();

  if (fPercent < 0) fPercent = 0;
  if (fPercent > 1) fPercent = 1;

  if (m_rangeSelection && guessSelector)
  {
    // choose selector which value is closer to value calculated from position
    if (fabs(GetPercentage(RangeSelectorLower) - 100 * fPercent) <= fabs(GetPercentage(RangeSelectorUpper) - 100 * fPercent))
      m_currentSelector = RangeSelectorLower;
    else
      m_currentSelector = RangeSelectorUpper;
  }

  switch (m_iType)
  {
  case SLIDER_CONTROL_TYPE_FLOAT:
    {
      float fValue = m_fStart + (m_fEnd - m_fStart) * fPercent;
      SetFloatValue(fValue, m_currentSelector, true);
      break;
    }

  case SLIDER_CONTROL_TYPE_INT:
    {
      int iValue = (int)(m_iStart + (float)(m_iEnd - m_iStart) * fPercent + 0.49f);
      SetIntValue(iValue, m_currentSelector, true);
      break;
    }

  case SLIDER_CONTROL_TYPE_PERCENTAGE:
  default:
    {
      SetPercentage(fPercent * 100, m_currentSelector, true);
      break;
    }
  }
  SendClick();
}
예제 #15
0
void CGUISliderControl::Process(unsigned int currentTime, CDirtyRegionList &dirtyregions)
{
  bool dirty = false;

  dirty |= m_guiBackground.SetPosition( m_posX, m_posY );
  int infoCode = m_iInfoCode;
  if (m_action && (!m_dragging || m_action->fireOnDrag))
    infoCode = m_action->infoCode;
  if (infoCode)
  {
    int val;
    if (g_infoManager.GetInt(val, infoCode))
      SetIntValue(val);
  }

  float fScaleY = m_height == 0 ? 1.0f : m_height / m_guiBackground.GetTextureHeight();

  dirty |= m_guiBackground.SetHeight(m_height);
  dirty |= m_guiBackground.SetWidth(m_width);
  dirty |= m_guiBackground.Process(currentTime);

  // we render the nib centered at the appropriate percentage, except where the nib
  // would overflow the background image
  CGUITexture &nib = (m_bHasFocus && !IsDisabled()) ? m_guiMidFocus : m_guiMid;

  dirty |= nib.SetHeight(nib.GetTextureHeight() * fScaleY);
  dirty |= nib.SetWidth(nib.GetHeight() * 2);
  CAspectRatio ratio(CAspectRatio::AR_KEEP); ratio.align = ASPECT_ALIGN_LEFT | ASPECT_ALIGNY_CENTER;
  dirty |= nib.SetAspectRatio(ratio);
  CRect rect = nib.GetRenderRect();

  float offset = GetProportion() * m_width - rect.Width() / 2;
  if (offset > m_width - rect.Width())
    offset = m_width - rect.Width();
  if (offset < 0)
    offset = 0;
  dirty |= nib.SetPosition(m_guiBackground.GetXPosition() + offset, m_guiBackground.GetYPosition() );
  dirty |= nib.Process(currentTime);

  if (dirty)
    MarkDirtyRegion();

  CGUIControl::Process(currentTime, dirtyregions);
}
예제 #16
0
파일: DialogCCD.cpp 프로젝트: dusong7/NULL
void CDialogCCD::OnCbnSelchangeMode()
{
	UpdateData(TRUE);
	if (m_comboxMode.GetCurSel() == 0)
	{
		m_btnTempSeled.EnableWindow(TRUE);
		m_wndWorkFile.EnableWindow(TRUE);
		m_staPathTitle.EnableWindow(TRUE);
		g_nWorkMode = WM_TEMPLATE;
	}
	else
	{
		m_btnTempSeled.EnableWindow(FALSE);
		m_wndWorkFile.EnableWindow(FALSE);
		m_staPathTitle.EnableWindow(FALSE);

		if (m_comboxMode.GetCurSel() == 1)
		{
			g_nWorkMode = WM_CONTOUR;
		}
		else if (m_comboxMode.GetCurSel() == 2)
		{
			g_nWorkMode = WM_RANGE;
		}
		else if (m_comboxMode.GetCurSel() == 3)
		{
			g_nWorkMode = WM_ORIG;
		}
		else
		{
			g_nWorkMode = WM_NONE;
		}
	}
	
	SetIntValue(PK_WorkMode, g_nWorkMode);
	SaveToFile();
	UpdateData(FALSE);
}
예제 #17
0
void CGUISliderControl::Render()
{
    m_guiBackground.SetPosition( m_posX, m_posY );
    if (m_iInfoCode)
        SetIntValue(g_infoManager.GetInt(m_iInfoCode));

    float fScaleX = m_width == 0 ? 1.0f : m_width / m_guiBackground.GetTextureWidth();
    float fScaleY = m_height == 0 ? 1.0f : m_height / m_guiBackground.GetTextureHeight();

    m_guiBackground.SetHeight(m_height);
    m_guiBackground.SetWidth(m_width);
    m_guiBackground.Render();

    float fWidth = (m_guiBackground.GetTextureWidth() - m_guiMid.GetTextureWidth())*fScaleX;

    float fPos = m_guiBackground.GetXPosition() + GetProportion() * fWidth;

    if ((int)fWidth > 1)
    {
        if (m_bHasFocus && !IsDisabled())
        {
            m_guiMidFocus.SetPosition(fPos, m_guiBackground.GetYPosition() );
            m_guiMidFocus.SetWidth(m_guiMidFocus.GetTextureWidth() * fScaleX);
            m_guiMidFocus.SetHeight(m_guiMidFocus.GetTextureHeight() * fScaleY);
            m_guiMidFocus.Render();
        }
        else
        {
            m_guiMid.SetPosition(fPos, m_guiBackground.GetYPosition() );
            m_guiMid.SetWidth(m_guiMid.GetTextureWidth()*fScaleX);
            m_guiMid.SetHeight(m_guiMid.GetTextureHeight()*fScaleY);
            m_guiMid.Render();
        }
    }
    CGUIControl::Render();
}
예제 #18
0
void wxSlider::SetValue(int value)
{
    SetIntValue(ValueInvertOrNot(value));
    m_oldValue = m_oldPos = value;
}
예제 #19
0
/* Set number of paper size records and the records itself */
void nsPrinterFeatures::SetNumPaperSizeRecords( PRInt32 aCount )
{
  SetIntValue("paper.count", aCount);          
}
예제 #20
0
void nsPrinterFeatures::SetNumOrientationRecords( PRInt32 aCount )
{
  SetIntValue("orientation.count", aCount);          
}
예제 #21
0
void IniHash::SetBoolValue(const char *section, const char *var, bool value){ SetIntValue(section, var, value ? 1 : 0); }
예제 #22
0
void nsPrinterFeatures::SetNumPlexRecords( PRInt32 aCount )
{
  SetIntValue("plex.count", aCount);          
}
예제 #23
0
void nsPrinterFeatures::SetNumResolutionNameRecords( PRInt32 aCount )
{
  SetIntValue("resolution.count", aCount);          
}
예제 #24
0
void nsPrinterFeatures::SetNumColorspaceRecords( PRInt32 aCount )
{
  SetIntValue("colorspace.count", aCount);          
}
예제 #25
0
/*!
  @param filename - the name of the configuration file
  @return CFG_FILE_NOT_SPECIFIED if filename is ""
  @return CFG_FILE_NOT_WRITABLE if the file cannot be opened for writing
  @return CFG_OK if successful

  Saves the configuration of the ConfigMgr to file.
*/
ConfigMgrStatusType ConfigMgr::Save(string filename)
{
  int i;
  FILE *fp;
  xmlDocPtr document;
  xmlNodePtr rootNode;
  xmlNodePtr repositoryNode;
  xmlNodePtr featureNode;
  int numRepositories;
  string appRoverDir = APP_ROVER_DIR;
  map<string,bool>::iterator feature;

  if ( filename == "" )
    return CFG_FILE_NOT_SPECIFIED;

  fp = fopen(filename.c_str(), "w");
  if ( !fp )
    return CFG_FILE_NOT_WRITABLE;

  mCfgFilename = filename;

  document = xmlNewDoc(NULL);
  rootNode = xmlNewDocNode(document,NULL,(const xmlChar *)CONFIG_HDR_STR,NULL);
  SetDoubleValue(rootNode, VERSION_STR, 1);
  xmlDocSetRootElement(document,rootNode);

  if ( mInstallLogFilename == "" )
    SetStringValue(rootNode, LOG_STR, appRoverDir+"AppRover.log");
  else
    SetStringValue(rootNode, LOG_STR, mInstallLogFilename);
  if ( mStorageDirectory == "" )
    SetStringValue(rootNode, STORAGE_STR, appRoverDir+"storage/");
  else
    SetStringValue(rootNode, STORAGE_STR, mStorageDirectory);
  if ( mWorkDirectory == "" )
    SetStringValue(rootNode, WORK_STR, appRoverDir + "work/");
  else
    SetStringValue(rootNode, WORK_STR, mWorkDirectory);
  if ( mInstallFileDirectory == "" )
    SetStringValue(rootNode, INSTALL_FILE_STR, appRoverDir + "files/");
  else
    SetStringValue(rootNode, INSTALL_FILE_STR, mInstallFileDirectory);

  if ( mNumProcessors < 1 )
    DetectNumProcessors();
  SetIntValue(rootNode, PROCESSOR_STR, mNumProcessors);

  numRepositories = mRepositoryDirectories.size();
  if ( !numRepositories )
  {
    repositoryNode = xmlNewNode(NULL,(const xmlChar*)REPOSITORY_STR);
    SetStringValue(repositoryNode, DIR_STR, appRoverDir+"repo/");
    xmlAddChild(rootNode,repositoryNode);
  }
  else
  {
    for (i = 0; i < numRepositories; i++)
    {
      repositoryNode = xmlNewNode(NULL,(const xmlChar*)REPOSITORY_STR);
      SetStringValue(repositoryNode, DIR_STR, mRepositoryDirectories[i]);
      xmlAddChild(rootNode,repositoryNode);
    }
  }

  for (feature=mFeatureSettings.begin(); feature!=mFeatureSettings.end(); feature++)
  {
    featureNode = xmlNewNode(NULL,(const xmlChar*)FEATURE_STR);
    SetStringValue(featureNode, FEATURE_NAME_STR, (*feature).first);
    SetBoolValue(featureNode, ENABLED_STR, (*feature).second);
    xmlAddChild(rootNode,featureNode);
  }

  xmlDocFormatDump(fp,document,1);
  fclose(fp);
  xmlFreeDoc(document);
  return CFG_OK;
}
예제 #26
0
void wxControl::SetBoolValue(bool val)
{
    SetIntValue(val?1:0);
}
예제 #27
0
static void ReadUserData(void) {
	unsigned char Idx;

	SetCharValue(UD_INVALID_CHAR, READCHARVALUE(UD_INVALID_CHAR));
	SetCharValue(UD_ROUND, READCHARVALUE(UD_ROUND));
	SetCharValue(UD_BETTIME, READCHARVALUE(UD_BETTIME));
	SetCharValue(UD_RANDCHIP, READCHARVALUE(UD_RANDCHIP));
	SetCharValue(UD_MONTH_DAY, READCHARVALUE(UD_MONTH_DAY));
	SetCharValue(UD_START_SAVE, READCHARVALUE(UD_START_SAVE));
	SetCharValue(UD_IF_PRINT, READCHARVALUE(UD_IF_PRINT));
	SetCharValue(UD_UNSAVE_SCORE, READCHARVALUE(UD_UNSAVE_SCORE));
	SetCharValue(UD_CHECK_DOOR, READCHARVALUE(UD_CHECK_DOOR));
	for (Idx = 0; Idx < PLAYER_COUNT; Idx++) {
		SetCharValue(UD_BETSCORE_SWITCH+Idx, READCHARVALUE(UD_BETSCORE_SWITCH+Idx));	// 押分档
	}
	SetCharValue(UD_NEXT_PRIZETYPE, READCHARVALUE(UD_NEXT_PRIZETYPE));
	SetCharValue(UD_NEXT_PRIZEPARAM, READCHARVALUE(UD_NEXT_PRIZEPARAM));	
	SetCharValue(UD_EXTRA_CODE_DIFFICULT, READCHARVALUE(UD_EXTRA_CODE_DIFFICULT));	// 外5门设定难度
	SetCharValue(UD_EXTRA_DIFFICULT, READCHARVALUE(UD_EXTRA_DIFFICULT));			// 外5门当前难度
	SetCharValue(UD_EXTRA_REACHED_MAXPROFIT, READCHARVALUE(UD_EXTRA_REACHED_MAXPROFIT));	//外5门到达最大盈利(抽水)标志
	SetCharValue(UD_SAME_COLOR_REP, READCHARVALUE(UD_SAME_COLOR_REP));		// 替换相同颜色
	SetCharValue(UD_SAME_FLOWER_REP, READCHARVALUE(UD_SAME_FLOWER_REP));	// 替换相同花色		
	SetCharValue(UD_MIN_SAME_FLOWER, READCHARVALUE(UD_MIN_SAME_FLOWER));	// 相同花色范围
	SetCharValue(UD_MAX_SAME_FLOWER, READCHARVALUE(UD_MAX_SAME_FLOWER));
	SetCharValue(UD_MIN_DIFF_COLOR,	READCHARVALUE(UD_MIN_DIFF_COLOR));		// 不同颜色范围
	SetCharValue(UD_MAX_DIFF_COLOR, READCHARVALUE(UD_MAX_DIFF_COLOR));
	SetCharValue(UD_RULE_USE_ODDS, READCHARVALUE(UD_RULE_USE_ODDS));		// 规则使用几率
	SetCharValue(UD_RULE_MERGE, READCHARVALUE(UD_RULE_MERGE));				// 路单合并
	
	SetShortValue(UD_INVALID_SHORT, READSHORTVALUE(UD_INVALID_SHORT));
	SetShortValue(UD_LIMITRED_COUNT, READSHORTVALUE(UD_LIMITRED_COUNT));// 限红修改多少回
	SetShortValue(UD_EXTRABET_MIN, READSHORTVALUE(UD_EXTRABET_MIN));	// 外5门最低押注
	SetShortValue(UD_EXTRABET_MAX, READSHORTVALUE(UD_EXTRABET_MAX));	// 外5门最大押注
	SetShortValue(UD_SWITCH_MIN, READSHORTVALUE(UD_SWITCH_MIN));		// 最小Switch
		
	SetIntValue(UD_INVALID_INT, READINTVALUE(UD_INVALID_INT));
#if (USB_PLAYER_COUNT > 0)
	for (Idx = 0; Idx < USB_PLAYER_COUNT; Idx++) {
		SetIntValue(UD_USB_UUID+Idx, READINTVALUE(UD_USB_UUID+Idx));
	}
#endif
	for (Idx = 0; Idx < PLAYER_COUNT; Idx++) {
		SetIntValue(UD_RANDOMID + Idx, READINTVALUE(UD_RANDOMID + Idx));
		SetIntValue(UD_PUSHSCORE + Idx, READINTVALUE(UD_PUSHSCORE + Idx));
		SetIntValue(UD_POLLSCORE + Idx, READINTVALUE(UD_POLLSCORE + Idx));
		SetIntValue(UD_TOTALSCORE + Idx, READINTVALUE(UD_TOTALSCORE + Idx));
		SetIntValue(UD_PLAYER_PROFIT + Idx, READINTVALUE(UD_PLAYER_PROFIT + Idx));
		SetIntValue(UD_LAST_TOTAL_BET + Idx, READINTVALUE(UD_LAST_TOTAL_BET + Idx));
		SetIntValue(UD_LAST_WON_SCORE + Idx, READINTVALUE(UD_LAST_WON_SCORE + Idx));
	}

	SetIntValue(UD_CLIENT_PROFIT_POOL, READINTVALUE(UD_CLIENT_PROFIT_POOL));		// 盈利池(客户)

	SetIntValue(UD_EXTRA_ALLPROFIT, READINTVALUE(UD_EXTRA_ALLPROFIT));						// 外5门永久盈利
	SetIntValue(UD_EXTRA_CHOUSHUI_POOL, READINTVALUE(UD_EXTRA_CHOUSHUI_POOL));				// 外4门抽水池
	SetIntValue(UD_EXTRA_HANDSEL_POOL, READINTVALUE(UD_EXTRA_HANDSEL_POOL));				// 外4门彩金池
	SetIntValue(UD_EXTRA_MINGPAI_POOL, READINTVALUE(UD_EXTRA_MINGPAI_POOL));				// 外4门明牌池
	SetIntValue(UD_EXTRA_LIMITRED, READINTVALUE(UD_EXTRA_LIMITRED));						// 外5门限红
	SetIntValue(UD_EXTRA_ROUND_PROFIT, 0);				// 外5门一轮盈利
	SetIntValue(UD_KING_BET, READINTVALUE(UD_KING_BET));									// 王的一轮押分
	SetIntValue(UD_KING_PROFIT, READINTVALUE(UD_KING_PROFIT));								// 王的一轮盈利
	SetIntValue(UD_EXTRA_COMPANY_PROFIT_POOL,READINTVALUE(UD_EXTRA_COMPANY_PROFIT_POOL));	// 外5门盈利池(公司)	
	
	SetIntValue(UD_PUSHSCORE_RATIO,	READINTVALUE(UD_PUSHSCORE_RATIO));
	SetIntValue(UD_POLLSCORE_RATIO,	READINTVALUE(UD_POLLSCORE_RATIO));
	SetIntValue(UD_PUSHCOIN_RATIO,	READINTVALUE(UD_PUSHCOIN_RATIO));
	SetIntValue(UD_POLLCOIN_RATIO,	READINTVALUE(UD_POLLCOIN_RATIO));
	SetIntValue(UD_ROUNDLOSS_BOOM,	READINTVALUE(UD_ROUNDLOSS_BOOM));
	SetIntValue(UD_STAGEWIN_BOOM, READINTVALUE(UD_STAGEWIN_BOOM));
	SetIntValue(UD_STAGELOSS_BOOM, READINTVALUE(UD_STAGELOSS_BOOM));
	SetIntValue(UD_LEFT_SECONDS,  READINTVALUE(UD_LEFT_SECONDS));
	SetIntValue(UD_RULE_USE_SECONDS, READINTVALUE(UD_RULE_USE_SECONDS));	// 使用路单规则剩余多少秒
	
	SetLongLongValue(UD_INVALID_LONGLONG, READLONGLONGVALUE(UD_INVALID_LONGLONG));
	SetLongLongValue(UD_EXTRA_ALLBET, READLONGLONGVALUE(UD_EXTRA_ALLBET));

}
예제 #28
0
NS_IMETHODIMP nsAbLDAPDirectory::SetLastChangeNumber(PRInt32 aLastChangeNumber)
{
    return SetIntValue("lastChangeNumber", aLastChangeNumber);
}
예제 #29
0
NS_IMETHODIMP nsAbLDAPDirectory::SetMaxHits(PRInt32 aMaxHits)
{
    return SetIntValue("maxHits", aMaxHits);
}
예제 #30
0
void ClearUserData(void) {
	unsigned char Idx;

	SetCharValue(UD_INVALID_CHAR, 0);	
	SetCharValue(UD_ROUND, 0);			// 轮
	SetCharValue(UD_BETTIME, 5);		// 押分时间
	SetCharValue(UD_RANDCHIP, 8);		// 片子8
	SetCharValue(UD_MONTH_DAY, 0);		// 日期(日)
	SetCharValue(UD_START_SAVE, 0);		// 保存标志
	SetCharValue(UD_IF_PRINT, 1);		// 打保单
	SetCharValue(UD_CHECK_DOOR, 1);		// 检测门
	SetCharValue(UD_UNSAVE_SCORE, 0);	// 没有计算上局分数
	for (Idx = 0; Idx < PLAYER_COUNT; Idx++) {
		SetCharValue(UD_BETSCORE_SWITCH+Idx, 0);	// 押分档
	}
	SetCharValue(UD_NEXT_PRIZETYPE, 0);				// 下一个大奖类型
	SetCharValue(UD_NEXT_PRIZEPARAM, 0);			// 下一个大奖参数	
	SetCharValue(UD_EXTRA_CODE_DIFFICULT, ORIGIN_EXTRA_DIFFICULT);	// 外5门设定难度
	SetCharValue(UD_EXTRA_DIFFICULT, ORIGIN_EXTRA_DIFFICULT);		// 外5门当前难度
	SetCharValue(UD_EXTRA_REACHED_MAXPROFIT, 0);					// 外5门到达最大盈利(抽水)标志
	SetCharValue(UD_SAME_COLOR_REP, 0);		// 替换相同颜色
	SetCharValue(UD_SAME_FLOWER_REP, 0);	// 替换相同花色
	SetCharValue(UD_MIN_SAME_FLOWER, 0);	// 相同花色范围
	SetCharValue(UD_MAX_SAME_FLOWER, 99);
	SetCharValue(UD_MIN_DIFF_COLOR,	0);		// 不同颜色范围
	SetCharValue(UD_MAX_DIFF_COLOR, 99);
	SetCharValue(UD_RULE_USE_ODDS, 0);		// 规则使用几率
	SetCharValue(UD_RULE_MERGE, 0);			// 路单合并
	
	SetShortValue(UD_INVALID_SHORT, 0);
	SetShortValue(UD_LIMITRED_COUNT, 1);		// 限红修改多少回
	SetShortValue(UD_EXTRABET_MIN, 10);			// 外5门最低押注
	SetShortValue(UD_EXTRABET_MAX, 9999);		// 外5门最大押注
	SetShortValue(UD_SWITCH_MIN, 1);	// Switch(0~7档)
	
	SetIntValue(UD_INVALID_INT, 0);
#if (USB_PLAYER_COUNT > 0)
	for (Idx = 0; Idx < USB_PLAYER_COUNT; Idx++) {
		SetIntValue(UD_USB_UUID+Idx, 0);
	}
#endif
	for (Idx = 0; Idx < PLAYER_COUNT; Idx++) {
		SetIntValue(UD_RANDOMID + Idx, 0);
		SetIntValue(UD_PUSHSCORE + Idx, 0);
		SetIntValue(UD_POLLSCORE + Idx, 0);
		SetIntValue(UD_TOTALSCORE + Idx, 0);
		SetIntValue(UD_PLAYER_PROFIT + Idx, 0);
		SetIntValue(UD_LAST_TOTAL_BET + Idx, 0);
		SetIntValue(UD_LAST_WON_SCORE + Idx, 0);
	}
	SetIntValue(UD_CLIENT_PROFIT_POOL, 0);		// 8(12)客户盈利

	SetIntValue(UD_EXTRA_ALLPROFIT, 0);			// 外5门永久盈利
	SetIntValue(UD_EXTRA_CHOUSHUI_POOL, 0);		// 外4门抽水池
	SetIntValue(UD_EXTRA_HANDSEL_POOL, 0);		// 外4门彩金池
	SetIntValue(UD_EXTRA_MINGPAI_POOL, 0);		// 外4门明牌池
	SetIntValue(UD_EXTRA_LIMITRED, 3000);		// 外5门限红
	SetIntValue(UD_EXTRA_ROUND_PROFIT, 0);		// 外5门一轮的盈利
	SetIntValue(UD_KING_BET, 0);				// 王的一轮押分
	SetIntValue(UD_KING_PROFIT, 0);				// 王的一轮盈利	
	SetIntValue(UD_EXTRA_COMPANY_PROFIT_POOL,0);// 外5门盈利池(公司)
	
	SetIntValue(UD_PUSHSCORE_RATIO,	1000);		// 上分rate
	SetIntValue(UD_POLLSCORE_RATIO,	1000);		// 下分rate
	SetIntValue(UD_PUSHCOIN_RATIO,	10);		// 投币rate
	SetIntValue(UD_POLLCOIN_RATIO,	10);		// 退币rate
	SetIntValue(UD_ROUNDLOSS_BOOM, 500000);		// 当轮输爆机
	SetIntValue(UD_STAGEWIN_BOOM, 500000);		// 当期max loss
	SetIntValue(UD_STAGELOSS_BOOM, 500000);		// 当期max win
	SetIntValue(UD_LEFT_SECONDS, DELAY_TIME);	// 200 hours
	SetIntValue(UD_RULE_USE_SECONDS, 0);		// 路单规则剩余多少秒
	
	SetLongLongValue(UD_INVALID_LONGLONG, 0);
	SetLongLongValue(UD_EXTRA_ALLBET, 0);
	
	GenerateExtraRouteList();
}