-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Include bomb plant and defuse events from game server to API calls.
Since these are game specific, we will not create public API calls for this.
- Loading branch information
1 parent
7f111ba
commit 72e205e
Showing
10 changed files
with
493 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
"use strict"; | ||
|
||
var dbm; | ||
var type; | ||
var seed; | ||
|
||
/** | ||
* We receive the dbmigrate dependency from dbmigrate initially. | ||
* This enables us to not have to rely on NODE_PATH. | ||
*/ | ||
exports.setup = function (options, seedLink) { | ||
dbm = options.dbmigrate; | ||
type = dbm.dataType; | ||
seed = seedLink; | ||
}; | ||
|
||
exports.up = function (db) { | ||
return db.createTable("match_bomb_plants", { | ||
id: { type: "int", primaryKey: true, autoIncrement: true, length: 11 }, | ||
match_id: { | ||
type: "int", | ||
foreignKey: { | ||
name: "match_id_bomb_plants_fk", | ||
table: "match", | ||
rules: { | ||
onDelete: "CASCADE", | ||
onUpdate: "RESTRICT" | ||
}, | ||
mapping: "id" | ||
}, | ||
length: 11, | ||
notNull: false | ||
}, | ||
map_id: { | ||
type: "int", | ||
foreignKey: { | ||
name: "map_id_bomb_plants_fk", | ||
table: "map_stats", | ||
rules: { | ||
onDelete: "CASCADE", | ||
onUpdate: "RESTRICT" | ||
}, | ||
mapping: "id" | ||
}, | ||
length: 11, | ||
notNull: false | ||
}, | ||
player_stats_id: { | ||
type: "int", | ||
foreignKey: { | ||
name: "player_stats_id_bomb_plants_fk", | ||
table: "player_stats", | ||
rules: { | ||
onDelete: "CASCADE", | ||
onUpdate: "RESTRICT" | ||
}, | ||
mapping: "id" | ||
}, | ||
length: 11, | ||
notNull: false | ||
}, | ||
round_number: { type: "int", length: 11, notNull: true }, | ||
round_time: { type: "int", length: 11, notNull: true }, | ||
site: { type: "string", length: 10, notNull: true }, | ||
defused: { type: "boolean", notNull: false }, | ||
bomb_time_remaining: { type: "int", length: 11, notNull: false } | ||
}); | ||
}; | ||
|
||
exports.down = function (db) { | ||
return db.dropTable("match_bomb_plants"); | ||
}; | ||
|
||
exports._meta = { | ||
version: 23 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
"use strict"; | ||
|
||
var dbm; | ||
var type; | ||
var seed; | ||
|
||
/** | ||
* We receive the dbmigrate dependency from dbmigrate initially. | ||
* This enables us to not have to rely on NODE_PATH. | ||
*/ | ||
exports.setup = function (options, seedLink) { | ||
dbm = options.dbmigrate; | ||
type = dbm.dataType; | ||
seed = seedLink; | ||
}; | ||
|
||
exports.up = function (db) { | ||
return db.createTable("match_bomb_plants", { | ||
id: { type: "int", primaryKey: true, autoIncrement: true, length: 11 }, | ||
match_id: { | ||
type: "int", | ||
foreignKey: { | ||
name: "match_id_bomb_plants_fk", | ||
table: "match", | ||
rules: { | ||
onDelete: "CASCADE", | ||
onUpdate: "RESTRICT" | ||
}, | ||
mapping: "id" | ||
}, | ||
length: 11, | ||
notNull: false | ||
}, | ||
map_id: { | ||
type: "int", | ||
foreignKey: { | ||
name: "map_id_bomb_plants_fk", | ||
table: "map_stats", | ||
rules: { | ||
onDelete: "CASCADE", | ||
onUpdate: "RESTRICT" | ||
}, | ||
mapping: "id" | ||
}, | ||
length: 11, | ||
notNull: false | ||
}, | ||
player_stats_id: { | ||
type: "int", | ||
foreignKey: { | ||
name: "player_stats_id_bomb_plants_fk", | ||
table: "player_stats", | ||
rules: { | ||
onDelete: "CASCADE", | ||
onUpdate: "RESTRICT" | ||
}, | ||
mapping: "id" | ||
}, | ||
length: 11, | ||
notNull: false | ||
}, | ||
round_number: { type: "int", length: 11, notNull: true }, | ||
round_time: { type: "int", length: 11, notNull: true }, | ||
site: { type: "string", length: 10, notNull: true }, | ||
defused: { type: "boolean", notNull: false } | ||
}); | ||
}; | ||
|
||
exports.down = function (db) { | ||
return db.dropTable("match_bomb_plants"); | ||
}; | ||
|
||
exports._meta = { | ||
version: 23 | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
"use strict"; | ||
|
||
var dbm; | ||
var type; | ||
var seed; | ||
|
||
/** | ||
* We receive the dbmigrate dependency from dbmigrate initially. | ||
* This enables us to not have to rely on NODE_PATH. | ||
*/ | ||
exports.setup = function (options, seedLink) { | ||
dbm = options.dbmigrate; | ||
type = dbm.dataType; | ||
seed = seedLink; | ||
}; | ||
|
||
exports.up = function (db) { | ||
return db.createTable("match_bomb_plants", { | ||
id: { type: "int", primaryKey: true, autoIncrement: true, length: 11 }, | ||
match_id: { | ||
type: "int", | ||
foreignKey: { | ||
name: "match_id_bomb_plants_fk", | ||
table: "match", | ||
rules: { | ||
onDelete: "CASCADE", | ||
onUpdate: "RESTRICT" | ||
}, | ||
mapping: "id" | ||
}, | ||
length: 11, | ||
notNull: false | ||
}, | ||
map_id: { | ||
type: "int", | ||
foreignKey: { | ||
name: "map_id_bomb_plants_fk", | ||
table: "map_stats", | ||
rules: { | ||
onDelete: "CASCADE", | ||
onUpdate: "RESTRICT" | ||
}, | ||
mapping: "id" | ||
}, | ||
length: 11, | ||
notNull: false | ||
}, | ||
player_stats_id: { | ||
type: "int", | ||
foreignKey: { | ||
name: "player_stats_id_bomb_plants_fk", | ||
table: "player_stats", | ||
rules: { | ||
onDelete: "CASCADE", | ||
onUpdate: "RESTRICT" | ||
}, | ||
mapping: "id" | ||
}, | ||
length: 11, | ||
notNull: false | ||
}, | ||
round_number: { type: "int", length: 11, notNull: true }, | ||
round_time: { type: "int", length: 11, notNull: true }, | ||
site: { type: "string", length: 10, notNull: true }, | ||
defused: { type: "boolean", notNull: false } | ||
}); | ||
}; | ||
|
||
exports.down = function (db) { | ||
return db.dropTable("match_bomb_plants"); | ||
}; | ||
|
||
exports._meta = { | ||
version: 23 | ||
}; |
Oops, something went wrong.