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(); }
void nsPrinterFeatures::SetColorspaceRecord( PRInt32 aIndex, const char *aColorspace ) { SetCharValue(nsPrintfCString(256, "colorspace.%d.name", aIndex).get(), aColorspace); }
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)); }
void nsPrinterFeatures::SetResolutionNameRecord( PRInt32 aIndex, const char *aResolutionName ) { SetCharValue(nsPrintfCString(256, "resolution.%d.name", aIndex).get(), aResolutionName); }
void nsPrinterFeatures::SetPlexRecord( PRInt32 aIndex, const char *aPlexName ) { SetCharValue(nsPrintfCString(256, "plex.%d.name", aIndex).get(), aPlexName); }
void nsPrinterFeatures::SetOrientationRecord( PRInt32 aIndex, const char *aOrientationName ) { SetCharValue(nsPrintfCString(256, "orientation.%d.name", aIndex).get(), aOrientationName); }
NS_IMETHODIMP nsPop3IncomingServer::SetDeferredToAccount(const nsACString& aAccountKey) { nsCString deferredToAccount; GetDeferredToAccount(deferredToAccount); m_rootMsgFolder = nullptr; // clear this so we'll recalculate it on demand. //Notify listeners who listen to every folder nsresult rv = SetCharValue("deferred_to_account", aAccountKey); NS_ENSURE_SUCCESS(rv, rv); nsCOMPtr<nsIFolderListener> folderListenerManager = do_GetService(NS_MSGMAILSESSION_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) { nsCOMPtr<nsIMsgFolder> rootFolder; // use GetRootFolder, because that returns the real // root, not the deferred to root. rv = GetRootFolder(getter_AddRefs(rootFolder)); if (rootFolder) { // if isDeferred state has changed, send notification if (aAccountKey.IsEmpty() != deferredToAccount.IsEmpty()) { nsCOMPtr <nsIAtom> deferAtom = MsgGetAtom("isDeferred"); nsCOMPtr <nsIAtom> canFileAtom = MsgGetAtom("CanFileMessages"); folderListenerManager->OnItemBoolPropertyChanged(rootFolder, deferAtom, !deferredToAccount.IsEmpty(), deferredToAccount.IsEmpty()); folderListenerManager->OnItemBoolPropertyChanged(rootFolder, canFileAtom, deferredToAccount.IsEmpty(), !deferredToAccount.IsEmpty()); // this hack causes the account manager ds to send notifications to the // xul content builder that make the changed acct appear or disappear // from the folder pane and related menus. nsCOMPtr<nsIMsgAccountManager> acctMgr = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID); if (acctMgr) { acctMgr->NotifyServerUnloaded(this); acctMgr->NotifyServerLoaded(this); // check if this newly deferred to account is the local folders account // and needs to have a newly created INBOX. if (!aAccountKey.IsEmpty()) { nsCOMPtr <nsIMsgAccount> account; acctMgr->GetAccount(aAccountKey, getter_AddRefs(account)); if (account) { nsCOMPtr <nsIMsgIncomingServer> server; account->GetIncomingServer(getter_AddRefs(server)); if (server) { nsCOMPtr <nsILocalMailIncomingServer> incomingLocalServer = do_QueryInterface(server); if (incomingLocalServer) { nsCOMPtr <nsIMsgFolder> rootFolder; rv = server->GetRootFolder(getter_AddRefs(rootFolder)); NS_ENSURE_SUCCESS(rv, rv); // this will fail if it already exists, which is fine. rootFolder->CreateSubfolder(NS_LITERAL_STRING("Inbox"), nullptr); } } } } } } } } return rv; }
NS_IMETHODIMP nsPop3IncomingServer::GetDeferredToAccount(nsACString& aRetVal) { nsresult rv = GetCharValue("deferred_to_account", aRetVal); if (aRetVal.IsEmpty()) return rv; // We need to repair broken profiles that defer to hidden or invalid servers, // so find out if the deferred to account has a valid non-hidden server, and // if not, defer to the local folders inbox. nsCOMPtr<nsIMsgAccountManager> acctMgr = do_GetService(NS_MSGACCOUNTMANAGER_CONTRACTID); bool invalidAccount = true; if (acctMgr) { nsCOMPtr<nsIMsgAccount> account; nsCOMPtr<nsIMsgIncomingServer> server; rv = acctMgr->GetAccount(aRetVal, getter_AddRefs(account)); if (account) { account->GetIncomingServer(getter_AddRefs(server)); if (server) server->GetHidden(&invalidAccount); } if (invalidAccount) { nsCOMPtr<nsIMsgIncomingServer> localServer; nsCOMPtr<nsIMsgAccount> localAccount; rv = acctMgr->GetLocalFoldersServer(getter_AddRefs(localServer)); NS_ENSURE_SUCCESS(rv, rv); // Try to copy any folders that have been stranded in the hidden account // into the local folders account. if (server) { nsCOMPtr<nsIMsgFolder> hiddenRootFolder; nsCOMPtr<nsIMsgFolder> localFoldersRoot; server->GetRootFolder(getter_AddRefs(hiddenRootFolder)); localServer->GetRootFolder(getter_AddRefs(localFoldersRoot)); if (hiddenRootFolder && localFoldersRoot) { // We're going to iterate over the folders in Local Folders-1, // though I suspect only the Inbox will have messages. I don't // think Sent Mail could end up here, but if any folders have // messages, might as well copy them to the real Local Folders // account. nsCOMPtr<nsISimpleEnumerator> enumerator; rv = hiddenRootFolder->GetSubFolders(getter_AddRefs(enumerator)); if (NS_SUCCEEDED(rv)) { bool hasMore; while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMore)) && hasMore) { nsCOMPtr<nsISupports> item; enumerator->GetNext(getter_AddRefs(item)); nsCOMPtr<nsIMsgFolder> subFolder(do_QueryInterface(item)); if (subFolder) { nsCOMPtr<nsIMsgDatabase> subFolderDB; subFolder->GetMsgDatabase(getter_AddRefs(subFolderDB)); if (subFolderDB) { // Copy any messages in this sub-folder of the hidden // account to the corresponding folder in Local Folders. nsRefPtr<nsMsgKeyArray> keys = new nsMsgKeyArray; rv = subFolderDB->ListAllKeys(keys); nsCOMPtr<nsIMutableArray> hdrsToCopy(do_CreateInstance(NS_ARRAY_CONTRACTID)); MsgGetHeadersFromKeys(subFolderDB, keys->m_keys, hdrsToCopy); uint32_t numHdrs = 0; if (hdrsToCopy) hdrsToCopy->GetLength(&numHdrs); if (numHdrs) { // Look for a folder with the same name in Local Folders. nsCOMPtr<nsIMsgFolder> dest; nsString folderName; subFolder->GetName(folderName); localFoldersRoot->GetChildNamed(folderName, getter_AddRefs(dest)); if (dest) dest->CopyMessages(subFolder, hdrsToCopy, false, nullptr, nullptr, false,false); // Should we copy the folder if the dest doesn't exist? } } } } } } } rv = acctMgr->FindAccountForServer(localServer, getter_AddRefs(localAccount)); NS_ENSURE_SUCCESS(rv, rv); if (!localAccount) return NS_ERROR_NOT_AVAILABLE; localAccount->GetKey(aRetVal); // Can't call SetDeferredToAccount because it calls GetDeferredToAccount. return SetCharValue("deferred_to_account", aRetVal); } } return rv; }