-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgameservers.install
126 lines (114 loc) · 3.29 KB
/
gameservers.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
<?php
/**
* Implements hook_schema().
*/
function gameservers_schema() {
$schema = array();
$schema['gameservers'] = array(
'description' => 'The base table for the gameserver entity.',
'fields' => array(
'id' => array(
'description' => 'Primary key of the gameserver entity.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'name' => array(
'description' => 'Gameserver name.',
'type' => 'varchar',
'length' => 128,
'not null' => FALSE,
),
'description' => array(
'description' => 'Gameserver description.',
'type' => 'text',
'size' => 'medium',
'not null' => TRUE,
),
'ip' => array(
'description' => 'Gameserver IP address.',
'type' => 'varchar',
'length' => 128,
),
'port' => array(
'description' => 'Gameserver query port.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'gametype' => array(
'description' => 'Gameserver type.',
'type' => 'varchar',
'length' => 128,
),
'players' => array(
'description' => 'Number of players on gameserver at last update.',
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
),
'uid' => array(
'description' => 'The {users}.uid that owns this gameserver; initially, this is the user that created it.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
'status' => array(
'description' => 'Boolean indicating whether the gameserver is published (visible to non-administrators).',
'type' => 'int',
'unsigned' => TRUE,
'default' => 1,
),
'created' => array(
'description' => 'The Unix timestamp when the gameserver was created.',
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
),
'changed' => array(
'description' => 'The Unix timestamp when the server was most recently saved.',
'type' => 'int',
'unsigned' => TRUE,
'default' => 0,
),
),
'indexes' => array(
'entity_changed' => array('changed'),
'entity_created' => array('created'),
'uid' => array('uid'),
),
'primary key' => array('id'),
);
return $schema;
}
/**
* Implements hook_requirements().
*/
function gameservers_requirements($phase) {
$requirements = array();
$t = get_t();
$lib_name = 'gameq';
if ($phase == 'runtime') {
$requirements['gameservers'] = array(
'title' => $t('Gameservers: GameQ library')
);
$library = libraries_detect($lib_name);
if ($library && !empty($library['installed'])) {
$requirements['gameservers']['value'] = $t('GameQ library is available.');
$requirements['gameservers']['severity'] = REQUIREMENT_OK;
}
else {
$requirements['gameservers']['description'] = $library['error message'];
$requirements['gameservers']['value'] = $t('GameQ library is not available.');
$requirements['gameservers']['severity'] = REQUIREMENT_ERROR;
}
}
return $requirements;
}
/**
* Implements hook_uninstall().
*/
function gameservers_uninstall() {
//variable_del('variable_name');
}