Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Rappelz > Rappelz Private Server
You last visited: Today at 23:14

  • Please register to post and access all features, it's quick, easy and FREE!

 

[INFO] Types of .opt files

Reply
 
Old   #1


 
elite*gold: 30
Join Date: May 2011
Posts: 4,795
Received Thanks: 3,179
[INFO] Types of .opt files

'evening,

Since I'm currently working on a little project, I was able to figure something out.
As far as I know we never had a real explanation for this and there are still people out which were wondering about this, so:

TypeKeyData
Slog.ip127.0.0.1
Sdb.auth.port1433
Nauth.version200701120

Which would be, as example:
S log.ip:127.0.0.1

Did you ever asked yourself what S, N or even T means?

Here's the answer to that question:
PrincessAurora needs those values to specify which type the data has (see header of the table).
In this case, 127.0.0.1, the IP-Address of the logserver, is a String.
The data of auth.version is a Number.

The rest of those data types:

S -> String, which obviously can hold words or sentences.
N -> Number, which is used for booleans (true or false, which is equal to 1 or 0) as well.
T -> Equal to N, except that its value is a short* instead of long*.
F -> It is used for reading float values, as example: 3.1415
V -> It is used to read vector values, as example: auth.some_vector:2.45;5.43;1.29 **.
Q -> It is used to read a quaternion, as example: auth.some_vector:2.45;5.43;1.29;2.65 **.

*The difference between a short and a long is just their capacity. Short (Int16) is able to hold a value between −32,768 and 32,767, whereas a long (Int32) can hold a value between −2,147,483,648 and 2,147,483,647.
**I'm not really sure for what vector and quaternion is used, but apparently you can use them in the .opt files.

For the people out there which do understand C++, here's the code which does get used for reading the .opt file:
Code:
bool XEnvStruct::LoadFromFile( const char * pszFileName, const char *pszMask )
{
	THREAD_SYNCRONIZE( &m_pImpl->csLock );
	bool bRtn = false;

	FILE *fp = fopen( pszFileName, "r" );

	if( !fp ) return false;

	char buf[1024];
	char *p;

	bRtn = true;

	while( !feof( fp ) )
	{
		if( !fgets( buf, 1024, fp ) ) break;

		p = strchr( &buf[2], ':' );

		if( !p ) {
			bRtn = false;
			break;
		}

		*p = '\0';
		p++;

		if( *p )
		{
			if( p[ strlen( p ) - 1 ] == '\n' ) p[ strlen( p ) - 1 ] = '\0';
		}

		char type  = buf[0];
		char *key  = &buf[2];
		char *data = p;

		if( !XStringUtil::WildCardCmp( pszMask, key, true ) ) continue;

		Vector v;
		Quaternion q;

		v.x = v.y = v.z = 0.0f;
		q.x = q.y = q.z = q.w = 0.0f;
		
		switch( type )
		{
		case 'S':	Set( key, data ); break;
		case 'F':	Set( key, (float)atof(data) ); break;
		case 'V':	sscanf( data, "%f;%f;%f", &v.x, &v.y, &v.z ); Set( key, v ); break;
		case 'Q':	sscanf( data, "%f;%f;%f;%f", &q.x, &q.y, &q.z, &q.w ); Set( key, q ); break;
		case 'N':	Set( key, atoi(data) ); break;
		case 'T':	Set( key, (short)atoi(data) ); break;
		}
	}

	fclose( fp );

	return bRtn;
}
I hope this helps you out somehow.

Xijezu



Xijezu is offline  
Thanks
12 Users
Old   #2
 
elite*gold: 0
Join Date: Oct 2011
Posts: 84
Received Thanks: 11
thank u

i was asking my self this question long time ago but didn't get an answer for it

now i got the answer so thank u again


pprfds is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
X7 Files Info
Does anyone know the description of the X7 files? Like what each file is about and what does it do. Since I want to make it so I can buy a perm hair....
0 Replies - S4 League
[ HELP / Info ] GM shape files
I wonder if anyone have GM shape files ? This is the GM image : http://img204.imageshack.us/img204/1012/gmhq.png
0 Replies - Metin2 PServer - Discussions / Questions
SOME INFO about .KOm files
File Extension KOM ( .KOM ) - Information link File Extension KOM ( .KOM ) - Information may you can find files extension information here......
8 Replies - Grand Chase
[INFO] To all those who will upload some files
If you are going to upload/release anything, better upload it to multiupload.com since some of the users encounters problems on your download links....
8 Replies - Grand Chase Hacks, Bots, Cheats & Exploits



All times are GMT +2. The time now is 23:14.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.