javascript - Deprecated io.use() and io.get() with socket.io -
i'm writing game of tutorial :
and have problem deprecated socket.io.
i have read guide : http://socket.io/docs/migrating-from-0-9/
but don't know how can change it...
i have problem socket.set() , socket.get().
for example :
var idx = playerin.push(slot); socket.set('playerslot', idx-1);
or
socket.get('playerslot', function(err, idx){ var slot = playerin[idx]; socket.emit('serverplayerstatus', slot); });
how can change it?
thanks guys :)
btw error :
missing error handler on
socket
. typeerror: undefined not function @ socket. (/home/adelante/tutorial/app.js:87:16) @ socket.emit (events.js:107:17) @ socket.onevent (/home/adelante/tutorial/node_modules/socket.io/lib/socket.js:330:8) @ socket.onpacket (/home/adelante/tutorial/node_modules/socket.io/lib/socket.js:290:12) @ client.ondecoded (/home/adelante/tutorial/node_modules/socket.io/lib/client.js:193:14) @ decoder.emitter.emit (/home/adelante/tutorial/node_modules/socket.io/node_modules/socket.io-parser/node_modules/component-emitter/index.js:134:20) @ decoder.add (/home/adelante/tutorial/node_modules/socket.io/node_modules/socket.io-parser/index.js:247:12) @ client.ondata (/home/adelante/tutorial/node_modules/socket.io/lib/client.js:175:18) @ socket.emit (events.js:107:17) @ socket.onpacket (/home/adelante/tutorial/node_modules/socket.io/node_modules/engine.io/lib/socket.js:99:14)
Comments
Post a Comment