1
0
mirror of https://github.com/wbbaddons/Tims-Chat.git synced 2024-12-22 21:40:08 +00:00

Default color ist generated randomly now

This commit is contained in:
Tim Düsterhus 2012-02-16 18:21:33 +01:00
parent 7b81b91454
commit 4357ccf342

View File

@ -67,7 +67,7 @@ public static function readUserData($field) {
if ($data[WCF::getUser()->userID] === null) { if ($data[WCF::getUser()->userID] === null) {
switch ($field) { switch ($field) {
case 'color': case 'color':
$data[WCF::getUser()->userID] = array(1 => 0xFF0000, 2 => 0x00FF00); $data[WCF::getUser()->userID] = array(1 => self::getRandomNumber(), 2 => self::getRandomNumber() * 0xFFFF);
break; break;
} }
static::writeUserData(array($field => $data[WCF::getUser()->userID])); static::writeUserData(array($field => $data[WCF::getUser()->userID]));
@ -79,6 +79,16 @@ public static function readUserData($field) {
else return $data[WCF::getUser()->userID]; else return $data[WCF::getUser()->userID];
} }
/**
* Returns a random number.
*
* @return integer
*/
public static /* int */ getRandomNumber() {
return 4; // chosen by a fair dice roll
// guaranteed to be random
}
/** /**
* Writes user data * Writes user data
* *