Beispiel #1
0
/* Write an entry to the given stream.  This must know the format of
   the password file.  If the input contains invalid characters,
   return EINVAL, or replace them with spaces (if they are contained
   in the GECOS field).  */
int
putpwent (const struct passwd *p, FILE *stream)
{
  if (p == NULL || stream == NULL
      || p->pw_name == NULL || !__nss_valid_field (p->pw_name)
      || !__nss_valid_field (p->pw_passwd)
      || !__nss_valid_field (p->pw_dir)
      || !__nss_valid_field (p->pw_shell))
    {
      __set_errno (EINVAL);
      return -1;
    }

  int ret;
  char *gecos_alloc;
  const char *gecos = __nss_rewrite_field (p->pw_gecos, &gecos_alloc);

  if (gecos == NULL)
    return -1;

  if (p->pw_name[0] == '+' || p->pw_name[0] == '-')
      ret = fprintf (stream, "%s:%s:::%s:%s:%s\n",
		     p->pw_name, _S (p->pw_passwd),
		     gecos, _S (p->pw_dir), _S (p->pw_shell));
  else
      ret = fprintf (stream, "%s:%s:%lu:%lu:%s:%s:%s\n",
		     p->pw_name, _S (p->pw_passwd),
		     (unsigned long int) p->pw_uid,
		     (unsigned long int) p->pw_gid,
		     gecos, _S (p->pw_dir), _S (p->pw_shell));

  free (gecos_alloc);
  if (ret >= 0)
    ret = 0;
  return ret;
}
/*************************************
 * AddLine
 *************************************/
void SHVTestLoggerConsole::AddLine(const SHVStringC str)
{
	SHVConsole::Printf(_S("  %s\n"), str.GetSafeBuffer());
}
Beispiel #3
0
// ----------------------------------------------------------------------------
// Name : Create()
// Desc :
// ----------------------------------------------------------------------------
void CUICompound::Create( CUIWindow *pParentWnd, int nX, int nY, int nWidth, int nHeight )
{
	CUIWindow::Create(pParentWnd, nX, nY, nWidth, nHeight);

	_iMaxMsgStringChar = 187 / ( _pUIFontTexMgr->GetFontWidth() + _pUIFontTexMgr->GetFontSpacing() );

	// Region of each part
	m_rcTitle.SetRect( 0, 0, 216, 22 );
	
	m_rcItemSlot[0].SetRect( 66, 0, 66 + COMPOUND_ITEM_SLOT_SIZE, 0 );
	m_rcItemSlot[1].SetRect( 116, 0, 116 + COMPOUND_ITEM_SLOT_SIZE, 0 );
	m_rcItemSlot[2].SetRect( 91, 0, 91 + COMPOUND_ITEM_SLOT_SIZE, 0 );

	m_rcInsertItem.SetRect( 3, 0, 213, 0 );

	// Create Compound texture
	m_ptdBaseTexture = CreateTexture( CTString( "Data\\Interface\\MessageBox.tex" ) );
	FLOAT	fTexWidth	= m_ptdBaseTexture->GetPixWidth();
	FLOAT	fTexHeight	= m_ptdBaseTexture->GetPixHeight();

	// UV Coordinate of each part
	// Background
	m_rtTop.SetUV( 0, 0, 216, 26, fTexWidth, fTexHeight );
	m_rtMiddle1.SetUV( 0, 31, 216, 33, fTexWidth, fTexHeight );
	m_rtMiddle2.SetUV( 0, 35, 216, 37, fTexWidth, fTexHeight );
	m_rtBottom.SetUV( 0, 38, 216, 45, fTexWidth, fTexHeight );
	m_rtItemSlot.SetUV( 0, 68, 34, 102, fTexWidth, fTexHeight );

	// Close button
	m_btnClose.Create( this, CTString( "" ), 184, 4, 14, 14 );
	m_btnClose.SetUV( UBS_IDLE, 219, 0, 233, 14, fTexWidth, fTexHeight );
	m_btnClose.SetUV( UBS_CLICK, 234, 0, 248, 14, fTexWidth, fTexHeight );
	m_btnClose.CopyUV( UBS_IDLE, UBS_ON );
	m_btnClose.CopyUV( UBS_IDLE, UBS_DISABLE );

	// OK button
	m_btnOK.Create( this, _S( 191, "확인" ), 36, 154, 63, 21 );					
	m_btnOK.SetUV( UBS_IDLE, 0, 46, 63, 67, fTexWidth, fTexHeight );
	m_btnOK.SetUV( UBS_CLICK, 66, 46, 129, 67, fTexWidth, fTexHeight );
	m_btnOK.CopyUV( UBS_IDLE, UBS_ON );
	m_btnOK.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Cancel button
	m_btnCancel.Create( this, _S( 139, "취소" ), 117, 154, 63, 21 );
	m_btnCancel.SetUV( UBS_IDLE, 0, 46, 63, 67, fTexWidth, fTexHeight );
	m_btnCancel.SetUV( UBS_CLICK, 66, 46, 129, 67, fTexWidth, fTexHeight );
	m_btnCancel.CopyUV( UBS_IDLE, UBS_ON );
	m_btnCancel.CopyUV( UBS_IDLE, UBS_DISABLE );

	// Add string
	AddString( _S( 724, "합성할 일반제련석, 악세사리, 마법가루를 인벤토리에서 선택하여 넣어주십시오." ) );

	// Set region of slot item & money...
	int	nNewHeight = COMPOUND_DESC_TEXT_SY + ( m_nStringCount + 1 ) * _pUIFontTexMgr->GetLineHeight();
		
	m_rcItemSlot[0].Top = nNewHeight;
	m_rcItemSlot[0].Bottom = m_rcItemSlot[0].Top + COMPOUND_ITEM_SLOT_SIZE;

	m_rcItemSlot[1].Top = nNewHeight;
	m_rcItemSlot[1].Bottom = m_rcItemSlot[1].Top + COMPOUND_ITEM_SLOT_SIZE;

	nNewHeight += 12 + COMPOUND_ITEM_SLOT_SIZE;

	m_rcItemSlot[2].Top = nNewHeight;
	m_rcItemSlot[2].Bottom = m_rcItemSlot[2].Top + COMPOUND_ITEM_SLOT_SIZE;

	nNewHeight += COMPOUND_ITEM_SLOT_SIZE + _pUIFontTexMgr->GetLineHeight();
	m_nTextRegionHeight = nNewHeight - COMPOUND_DESC_TEXT_SY + 8;

	m_rcInsertItem.Top = COMPOUND_DESC_TEXT_SY;
	m_rcInsertItem.Bottom = nNewHeight;

	nNewHeight += 6;
	m_btnOK.SetPosY( nNewHeight );
	m_btnCancel.SetPosY( nNewHeight );

	nNewHeight += m_btnOK.GetHeight() + 7;
	SetHeight( nNewHeight );

	// Slot item button
	for (int i  = 0; i < COMPOUND_ITEM_SLOT_COUNT; i++)
	{
		//m_pIconSlot[i].Create( this, m_rcItemSlot[i].Left + 1, m_rcItemSlot[i].Top + 1, BTN_SIZE, BTN_SIZE, UI_COMPOUND, UBET_ITEM );
		m_pIconSlot[i] = new CUIIcon();
		m_pIconSlot[i]->Create(this, m_rcItemSlot[i].Left + 1, m_rcItemSlot[i].Top + 1, BTN_SIZE, BTN_SIZE, UI_COMPOUND, UBET_ITEM);
	}
}
Beispiel #4
0
void IRCChannelPage::initWindow()
{
	m_iconsMap[ircUserTypeNormal] = m_imageList.Add(wxBitmap(conversions::from_utf16<wxString>(Application::instance()->getResourcesFilePath(_S("irc_icons_user_normal.png"))), wxBITMAP_TYPE_PNG));
	m_iconsMap[ircUserTypeOperator] = m_imageList.Add(wxBitmap(conversions::from_utf16<wxString>(Application::instance()->getResourcesFilePath(_S("irc_icons_user_operator.png"))), wxBITMAP_TYPE_PNG));
	m_iconsMap[ircUserTypeHalfOperator] = m_imageList.Add(wxBitmap(conversions::from_utf16<wxString>(Application::instance()->getResourcesFilePath(_S("irc_icons_user_half_operator.png"))), wxBITMAP_TYPE_PNG));
	
	m_usersCtrl->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(IRCChannelPage::onUserActivated), NULL, this);
	m_usersCtrl->Connect(wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, wxListEventHandler(IRCChannelPage::onUserRightClick), NULL, this);
	
	m_usersCtrl->InsertColumn(0, wxEmptyString);
	m_usersCtrl->SetImageList(&m_imageList, wxIMAGE_LIST_SMALL);
}
Beispiel #5
0
struct pv_addr undstack;
struct pv_addr abtstack;
struct pv_addr kernelstack;

