- // I play in this game, so g.fen will be defined
- // NOTE: this is a fragile way to detect turn,
- // but since V isn't defined let's do that for now. (TODO:)
- //if (V.ParseFen(g.fen).turn == myColor)
- if (g.fen.match(" " + myColor + " ")) priority++;
+ myColor =
+ g.players[0].uid == this.st.user.id ||
+ g.players[0].sid == this.st.user.sid
+ ? "w"
+ : "b";
+ if (g.score == "*") {
+ priority++;
+ // I play in this game, so g.fen will be defined
+ // NOTE: this is a fragile way to detect turn,
+ // but since V isn't defined let's do that for now. (TODO:)
+ //if (V.ParseFen(g.fen).turn == myColor)
+ if (g.fen.match(" " + myColor + " ")) priority++;
+ }