mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-13 03:21:03 +00:00
16 lines
No EOL
394 B
JavaScript
16 lines
No EOL
394 B
JavaScript
module.exports=inject;
|
|
|
|
function inject(serv)
|
|
{
|
|
serv.writeOthers=function(client,packetName, packetFields) {
|
|
serv.otherClients(client).forEach(function (otherClient) {
|
|
otherClient.write(packetName, packetFields);
|
|
});
|
|
};
|
|
|
|
serv.otherClients = function(client) {
|
|
return serv.playersConnected.filter(function (otherClient) {
|
|
return otherClient != client
|
|
});
|
|
};
|
|
} |