diff options
author | Adam Frisby | 2007-05-31 19:02:28 +0000 |
---|---|---|
committer | Adam Frisby | 2007-05-31 19:02:28 +0000 |
commit | 931adbcc43cc894d707f5671afa30c2f3edce7c5 (patch) | |
tree | 584796581d0c42f3960d0e2300d01dd070df5ffd | |
parent | * Completed reading of inventory in Manager. (still needs to be hooked up via... (diff) | |
download | opensim-SC-931adbcc43cc894d707f5671afa30c2f3edce7c5.zip opensim-SC-931adbcc43cc894d707f5671afa30c2f3edce7c5.tar.gz opensim-SC-931adbcc43cc894d707f5671afa30c2f3edce7c5.tar.bz2 opensim-SC-931adbcc43cc894d707f5671afa30c2f3edce7c5.tar.xz |
* Added /trunk/share
* Imported SQL files to /share/sql
* Added a PHP function file to generate new users in /share/php
Diffstat (limited to '')
-rw-r--r-- | share/php/generateUserFunction.php | 46 | ||||
-rw-r--r-- | share/sql/mysql-agents.sql | 24 | ||||
-rw-r--r-- | share/sql/mysql-inventoryfolders.sql | 9 | ||||
-rw-r--r-- | share/sql/mysql-inventoryitems.sql | 14 | ||||
-rw-r--r-- | share/sql/mysql-logs.sql | 10 | ||||
-rw-r--r-- | share/sql/mysql-regions.sql | 29 | ||||
-rw-r--r-- | share/sql/mysql-users.sql | 34 |
7 files changed, 166 insertions, 0 deletions
diff --git a/share/php/generateUserFunction.php b/share/php/generateUserFunction.php new file mode 100644 index 0000000..52ebc9f --- /dev/null +++ b/share/php/generateUserFunction.php | |||
@@ -0,0 +1,46 @@ | |||
1 | <?php | ||
2 | // GenerateUser (v1.0) | ||
3 | // Creates a new user account, and returns it into an associative array. | ||
4 | // -- | ||
5 | // $firstname - The users firstname | ||
6 | // $lastname - The users lastname | ||
7 | // $password - the users password | ||
8 | // $home - the regionhandle of the users home location | ||
9 | // -- | ||
10 | function generateUser($firstname,$lastname,$password,$home) { | ||
11 | $user = array(); | ||
12 | $user['UUID'] = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', | ||
13 | mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), | ||
14 | mt_rand( 0, 0x0fff ) | 0x4000, | ||
15 | mt_rand( 0, 0x3fff ) | 0x8000, | ||
16 | mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) ); | ||
17 | $user['username'] = $firstname; | ||
18 | $user['lastname'] = $lastname; | ||
19 | |||
20 | $user['passwordSalt'] = md5(microtime() . mt_rand(0,0xffff)); | ||
21 | $user['passwordHash'] = md5(md5($password) . ":" . $user['passwordSalt']); | ||
22 | |||
23 | $user['homeRegion'] = $home; | ||
24 | $user['homeLocationX'] = 128; | ||
25 | $user['homeLocationY'] = 128; | ||
26 | $user['homeLocationZ'] = 128; | ||
27 | $user['homeLookAtX'] = 15; | ||
28 | $user['homeLookAtY'] = 15; | ||
29 | $user['homeLookAtZ'] = 15; | ||
30 | |||
31 | $user['created'] = time(); | ||
32 | $user['lastLogin'] = 0; | ||
33 | |||
34 | $user['userInventoryURI'] = "http://inventory.server.tld:8004/"; | ||
35 | $user['userAssetURI'] = "http://asset.server.tld:8003/"; | ||
36 | |||
37 | $user['profileCanDoMask'] = 0; | ||
38 | $user['profileWantDoMask'] = 0; | ||
39 | $user['profileAboutText'] = "I am a user."; | ||
40 | $user['profileFirstText'] = "Stuff."; | ||
41 | $user['profileImage'] = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', 0, 0, 0, 0, 0, 0, 0, 0 ); | ||
42 | $user['profileFirstImage'] = sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', 0, 0, 0, 0, 0, 0, 0, 0 ); | ||
43 | |||
44 | return $user; | ||
45 | } | ||
46 | ?> \ No newline at end of file | ||
diff --git a/share/sql/mysql-agents.sql b/share/sql/mysql-agents.sql new file mode 100644 index 0000000..8194ca9 --- /dev/null +++ b/share/sql/mysql-agents.sql | |||
@@ -0,0 +1,24 @@ | |||
1 | SET FOREIGN_KEY_CHECKS=0; | ||
2 | -- ---------------------------- | ||
3 | -- Table structure for agents | ||
4 | -- ---------------------------- | ||
5 | CREATE TABLE `agents` ( | ||
6 | `UUID` varchar(36) NOT NULL, | ||
7 | `sessionID` varchar(36) NOT NULL, | ||
8 | `secureSessionID` varchar(36) NOT NULL, | ||
9 | `agentIP` varchar(16) NOT NULL, | ||
10 | `agentPort` int(11) NOT NULL, | ||
11 | `agentOnline` tinyint(4) NOT NULL, | ||
12 | `loginTime` int(11) NOT NULL, | ||
13 | `logoutTime` int(11) NOT NULL, | ||
14 | `currentRegion` varchar(36) NOT NULL, | ||
15 | `currentHandle` bigint(20) unsigned NOT NULL, | ||
16 | `currentPos` varchar(64) NOT NULL, | ||
17 | PRIMARY KEY (`UUID`), | ||
18 | UNIQUE KEY `session` (`sessionID`), | ||
19 | UNIQUE KEY `ssession` (`secureSessionID`) | ||
20 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; | ||
21 | |||
22 | -- ---------------------------- | ||
23 | -- Records | ||
24 | -- ---------------------------- | ||
diff --git a/share/sql/mysql-inventoryfolders.sql b/share/sql/mysql-inventoryfolders.sql new file mode 100644 index 0000000..c30239e --- /dev/null +++ b/share/sql/mysql-inventoryfolders.sql | |||
@@ -0,0 +1,9 @@ | |||
1 | CREATE TABLE `inventoryfolders` ( | ||
2 | `folderID` varchar(36) NOT NULL default '', | ||
3 | `agentID` varchar(36) default NULL, | ||
4 | `parentFolderID` varchar(36) default NULL, | ||
5 | `folderName` varchar(64) default NULL, | ||
6 | PRIMARY KEY (`folderID`), | ||
7 | KEY `owner` (`agentID`), | ||
8 | KEY `parent` (`parentFolderID`) | ||
9 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
diff --git a/share/sql/mysql-inventoryitems.sql b/share/sql/mysql-inventoryitems.sql new file mode 100644 index 0000000..6e90005 --- /dev/null +++ b/share/sql/mysql-inventoryitems.sql | |||
@@ -0,0 +1,14 @@ | |||
1 | CREATE TABLE `inventoryitems` ( | ||
2 | `inventoryID` varchar(36) NOT NULL default '', | ||
3 | `assetID` varchar(36) default NULL, | ||
4 | `type` int(11) default NULL, | ||
5 | `parentFolderID` varchar(36) default NULL, | ||
6 | `avatarID` varchar(36) default NULL, | ||
7 | `inventoryName` varchar(64) default NULL, | ||
8 | `inventoryDescription` varchar(64) default NULL, | ||
9 | `inventoryNextPermissions` int(10) unsigned default NULL, | ||
10 | `inventoryCurrentPermissions` int(10) unsigned default NULL, | ||
11 | PRIMARY KEY (`inventoryID`), | ||
12 | KEY `owner` (`avatarID`), | ||
13 | KEY `folder` (`parentFolderID`) | ||
14 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; | ||
diff --git a/share/sql/mysql-logs.sql b/share/sql/mysql-logs.sql new file mode 100644 index 0000000..05c19e8 --- /dev/null +++ b/share/sql/mysql-logs.sql | |||
@@ -0,0 +1,10 @@ | |||
1 | CREATE TABLE `logs` ( | ||
2 | `logID` int(10) unsigned NOT NULL auto_increment, | ||
3 | `target` varchar(36) default NULL, | ||
4 | `server` varchar(64) default NULL, | ||
5 | `method` varchar(64) default NULL, | ||
6 | `arguments` varchar(255) default NULL, | ||
7 | `priority` int(11) default NULL, | ||
8 | `message` text, | ||
9 | PRIMARY KEY (`logID`) | ||
10 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 \ No newline at end of file | ||
diff --git a/share/sql/mysql-regions.sql b/share/sql/mysql-regions.sql new file mode 100644 index 0000000..4f98826 --- /dev/null +++ b/share/sql/mysql-regions.sql | |||
@@ -0,0 +1,29 @@ | |||
1 | CREATE TABLE `regions` ( | ||
2 | `uuid` varchar(36) NOT NULL, | ||
3 | `regionHandle` bigint(20) unsigned NOT NULL, | ||
4 | `regionName` varchar(32) default NULL, | ||
5 | `regionRecvKey` varchar(128) default NULL, | ||
6 | `regionSendKey` varchar(128) default NULL, | ||
7 | `regionSecret` varchar(128) default NULL, | ||
8 | `regionDataURI` varchar(255) default NULL, | ||
9 | `serverIP` varchar(16) default NULL, | ||
10 | `serverPort` int(10) unsigned default NULL, | ||
11 | `serverURI` varchar(255) default NULL, | ||
12 | `locX` int(10) unsigned default NULL, | ||
13 | `locY` int(10) unsigned default NULL, | ||
14 | `locZ` int(10) unsigned default NULL, | ||
15 | `eastOverrideHandle` bigint(20) unsigned default NULL, | ||
16 | `westOverrideHandle` bigint(20) unsigned default NULL, | ||
17 | `southOverrideHandle` bigint(20) unsigned default NULL, | ||
18 | `northOverrideHandle` bigint(20) unsigned default NULL, | ||
19 | `regionAssetURI` varchar(255) default NULL, | ||
20 | `regionAssetRecvKey` varchar(128) default NULL, | ||
21 | `regionAssetSendKey` varchar(128) default NULL, | ||
22 | `regionUserURI` varchar(255) default NULL, | ||
23 | `regionUserRecvKey` varchar(128) default NULL, | ||
24 | `regionUserSendKey` varchar(128) default NULL, `regionMapTexture` varchar(36) default NULL, | ||
25 | PRIMARY KEY (`uuid`), | ||
26 | KEY `regionName` (`regionName`), | ||
27 | KEY `regionHandle` (`regionHandle`), | ||
28 | KEY `overrideHandles` (`eastOverrideHandle`,`westOverrideHandle`,`southOverrideHandle`,`northOverrideHandle`) | ||
29 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED \ No newline at end of file | ||
diff --git a/share/sql/mysql-users.sql b/share/sql/mysql-users.sql new file mode 100644 index 0000000..5ce4d1c --- /dev/null +++ b/share/sql/mysql-users.sql | |||
@@ -0,0 +1,34 @@ | |||
1 | SET FOREIGN_KEY_CHECKS=0; | ||
2 | -- ---------------------------- | ||
3 | -- Table structure for users | ||
4 | -- ---------------------------- | ||
5 | CREATE TABLE `users` ( | ||
6 | `UUID` varchar(36) NOT NULL default '', | ||
7 | `username` varchar(32) NOT NULL, | ||
8 | `lastname` varchar(32) NOT NULL, | ||
9 | `passwordHash` varchar(32) NOT NULL, | ||
10 | `passwordSalt` varchar(32) NOT NULL, | ||
11 | `homeRegion` bigint(20) unsigned default NULL, | ||
12 | `homeLocationX` float default NULL, | ||
13 | `homeLocationY` float default NULL, | ||
14 | `homeLocationZ` float default NULL, | ||
15 | `homeLookAtX` float default NULL, | ||
16 | `homeLookAtY` float default NULL, | ||
17 | `homeLookAtZ` float default NULL, | ||
18 | `created` int(11) NOT NULL, | ||
19 | `lastLogin` int(11) NOT NULL, | ||
20 | `userInventoryURI` varchar(255) default NULL, | ||
21 | `userAssetURI` varchar(255) default NULL, | ||
22 | `profileCanDoMask` int(10) unsigned default NULL, | ||
23 | `profileWantDoMask` int(10) unsigned default NULL, | ||
24 | `profileAboutText` text, | ||
25 | `profileFirstText` text, | ||
26 | `profileImage` varchar(36) default NULL, | ||
27 | `profileFirstImage` varchar(36) default NULL, | ||
28 | PRIMARY KEY (`UUID`), | ||
29 | UNIQUE KEY `usernames` (`username`,`lastname`) | ||
30 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8; | ||
31 | |||
32 | -- ---------------------------- | ||
33 | -- Records | ||
34 | -- ---------------------------- | ||