mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-14 12:01:12 +00:00
16 lines
No EOL
382 B
JavaScript
16 lines
No EOL
382 B
JavaScript
module.exports=inject;
|
|
|
|
function inject(serv,player)
|
|
{
|
|
player._writeOthers=function(packetName, packetFields) {
|
|
player.getOthers().forEach(function (otherPlayer) {
|
|
otherPlayer._client.write(packetName, packetFields);
|
|
});
|
|
};
|
|
|
|
player.getOthers = function() {
|
|
return serv.players.filter(function (otherPlayer) {
|
|
return otherPlayer != player
|
|
});
|
|
};
|
|
} |