-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmetaverse.install
executable file
·163 lines (158 loc) · 4.29 KB
/
metaverse.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
<?php
// $Id: $
/**
* @package metaverse
* @copyright Copyright (C) 2010 Paul Mitchum/Solo Mornington. All rights reserved.
* @license GPL
*/
/**
* @file
* Install file for metaverse module.
*
* Set up databse tables, mostly.
*/
/**
* Implementation of hook_install().
*/
function metaverse_install() {
// Create tables.
drupal_install_schema('metaverse');
/* drupal_set_message(st("Metaverse module settings are available under !link",
array( '!link' => l('Administer > Site configuration > Metaverse ', 'admin/settings/yourmodule/settings' ) )
));*/
}
/**
* Implementation of hook_uninstall().
*/
function metaverse_uninstall() {
// Remove tables.
drupal_uninstall_schema('metaverse');
// Remove variables.
//db_query("DELETE FROM {variable} WHERE name LIKE 'metaverse%%'");
}
/**
* Implementation of hook_schema().
*/
function metaverse_schema() {
$schema['metaverse_grids'] = array(
'description' => t('Grids out there in the metaverse'),
'fields' => array(
'grid_id' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => t('grid ID')
),
'nid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => t('The node that describes us.')
),
'vid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => t('The node revision that describes us.')
),
'grid_restricted' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => t('restrict access for this grid')
),
'grid_name' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => t('human-readable name')
),
'grid_nick' => array(
'type' => 'varchar',
'length' => 4,
'not null' => TRUE,
'default' => '',
'description' => t('human-readable very short nickname (like SL)')
),
'shard_name' => array(
'type' => 'varchar',
'length' => 36,
'not null' => TRUE,
'default' => '',
'description' => t('machine-readable grid name from x-secondlife-shard')
),
'grid_allowed_ips' => array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
'description' => t('valid IP addresses for this grid.')
)
),
'indexes' => array(
'shard_name' => array('shard_name'),
'shard_name_ips' => array('shard_name', 'grid_allowed_ips'),
),
'unique keys' => array(
'grid_id' => array('grid_id'),
),
'primary key' => array('grid_id')
);
$schema['metaverse_regions'] = array(
'description' => t('Any simulator'),
'fields' => array(
'region_id' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => t('simulator ID')
),
'grid_id' => array(
'type' => 'int',
'not null' => TRUE,
'description' => t('Grid where this region lives')
),
'nid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => t('The node that describes us.')
),
'vid' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => t('The node revision that describes us.')
),
'region_restricted' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => t('restrict access for this simulator')
),
'region_name' => array(
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
'description' => t('human-readable name')
),
'region_coords_x' => array(
'type' => 'int',
'not null' => FALSE,
'default' => 0,
'description' => t('grid coords for simulator')
),
'region_coords_y' => array(
'type' => 'int',
'not null' => FALSE,
'default' => 0,
'description' => t('grid coords for simulator')
),
),
'unique keys' => array(
'region_id' => array('region_id'),
),
'primary key' => array('region_id')
);
return $schema;
}