server.js 605 B

1234567891011121314151617181920212223242526272829
  1. var server = function(){
  2. this.name = null;
  3. this.sid = null;
  4. this.description = null;
  5. this.distance = null;
  6. this.uplink = null;
  7. this.events = {};
  8. this.setEvents = function(events){
  9. this.events = events;
  10. };
  11. this.introduce = function(newName, newSid, newDescription, newDistance, newUplink){
  12. this.name = newName;
  13. this.sid = newSid;
  14. this.description = newDescription;
  15. this.distance = newDistance;
  16. this.uplink = newUplink;
  17. };
  18. this.setDescription = function(description){
  19. this.description = description;
  20. this.events.doEvent('serverDesc', this);
  21. };
  22. }
  23. module.exports = server;