#define	_A(a)	((a) & ~L1_S_OFFSET)
#define	_S(s)	(((s) + L1_S_SIZE - 1) & ~(L1_S_SIZE-1))

/* Static device mappings. */
static const struct arm_devmap_entry s3c24x0_devmap[] = {
	/*
	 * Map the devices we need early on.
	 */
	{
		_A(S3C24X0_CLKMAN_BASE),
		_A(S3C24X0_CLKMAN_PA_BASE),
		_S(S3C24X0_CLKMAN_SIZE),
		VM_PROT_READ|VM_PROT_WRITE,
		PTE_NOCACHE,
	},
	{
		_A(S3C24X0_GPIO_BASE),
		_A(S3C24X0_GPIO_PA_BASE),
		_S(S3C2410_GPIO_SIZE),
		VM_PROT_READ|VM_PROT_WRITE,
		PTE_NOCACHE,
	},
	{
		_A(S3C24X0_INTCTL_BASE),
		_A(S3C24X0_INTCTL_PA_BASE),
		_S(S3C24X0_INTCTL_SIZE),
		VM_PROT_READ|VM_PROT_WRITE,
Beispiel #6
0
void 
_trace_descfield_type (SQLSMALLINT type)
{
  char *ptr = "unknown field identifier";

  switch (type)
    {
      _S (SQL_DESC_ALLOC_TYPE);
      _S (SQL_DESC_ARRAY_SIZE);
      _S (SQL_DESC_ARRAY_STATUS_PTR);
      _S (SQL_DESC_AUTO_UNIQUE_VALUE);
      _S (SQL_DESC_BASE_COLUMN_NAME);
      _S (SQL_DESC_BASE_TABLE_NAME);
      _S (SQL_DESC_BIND_OFFSET_PTR);
      _S (SQL_DESC_BIND_TYPE);
      _S (SQL_DESC_CASE_SENSITIVE);
      _S (SQL_DESC_CATALOG_NAME);
      _S (SQL_DESC_CONCISE_TYPE);
      _S (SQL_DESC_COUNT);
      _S (SQL_DESC_DATA_PTR);
      _S (SQL_DESC_DATETIME_INTERVAL_CODE);
      _S (SQL_DESC_DATETIME_INTERVAL_PRECISION);
      _S (SQL_DESC_DISPLAY_SIZE);
      _S (SQL_DESC_FIXED_PREC_SCALE);
      _S (SQL_DESC_INDICATOR_PTR);
      _S (SQL_DESC_LABEL);
      _S (SQL_DESC_LENGTH);
      _S (SQL_DESC_LITERAL_PREFIX);
      _S (SQL_DESC_LITERAL_SUFFIX);
      _S (SQL_DESC_LOCAL_TYPE_NAME);
      _S (SQL_DESC_MAXIMUM_SCALE);
      _S (SQL_DESC_MINIMUM_SCALE);
      _S (SQL_DESC_NAME);
      _S (SQL_DESC_NULLABLE);
      _S (SQL_DESC_NUM_PREC_RADIX);
      _S (SQL_DESC_OCTET_LENGTH);
      _S (SQL_DESC_OCTET_LENGTH_PTR);
      _S (SQL_DESC_PARAMETER_TYPE);
      _S (SQL_DESC_PRECISION);
      _S (SQL_DESC_ROWS_PROCESSED_PTR);
      _S (SQL_DESC_SCALE);
      _S (SQL_DESC_SCHEMA_NAME);
      _S (SQL_DESC_SEARCHABLE);
      _S (SQL_DESC_TABLE_NAME);
      _S (SQL_DESC_TYPE);
      _S (SQL_DESC_TYPE_NAME);
      _S (SQL_DESC_UNNAMED);
      _S (SQL_DESC_UNSIGNED);
      _S (SQL_DESC_UPDATABLE);

#if (ODBCVER >= 0x0350)
      _S (SQL_DESC_ROWVER);
#endif
    }

  trace_emit ("\t\t%-15.15s   %d (%s)\n", "SQLUSMALLINT ", (int) type, ptr);
}
Beispiel #7
0
CBrdSession::CBrdSession(/* TInt aClient */)
    :CSession2()
    {
    __DECLARE_NAME(_S("CBrdSession"));
    }
Beispiel #8
0
TBool CIniFile::FindVar(const TDesC &aSection,
						const TDesC &aVarName,
						TPtrC &aResult)
//
// Find a variable's value given a section name and a var name
//
	{
	__ASSERT_DEBUG(aSection.Length()<=(TInt)KTokenSize,Panic(ESectionNameTooBig));
	__ASSERT_DEBUG(aVarName.Length()<=(TInt)KTokenSize,Panic(EVarNameTooBig));

	TPtr sectionToken = iToken->Des();
	_LIT(KSectionTokenString,"[%S]");
	sectionToken.Format(KSectionTokenString,&aSection);
	TInt sectionStart = iPtr.Find(sectionToken);
	TInt ret = ETrue;
	if (sectionStart == KErrNotFound)
		{
		ret = EFalse;
		}
	else
		{		
		TPtrC section = iPtr.Mid(sectionStart);
		TInt endBracket = section.Find(TPtrC(_S("]")));
		if (endBracket == KErrNotFound)
			{
			ret = EFalse;
			}
		else
			{
			sectionStart += endBracket + 1;
			section.Set(iPtr.Mid(sectionStart));
			
			TInt sectionEnd = section.Find(TPtrC(_S("[")));
			if (sectionEnd == KErrNotFound)
				{
				sectionEnd = iPtr.Length() - sectionStart;
				}
			else
				{
				sectionEnd--;
				}
			section.Set(iPtr.Mid(sectionStart,sectionEnd));
			TPtr varToken = iToken->Des();
			_LIT(KVarTokenString,"%S=");
			varToken.Format(KVarTokenString,&aVarName);
			TInt pos = section.Find(varToken);
			if (pos == KErrNotFound)
				{
				ret = EFalse;
				}
			else
				{
				// 'lex' points at the start of the data
				TPtrC lex(section.Mid(pos));
				TInt startpos = lex.Locate(TChar('='));
				startpos++; // startpos points immediately after the =.
				while ( TChar(lex[startpos]).IsSpace() )
					{
					startpos++; // skip to start of data
					}
				TInt endpos = lex.Locate(TChar('\n')); // assumes \n is after =.
				if ( endpos == KErrNotFound ) // may not be \n on last line
					{
					endpos = section.Length()-1;
					}
				aResult.Set(lex.Mid(startpos).Ptr(),endpos-startpos-1);
				}
			}
		}

	return ret;
	}
Beispiel #9
0
//bool EntitiesEntity::_loadObject(const shared_ptr<IPortalDatabase> &database, shared_ptr<ObjectsIRevisionable> object)
bool EntitiesEntity::load(const shared_ptr<IPortalDatabase> &database, const EntityID & id)
{
	OS_TIMER_PERFORMANCE(TP, _S("Entity::_loadObject"));
	OS_LOCK(m_cs);

#ifndef OS_TODOCIP
	shared_ptr<ObjectsIRevisionable> object = objects_revisionable_cast(database->getPortal()->getObject(database, id.toUTF16()));
	m_primary = object;
	//OS_ASSERT(getEntityID() == id);
#endif

	if(database->getPortal()->getSnapshotManager()->m_enableEnsureLoadingEntity)
		database->getPortal()->getSnapshotManager()->ensure(database, id);

	DataTable result;
	// TOCLEAN_SNAPSHOT_SCORE
	//String sql = String::format(_S("select current,visible,score,depth,parent,section,stability_date from os_snapshot_objects where reference='%S'").c_str(), m_primary->id->toUTF16().c_str());
	String sql = String::format(_S("select type,current,visible,depth,parent,section,stability_date from os_snapshot_objects where entity='%S'").c_str(), id.toUTF16().c_str());
	database->execute(sql, result);
	if(!result.hasRow(0))
	{
		clear();
		return false;
	}
	else
	{
		ObjectID currentID = static_cast<String>(result.get(0,_S("current"))).to_ascii();
		m_type = Convert::toObjectType(static_cast<uint32>(result.get(0,_S("type"))));
		m_visible = result.get(0,_S("visible"));
		//m_score = *result.get(0,_S("score")); // TOCLEAN_SNAPSHOT_SCORE
		m_depth = result.get(0,_S("depth"));
		m_parent = static_cast<String>(result.get(0,_S("parent"))).to_ascii();
		m_section = static_cast<String>(result.get(0,_S("section"))).to_ascii();
		m_stabilityDate = String(result.get(0,_S("stability_date")));

		if(id == ObjectsSystem::instance()->getRootID())
			//m_current = objects_revisionable_cast(database->getPortal()->getObject(database, ObjectsSystem::instance()->getRootID().toObjectID()));
			m_current = ObjectsSection::getRootSection();
		else
		{		
#ifdef OS_TODOCIP
			/*
			if(currentID.empty())
				return false;
			m_current = objects_revisionable_cast(database->getPortal()->getObject(database, currentID));
			if(m_current == nullptr)
				return false;				
			*/

			if(currentID.empty() == false)
				m_current = objects_revisionable_cast(database->getPortal()->getObject(database, currentID));
#else
			if(currentID.empty())
			{
				m_current.reset();
				// OS_ASSERT(m_parent == ObjectsSystem::instance()->getSkippedID());
				// No, dato che la getEntity non fa + l'ensure, può succedere che carica un oggetto non stabilizzato.
				m_visible = false;
			}
			else
				m_current = objects_revisionable_cast(database->getPortal()->getObject(database, currentID));
#endif
		}

		return true;
	}
}
UINT CHttpDownload::DownloadFile( FILE_INFO& info )
{
	ASSERT( m_hHttpFile == NULL );

	CBetaPatchClientDlg* pDlg	= (CBetaPatchClientDlg*)m_pParent;

	PatchLog( "%s, %d(th), %dbytes", info.szServerPath, m_nRecvdFile, info.nFileSize );
	pDlg->m_File_Progress.SetPos( 0 );

	CString sObject;
	sObject.Format( "/%s", info.szServerPath );

	static LPCTSTR ppszAcceptTypes[2] = { "*/*", NULL };
	static DWORD dwFlags = INTERNET_FLAG_RELOAD | INTERNET_FLAG_DONT_CACHE | 
					INTERNET_FLAG_PRAGMA_NOCACHE | INTERNET_FLAG_RESYNCHRONIZE;

	m_hHttpFile	= HttpOpenRequest( m_hHttpConnection, NULL, sObject, "HTTP/1.1", NULL, ppszAcceptTypes,
									dwFlags,
									0 );
	if( m_hHttpFile == NULL )
		return DOWNLOAD_ERROR_HTTPOPENREQUEST;

	if( !HttpSendRequest( m_hHttpFile, NULL, 0, NULL, 0 ) )
		return DOWNLOAD_ERROR_HTTPSENDREQUEST;

	DWORD dwInfo = 0;
	DWORD dwLength  = sizeof( dwInfo );
    if( HttpQueryInfo( m_hHttpFile, HTTP_QUERY_CONTENT_LENGTH | HTTP_QUERY_FLAG_NUMBER, &dwInfo, &dwLength, NULL ) )
		info.nFileSize = dwInfo;

	if( !HttpQueryInfo( m_hHttpFile, HTTP_QUERY_STATUS_CODE  | HTTP_QUERY_FLAG_NUMBER, &dwInfo, &dwLength, NULL ) )
		return DOWNLOAD_ERROR_HTTPQUERYINFO;

	if( dwInfo != HTTP_STATUS_OK )
	{
//		char szMsg[2048];
//		sprintf( szMsg, "dwInfo:%d file:%s", dwInfo, sObject );
//		AfxMessageBox( szMsg );
		return DOWNLOAD_ERROR_HTTP_STATUS_NG;
	}

	//	Try and open the file we will download into
	CString strCompressedFile = info.szPath;
	strCompressedFile += ".gz";

	CFile fileToWrite;
	if( !fileToWrite.Open( strCompressedFile, CFile::modeCreate | CFile::modeWrite | CFile::shareDenyWrite) )
		return DOWNLOAD_ERROR_CREATEFILE;

#if __CURRENT_LANG == LANG_FRA
	SetStatusText( _S(IDS_STR_FRA_DOWNLOADING) );
#else
	SetStatusText( "Downloading..." );
#endif
	//	Now do the actual read of the file
	DWORD dwBytesRead	= 0;
	char szReadBuf[2048];
	DWORD dwBytesToRead	= 2048;
	DWORD dwCur	= 0;
	DWORD dwLastTotalBytes	= 0;
	DWORD dwStartTicks	= ::GetTickCount();
	DWORD dwCurrentTicks	= dwStartTicks;
	do
	{
		if( !InternetReadFile(m_hHttpFile, szReadBuf, dwBytesToRead, &dwBytesRead) )
		{
			fileToWrite.Close();
			DeleteFile( strCompressedFile );
			return DOWNLOAD_ERROR_INTERNETREADFILE;
		}
		else if( dwBytesRead )
		{
			try
			{
				fileToWrite.Write( szReadBuf, dwBytesRead );
			}
			catch( ... )
			{
				return DOWNLOAD_ERROR_WRITEFILE;
			}

			dwCur += dwBytesRead;  
			
			// Update the transfer rate amd estimated time left every second
			DWORD dwNowTicks	= GetTickCount();
			DWORD dwTimeTaken	= dwNowTicks - dwCurrentTicks;
			if( dwTimeTaken > 100 )
			{
				double KbPerSecond	= ( (double)( dwCur ) - (double)( dwLastTotalBytes ) ) / ( (double)( dwTimeTaken ) );
				char sTransferRate[32];
				sprintf( sTransferRate, "%4.1fKb/sec", KbPerSecond );
				pDlg->m_Static_DownSpeed.SetText( sTransferRate );
//#if __COUNTRY == CNTRY_USA
				COLORREF cr = RGB( 0, 0, 0 );
				pDlg->m_Static_DownSpeed.SetTextColor( cr );
/*#elif __CURRENT_LANG == LANG_POR
				COLORREF cr = RGB( 255, 255, 255 );
				pDlg->m_Static_DownSpeed.SetTextColor( cr );
				pDlg->m_Static_DownSpeed.SetFontBold( TRUE );
#endif*/

				// Setup for the next time around the loop
				dwCurrentTicks	= dwNowTicks;
				dwLastTotalBytes	= dwCur;
			}

			if( info.nFileSize == 0 )	info.nFileSize	= 1;
			int nPos = MulDiv( dwCur, 100, info.nFileSize );
			if( nPos < 0 )		nPos = 0;
			if( nPos > 100 )	nPos = 100;
			pDlg->m_File_Progress.SetPos( nPos );

			int nPos2 = MulDiv( m_nRecvdFile * 100 + nPos, 100, m_pPatchManager->m_files.size() * 100 );
			if( nPos2 < 0 )		nPos2 = 0;
			if( nPos2 > 100 )	nPos2 = 100;
			pDlg->m_Total_Progress.SetPos( nPos2 );
		}
	} 
	while( dwBytesRead );

	InternetCloseHandle( m_hHttpFile );
	m_hHttpFile	= NULL;
	fileToWrite.Close();

#if __CURRENT_LANG == LANG_FRA
	SetStatusText( _S(IDS_STR_FRA_DECOMPRESS) );
#else
	SetStatusText( "Decompress..." );
#endif
	UINT nResult = Decompress( strCompressedFile, info.szPath );
	if( nResult != DECOMPRESS_ERROR_OK )
	{
		DeleteFile( strCompressedFile );
		return nResult;
	}
	DeleteFile( strCompressedFile );

	if( info.ft.dwHighDateTime && info.ft.dwLowDateTime )
	{
		// 파일시각 바꾸기 
		if( !fileToWrite.Open( info.szPath, CFile::modeWrite | CFile::shareDenyNone) )
		{
			AfxMessageBox( info.szPath );
			return DOWNLOAD_ERROR_SETFILEDATE;
		}

		// info.ft는 GMT기준이다.
		SetFileTime( (HANDLE)fileToWrite.m_hFile, &info.ft, &info.ft, &info.ft );
		fileToWrite.Close();
	}

	return DOWNLOAD_ERROR_OK;
}
Beispiel #11
0
#include <kernel/ls_std.h>
#include "locl_region.h"

//  REGION CONSTANTS AND MACROS  

// The configuration data
const TInt RegionAspect::CountryCode = 82;
const TInt RegionAspect::UniversalTimeOffset = 32400;
const TDateFormat RegionAspect::DateFormat = EDateJapanese;
const TTimeFormat RegionAspect::TimeFormat = ETime12;
const TLocalePos RegionAspect::CurrencySymbolPosition = ELocaleAfter;
const TBool RegionAspect::CurrencySpaceBetween = EFalse;
const TInt RegionAspect::CurrencyDecimalPlaces = 0;
const TLocale::TNegativeCurrencyFormat RegionAspect::NegativeCurrencyFormat=TLocale::TNegativeCurrencyFormat(TLocale::ELeadingMinusSign); // replacing CurrencyNegativeInBrackets
const TBool RegionAspect::CurrencyTriadsAllowed = ETrue;
const TText * const RegionAspect::ThousandsSeparator = _S(",");
const TText * const RegionAspect::DecimalSeparator = _S(".");
const TText * const RegionAspect::DateSeparator[KMaxDateSeparators] = {_S(""),_S("/"),_S("/"),_S("")};
const TText * const RegionAspect::TimeSeparator[KMaxTimeSeparators] = {_S(""),_S(":"),_S(":"),_S("")};
const TLocalePos RegionAspect::AmPmSymbolPosition = ELocaleAfter;
const TBool RegionAspect::AmPmSpaceBetween = EFalse;
const TDaylightSavingZone RegionAspect::HomeDaylightSavingZone = EDstNone;
const TUint RegionAspect::WorkDays = 0x1f;
const TText * const RegionAspect::CurrencySymbol = _S("\x20A9");
const TText* const RegionAspect::ShortDateFormatSpec = _S("%F%/0%D%/1%M%/2%Y%/3"); // no leading zeros //check this
const TText* const RegionAspect::LongDateFormatSpec = _S("%F%D%X %N %Y"); // leading zeros in day //check this
const TText* const RegionAspect::TimeFormatSpec = _S("%F%:0%*I%:1%*T%:2%*S%:3 %B"); // am/pm -symbol included //check this
const TDay RegionAspect::StartOfWeek = EMonday;
const TClockFormat RegionAspect::ClockFormat = EClockDigital;
const TUnitsFormat RegionAspect::UnitsGeneral = EUnitsMetric;
const TUnitsFormat RegionAspect::UnitsDistanceShort = EUnitsMetric;
static void
_trace_func_name (SQLUSMALLINT fFunc, int format)
{
  char *ptr = "unknown function";

  switch (fFunc)
    {
/* All ODBC 2.x functions */
      _S (SQL_API_ALL_FUNCTIONS);

/* ODBC 2.x */
      _S (SQL_API_SQLALLOCCONNECT);
      _S (SQL_API_SQLALLOCENV);
      _S (SQL_API_SQLALLOCSTMT);
      _S (SQL_API_SQLBINDCOL);
      _S (SQL_API_SQLBINDPARAMETER);
      _S (SQL_API_SQLBROWSECONNECT);
      _S (SQL_API_SQLCANCEL);
#if (ODBCVER < 0x0300)
      _S (SQL_API_SQLCOLATTRIBUTES);
#endif
      _S (SQL_API_SQLCOLUMNPRIVILEGES);
      _S (SQL_API_SQLCOLUMNS);
      _S (SQL_API_SQLCONNECT);
      _S (SQL_API_SQLDATASOURCES);
      _S (SQL_API_SQLDESCRIBECOL);
      _S (SQL_API_SQLDESCRIBEPARAM);
      _S (SQL_API_SQLDISCONNECT);
      _S (SQL_API_SQLDRIVERCONNECT);
      _S (SQL_API_SQLDRIVERS);
      _S (SQL_API_SQLERROR);
      _S (SQL_API_SQLEXECDIRECT);
      _S (SQL_API_SQLEXECUTE);
      _S (SQL_API_SQLEXTENDEDFETCH);
      _S (SQL_API_SQLFETCH);
      _S (SQL_API_SQLFOREIGNKEYS);
      _S (SQL_API_SQLFREECONNECT);
      _S (SQL_API_SQLFREEENV);
      _S (SQL_API_SQLFREESTMT);
      _S (SQL_API_SQLGETCONNECTOPTION);
      _S (SQL_API_SQLGETCURSORNAME);
      _S (SQL_API_SQLGETDATA);
      _S (SQL_API_SQLGETFUNCTIONS);
      _S (SQL_API_SQLGETINFO);
      _S (SQL_API_SQLGETSTMTOPTION);
      _S (SQL_API_SQLGETTYPEINFO);
      _S (SQL_API_SQLMORERESULTS);
      _S (SQL_API_SQLNATIVESQL);
      _S (SQL_API_SQLNUMPARAMS);
      _S (SQL_API_SQLNUMRESULTCOLS);
      _S (SQL_API_SQLPARAMDATA);
      _S (SQL_API_SQLPARAMOPTIONS);
      _S (SQL_API_SQLPREPARE);
      _S (SQL_API_SQLPRIMARYKEYS);
      _S (SQL_API_SQLPROCEDURECOLUMNS);
      _S (SQL_API_SQLPROCEDURES);
      _S (SQL_API_SQLPUTDATA);
      _S (SQL_API_SQLROWCOUNT);
      _S (SQL_API_SQLSETCONNECTOPTION);
      _S (SQL_API_SQLSETCURSORNAME);
      _S (SQL_API_SQLSETPARAM);
      _S (SQL_API_SQLSETPOS);
      _S (SQL_API_SQLSETSCROLLOPTIONS);
      _S (SQL_API_SQLSETSTMTOPTION);
      _S (SQL_API_SQLSPECIALCOLUMNS);
      _S (SQL_API_SQLSTATISTICS);
      _S (SQL_API_SQLTABLEPRIVILEGES);
      _S (SQL_API_SQLTABLES);
      _S (SQL_API_SQLTRANSACT);
#if (ODBCVER >= 0x0300)
/* All ODBC 2.x functions */
      _S (SQL_API_ODBC3_ALL_FUNCTIONS);

/* ODBC 3.x */
      _S (SQL_API_SQLALLOCHANDLE);
      _S (SQL_API_SQLALLOCHANDLESTD);
      _S (SQL_API_SQLBINDPARAM);
      _S (SQL_API_SQLBULKOPERATIONS);
      _S (SQL_API_SQLCLOSECURSOR);
      _S (SQL_API_SQLCOLATTRIBUTE);
      _S (SQL_API_SQLCOPYDESC);
      _S (SQL_API_SQLENDTRAN);
      _S (SQL_API_SQLFETCHSCROLL);
      _S (SQL_API_SQLFREEHANDLE);
      _S (SQL_API_SQLGETCONNECTATTR);
      _S (SQL_API_SQLGETDESCFIELD);
      _S (SQL_API_SQLGETDESCREC);
      _S (SQL_API_SQLGETDIAGFIELD);
      _S (SQL_API_SQLGETDIAGREC);
      _S (SQL_API_SQLGETENVATTR);
      _S (SQL_API_SQLGETSTMTATTR);
      _S (SQL_API_SQLSETCONNECTATTR);
      _S (SQL_API_SQLSETDESCFIELD);
      _S (SQL_API_SQLSETDESCREC);
      _S (SQL_API_SQLSETENVATTR);
      _S (SQL_API_SQLSETSTMTATTR);

#endif
    }

  if (format)
    trace_emit ("\t\t%-15.15s   %d (%s)\n", "SQLUSMALLINT", (int) fFunc, ptr);
  else
    trace_emit_string (ptr, SQL_NTS, 0);
}
Beispiel #13
0
	window.EndRedraw();
	TFontSpec fspec(KTestFontTypefaceName,200);
	CFbsFont *font;
	User::LeaveIfError(device->GetNearestFontToDesignHeightInTwips((CFont *&)font, fspec));
	gc->UseFont(font);
	TBuf<100> loadsatext(_L("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890zyxwvutsrqponmlkjihgfedcba"));
	TInt ascent=font->AscentInPixels();
	TInt fheight=font->HeightInPixels();
	for(TInt nTimes=0;nTimes<10;nTimes++)
		{
		TPoint pos;
//		for(pos.iY=ascent;pos.iY<scrSize.iHeight;pos.iY+=font->HeightInPixels())
//			gc->DrawText(loadsatext,pos);
		for(pos.iY=0;pos.iY<scrSize.iHeight;pos.iY+=fheight)
			gc->DrawText(loadsatext,TRect(pos,TPoint(scrSize.iWidth,pos.iY+fheight)),ascent);
		gc->Clear();
		}
	gc->Deactivate();
//
	ws.Flush();
	delete gc;
	device->ReleaseFont(font);
	window.Close();
	group.Close();
	delete device;
	ws.Close();
	return(KErrNone);
	}

GLDEF_D TTimeTestHeader LoadsaText={_S("Loads of text"),LoadsOfText};
/*************************************
 * False
 *************************************/
const SHVStringC SHVTestLoggerConsole::False()
{
	return _S("false");
}
/*************************************
 * True
 *************************************/
const SHVStringC SHVTestLoggerConsole::True()
{
	return _S("true");
}
Beispiel #16
0
HtmlUnit HtmlTable::getCellPadding() const
{
	return HtmlUnit::fromString(getAttributes()->value_of(_S("cellpadding")));
}
Beispiel #17
0
void HtmlTable::setCellPadding(const HtmlUnit &value)
{
	getAttributes()->set(_S("cellpadding"), value);
}
Beispiel #18
0
CPriorityKey::CPriorityKey(CWsClient *aOwner) : CEventBase(aOwner)
	{
	__DECLARE_NAME(_S("CPriorityKey"));
	}
Beispiel #19
0
// CBrdServer::CBrdServer(CAnvltestEngine *aControl)
//    :CServer(EPriorityStandard), iControl(aControl)
CBrdServer::CBrdServer(CAnvltestEngine *aControl)
    :CServer2(EPriorityStandard), iControl(aControl)

    {
    __DECLARE_NAME(_S("CBrdServer"));
    }
Beispiel #20
0
#include "ls_std.h"
#include "complocl.h"

// The configuration data
const TLanguage LLocaleData::Language = ELangSpanish;
const TInt LLocaleData::CountryCode = 34;
const TInt LLocaleData::UniversalTimeOffset = 3600;
const TDateFormat LLocaleData::DateFormat = EDateEuropean;
const TTimeFormat LLocaleData::TimeFormat = ETime24;
const TLocalePos LLocaleData::CurrencySymbolPosition = ELocaleAfter;
const TBool LLocaleData::CurrencySpaceBetween = ETrue;
const TInt LLocaleData::CurrencyDecimalPlaces = 0;
const TLocale::TNegativeCurrencyFormat LLocaleData::NegativeCurrencyFormat=TLocale::TNegativeCurrencyFormat(0); // replacing CurrencyNegativeInBrackets
const TBool LLocaleData::CurrencyTriadsAllowed = ETrue;
const TText * const LLocaleData::ThousandsSeparator = _S(".");
const TText * const LLocaleData::DecimalSeparator = _S(",");
const TText * const LLocaleData::DateSeparator[KMaxDateSeparators] = {_S(""),_S("/"),_S("/"),_S("")};
const TText * const LLocaleData::TimeSeparator[KMaxTimeSeparators] = {_S(""),_S(":"),_S(":"),_S("")};
const TLocalePos LLocaleData::AmPmSymbolPosition = ELocaleAfter;
const TBool LLocaleData::AmPmSpaceBetween = ETrue;
//const TUint LLocaleData::DaylightSaving = EDstNone;
const TDaylightSavingZone LLocaleData::HomeDaylightSavingZone = EDstEuropean;
const TUint LLocaleData::WorkDays = 0x1f;
const TText * const LLocaleData::CurrencySymbol = _S("\x20ac");
const TText* const LLocaleData::ShortDateFormatSpec = _S("%F%*D/%*M/%Y"); // needs checking by a localisation team (this item was added since real localisation - the value given here has been set by a software developer so it may be wrong)
const TText* const LLocaleData::LongDateFormatSpec = _S("%F%*D%X %N %Y"); // needs checking by a localisation team (this item was added since real localisation - the value given here has been set by a software developer so it may be wrong)
const TText* const LLocaleData::TimeFormatSpec = _S("%F%H:%T:%S"); // needs checking by a localisation team (this item was added since real localisation - the value given here has been set by a software developer so it may be wrong)
const TFatUtilityFunctions* const LLocaleData::FatUtilityFunctions = NULL;
const TDay LLocaleData::StartOfWeek = EMonday;
const TClockFormat LLocaleData::ClockFormat = EClockAnalog;
Beispiel #21
0
bool MREA::Extract(const SpecBase& dataSpec,
                   PAKEntryReadStream& rs,
                   const hecl::ProjectPath& outPath,
                   PAKRouter<PAKBridge>& pakRouter,
                   const PAK::Entry& entry,
                   bool force,
                   std::function<void(const hecl::SystemChar*)>)
{
    using RigPair = std::pair<CSKR*, CINF*>;
    RigPair dummy(nullptr, nullptr);

    hecl::ProjectPath mreaPath;
    if (pakRouter.isShared())
        /* Rename MREA for consistency */
        mreaPath = hecl::ProjectPath(outPath.getParentPath(), _S("!area.blend"));
    else
        /* We're not in a world pak, so lets keep the original name */
        mreaPath = outPath;

    if (!force && mreaPath.getPathType() == hecl::ProjectPath::Type::File)
        return true;

    /* Do extract */
    Header head;
    head.read(rs);
    rs.seekAlign32();

    /* MREA decompression stream */
    StreamReader drs(rs, head.compressedBlockCount, head.secIndexCount);
    athena::io::FileWriter mreaDecompOut(pakRouter.getCooked(&entry).getWithExtension(_S(".decomp")).getAbsolutePath());
    head.write(mreaDecompOut);
    mreaDecompOut.seekAlign32();
    drs.writeDecompInfos(mreaDecompOut);
    mreaDecompOut.seekAlign32();
    drs.writeSecIdxs(mreaDecompOut);
    mreaDecompOut.seekAlign32();
    atUint64 decompLen = drs.length();
    mreaDecompOut.writeBytes(drs.readBytes(decompLen).get(), decompLen);
    mreaDecompOut.close();
    drs.seek(0, athena::Begin);


    /* Start up blender connection */
    hecl::BlenderConnection& conn = hecl::BlenderConnection::SharedConnection();
    if (!conn.createBlend(mreaPath, hecl::BlenderConnection::BlendType::Area))
        return false;

    /* Open Py Stream and read sections */
    hecl::BlenderConnection::PyOutStream os = conn.beginPythonOut(true);
    os.format("import bpy\n"
              "import bmesh\n"
              "from mathutils import Vector\n"
              "\n"
              "bpy.context.scene.name = '%s'\n",
              pakRouter.getBestEntryName(entry).c_str());
    DNACMDL::InitGeomBlenderContext(os, dataSpec.getMasterShaderPath());
    MaterialSet::RegisterMaterialProps(os);
    os << "# Clear Scene\n"
          "for ob in bpy.data.objects:\n"
          "    bpy.context.scene.objects.unlink(ob)\n"
          "    bpy.data.objects.remove(ob)\n"
          "bpy.types.Lamp.retro_layer = bpy.props.IntProperty(name='Retro: Light Layer')\n"
          "bpy.types.Lamp.retro_origtype = bpy.props.IntProperty(name='Retro: Original Type')\n"
          "\n";

    /* One shared material set for all meshes */
    os << "# Materials\n"
          "materials = []\n"
          "\n";
    MaterialSet matSet;
    atUint64 secStart = drs.position();
    matSet.read(drs);
    matSet.readToBlender(os, pakRouter, entry, 0);
    drs.seek(secStart + head.secSizes[0], athena::Begin);
    std::vector<DNACMDL::VertexAttributes> vertAttribs;
    DNACMDL::GetVertexAttributes(matSet, vertAttribs);

    /* Read mesh info */
    atUint32 curSec = 1;
    std::vector<atUint32> surfaceCounts;
    surfaceCounts.reserve(head.meshCount);
    for (atUint32 m=0 ; m<head.meshCount ; ++m)
    {
        /* Mesh header */
        MeshHeader mHeader;
        secStart = drs.position();
        mHeader.read(drs);
        drs.seek(secStart + head.secSizes[curSec++], athena::Begin);

        /* Surface count from here */
        secStart = drs.position();
        surfaceCounts.push_back(drs.readUint32Big());
        drs.seek(secStart + head.secSizes[curSec++], athena::Begin);

        /* Seek through AROT-relation sections */
        drs.seek(head.secSizes[curSec++], athena::Current);
        drs.seek(head.secSizes[curSec++], athena::Current);
    }

    /* Skip though WOBJs */
    auto secIdxIt = drs.beginSecIdxs();
    while (secIdxIt->first == FOURCC('WOBJ'))
        ++secIdxIt;

    /* Skip AROT */
    if (secIdxIt->first == FOURCC('ROCT'))
    {
        drs.seek(head.secSizes[curSec++], athena::Current);
        ++secIdxIt;
    }

    /* Skip AABB */
    if (secIdxIt->first == FOURCC('AABB'))
    {
        drs.seek(head.secSizes[curSec++], athena::Current);
        ++secIdxIt;
    }

    /* Now the meshes themselves */
    if (secIdxIt->first == FOURCC('GPUD'))
    {
        for (atUint32 m=0 ; m<head.meshCount ; ++m)
        {
            curSec += DNACMDL::ReadGeomSectionsToBlender<PAKRouter<PAKBridge>, MaterialSet, RigPair, DNACMDL::SurfaceHeader_3>
                          (os, drs, pakRouter, entry, dummy, true,
                           false, vertAttribs, m, head.secCount, 0, &head.secSizes[curSec], surfaceCounts[m]);
        }
        ++secIdxIt;
    }

    /* Skip DEPS */
    if (secIdxIt->first == FOURCC('DEPS'))
    {
        drs.seek(head.secSizes[curSec++], athena::Current);
        ++secIdxIt;
    }

    /* Skip SOBJ (SCLY) */
    if (secIdxIt->first == FOURCC('SOBJ'))
    {
        for (atUint32 l=0 ; l<head.sclyLayerCount ; ++l)
            drs.seek(head.secSizes[curSec++], athena::Current);
        ++secIdxIt;
    }

    /* Skip SGEN */
    if (secIdxIt->first == FOURCC('SGEN'))
    {
        drs.seek(head.secSizes[curSec++], athena::Current);
        ++secIdxIt;
    }

    /* Read Collision Meshes */
    if (secIdxIt->first == FOURCC('COLI'))
    {
        DNAMP2::DeafBabe collision;
        secStart = drs.position();
        collision.read(drs);
        DNAMP2::DeafBabe::BlenderInit(os);
        collision.sendToBlender(os);
        drs.seek(secStart + head.secSizes[curSec++], athena::Begin);
        ++secIdxIt;
    }

    /* Read BABEDEAD Lights as Cycles emissives */
    if (secIdxIt->first == FOURCC('LITE'))
    {
        secStart = drs.position();
        ReadBabeDeadToBlender_3(os, drs);
        drs.seek(secStart + head.secSizes[curSec++], athena::Begin);
        ++secIdxIt;
    }

    /* Origins to center of mass */
    os << "bpy.context.scene.layers[1] = True\n"
          "bpy.ops.object.select_by_type(type='MESH')\n"
          "bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_MASS')\n"
          "bpy.ops.object.select_all(action='DESELECT')\n"
          "bpy.context.scene.layers[1] = False\n";

    os.centerView();
    os.close();
    return conn.saveBlend();
}
Beispiel #22
0
#include "options.h"
#include "portalsportals.h"
#include "htmlparser.h"
#include "htmlpage.h"
#include "xmldocument.h"
#include "xmlnode.h"
#include "xmlnodes.h"
#include "xmlschema.h"

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

OS_NAMESPACE_BEGIN()

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

const String IdeSkin::ID = _S("id");
const String IdeSkin::NAME = _S("name");
const String IdeSkin::PREVIEW = _S("preview");
const String IdeSkin::DESCRIPTION = _S("description");
const String IdeSkin::VERSION = _S("version");
const String IdeSkin::AUTHOR = _S("author");
const String IdeSkin::COMPATIBILITY = _S("compatibility");
//const String IdeSkin::DEFAULT = _S("default");

const String IdeSkin::STYLES = _S("styles");
const String IdeSkin::STYLE = _S("style");
const String IdeSkin::CSS = _S("css");
const String IdeSkin::SCRIPTS = _S("scripts");
const String IdeSkin::SCRIPT = _S("script");
const String IdeSkin::JS = _S("js");
Beispiel #23
0
void CClientVariables::LoadDefaults ( void )
{
#define DEFAULT(__x,__y)    if(!Exists(__x)) \
                                Set(__x,__y)
#define _S(__x)             std::string(__x)

    if(!Exists("nick"))
    {
        DEFAULT ( "nick",                       _S(CNickGen::GetRandomNickname()) );       // nickname
        CCore::GetSingleton ().RequestNewNickOnStart();  // Request the user to set a new nickname
    }

    DEFAULT ( "host",                       _S("127.0.0.1") );              // hostname
    DEFAULT ( "port",                       22003 );                        // port
    DEFAULT ( "password",                   _S("") );                       // password
    DEFAULT ( "qc_host",                    _S("127.0.0.1") );              // quick connect hostname
    DEFAULT ( "qc_port",                    22003 );                        // quick connect port
    DEFAULT ( "qc_password",                _S("") );                       // quick connect password
    DEFAULT ( "debugfile",                  _S("") );                       // debug filename
    DEFAULT ( "console_pos",                CVector2D ( 0, 0 ) );           // console position
    DEFAULT ( "console_size",               CVector2D ( 200, 200 ) );       // console size
    DEFAULT ( "serverbrowser_size",         CVector2D ( 720.0f, 495.0f ) ); // serverbrowser size
    DEFAULT ( "fps_limit",                  100 );                          // frame limiter
    DEFAULT ( "chat_font",                  0 );                            // chatbox font type
    DEFAULT ( "chat_lines",                 7 );                            // chatbox lines
    DEFAULT ( "chat_color",                 CColor (0,0,128,100) );         // chatbox color
    DEFAULT ( "chat_text_color",            CColor (172,213,254,255) );     // chatbox text color
    DEFAULT ( "chat_input_color",           CColor (0,0,191,110) );         // chatbox input color
    DEFAULT ( "chat_input_prefix_color",    CColor (172,213,254,255) );     // chatbox prefix input color
    DEFAULT ( "chat_input_text_color",      CColor (172,213,254,255) );     // chatbox text input color
    DEFAULT ( "chat_scale",                 CVector2D ( 1.0f, 1.0f ) );     // chatbox scale
    DEFAULT ( "chat_width",                 1.0f );                         // chatbox width
    DEFAULT ( "chat_css_style_text",        false );                        // chatbox css/hl style text
    DEFAULT ( "chat_css_style_background",  false );                        // chatbox css/hl style background
    DEFAULT ( "chat_line_life",             12000 );                        // chatbox line life time
    DEFAULT ( "chat_line_fade_out",         3000 );                         // chatbox line fade out time
    DEFAULT ( "chat_use_cegui",             false );                        // chatbox uses cegui
    DEFAULT ( "chat_nickcompletion",        true );                         // chatbox nick completion
    DEFAULT ( "server_can_flash_window",    true );                         // allow server to flash the window
    DEFAULT ( "text_scale",                 1.0f );                         // text scale
    DEFAULT ( "invert_mouse",               false );                        // mouse inverting
    DEFAULT ( "fly_with_mouse",             false );                        // flying with mouse controls
    DEFAULT ( "steer_with_mouse",           false );                        // steering with mouse controls
    DEFAULT ( "classic_controls",           false );                        // classic/standard controls
    DEFAULT ( "mtavolume",                  1.0f );                         // custom sound's volume
    DEFAULT ( "voicevolume",                1.0f );                         // voice chat output volume
    DEFAULT ( "mapalpha",                   155 );                          // map alpha
    DEFAULT ( "browser_speed",              1 );                            // Browser speed
    DEFAULT ( "single_download",            0 );                            // Single connection for downloads
    DEFAULT ( "packet_tag",                 0 );                            // Tag network packets
    DEFAULT ( "progress_animation",         1 );                            // Progress spinner at the bottom of the screen
    DEFAULT ( "update_build_type",          0 );                            // 0-stable 1-test 2-nightly
    DEFAULT ( "update_auto_install",        1 );                            // 0-off 1-on
    DEFAULT ( "volumetric_shadows",         0 );                            // Enable volumetric shadows
    DEFAULT ( "aspect_ratio",               0 );                            // Display aspect ratio
    DEFAULT ( "hud_match_aspect_ratio",     1 );                            // GTA HUD should match the display aspect ratio
    DEFAULT ( "anisotropic",                0 );                            // Anisotropic filtering
    DEFAULT ( "grass",                      1 );                            // Enable grass
    DEFAULT ( "heat_haze",                  1 );                            // Enable heat haze
    DEFAULT ( "tyre_smoke_enabled",         1 );                            // Enable tyre smoke
    DEFAULT ( "fast_clothes_loading",       1 );                            // 0-off 1-auto 2-on
    DEFAULT ( "allow_screen_upload",        1 );                            // 0-off 1-on
    DEFAULT ( "max_clientscript_log_kb",    5000 );                         // Max size in KB (0-No limit)
    DEFAULT ( "display_fullscreen_style",   0 );                            // 0-standard 1-borderless 2-borderless keep res 3-borderless stretch
    DEFAULT ( "display_windowed",           0 );                            // 0-off 1-on
    DEFAULT ( "multimon_fullscreen_minimize", 1 );                          // 0-off 1-on
    DEFAULT ( "vertical_aim_sensitivity",   0.0015f );                      // 0.0015f is GTA default setting
    DEFAULT ( "process_priority",           0 );                            // 0-normal 1-above normal 2-high
    DEFAULT ( "mute_sfx_when_minimized",    0 );                            // 0-off 1-on
    DEFAULT ( "mute_radio_when_minimized",  0 );                            // 0-off 1-on
    DEFAULT ( "mute_mta_when_minimized",    0 );                            // 0-off 1-on
    DEFAULT ( "mute_voice_when_minimized",  0 );                            // 0-off 1-on
    DEFAULT ( "share_file_cache",           1 );                            // 0-no 1-share client resource file cache with other MTA installs
    DEFAULT ( "show_unsafe_resolutions",    0 );                            // 0-off 1-show resolutions that are higher that the desktop
    DEFAULT ( "fov",                        70 );                           // Camera field of view
    DEFAULT ( "browser_remote_websites",    true );                         // Load remote websites?
    DEFAULT ( "browser_remote_javascript",  true );                         // Execute javascript on remote websites?
    DEFAULT ( "browser_plugins",            false );                         // Enable browser plugins?
    DEFAULT ( "filter_duplicate_log_lines", true );                         // Filter duplicate log lines for debug view and clientscript.log

    if (!Exists("locale"))
    {
        SString strLangCode = GetApplicationSetting ( "locale" );
        Set ( "locale", !strLangCode.empty() ? strLangCode : _S("en_US") );
    }

    // Set default resolution to native resolution
    if ( !Exists ( "display_resolution" ) )
    {
        RECT rect;
        GetWindowRect( GetDesktopWindow (), &rect );
        Set ( "display_resolution", SString ( "%dx%dx32", rect.right, rect.bottom ) );
    }

    // We will default this one at CClientGame.cpp, because we need a valid direct3d device to give a proper default value.
#if 0
    DEFAULT ( "streaming_memory",           50 );                           // Streaming memory
#endif
}
void CClientVariables::LoadDefaults ( void )
{
    #define DEFAULT(__x,__y)    if(!Exists(__x)) \
                                Set(__x,__y)
    #define _S(__x)             std::string(__x)

    if(!Exists("nick")) 
    {
        DEFAULT ( "nick",                       _S(GenerateNickname()) );       // nickname
        CCore::GetSingleton ().RequestNewNickOnStart();  // Request the user to set a new nickname
    }

    DEFAULT ( "host",                       _S("127.0.0.1") );              // hostname
    DEFAULT ( "port",                       22003 );                        // port
    DEFAULT ( "password",                   _S("") );                       // password
    DEFAULT ( "qc_host",                    _S("127.0.0.1") );              // quick connect hostname
    DEFAULT ( "qc_port",                    22003 );                        // quick connect port
    DEFAULT ( "qc_password",                _S("") );                       // quick connect password
    DEFAULT ( "debugfile",                  _S("") );                       // debug filename
    DEFAULT ( "console_pos",                CVector2D ( 0, 0 ) );           // console position
    DEFAULT ( "console_size",               CVector2D ( 200, 200 ) );       // console size
    DEFAULT ( "serverbrowser_size",         CVector2D ( 720.0f, 495.0f ) ); // serverbrowser size
    DEFAULT ( "fps_limit",                  100 );                          // frame limiter
    DEFAULT ( "chat_font",                  0 );                            // chatbox font type
    DEFAULT ( "chat_lines",                 7 );                            // chatbox lines
    DEFAULT ( "chat_color",                 CColor (0,0,128,100) );         // chatbox color
    DEFAULT ( "chat_text_color",            CColor (172,213,254,255) );     // chatbox text color
    DEFAULT ( "chat_input_color",           CColor (0,0,191,110) );         // chatbox input color
    DEFAULT ( "chat_input_prefix_color",    CColor (172,213,254,255) );     // chatbox prefix input color
    DEFAULT ( "chat_input_text_color",      CColor (172,213,254,255) );     // chatbox text input color
    DEFAULT ( "chat_scale",                 CVector2D ( 1.0f, 1.0f ) );     // chatbox scale
    DEFAULT ( "chat_width",                 1.0f );                         // chatbox width
    DEFAULT ( "chat_css_style_text",        false );                        // chatbox css/hl style text
    DEFAULT ( "chat_css_style_background",  false );                        // chatbox css/hl style background
    DEFAULT ( "chat_line_life",             12000 );                        // chatbox line life time
    DEFAULT ( "chat_line_fade_out",         3000 );                         // chatbox line fade out time
    DEFAULT ( "chat_use_cegui",             false );                        // chatbox uses cegui
    DEFAULT ( "text_scale",                 1.0f );                         // text scale
    DEFAULT ( "invert_mouse",               false );                        // mouse inverting
    DEFAULT ( "fly_with_mouse",             false );                        // flying with mouse controls
    DEFAULT ( "steer_with_mouse",           false );                        // steering with mouse controls
    DEFAULT ( "classic_controls",           false );                        // classic/standard controls
    DEFAULT ( "mtavolume",                  1.0f );                         // custom sound's volume
    DEFAULT ( "voicevolume",                1.0f );                         // voice chat output volume
    DEFAULT ( "mapalpha",                   155 );                          // map alpha
    DEFAULT ( "browser_speed",              2 );                            // Browser speed
    DEFAULT ( "single_download",            0 );                            // Single connection for downloads
    DEFAULT ( "update_build_type",          0 );                            // 0-stable 1-test 2-nightly
    DEFAULT ( "volumetric_shadows",         0 );                            // Enable volumetric shadows
    DEFAULT ( "aspect_ratio",               0 );                            // Display aspect ratio
    DEFAULT ( "hud_match_aspect_ratio",     1 );                            // GTA HUD should match the display aspect ratio
    DEFAULT ( "anisotropic",                0 );                            // Anisotropic filtering
    DEFAULT ( "grass",                      1 );                            // Enable grass
    DEFAULT ( "heat_haze",                  1 );                            // Enable heat haze
    DEFAULT ( "fast_clothes_loading",       1 );                            // 0-off 1-auto 2-on
    DEFAULT ( "allow_screen_upload",        1 );                            // 0-off 1-on
    DEFAULT ( "max_clientscript_log_kb",    5000 );                         // Max size in KB (0-No limit)
    DEFAULT ( "display_fullscreen_style",   0 );                            // 0-standard 1-borderless 2-borderless keep res 3-borderless stretch
    DEFAULT ( "display_windowed",           0 );                            // 0-off 1-on
    DEFAULT ( "multimon_fullscreen_minimize", 1 );                          // 0-off 1-on
    DEFAULT ( "vertical_aim_sensitivity",   0.0015f );                      // 0.0015f is GTA default setting
    DEFAULT ( "process_priority",           0 );                            // 0-normal 1-above normal 2-high
    DEFAULT ( "mute_sfx_when_minimized",    0 );                            // 0-off 1-on
    DEFAULT ( "mute_radio_when_minimized",  0 );                            // 0-off 1-on
    DEFAULT ( "mute_mta_when_minimized",    0 );                            // 0-off 1-on
    DEFAULT ( "mute_voice_when_minimized",  0 );                            // 0-off 1-on

    // We will default this one at CClientGame.cpp, because we need a valid direct3d device to give a proper default value.
#if 0
    DEFAULT ( "streaming_memory",           50 );                           // Streaming memory
#endif
}
Beispiel #25
0
/*************************************
 * AddLogLine
 *************************************/
void SHVTestServer::AddLogLine(SHVModuleBase* caller, const SHVStringC& log)
{
SHVRefObjectTemplate<SHVString>* obj = new SHVRefObjectTemplate<SHVString>;
	obj->Object().Format(_S("LOG (%s - 0x%X): %s"), caller->GetName().GetSafeBuffer(), SHVThreadBase::GetCurrentThreadID(), log.GetSafeBuffer());
	EmitEvent(new SHVEvent(this,EventInternalAddLogLine,0,obj));
}
Beispiel #26
0
void CSecEngine::PrintCipherNameL(const TDes8& aBuf)
	{
	TLex8 lex(aBuf);
	TUint cipherCode=aBuf[1];
	if ((cipherCode<1) || (cipherCode > 0x1B))
		User::Leave(KErrArgument);
	const TText* KCipherNameArray[0x1B] = 
		{
		_S("TLS_RSA_WITH_NULL_MD5"),
		_S("TLS_RSA_WITH_NULL_SHA"),
		_S("TLS_RSA_EXPORT_WITH_RC4_40_MD5"),
		_S("TLS_RSA_WITH_RC4_128_MD5"),
		_S("TLS_RSA_WITH_RC4_128_SHA"),
		_S("TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5"),
		_S("TLS_RSA_WITH_IDEA_CBC_SHA"),
		_S("TLS_RSA_EXPORT_WITH_DES40_CBC_SHA"),
		_S("TLS_RSA_WITH_DES_CBC_SHA"),
		_S("TLS_RSA_WITH_3DES_EDE_CBC_SHA"),
		_S("TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA"),
		_S("TLS_DH_DSS_WITH_DES_CBC_SHA"),
		_S("TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA"),
		_S("TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA"),
		_S("TLS_DH_RSA_WITH_DES_CBC_SHA"),
		_S("TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA"),
		_S("TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA"),
		_S("TLS_DHE_DSS_WITH_DES_CBC_SHA"),
		_S("TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA"),
		_S("TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA"),
		_S("TLS_DHE_RSA_WITH_DES_CBC_SHA"),
		_S("TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA"),
		_S("TLS_DH_anon_EXPORT_WITH_RC4_40_MD5"),
		_S("TLS_DH_anon_WITH_RC4_128_MD5"),
		_S("TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA"),
		_S("TLS_DH_anon_WITH_DES_CBC_SHA"),
		_S("TLS_DH_anon_WITH_3DES_EDE_CBC_SHA")
		};

	TPtrC name(KCipherNameArray[cipherCode-1]);
	iConsole->Printf(KCipherSuiteInUseMessage, &name );
	}
Beispiel #27
0
// ----------------------------------------------------------------------------
// Name : Render()
// Desc :
// ----------------------------------------------------------------------------
void CUICompound::Render()
{
	CDrawPort* pDrawPort = CUIManager::getSingleton()->GetDrawPort();

	// Set texture
	pDrawPort->InitTextureData( m_ptdBaseTexture );

	// Add render regions
	int	nX, nY, i;
	// Background
	// Top
	nX = m_nPosX + m_nWidth;
	nY = m_nPosY + 26;
	pDrawPort->AddTexture( m_nPosX, m_nPosY, nX, nY,
										m_rtTop.U0, m_rtTop.V0, m_rtTop.U1, m_rtTop.V1,
										0xFFFFFFFF );

	// Middle 1
	pDrawPort->AddTexture( m_nPosX, nY, nX, nY + m_nTextRegionHeight,
										m_rtMiddle1.U0, m_rtMiddle1.V0, m_rtMiddle1.U1, m_rtMiddle1.V1,
										0xFFFFFFFF );

	// Middle 2
	nY += m_nTextRegionHeight;
	pDrawPort->AddTexture( m_nPosX, nY, nX, m_nPosY + m_nHeight - 7,
										m_rtMiddle2.U0, m_rtMiddle2.V0, m_rtMiddle2.U1, m_rtMiddle2.V1,
										0xFFFFFFFF );

	// Bottom
	nY = m_nPosY + m_nHeight - 7;
	pDrawPort->AddTexture( m_nPosX, nY, nX, m_nPosY + m_nHeight,
										m_rtBottom.U0, m_rtBottom.V0, m_rtBottom.U1, m_rtBottom.V1,
										0xFFFFFFFF );

	for ( i = 0; i < COMPOUND_ITEM_SLOT_COUNT; i++ )
	{
		// Slot item region
		pDrawPort->AddTexture( m_nPosX + m_rcItemSlot[i].Left, m_nPosY + m_rcItemSlot[i].Top,
											m_nPosX + m_rcItemSlot[i].Right, m_nPosY + m_rcItemSlot[i].Bottom,
											m_rtItemSlot.U0, m_rtItemSlot.V0, m_rtItemSlot.U1, m_rtItemSlot.V1,
											0xFFFFFFFF );
	}

	// Close button
	m_btnClose.Render();

	// OK button
	m_btnOK.Render();

	// Cancel button
	m_btnCancel.Render();

	// Render all elements
	pDrawPort->FlushRenderingQueue();

	// Item
	for( i = 0; i < COMPOUND_ITEM_SLOT_COUNT; i++ )
	{
		if (m_pIconSlot[i]->IsEmpty() == false)
		{
			m_pIconSlot[i]->Render(pDrawPort);
			pDrawPort->FlushBtnRenderingQueue( UBET_ITEM );
		}
	}

	// Text in 
	pDrawPort->PutTextEx( _S( 723, "힘의 상자" ), m_nPosX + COMPOUND_TITLE_TEXT_OFFSETX,			
										m_nPosY + COMPOUND_TITLE_TEXT_OFFSETY, 0xFFFFFFFF );

	nX = m_nPosX + COMPOUND_DESC_TEXT_SX;
	nY = m_nPosY + COMPOUND_DESC_TEXT_SY;
	for( int iDesc = 0; iDesc < m_nStringCount; iDesc++ )
	{
		pDrawPort->PutTextEx( m_strDesc[iDesc], nX , nY, 0xC5C5C5FF );
		nY += _pUIFontTexMgr->GetLineHeight();
	}

	// Flush all render text queue
	pDrawPort->EndTextEx();
}
Beispiel #28
0
FileEditor::FileEditor(shared_ptr<EntitiesEntity> entity, shared_ptr<EntitiesEntity> parent) :	EditorBase(portalObjectTypeFile, entity, parent),
																					m_title(OS_NEW HtmlTextBox()),
																					m_description(OS_NEW HtmlTextBox()),
																					m_enableBrowser(OS_NEW HtmlCheckBox()),
																					m_browser(OS_NEW HtmlFileBrowser())
{
	m_title->setID(_S("title"));
	m_title->setCss(_S("os_input_full"));
	m_title->setMaxLength(OS_CONTROLS_TITLE_MAXLENGTH);
	m_description->setID(_S("description"));
	m_description->setCss(_S("os_input_full"));
	m_description->setMaxLength(OS_CONTROLS_DESCRIPTION_MAXLENGTH);
	m_browser->setID(_S("browser"));
	m_browser->setCss(_S("os_input_full"));

	getTemplate()->addChildParam(m_title, _S("title"));
	getTemplate()->addChildParam(m_description, _S("description"));
	if(isRevision())
	{
		m_enableBrowser->setID(_S("enableBrowser"));
		m_enableBrowser->setCheck(false);
		m_enableBrowser->setAutoPostBack(true);

		getTemplate()->addChildParam(m_enableBrowser, _S("enable_browser"));
	}

	getTemplate()->addChildParam(m_browser, _S("browser"));
}
Beispiel #29
0
//------------------------------------------------------------------------------
// CUICompound::SetCompoundItem 
// Explain:  !!erro processing
// Date : 2005-01-12,Author: Lee Ki-hwan
//------------------------------------------------------------------------------
void CUICompound::SetCompoundItem ( int nSlotIndex )
{
	CUIManager* pUIManager = CUIManager::getSingleton();

	if (pUIManager->GetDragIcon() == NULL)
		return;

	// If this is wearing item
	if (pUIManager->GetDragIcon()->IsWearTab() == true)
	{
		pUIManager->GetChattingUI()->AddSysMessage( _S( 728, "착용한 아이템은 합성할 수 없습니다." ), SYSMSG_ERROR );	
		pUIManager->ResetHoldBtn();
		return;
	}

	CItems* pItems = pUIManager->GetDragIcon()->getItems();

	if (pItems == NULL)
		return;

	CItemData*	pItemData = pItems->ItemData;
	
	ResetCompoundItem();	// 버튼이 들려 있으면 삭제 하고
	
	// 아이템이 현재 사용중인지 확인 한다.
	for ( int i = 0; i < COMPOUND_ITEM_SLOT_COUNT; i++ )
	{
		if (m_pIconSlot[i]->IsEmpty() == false)
		{
			if (pItems->Item_UniIndex == m_pIconSlot[i]->getItems()->Item_UniIndex)
			{
				pUIManager->GetChattingUI()->AddSysMessage( _S( 556, "이미 사용중인 아이템 입니다." ), SYSMSG_ERROR );	
				pUIManager->ResetHoldBtn();
				return;
			}
		}
	}

	// Insert upgrade slot
	//if ( m_nCurItemCount < COMPOUND_ITEM_SLOT_COUNT )
//	{	
		// 비어 있는 슬롯을 찾는다.
	/*	if ( nSlotIndex == -1 )
		{
			for ( int i = 0; i < COMPOUND_ITEM_SLOT_COUNT; i++ )
			{
				if ( m_btnItemSlot[i].IsEmpty() )
				{
					nSlotIndex = i;
					break;
				}
			}
		}
	*/		
		// 해당 아이템의 위치를 찾아 준다.
		if( pItemData->GetType() == CItemData::ITEM_ETC && 
			pItemData->GetSubType() == CItemData::ITEM_ETC_REFINE &&
			pItemData->GetRefineType() == CItemData::REFINE_GENERAL )  // 일반제련석
		{
			nSlotIndex = ITEM_ARCANE_MATERIAL_UPGRADE;
		}
		else if( pItemData->GetType() == CItemData::ITEM_ETC && 
				pItemData->GetSubType() == CItemData::ITEM_ETC_SAMPLE ) // 시료
		{
			nSlotIndex = ITEM_ARCANE_MATERIAL_SAMPLE;
		}
		else if( pItemData->GetType() == CItemData::ITEM_ACCESSORY ) // 악세서리
		{
			nSlotIndex = ITEM_ARCANE_MATERIAL_ACCESSORY;
		}
		else
		{
			pUIManager->GetChattingUI()->AddSysMessage( _S( 729, "합성 할 수 있는 아이템이 아닙니다." ), SYSMSG_ERROR ); 
			pUIManager->ResetHoldBtn();
			return;
		}
		
		// 사용중이 아니라면 입력 해 준다.
		if (m_pIconSlot[nSlotIndex]->IsEmpty() == true)
		{
			m_nCurItemCount++;	
		}

		CItems* pClone = new CItems;
		memcpy(pClone, pItems, sizeof(CItems));
		pClone->Item_Sum = 1;

		m_pIconSlot[nSlotIndex]->setData(pClone, false);
//	}
	
	if ( m_nCurItemCount >= COMPOUND_ITEM_SLOT_COUNT )
	{
		m_btnOK.SetEnable ( TRUE );
	}
	else 
	{
		m_btnOK.SetEnable ( FALSE );
	}
	
	pUIManager->ResetHoldBtn();

	// Lock arrange of inventory
	pUIManager->GetInventory()->Lock( TRUE, TRUE, LOCK_COMPOUND );
}
Beispiel #30
0
String FileEditor::getTemplatePath()
{
	return getSkin()->getTemplatePath(_S("file_editor.xsl"));
}