mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-14 07:00:01 -04:00
Merge branch 'master' into production
This commit is contained in:
commit
d07b087c7b
7 changed files with 32 additions and 8 deletions
|
@ -23,4 +23,4 @@ before_script:
|
|||
|
||||
script:
|
||||
- "./node_modules/jasmine-node/bin/jasmine-node test/server/ --coffee --captureExceptions"
|
||||
# - "./node_modules/karma/bin/karma start --browsers Firefox --single-run"
|
||||
- "./node_modules/karma/bin/karma start --browsers Firefox --single-run --reporters progress"
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
module.exports.thangNames = thangNames =
|
||||
'Ogre Munchkin F': [
|
||||
# Female
|
||||
'Alali'
|
||||
'Anabel'
|
||||
'Dosha'
|
||||
'Gurzunn'
|
||||
|
@ -25,6 +26,7 @@ module.exports.thangNames = thangNames =
|
|||
'Gert'
|
||||
'Godel'
|
||||
'Goreball'
|
||||
'Gordok'
|
||||
'Toremon'
|
||||
'Gort'
|
||||
'Kog'
|
||||
|
@ -32,8 +34,10 @@ module.exports.thangNames = thangNames =
|
|||
'Kratt'
|
||||
'Leerer'
|
||||
'Nerph'
|
||||
'Oogre'
|
||||
'Raack'
|
||||
'Ragtime'
|
||||
'Rexxar'
|
||||
'Skoggen'
|
||||
'Smerk'
|
||||
'Snortt'
|
||||
|
@ -48,6 +52,7 @@ module.exports.thangNames = thangNames =
|
|||
'Ogre Thrower': [
|
||||
# Female
|
||||
'Beebatha'
|
||||
'Dross'
|
||||
'Drumbaa'
|
||||
'Durnath'
|
||||
'Esha'
|
||||
|
@ -78,6 +83,7 @@ module.exports.thangNames = thangNames =
|
|||
]
|
||||
'Paladin': [
|
||||
# Female
|
||||
'Illumina'
|
||||
'Celadia'
|
||||
'Taric'
|
||||
'Vaelia'
|
||||
|
@ -136,6 +142,7 @@ module.exports.thangNames = thangNames =
|
|||
]
|
||||
'Cougar': [
|
||||
# Animal
|
||||
'Guenhwyvar'
|
||||
'Kitty'
|
||||
'Shasta'
|
||||
'Simbia'
|
||||
|
@ -159,6 +166,7 @@ module.exports.thangNames = thangNames =
|
|||
]
|
||||
'Horse': [
|
||||
# Animal
|
||||
'Abby'
|
||||
'Wildsilver'
|
||||
'Fleetfire'
|
||||
'Ed'
|
||||
|
@ -336,6 +344,7 @@ module.exports.thangNames = thangNames =
|
|||
# Male
|
||||
'Senick'
|
||||
'John'
|
||||
'Kyle'
|
||||
]
|
||||
'Forest Archer': [
|
||||
# Female
|
||||
|
@ -346,6 +355,7 @@ module.exports.thangNames = thangNames =
|
|||
'Raider': [
|
||||
# Female
|
||||
'Arryn'
|
||||
'Thrat'
|
||||
]
|
||||
'Goliath': [
|
||||
# Male
|
||||
|
@ -374,6 +384,8 @@ module.exports.thangNames = thangNames =
|
|||
]
|
||||
'Necromancer': [
|
||||
# Male
|
||||
'Krekai'
|
||||
'Kethum'
|
||||
'Morcelu'
|
||||
'Nalfar'
|
||||
'Drezhul'
|
||||
|
@ -383,6 +395,7 @@ module.exports.thangNames = thangNames =
|
|||
'Lilith'
|
||||
'Usara'
|
||||
'Veigar'
|
||||
'Voldemort'
|
||||
]
|
||||
'Archer F': [
|
||||
# Female
|
||||
|
@ -402,6 +415,7 @@ module.exports.thangNames = thangNames =
|
|||
'Ivy'
|
||||
'Jensen'
|
||||
'Katniss'
|
||||
'Katreena'
|
||||
'Keturah'
|
||||
'Kim'
|
||||
'Korra'
|
||||
|
@ -832,6 +846,7 @@ module.exports.thangNames = thangNames =
|
|||
'Clause'
|
||||
'Curie'
|
||||
'Fluvius'
|
||||
'Javin'
|
||||
'Kanada'
|
||||
'Omar'
|
||||
'Paracelsus'
|
||||
|
@ -892,6 +907,7 @@ module.exports.thangNames = thangNames =
|
|||
'Hardcastle'
|
||||
'Helena'
|
||||
'Isa'
|
||||
'Jan'
|
||||
'Jane'
|
||||
'Jarin'
|
||||
'Karp'
|
||||
|
@ -940,6 +956,7 @@ module.exports.thangNames = thangNames =
|
|||
'Ieyasu'
|
||||
'Izotokogawa'
|
||||
'Keitaro'
|
||||
'Miyoshi'
|
||||
'Nobunaga'
|
||||
'Yasuo'
|
||||
'Yi'
|
||||
|
|
|
@ -293,6 +293,7 @@
|
|||
tip_scrub_shortcut: "Use Ctrl+[ and Ctrl+] to rewind and fast-forward."
|
||||
tip_guide_exists: "Click the guide, inside game menu (at the top of the page), for useful info."
|
||||
tip_open_source: "CodeCombat is 100% open source!"
|
||||
tip_tell_friends: "Enjoying CodeCombat? Tell your friends about us!"
|
||||
tip_beta_launch: "CodeCombat launched its beta in October, 2013."
|
||||
tip_think_solution: "Think of the solution, not the problem."
|
||||
tip_theory_practice: "In theory, there is no difference between theory and practice. But in practice, there is. - Yogi Berra"
|
||||
|
|
|
@ -50,15 +50,15 @@ module.exports = nativeDescription: "한국어", englishDescription: "Korean", t
|
|||
play:
|
||||
play_as: "Play As " # Ladder page
|
||||
spectate: "관중모드" # Ladder page
|
||||
# players: "players" # Hover over a level on /play
|
||||
players: "플레이어" # Hover over a level on /play
|
||||
hours_played: "플레이한 시간" # Hover over a level on /play
|
||||
items: "아이템" # Tooltip on item shop button from /play
|
||||
# unlock: "Unlock" # For purchasing items and heroes
|
||||
unlock: "해제" # For purchasing items and heroes
|
||||
confirm: "확인"
|
||||
# owned: "Owned" # For items you own
|
||||
# locked: "Locked"
|
||||
# purchasable: "Purchasable" # For a hero you unlocked but haven't purchased
|
||||
# available: "Available"
|
||||
owned: "소지함" # For items you own
|
||||
locked: "잠김"
|
||||
purchasable: "구매 가능" # For a hero you unlocked but haven't purchased
|
||||
available: "가능"
|
||||
# skills_granted: "Skills Granted" # Property documentation details
|
||||
# heroes: "Heroes" # Tooltip on hero shop button from /play
|
||||
# achievements: "Achievements" # Tooltip on achievement list button from /play
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
strong.tip(data-i18n='play_level.tip_scrub_shortcut') Ctrl+[ and Ctrl+] rewind and fast-forward.
|
||||
strong.tip(data-i18n='play_level.tip_guide_exists') Click the guide, inside game menu (at the top of the page), for useful info.
|
||||
strong.tip(data-i18n='play_level.tip_open_source') CodeCombat is 100% open source!
|
||||
strong.tip(data-i18n='play_level.tip_tell_friends') Enjoying CodeCombat? Tell your friends about us!
|
||||
strong.tip(data-i18n='play_level.tip_beta_launch') CodeCombat launched its beta in October, 2013.
|
||||
strong.tip(data-i18n='play_level.tip_think_solution') Think of the solution, not the problem.
|
||||
strong.tip(data-i18n='play_level.tip_theory_practice') In theory there is no difference between theory and practice; in practice there is. - Yogi Berra
|
||||
|
|
|
@ -7,6 +7,7 @@ config = require '../../server_config'
|
|||
errors = require '../commons/errors'
|
||||
languages = require '../routes/languages'
|
||||
sendwithus = require '../sendwithus'
|
||||
log = require 'winston'
|
||||
|
||||
module.exports.setup = (app) ->
|
||||
authentication.serializeUser((user, done) -> done(null, user._id))
|
||||
|
@ -198,9 +199,10 @@ module.exports.loginUser = loginUser = (req, res, user, send=true, next=null) ->
|
|||
|
||||
module.exports.makeNewUser = makeNewUser = (req) ->
|
||||
user = new User({anonymous: true})
|
||||
user.set 'testGroupNumber', Math.floor(Math.random() * 256) # also in app/lib/auth
|
||||
user.set 'testGroupNumber', Math.floor(Math.random() * 256) # also in app/core/auth
|
||||
lang = languages.languageCodeFromAcceptedLanguages req.acceptedLanguages
|
||||
user.set 'preferredLanguage', lang if lang[...2] isnt 'en'
|
||||
user.set 'lastIP', req.connection.remoteAddress
|
||||
user.set 'chinaVersion', true if req.chinaVersion
|
||||
log.info "making new user #{user.get('_id')} with language #{user.get('preferredLanguage')} of #{req.acceptedLanguages} and chinaVersion #{req.chinaVersion} on #{if config.tokyo then 'Tokyo' else 'US'} server and lastIP #{req.connection.remoteAddress}."
|
||||
user
|
||||
|
|
|
@ -84,8 +84,11 @@ setupChinaRedirectMiddleware = (app) ->
|
|||
unless config.tokyo
|
||||
ip = req.headers['x-forwarded-for'] or req.connection.remoteAddress
|
||||
geo = geoip.lookup(ip)
|
||||
if speaksChinese or geo?.country is "CN"
|
||||
log.info("Should we redirect to Tokyo server? speaksChinese: #{speaksChinese}, acceptedLanguages: #{req.acceptedLanguages[0]}, ip: #{ip}, geo: #{geo} -- so redirecting? #{geo?.country is 'CN' and speaksChinese}")
|
||||
return geo?.country is "CN" and speaksChinese
|
||||
else
|
||||
log.info("We are on Tokyo server. speaksChinese: #{speaksChinese}, acceptedLanguages: #{req.acceptedLanguages[0]}")
|
||||
req.chinaVersion = true if speaksChinese
|
||||
return false # If the user is already redirected, don't redirect them!
|
||||
|
||||
|
|
Loading…
Reference in a new issue