-
Notifications
You must be signed in to change notification settings - Fork 7
/
install.sql
375 lines (319 loc) · 13.3 KB
/
install.sql
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
-- phpMyAdmin SQL Dump
-- version 4.4.0-dev
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Jan 24, 2015 at 10:38 AM
-- Server version: 5.6.20-log
-- PHP Version: 5.6.3
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
-- --------------------------------------------------------
--
-- Table structure for table `player`
--
CREATE TABLE IF NOT EXISTS `player` (
`player_id` int(11) unsigned NOT NULL,
`username` varchar(20) COLLATE utf8_general_ci NOT NULL DEFAULT '',
`first_name` varchar(20) COLLATE utf8_general_ci DEFAULT NULL,
`last_name` varchar(20) COLLATE utf8_general_ci DEFAULT NULL,
`email` varchar(100) COLLATE utf8_general_ci NOT NULL DEFAULT '',
`timezone` varchar(255) COLLATE utf8_general_ci NOT NULL DEFAULT 'UTC',
`is_admin` tinyint(1) unsigned NOT NULL DEFAULT '0',
`password` varchar(32) COLLATE utf8_general_ci NOT NULL DEFAULT '',
`alt_pass` varchar(32) COLLATE utf8_general_ci NOT NULL DEFAULT '',
`ident` varchar(32) COLLATE utf8_general_ci DEFAULT NULL,
`token` varchar(32) COLLATE utf8_general_ci DEFAULT NULL,
`create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`is_approved` tinyint(1) unsigned NOT NULL DEFAULT '0'
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `wr_chat`
--
DROP TABLE IF EXISTS `wr_chat`;
CREATE TABLE IF NOT EXISTS `wr_chat` (
`chat_id` int(10) unsigned NOT NULL,
`message` text COLLATE utf8_general_ci NOT NULL,
`from_id` int(10) unsigned NOT NULL DEFAULT '0',
`game_id` int(10) unsigned NOT NULL DEFAULT '0',
`private` tinyint(1) unsigned NOT NULL DEFAULT '0',
`create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `wr_game`
--
DROP TABLE IF EXISTS `wr_game`;
CREATE TABLE IF NOT EXISTS `wr_game` (
`game_id` int(11) unsigned NOT NULL,
`host_id` int(11) unsigned NOT NULL DEFAULT '0',
`name` varchar(255) COLLATE utf8_general_ci NOT NULL DEFAULT '',
`password` varchar(32) COLLATE utf8_general_ci DEFAULT NULL,
`capacity` tinyint(1) unsigned NOT NULL DEFAULT '2',
`time_limit` tinyint(2) unsigned DEFAULT NULL,
`allow_kibitz` tinyint(1) NOT NULL DEFAULT '0',
`game_type` varchar(255) COLLATE utf8_general_ci DEFAULT 'Original',
`next_bonus` tinyint(3) unsigned NOT NULL DEFAULT '4',
`state` enum('Waiting','Placing','Playing','Finished') COLLATE utf8_general_ci NOT NULL DEFAULT 'Waiting',
`extra_info` text COLLATE utf8_general_ci,
`game_settings` text COLLATE utf8_general_ci DEFAULT NULL,
`paused` tinyint(1) NOT NULL DEFAULT '0',
`create_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modify_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `wr_game_land`
--
DROP TABLE IF EXISTS `wr_game_land`;
CREATE TABLE IF NOT EXISTS `wr_game_land` (
`game_id` int(10) unsigned NOT NULL DEFAULT '0',
`land_id` int(10) unsigned NOT NULL DEFAULT '0',
`player_id` int(10) unsigned NOT NULL DEFAULT '0',
`armies` smallint(5) unsigned NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `wr_game_log`
--
DROP TABLE IF EXISTS `wr_game_log`;
CREATE TABLE IF NOT EXISTS `wr_game_log` (
`game_id` int(11) unsigned NOT NULL DEFAULT '0',
`data` varchar(255) COLLATE utf8_general_ci DEFAULT NULL,
`create_date` datetime(6) NOT NULL DEFAULT '0000-00-00 00:00:00.000000',
`microsecond` decimal(18,8) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `wr_game_nudge`
--
DROP TABLE IF EXISTS `wr_game_nudge`;
CREATE TABLE IF NOT EXISTS `wr_game_nudge` (
`game_id` int(10) unsigned NOT NULL DEFAULT '0',
`player_id` int(10) unsigned NOT NULL DEFAULT '0',
`nudged` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `wr_game_player`
--
DROP TABLE IF EXISTS `wr_game_player`;
CREATE TABLE IF NOT EXISTS `wr_game_player` (
`game_id` int(11) unsigned NOT NULL DEFAULT '0',
`player_id` int(11) unsigned NOT NULL DEFAULT '0',
`order_num` tinyint(1) unsigned NOT NULL DEFAULT '0',
`color` varchar(10) COLLATE utf8_general_ci NOT NULL DEFAULT '',
`cards` varchar(255) COLLATE utf8_general_ci DEFAULT NULL,
`armies` smallint(5) unsigned NOT NULL DEFAULT '0',
`state` enum('Waiting','Trading','Placing','Attacking','Occupying','Fortifying','Resigned','Dead') COLLATE utf8_general_ci NOT NULL DEFAULT 'Waiting',
`get_card` tinyint(1) unsigned NOT NULL DEFAULT '0',
`forced` tinyint(1) unsigned NOT NULL DEFAULT '0',
`extra_info` text COLLATE utf8_general_ci,
`move_date` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `wr_message`
--
DROP TABLE IF EXISTS `wr_message`;
CREATE TABLE IF NOT EXISTS `wr_message` (
`message_id` int(10) unsigned NOT NULL,
`subject` varchar(255) COLLATE utf8_general_ci NOT NULL DEFAULT '',
`message` text COLLATE utf8_general_ci NOT NULL,
`create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `wr_message_glue`
--
DROP TABLE IF EXISTS `wr_message_glue`;
CREATE TABLE IF NOT EXISTS `wr_message_glue` (
`message_glue_id` int(10) unsigned NOT NULL,
`message_id` int(10) unsigned NOT NULL DEFAULT '0',
`from_id` int(10) unsigned NOT NULL DEFAULT '0',
`to_id` int(10) unsigned NOT NULL DEFAULT '0',
`send_date` datetime DEFAULT NULL,
`expire_date` datetime DEFAULT NULL,
`view_date` datetime DEFAULT NULL,
`create_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0'
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
-- --------------------------------------------------------
--
-- Table structure for table `wr_roll_log`
--
DROP TABLE IF EXISTS `wr_roll_log`;
CREATE TABLE IF NOT EXISTS `wr_roll_log` (
`id` int(11) unsigned NOT NULL,
`attack_1` tinyint(1) unsigned NOT NULL DEFAULT '0',
`attack_2` tinyint(1) unsigned DEFAULT NULL,
`attack_3` tinyint(1) unsigned DEFAULT NULL,
`defend_1` tinyint(1) unsigned NOT NULL DEFAULT '0',
`defend_2` tinyint(1) unsigned DEFAULT NULL
) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
-- --------------------------------------------------------
--
-- Table structure for table `wr_settings`
--
DROP TABLE IF EXISTS `wr_settings`;
CREATE TABLE IF NOT EXISTS `wr_settings` (
`setting` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '',
`value` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`notes` text CHARACTER SET utf8 COLLATE utf8_general_ci,
`sort` smallint(5) unsigned NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
--
-- Dumping data for table `wr_settings`
--
INSERT INTO `wr_settings` (`setting`, `value`, `notes`, `sort`) VALUES
('site_name', 'Your Site Name', 'The name of your site', 10),
('default_color', 'c_yellow_black.css', 'The default theme color for the game pages', 20),
('nav_links', '<!-- your links here -->', 'HTML code for your site''s navigation links to display on the game pages', 30),
('from_email', 'your.mail@yoursite.com', 'The email address used to send game emails', 40),
('to_email', 'you@yoursite.com', 'The email address to send admin notices to (comma separated)', 50),
('new_users', '1', '(1/0) Allow new users to register (0 = off)', 60),
('approve_users', '0', '(1/0) Require admin approval for new users (0 = off)', 70),
('confirm_email', '0', '(1/0) Require email confirmation for new users (0 = off)', 80),
('max_users', '0', 'Max users allowed to register (0 = off)', 90),
('default_pass', 'default', 'The password to use when resetting a user''s password', 100),
('expire_users', '45', 'Number of days until untouched user accounts are deleted (0 = off)', 110),
('save_games', '0', '(1/0) Save games in the ''games'' directory on the server (0 = off)', 120),
('expire_finished_games', '7', 'Number of days until finished games are deleted (0 = off)', 128),
('expire_games', '30', 'Number of days until untouched games are deleted (0 = off)', 130),
('nudge_flood_control', '24', 'Number of hours between nudges. (-1 = no nudging, 0 = no flood control)', 135),
('timezone', 'UTC', 'The timezone to use for dates (<a href="http://www.php.net/manual/en/timezones.php">List of Timezones</a>)', 140),
('long_date', 'M j, Y g:i a', 'The long format for dates (<a href="http://www.php.net/manual/en/function.date.php">Date Format Codes</a>)', 150),
('short_date', 'Y.m.d H:i', 'The short format for dates (<a href="http://www.php.net/manual/en/function.date.php">Date Format Codes</a>)', 160),
('debug_pass', '', 'The DEBUG password to use to set temporary DEBUG status for the script (empty = off)', 170),
('DB_error_log', '0', '(1/0) Log database errors to the ''logs'' directory on the server (0 = off)', 180),
('DB_error_email', '0', '(1/0) Email database errors to the admin email addresses given (0 = off)', 190);
-- --------------------------------------------------------
--
-- Table structure for table `wr_wr_player`
--
DROP TABLE IF EXISTS `wr_wr_player`;
CREATE TABLE IF NOT EXISTS `wr_wr_player` (
`player_id` int(11) unsigned NOT NULL DEFAULT '0',
`game_settings` text COLLATE utf8_general_ci DEFAULT NULL,
`is_admin` tinyint(1) unsigned NOT NULL DEFAULT '0',
`allow_email` tinyint(1) unsigned NOT NULL DEFAULT '1',
`color` varchar(25) COLLATE utf8_general_ci NOT NULL DEFAULT 'yellow_black',
`invite_opt_out` tinyint(1) NOT NULL DEFAULT '0',
`max_games` tinyint(3) unsigned NOT NULL DEFAULT '0',
`wins` smallint(5) unsigned NOT NULL DEFAULT '0',
`kills` smallint(5) unsigned NOT NULL DEFAULT '0',
`losses` smallint(5) unsigned NOT NULL DEFAULT '0',
`last_online` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' ON UPDATE CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
--
-- Indexes for dumped tables
--
--
-- Indexes for table `player`
--
ALTER TABLE `player`
ADD PRIMARY KEY (`player_id`),
ADD UNIQUE KEY `username` (`username`),
ADD UNIQUE KEY `email` (`email`);
--
-- Indexes for table `wr_chat`
--
ALTER TABLE `wr_chat`
ADD PRIMARY KEY (`chat_id`),
ADD KEY `game_id` (`game_id`),
ADD KEY `private` (`private`),
ADD KEY `from_id` (`from_id`);
--
-- Indexes for table `wr_game`
--
ALTER TABLE `wr_game`
ADD PRIMARY KEY (`game_id`);
--
-- Indexes for table `wr_game_land`
--
ALTER TABLE `wr_game_land`
ADD UNIQUE KEY `game_land` (`game_id`,`land_id`);
--
-- Indexes for table `wr_game_log`
--
ALTER TABLE `wr_game_log`
ADD UNIQUE KEY `game_id` (`game_id`,`create_date`,`microsecond`);
--
-- Indexes for table `wr_game_nudge`
--
ALTER TABLE `wr_game_nudge`
ADD UNIQUE KEY `game_player` (`game_id`,`player_id`);
--
-- Indexes for table `wr_game_player`
--
ALTER TABLE `wr_game_player`
ADD UNIQUE KEY `game_player` (`game_id`,`player_id`);
--
-- Indexes for table `wr_message`
--
ALTER TABLE `wr_message`
ADD PRIMARY KEY (`message_id`);
--
-- Indexes for table `wr_message_glue`
--
ALTER TABLE `wr_message_glue`
ADD PRIMARY KEY (`message_glue_id`),
ADD KEY `outbox` (`from_id`,`message_id`),
ADD KEY `created` (`create_date`),
ADD KEY `expire_date` (`expire_date`),
ADD KEY `inbox` (`to_id`,`from_id`,`send_date`,`deleted`),
ADD KEY `message_id` (`message_id`,`to_id`);
--
-- Indexes for table `wr_roll_log`
--
ALTER TABLE `wr_roll_log`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `wr_settings`
--
ALTER TABLE `wr_settings`
ADD UNIQUE KEY `setting` (`setting`),
ADD KEY `sort` (`sort`);
--
-- Indexes for table `wr_wr_player`
--
ALTER TABLE `wr_wr_player`
ADD UNIQUE KEY `id` (`player_id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `player`
--
ALTER TABLE `player`
MODIFY `player_id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `wr_chat`
--
ALTER TABLE `wr_chat`
MODIFY `chat_id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `wr_game`
--
ALTER TABLE `wr_game`
MODIFY `game_id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `wr_message`
--
ALTER TABLE `wr_message`
MODIFY `message_id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `wr_message_glue`
--
ALTER TABLE `wr_message_glue`
MODIFY `message_glue_id` int(10) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;
--
-- AUTO_INCREMENT for table `wr_roll_log`
--
ALTER TABLE `wr_roll_log`
MODIFY `id` int(11) unsigned NOT NULL AUTO_INCREMENT,AUTO_INCREMENT=1;