Jump to content

Question on XPSave on silent


blackknight8653
Go to solution Solved by gaoesa,

Recommended Posts

I have a question with regards to XPSave on silent mod. I have been thinking about how XPSave works for silent mod. If I remembered correctly, after Evenbalance stopped supporting Wolfenstein:Enemy Territory, a new solution to solve the problem of etkey generation was introduced for silent mod. If I am not mistaken, silent mod uses its own key instead of etkey for XPSave which is used by mods such as jaymod and noquarter.

After doing a google search and also on this forums how the system works, I was unable to find much information (Sorry if there actually is information on this but I missed it.) except an old comment by hellreturn on http://www.moddb.com/mods/silent which states:

 

hellreturn Jul 6 2012, 4:54pm replied:

U don't need etkey. silEnT mod has in build mod based key for xp saving and other uses.

Punkbuster is not even supported by EB anymore, so i suggest you disable PB on your server.

 

And also in the silent mod wiki in this website:

userdb.db is a binary format file that contain all the required information about shrubbot users and also all saved XP if the server is set to save XP

 

Based on these two information which I found, it seems that unlike etkey which is client side, silent key seems to be server sided and is stored in userdb.db in the silent mod server filesystem. In the ET Directory, I only manage to find silent.dat which I thought was the silent key but when I delete it and enter the server, my XP is still saved and silent.dat is regenerated in the silent mod directory. In this case, silent.dat is not where the server reads the silent guid of a particular player to determine the XP and admin level of the player. If that is so, how does one backup their silent key which the silent guid is saved or start fresh without doing !resetmyxp when connected to the server. Is there any client side method similar to backing up the etkey and deleting the etkey from the etmain directory? Thank you. Appreciate it.

 

Edited by blackknight8653
Link to comment
Share on other sites

Did you also have an etkey? even though PB doesn't support ET anymore most mods are still compatible with ETkeys, as the post by hellreturn is just stating silent mod has its own method of generating "etkeys" and yes the data is stored in silent.dat (hence when you reinstall et backup silent.dat for your admin/xp). 

Link to comment
Share on other sites

Did you also have an etkey? even though PB doesn't support ET anymore most mods are still compatible with ETkeys, as the post by hellreturn is just stating silent mod has its own method of generating "etkeys" and yes the data is stored in silent.dat (hence when you reinstall et backup silent.dat for your admin/xp). 

 

That must be what I have missed. Sorry. I was just doing a quick test hence, did not delete my etkey beforehand. I thought there would not be an additional check added for etkey since there was already a silent key. Thank you Purple. I will go try it again.

 

I apologise as this may be off topic. I am curious how etkeys are being generated from website like etkey.org. Are the etkeys consist of different random numbers? I was unable to find a written documentation on how it works and whether the numbers generated are random or an encrypted version of the et guid which you can find from /cl_guid. How do websites like etkey.org or similar websites ensure that the etkey they generated are different from each other and are different at all times.

 

As for things like et guid (similar to silent guid), sorry if this sounds stupid but when I open etkey with notepad, they showed random numbers at first I thought they would be how the et guid are being read off directly but after doing some checks, they are actually different so I thought they might be some encryption involve. This question came up as I was thinking whether it is possible to easily display my own guid without launching Wolfenstein: Enemy Territory such as et guid, pb guid, etc just by reading some files.

 

I am not really good at programming as of now, I am a beginner at this point, and only am curious hence, learn a little on the Internet whenever I have free time. I apologise if some of these questions can be answered through reading source codes released by Splash Damage or other developers. I am still not experienced enough to understand all programming languages such as C++ yet. Thank you. Appreciate it.

 

Edit: I tried the method you said and deleted both etkey and silent.dat and it works. Thank you Purple for the help.

Edited by blackknight8653
Link to comment
Share on other sites

  • Management
  • Solution

The silent GUID is used for identification if there exists one. If there doesn't exist one, it is generated and stored to silent.dat. When the player gets a new silent GUID it is not yet recognized by the server. Then the server uses the PB GUID(etkey) if, there exists one, to search it's database for a match. If a match is found, the database record is linked with the new silent GUID. If there already was a silent GUID for that record, the change of silent GUID is written to the server log. This was made so that the transition from PB GUIDs would work the easiest way. It doesn't work the same if your PB GUID changes. The server database is made to keep both PB and silent GUIDs as individually unique. But players are identified by their silent GUIDs if there exists a record for it and the PB GUID is ignored in such case.

 

I don't remember the algorithm for generating the real etkeys, but it might have something related to time. So for that reason it is good to get the keys from etkey.org so that they don't clash. Silent keys are made of hashed UUIDs provided by the platform, which are supposed to be unique. These are hashed also before sending to the server so that they don't match the stored value in silent.dat.

 

For more information of the PB GUIDs, you might find some from the Luigi Auriemmas website. I don't really know where to find the real algorithm if it's not there anywhere. It might be somewhere embedded in some thread about the matter for example at splashdamage or splatterladder.

Link to comment
Share on other sites

The silent GUID is used for identification if there exists one. If there doesn't exist one, it is generated and stored to silent.dat. When the player gets a new silent GUID it is not yet recognized by the server. Then the server uses the PB GUID(etkey) if, there exists one, to search it's database for a match. If a match is found, the database record is linked with the new silent GUID. If there already was a silent GUID for that record, the change of silent GUID is written to the server log. This was made so that the transition from PB GUIDs would work the easiest way. It doesn't work the same if your PB GUID changes. The server database is made to keep both PB and silent GUIDs as individually unique. But players are identified by their silent GUIDs if there exists a record for it and the PB GUID is ignored in such case.

 

