[Lib] Dice Fix

09/11/2013 00:13 Mijago#16
Wenn du den Text kopierst werden Smiley's nicht mitkopiert
09/11/2013 00:43 vıo#17
Endlich isse's vollständig gefixxt, Danke dir vielmals :3
09/11/2013 01:49 cryfact#18
1. nicht wirklich ein fix gibt auch ein Grund:

es reicht völlig /dice -1 0 zu machen

keine Abfrage würde da greifen und er wird
durch 0 teilen weil du die einfachste
Mathematik Regel nicht beachtest -> Punkt vor strich.

2. ich hoffe mal das du nicht denkst das das die grenzen vom int sind

verbesser den code etwas und bedenke dabei das lediglich eine 0 den core zum Absturz bringt dabei ist es egal ob positiv od negativ
09/11/2013 01:51 .HC'iPwnage#19
Thanks given . Good Job
09/11/2013 02:27 Tyrar#20
PHP Code:
int number_ex(int a1int a2)
{
    
a1 &= 0x7fffffff;
    
a2 &= 0x7fffffff;

    
int v1 = (a1 a2 a2 a1);
    
int v2 = (a1 a2 a1 a2);

    return 
rand() % (v2 v1) + v1;

Ich bin der Meinung, dass diese Funktion ein wenig schöner ist :o
09/11/2013 11:29 MrLibya#21
Very Nice
But Also You Can Disable It From CMD :D
09/11/2013 12:20 .In¢redible´#22
Nice,Danke.
09/11/2013 12:41 Fearn#23
Danke iRemix! :)
09/11/2013 14:34 Zonni#24
Quote:
Originally Posted by MrLibya View Post
Very Nice
But Also You Can Disable It From CMD :D
yea, we know at now 3 commands :)
maybe exist another one? :)
09/11/2013 15:54 miguelmig#25
Quote:
Originally Posted by Zonni View Post
yea, we know at now 3 commands :)
maybe exist another one? :)
What do you mean by that?
09/11/2013 15:57 Computerfreek#26
Quote:
Originally Posted by miguelmig View Post
What do you mean by that?
He means that there are many commands which use the number_ex function and there are also some alias for the dice function which could be also used to crash a server.
The only permanent fix is to fix the number_ex function and not to forbid any function which uses it.
09/11/2013 17:34 xCPx#27
Naja ...
[Only registered and activated users can see links. Click Here To Register...]

Is ja nich so als gäbs das schon ewig...


bzw hatte es dann extra nochmal in kleinere Releases verlinkt:
[Only registered and activated users can see links. Click Here To Register...]
09/12/2013 08:53 .Alpha.#28
Code:
  int from2 = from;
  int to2 = to;

  if ( from > to )
  {
    to2 = from;
    from2 = to;
  }

  unsigned int div = to2 + 1 - from2;
  if (div==0)
	return 0;

  return from2 + thecore_random() % div;
done ...
09/12/2013 09:03 .Inya#29
Vielen dank :)