Advertisement
Slowstone72

MPP to MeowBin

Dec 20th, 2024
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JavaScript 1.03 KB | Software | 0 0
  1. /* Ancient code published for archival purposes. May or may not work or be relevant.
  2. Feel free to do whatever you want with this, if anything.
  3. Archive from 2017-10-07 - contents may be older. */
  4.  
  5. //new Client("ws://ourworldofpixels.com:1234");
  6.  
  7. client1 = new Client("ws://mpp.meowbin.com:8080");
  8. client1.start();
  9. client1.setChannel('lobby');
  10. client2 = new Client("ws://multiplayerpiano.com:8080");
  11. client2.start();
  12. client2.setChannel('lobby')
  13. c1send = function(message) {client1.sendArray([{m:"a", message: message}]);}
  14. c2send = function(message) {client2.sendArray([{m:"a", message: message}]);}
  15.  
  16. setInterval(function() {
  17. client1.sendArray([{ m: "userset", set: { name: 'MPP Meowbin to MPP'} }]);
  18. client2.sendArray([{ m: "userset", set: { name: 'MPP to MPP Meowbin'} }]);
  19. }, 2000);
  20.  
  21. client1.on("a", function(msg) {
  22. if(!msg.p._id==client1.getOwnParticipant()._id){
  23. c2send(msg.p.name + ': ' + msg.a);
  24. }
  25. });
  26.  
  27. client2.on("a", function(msg) {
  28. if(!msg.p._id==client2.getOwnParticipant()._id){
  29. c1send(msg.p.name + ': ' + msg.a);
  30. }
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement