mirror of
https://github.com/wassname/GarageServer.IO.git
synced 2026-07-24 12:50:31 +08:00
19 lines
452 B
JavaScript
19 lines
452 B
JavaScript
function GarageServer (io) {
|
|
this.io = io;
|
|
}
|
|
|
|
GarageServer.prototype.PlayerConnect = function (callback) {
|
|
this.io.sockets.on('connection', function (socket) {
|
|
callback(socket);
|
|
});
|
|
};
|
|
|
|
GarageServer.prototype.PlayerDisconnect = function (callback) {
|
|
this.io.sockets.on('connection', function (socket) {
|
|
callback(socket);
|
|
});
|
|
};
|
|
|
|
exports.createGameServer = function (io, options){
|
|
return new GarageServer(io);
|
|
}; |