llFrand returning the same result for all users of our product
needs info
F
Furbella Resident
We're using the folling routine to generate a random number for chat-channel to use, and storing it encrypted for other valid objects to communicate on. Unfortunately as of today, it is reporting the exact same number for most of our customers, resulting in the same encrypted code generated, and our customers are now experiencing chat throttling on their pets as a result. This really shouldnt be happening.
the routing we're using to generate the number is as follows:
integer rand(integer min, integer max)
{
return min + (integer)llFrand(max - min + 1);
}
Log In
Lucia Nightfire
Related to BUG-11444.
Curious which region this is occurring in.
Maestro Linden
needs info
Maestro Linden
Hi Furbella Resident, could you please add debug chat to your script to show the raw value returned by llFrand(), and report that value here?
Also, could you please post a script that demonstrates this issue? I see a variety of values returned in server 2024-03-18.8333615376 when I run this basic script containing your function:
integer rand(integer min, integer max)
{
return min + (integer)llFrand(max - min + 1);
}
default
{
touch_start(integer total_number)
{
llOwnerSay((string)rand(1, 10));
}
}
CrystalShard Foo
I've tried to recreate this issue and haven't been able to.
Your code seems fine. Have you made sure that your rand() function is indeed the one that keeps returning the same value? It's hard to tell without knowing the min/max values being passed to the function.
You've also mentioned that the value is being stored encrypted. What sort of mechanism are you using to store the value? Could it be that your encryption is messing with the value somehow?
If this really is a problem with llFrand() then please share the simulator version that you are getting these errors on.
F
Furbella Resident
CrystalShard Foo Hi there, sorry for the delay in replying, the min is 0 and max is 38, which we repeat 38 times to generate a random string of numbers and letters. the problem is that for many of our customers, it is returning the exact same result, reguardless of region or owner.
F
Furbella Resident
CrystalShard Foo We previously used the llGenerateKey() function, stripping the dashes from the key, but the same problem occurred, the same UUID was generated every single time after a while.