Page 1 of 1

Signatures with non alpha chars

Posted: Sat Jun 14, 2014 3:42 am
by masterurat
Having trouble adding signatures to items when the sig has non alpha symbols in it IE: (<>/?:) etc

The string just cuts off once it hits the non alpha number, but it will do all the alpha chars up to that point.

This includes " " space.

IE I do:

Code: Select all

if (ID == 17652){
			int8* SigString = "Testing Sig";
			int8 EncodedString[25];
			EncodeStringSignature(SigString, EncodedString);
			PItem->setSignature(EncodedString);
		}
And the signature just appears in game as "Testing"

This goes for any non alpha symbol, not sure how to fix this.

Edit:

Im assuming the issue lies in here:

Code: Select all

for(uint8 currChar = 0; currChar < strlen((const char*)signature); ++currChar)
	{
		uint8 tempChar = 0;

		if		((signature[currChar] >= '0') && (signature[currChar] <= '9'))
			tempChar = signature[currChar]-'0'+1;
		else if ((signature[currChar] >= 'A') && (signature[currChar] <= 'Z'))
			tempChar = signature[currChar]-'A'+11;
		else if ((signature[currChar] >= 'a') && (signature[currChar] <= 'z'))
			tempChar = signature[currChar]-'a'+37;

		packBitsLE(encodedSignature,tempChar,6*currChar,6);
        	chars++;
	}
Inside of EncodeSignature

I assume this is the encoding process, and it only triggers for alphanumeric pieces.

But the game can support all characters, so what exactly is going on here? At the very least I want to encode the basic characters of ?,." and of course space.

The game SHOULD be able to handle such things, but I guess we aren't actually writing those symbols at all :x

Re: Signatures with non alpha chars

Posted: Sat Jun 14, 2014 4:21 am
by kjLotus
you can't. signatures use 6 bits for characters, which is why the encode/decode signature functions exist. that's just how the client handles the signature field in the packet

Re: Signatures with non alpha chars

Posted: Sat Jun 14, 2014 4:44 am
by masterurat
Then how come the client can handle characters like /<> etc?

Particularly it looks to me like Mezzotinting in delve content is literally using the signature of the item as a data storage, and it has the symbols /<>: in it.

Whats going on there?

Re: Signatures with non alpha chars

Posted: Sat Jun 14, 2014 5:50 am
by kjLotus
why don't you try it? delve content (or mezzotinting really) isn't implemented on DSP, so i've never personally looked at how the packet is structured. i think far more likely that the bytes are translated to text based on numerical codes than raw strings, though - how would you send "Type:A/Rank:15/RP:0" to clients of different languages? the server isn't supposed to translate stuff like that, that's what client side localization strings are for