You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
747 B

  1. define([
  2. 'js/system/events'
  3. ], function (
  4. events
  5. ) {
  6. return {
  7. type: 'social',
  8. customChannels: null,
  9. blockedPlayers: null,
  10. init: function (blueprint) {
  11. if (this.customChannels)
  12. events.emit('onGetCustomChatChannels', this.customChannels);
  13. if (blueprint.blockedPlayers)
  14. this.blockedList = blueprint.blockedList;
  15. if (blueprint.actions) {
  16. this.actions = blueprint.actions;
  17. events.emit('onGetSocialActions', this.actions);
  18. }
  19. },
  20. extend: function (blueprint) {
  21. if (blueprint.blockedPlayers)
  22. this.blockedPlayers = blueprint.blockedPlayers;
  23. },
  24. isPlayerBlocked: function (playerName) {
  25. if (!this.blockedPlayers)
  26. return false;
  27. return this.blockedPlayers.includes(playerName);
  28. }
  29. };
  30. });