Check the docs, http://colyseus.io/docs/api-room/#disconnect
As for tracking who created it you could simply keep a variable in the room class which, if not set, you set it to the client.sessionId of the joining client in onJoin. Of course if your variable is already set you know that this is the 2nd joining player and should not use its session id.
Ah yes, that would be much better. Thanks.
My first time trying to create a "real time" multiplayer game. I've only done turn-based, in multiplayer games, before so I'm not quite sure about all the correct ways to approach this.
thanks...I did that now i get this error:
email@example.com start c:\Projects\play
cross-env DEBUG=* ./node_modules/.bin/supervisor -i node_modules -- index.js
'cross-env' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! firstname.lastname@example.org start: cross-env DEBUG=* ./node_modules/.bin/supervisor -i node_modules -- index.js
npm ERR! Exit status 1
npm ERR! Failed at the email@example.com start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\owner\AppData\Roaming\npm-cache_logs\2018-05-13T21_05_40_940Z-debug.log
I have it narrowed down thou its something in my package.json file
Appreciate the help!!