I don't remember the algorithm for generating the real etkeys, but it might have something related to time. So for that reason it is good to get the keys from etkey.org so that they don't clash. Silent keys are made of hashed UUIDs provided by the platform, which are supposed to be unique. These are hashed also before sending to the server so that they don't match the stored value in silent.dat.

 

For more information of the PB GUIDs, you might find some from the Luigi Auriemmas website. I don't really know where to find the real algorithm if it's not there anywhere. It might be somewhere embedded in some thread about the matter for example at splashdamage or splatterladder.

 

I see, Thank you for taking your time to explain this to me. Appreciate it :)

Link to comment
Share on other sites

I used to have a php script for it (ask schnoog? (dont remember his name)) that was given to me. anyways if you look inside the etlegacy source you can see how its done.

 

Go here https://github.com/etlegacy/etlegacy/blob/master/src/client/cl_main.c

 

and you'll see this 

/**
 * @brief Update cl_guid using #ETKEY_FILE
 */
static void CL_UpdateGUID(void)
{
	fileHandle_t f;
	int          len;

	len = FS_SV_FOpenFileRead(BASEGAME "/" ETKEY_FILE, &f);
	FS_FCloseFile(f);

	if (len < ETKEY_SIZE)
	{
		Com_Printf(S_COLOR_RED "ERROR: Could not set etkey (size mismatch).\n");
		Cvar_Set("cl_guid", "");
	}
	else
	{
		char *guid = Com_MD5FileETCompat(ETKEY_FILE);

		if (guid)
		{
			Cvar_Set("cl_guid", guid);
		}
	}
}

Here you can see how they check for a guid in the dir and if its not there generate one.

 

also information in the header where the size and name is defined

 https://github.com/etlegacy/etlegacy/blob/master/src/client/client.h

#define ETKEY_FILE "etkey"
#define ETKEY_SIZE 28

but where most of the real magic happens for the acutal generating part is in md5.c

https://github.com/etlegacy/etlegacy/blob/159c4169fdcd6a2f80317a796514eb7d43c1b3c5/src/qcommon/md5.c

 

and if i'm correct this is the main peice where the actual generating happens ofc there is more to it then just this but you should get the point.

char *Com_MD5FileETCompat(const char *filename)
{
	char key[19] = { 0 };
	char *buffer;
	int  len;

	len = FS_ReadFile(filename, ( void ** ) &buffer);
	if (buffer)
	{
		if (len >= 28)
		{
			int i;

			for (i = 0; i < 18; i++)
			{
				key[i] = buffer[i + 10];
			}

			FS_FreeFile(buffer);

			return CalculateGUID(key);
		}
	}
	return NULL;
}

and if you don't understand the language just backtrack it afaik next stop > CalcluateGUID() and so on :)

 

I know this isn't the exact answer you wanted (sorry) but it should give you a understanding of something :D

Edited by Purple
Link to comment
Share on other sites

I used to have a php script for it (ask schnoog? (dont remember his name)) that was given to me. anyways if you look inside the etlegacy source you can see how its done.

 

Go here https://github.com/etlegacy/etlegacy/blob/master/src/client/cl_main.c

 

and you'll see this 

/**
 * @brief Update cl_guid using #ETKEY_FILE
 */
static void CL_UpdateGUID(void)
{
	fileHandle_t f;
	int          len;

	len = FS_SV_FOpenFileRead(BASEGAME "/" ETKEY_FILE, &f);
	FS_FCloseFile(f);

	if (len < ETKEY_SIZE)
	{
		Com_Printf(S_COLOR_RED "ERROR: Could not set etkey (size mismatch).\n");
		Cvar_Set("cl_guid", "");
	}
	else
	{
		char *guid = Com_MD5FileETCompat(ETKEY_FILE);

		if (guid)
		{
			Cvar_Set("cl_guid", guid);
		}
	}
}

Here you can see how they check for a guid in the dir and if its not there generate one.

 

also information in the header where the size and name is defined

 https://github.com/etlegacy/etlegacy/blob/master/src/client/client.h

#define ETKEY_FILE "etkey"
#define ETKEY_SIZE 28

but where most of the real magic happens for the acutal generating part is in md5.c

https://github.com/etlegacy/etlegacy/blob/159c4169fdcd6a2f80317a796514eb7d43c1b3c5/src/qcommon/md5.c

 

and if i'm correct this is the main peice where the actual generating happens ofc there is more to it then just this but you should get the point.

char *Com_MD5FileETCompat(const char *filename)
{
	char key[19] = { 0 };
	char *buffer;
	int  len;

	len = FS_ReadFile(filename, ( void ** ) &buffer);
	if (buffer)
	{
		if (len >= 28)
		{
			int i;

			for (i = 0; i < 18; i++)
			{
				key[i] = buffer[i + 10];
			}

			FS_FreeFile(buffer);

			return CalculateGUID(key);
		}
	}
	return NULL;
}

and if you don't understand the language just backtrack it afaik next stop > CalcluateGUID() and so on :)

 

I know this isn't the exact answer you wanted (sorry) but it should give you a understanding of something :D

 

 

here is a open sourced one for php, be sure to read the readme so you can get a full understanding of how things work.

 

https://github.com/BulldogDrummond/etkey

 

Credits: bulldogDrummond

Sorry for the late reply. It seems that unlike your first post where I got notified about your reply. I did not receive an email informing me of your replies this time until I checked the post again. Thank you for your help. I will take a look at it :)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...