- if (!!target) //opponent is online
- {
- this.st.conn.send(JSON.stringify({code:"newgame",
- gameInfo:gameInfo, target:target, cid:c.id}));
- }
+ const tryNotifyOpponent = () => {
+ if (!!target) //opponent is online
+ {
+ this.st.conn.send(JSON.stringify({code:"newgame",
+ gameInfo:gameInfo, target:target, cid:c.id}));
+ }
+ };