ebusiangamers
5th July 2015, 16:10
Hello,
I'm running a cracked server on CoDUO: the result is player GUIDs are all 0.
GUIDs serve a bunch in MySQL: easier to search due to its unicity.
So I decide to make this function.
mysql_get_guid(length)
{
/*
Notes from ebusiangamers:
- It is a number that indentify players. Each GUID generated must be unique.
- However, the player will have (50%)? chance that his GUID matches with another.
- You can change the amount of digits to your liking.
*/
if(!isDefined(length))
length = 7;
guid = 0; a = length - 1;
for(i = 0; i < length; i++)
{
digit[i] = randomInt(9);
while(digit[i] == 0)
digit[i] = randomInt(9);
guid += digit[i]*exp(10, a);
a--;
}
self.guid = guid;
return guid;
}
Tell me what you think.
I'm running a cracked server on CoDUO: the result is player GUIDs are all 0.
GUIDs serve a bunch in MySQL: easier to search due to its unicity.
So I decide to make this function.
mysql_get_guid(length)
{
/*
Notes from ebusiangamers:
- It is a number that indentify players. Each GUID generated must be unique.
- However, the player will have (50%)? chance that his GUID matches with another.
- You can change the amount of digits to your liking.
*/
if(!isDefined(length))
length = 7;
guid = 0; a = length - 1;
for(i = 0; i < length; i++)
{
digit[i] = randomInt(9);
while(digit[i] == 0)
digit[i] = randomInt(9);
guid += digit[i]*exp(10, a);
a--;
}
self.guid = guid;
return guid;
}
Tell me what you think.