Skip to content

Commit

Permalink
Merge branch 'dev' into db-test-update
Browse files Browse the repository at this point in the history
  • Loading branch information
LandonPatmore authored Apr 29, 2018
2 parents 05ff574 + 85f8f54 commit f874362
Show file tree
Hide file tree
Showing 18 changed files with 42,601 additions and 73 deletions.
42 changes: 38 additions & 4 deletions Database/Dictionary/src/main/resources/specialwords.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
WORD
OSWEGO
HOCKEY
LAKE
SHELDON
SNOW
COOPER
LAKE
LAKER
LAKERS
FUSION
BRIDGE
Expand All @@ -13,7 +13,6 @@ CULKIN
DBUS
HART
CALZONES
RUDYS
BARS
GEESE
WHITEOUT
Expand Down Expand Up @@ -52,4 +51,39 @@ LOOP
BASKETBALL
PALATES
ROKERTHON
TRACK
TRACK
WATERBURY
SHINEMAN
GOOSE
GOOSES
ONONDAGA
ONEIDA
TYLER
PENFIELD
LAKESIDE
PATHFINDER
LITTLEPAGE
LONIS
MORELAND
MACKIN
JOHNSON
WILBUR
PARK
MAHAR
LANIGAN
MARANO
GLIMMERGLASS
LAGOON
QUAD
ARTVILLE
COMPASS
WALKER
REGISTRAR
MIDTERM
MIDTERMS
FINAL
CTS
DEAN
POINT
RESLIFE
OPENMIC
20 changes: 8 additions & 12 deletions Server Backend/entities/GameManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ module.exports = (io) => {
for (let manager of this._playerManagers) {
if (manager.id === null) {
manager.createHandshakeWithClient(name, team, link, isAI, socket, {yellow: this._goldScore, green: this._greenScore})
this.emitGameEvent(`${manager.name} entered the game.`)
this.emitGameEvent(`${manager.name} entered the game.`, false)
this.updateFrontendData()
if (isAI) {
dg(`ai added to --> player manager ${manager.position}`, 'debug')
Expand Down Expand Up @@ -229,7 +229,7 @@ module.exports = (io) => {
frontend.sendEvent('removeAI', position)
}
manager.createHandshakeWithClient(name, team, link, isAI, socket, {yellow: this._goldScore, green: this._greenScore})
this.emitGameEvent(`${manager.name} entered the game.`)
this.emitGameEvent(`${manager.name} entered the game.`, false)
this.updateFrontendData()
dg(`client added to --> player manager ${manager.position}`, 'debug')
this._currentPlayers++
Expand Down Expand Up @@ -260,7 +260,7 @@ module.exports = (io) => {
dg('finding client to remove', 'debug')
for (let manager of this._playerManagers) {
if (manager.id === id) {
this.emitGameEvent(`${manager.name} left the game.`)
this.emitGameEvent(`${manager.name} left the game.`, false)
if (!manager.isAI) {
this._currentPlayers--
this.emitCurrentPlayerCount()
Expand Down Expand Up @@ -320,9 +320,7 @@ module.exports = (io) => {
return
}
manager.updateHand(manager.tiles)
io.emit('gameEvent', {
action: `${manager.name} swapped tiles`
})
this.emitGameEvent(`${manager.name} swapped tiles`, false)
this.updateTurn(manager, true)
}

Expand Down Expand Up @@ -367,7 +365,7 @@ module.exports = (io) => {
} else {
clearInterval(timer)
dg(`${manager.name}'s time has expired`, 'info')
this.emitGameEvent(`${manager.name}'s time has expired`)
this.emitGameEvent(`${manager.name}'s time has expired`, false)
this._swaps++
if (this.checkGameOver()) {
this.gameOver()
Expand All @@ -390,7 +388,7 @@ module.exports = (io) => {

gameOver() {
dg('all players have swapped tiles, game over', 'info')
this.emitGameEvent('game over!')
this.emitGameEvent('game over!', false)
for (let manager of this._playerManagers) {
if (manager.id !== null) {
manager.isTurn = false
Expand Down Expand Up @@ -434,7 +432,7 @@ module.exports = (io) => {
io.emit('newGameCountdown', {
timer: timeUntil
})
this.emitGameEvent(`New game starts in ${timeUntil}`)
this.emitGameEvent(`New game starts in ${timeUntil}`, false)
timeUntil--
} else {
clearInterval(timer)
Expand Down Expand Up @@ -583,9 +581,7 @@ module.exports = (io) => {
io.emit('newGame')
this.boardUpdate()
this.updateClientData()
io.emit('gameEvent', {
action: 'New game started'
})
this.emitGameEvent('New game started', false)
}

/**
Expand Down
3 changes: 2 additions & 1 deletion Server Backend/entities/PlayerManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ class PlayerManager {
break
case 'gameEvent':
this.socket.emit(event, {
action: data
action: data,
bonus: false
})
break
case 'boardUpdate':
Expand Down
18 changes: 15 additions & 3 deletions Server Backend/helpers/ResponseHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,21 @@ module.exports = (data, player, gm) => {
dg('sending out word played event', 'debug')
gm.boardUpdate()
dg('sending out game event event', 'debug')
let action = `${player.name} played ${data.data.map(w => w.word)} for ${score.totalScore} points`
let words = data.data.map(w => w.word)
let action = `${player.name} played ${words} for ${score.totalScore} points`
dg(action, 'info')
// TODO: Need to flag whether or not this is a bonus play or not @Landon
gm.emitGameEvent(action, false)
return true
const search = words.map(s => s).join(',')
db.dictionaryCheck(search).then(r => {
let bonus = false
for (let word of r) {
if (word.special) {
bonus = true
}
}
gm.emitGameEvent(action, bonus)
return true
}).catch(e => {
console.log(e)
})
}
2 changes: 1 addition & 1 deletion Server Backend/views/register.html
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ <h2>Register!</h2>

<script type="text/javascript">
$('document').ready(() => {
alert('Oswebble Tips:\n 1. Words may be played left-to-right or top-to-bottom.\n 2. To move a tile onto the board use the click and place method: "Click" the tile from your hand and then select the "Place" on the board you want to put the tile. \n 3. Each player will get three minutes for their turn. \n 4. Players have to exchange a tile or play a word on the board each turn. \n 5. Playing Oswego-themed words like "shineman", "lakers", "oswego", etc. (inlcuding proper nouns) will result in a bonus. \n 6. Playing a word over the gold ("DW") or green ("TW") tiles will result in a double or triple-word bonus. \n 7. Attempting to play profane words may result in your removal from the game. \n 8. Have Fun!');
alert('Oswebble Tips:\n 1. The first word MUST be played over the center tile.\n 2. Words must be played either left-to-right or top-to-bottom.\n 3. To move a tile onto the board: "Tap" the tile from your hand to select a tile and then "Tap" the board to place the tile. \n 4. Words need to be placed next to or joined with other words already placed on the board. \n 5. Once a word is placed on the board, press "DONE" to end your turn. \n 6. Points are awarded by adding up the number on the tiles that make up the placed word. \n 7. Each player will get one minute for their turn. \n 8. Players have to exchange a tile or play a word on the board each turn before the timer runs out or their turn will be skipped. \n 9. Playing Oswego-themed words like "shineman", "lakers", "oswego", etc. (inlcuding proper nouns) will result in a bonus. \n 10. Playing a word over the gold ("DW") or green ("TW") tiles will result in a double or triple-word bonus. \n 11. Attempting to play profane words may result in your removal from the game. \n 12. Have Fun!');
})
</script>

Expand Down
2 changes: 1 addition & 1 deletion Server Frontend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ allprojects {
apply plugin: "eclipse"
apply plugin: "idea"

version = '1.0'
version = '1.3-beta1'
ext {
appName = "my-gdx-game"
gdxVersion = '1.9.8'
Expand Down
Loading

0 comments on commit f874362

Please sign in to comment.