mirror of
https://gitlab.com/Deukhoofd/BattleSim.git
synced 2025-10-27 18:00:03 +00:00
Added page with pokemon data on /tiers
This commit is contained in:
@@ -29,7 +29,7 @@ loggedin = false
|
||||
exports.middleware = -> (req, res, next) ->
|
||||
cookies = new Cookies( req, res )
|
||||
|
||||
return next() if req.path.match(/^\/css|^\/js|^\/fonts|^\/Sprites|^\/replays\/\b/)
|
||||
return next() if req.path.match(/^\/css|^\/js|^\/fonts|^\/Sprites|^\/tiers|^\/replays\/\b/)
|
||||
return next() if req.path.match(/^\/leaderboard/) # add some proper site authentication later instead
|
||||
|
||||
authenticate req, (body) ->
|
||||
|
||||
@@ -91,6 +91,17 @@ CLIENT_VERSION = assets.getVersion()
|
||||
else
|
||||
res.json(players: results)
|
||||
|
||||
app.get '/tiers', (req, res) ->
|
||||
formes = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].FormeData
|
||||
species = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].SpeciesData
|
||||
res.render('tiers.jade', formes: formes, species: species)
|
||||
|
||||
app.get '/tiers/json', (req, res) ->
|
||||
formes = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].FormeData
|
||||
species = generations.GenerationJSON[generations.DEFAULT_GENERATION.toUpperCase()].SpeciesData
|
||||
res.json(formes: formes)
|
||||
|
||||
|
||||
app.get '/pokeuse/json', (req, res) ->
|
||||
user= req.user
|
||||
res.json(400) if user.name != "Deukhoofd"
|
||||
@@ -124,24 +135,6 @@ CLIENT_VERSION = assets.getVersion()
|
||||
pkmn.percentage = (pkmn.occurence/totalpokemon) * 100
|
||||
return occurences
|
||||
|
||||
app.get '/pokeuse', (req, res) ->
|
||||
|
||||
|
||||
modifyUsers = ["Deukhoofd", "Simply"]
|
||||
app.get '/modify', (req, res) ->
|
||||
if req.user.name not in modifyUsers
|
||||
res.json(400)
|
||||
else
|
||||
res.render('modify.jade')
|
||||
|
||||
app.get '/modify/formes', (req, res) ->
|
||||
if req.user.name not in modifyUsers
|
||||
res.json(400)
|
||||
else
|
||||
FormeData = require("./in/data/data_formes.json")
|
||||
res.render('modify/formes.jade', data: FormeData)
|
||||
|
||||
|
||||
lobby = new Room("Lobby")
|
||||
server.rooms.push(lobby)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user