Update to stats and trading fix.
This commit is contained in:
@@ -537,7 +537,7 @@ class TradeContainer extends React.Component {
|
|||||||
} else {
|
} else {
|
||||||
tradeObj = this.props.player.trade;
|
tradeObj = this.props.player.trade;
|
||||||
}
|
}
|
||||||
const cards = tradeObj.cards.split(' ').map(i => parseInt(i)),
|
const cards = tradeObj.cards? tradeObj.cards.split(' ').map(i => parseInt(i)) : [],
|
||||||
myCards = this.props.player.cards.filter(c => cards.includes(c.id)),
|
myCards = this.props.player.cards.filter(c => cards.includes(c.id)),
|
||||||
myCardsIds = myCards.map(c => c.id);
|
myCardsIds = myCards.map(c => c.id);
|
||||||
console.log(cards);
|
console.log(cards);
|
||||||
|
|||||||
@@ -62,6 +62,12 @@
|
|||||||
(string=? (crypt password (alist-ref 'salt user))
|
(string=? (crypt password (alist-ref 'salt user))
|
||||||
(alist-ref 'password user))))
|
(alist-ref 'password user))))
|
||||||
|
|
||||||
|
(define (unsecure-set-password username password)
|
||||||
|
(let ((salt (crypt-gensalt)))
|
||||||
|
(with-db (db)
|
||||||
|
(exec (sql db "update users set password=?, salt=? where username=?;")
|
||||||
|
(crypt password salt) salt username))))
|
||||||
|
|
||||||
(define (alist->string alist)
|
(define (alist->string alist)
|
||||||
(with-output-to-string (lambda () (write alist))))
|
(with-output-to-string (lambda () (write alist))))
|
||||||
|
|
||||||
|
|||||||
@@ -945,7 +945,7 @@
|
|||||||
(lambda (p1 p2)
|
(lambda (p1 p2)
|
||||||
(> (alist-ref 'emergency (player-stats p1))
|
(> (alist-ref 'emergency (player-stats p1))
|
||||||
(alist-ref 'emergency (player-stats p2))))))))
|
(alist-ref 'emergency (player-stats p2))))))))
|
||||||
(conc "Living on the edge: " (player-name p) " (" (alist-ref 'emergency (player-stats p)) ")"))))))
|
(conc "Living on the edge: " (player-name p) " ($" (alist-ref 'emergency (player-stats p)) ")"))))))
|
||||||
type: "end-of-game"))
|
type: "end-of-game"))
|
||||||
|
|
||||||
(define (create-ws-response player event misc)
|
(define (create-ws-response player event misc)
|
||||||
@@ -1299,7 +1299,7 @@
|
|||||||
(farming-round (+ amount (* amount (game-setting 'loan-interest game)))))
|
(farming-round (+ amount (* amount (game-setting 'loan-interest game)))))
|
||||||
(game-setting 'max-debt game))
|
(game-setting 'max-debt game))
|
||||||
;; emergency loan
|
;; emergency loan
|
||||||
(begin ((make-player-stat 'emergency amount) player)
|
(begin ((make-player-stat 'emergency (* amount 2)) player)
|
||||||
(safe-set! (player-cash player) (+ (player-cash player) amount))
|
(safe-set! (player-cash player) (+ (player-cash player) amount))
|
||||||
(safe-set! (player-display-cash player) (player-cash player))
|
(safe-set! (player-display-cash player) (player-cash player))
|
||||||
(safe-set! (player-debt player) (+ (player-debt player) (* amount 2))))
|
(safe-set! (player-debt player) (+ (player-debt player) (* amount 2))))
|
||||||
@@ -2437,3 +2437,21 @@
|
|||||||
;; TODO
|
;; TODO
|
||||||
;; make sure two players can't have the same name
|
;; make sure two players can't have the same name
|
||||||
;; "your turn to roll" showing up on mobile when on action screen
|
;; "your turn to roll" showing up on mobile when on action screen
|
||||||
|
|
||||||
|
;; bug on display for uncle berts farm
|
||||||
|
;; Error: (mailbox-send!) bad argument type - not a mailbox: "redhead91
|
||||||
|
|
||||||
|
;; Uncaught TypeError: Cannot read property 'toFixed' of undefined
|
||||||
|
;; at St (app.0f8d4f4543faaee5dff1.js:1377)
|
||||||
|
;; at app.0f8d4f4543faaee5dff1.js:1457
|
||||||
|
;; at Object.y [as dispatch] (vendors.bef6ac3591b4d9cb3c76.js:8936)
|
||||||
|
;; at app.0f8d4f4543faaee5dff1.js:1226
|
||||||
|
;; at eu (vendors.bef6ac3591b4d9cb3c76.js:12601)
|
||||||
|
;; at WebSocket.pt (app.0f8d4f4543faaee5dff1.js:1127)
|
||||||
|
|
||||||
|
;; Uncaught TypeError: Cannot read property 'krispy kreme' of undefined
|
||||||
|
;; at app.0f8d4f4543faaee5dff1.js:1461
|
||||||
|
;; at Object.y [as dispatch] (vendors.bef6ac3591b4d9cb3c76.js:8936)
|
||||||
|
;; at app.0f8d4f4543faaee5dff1.js:1226
|
||||||
|
;; at eu (vendors.bef6ac3591b4d9cb3c76.js:12601)
|
||||||
|
;; at WebSocket.pt (app.0f8d4f4543faaee5dff1.js:1127)
|
||||||
|
|||||||
Reference in New Issue
Block a user