0.6.5 • Published 5 years ago

losand.pvp v0.6.5

Weekly downloads
4
License
MIT
Repository
github
Last release
5 years ago

losand.pvp

It's a usecase about ...

npm i losand.pvp

import server.js file

require("losand.pvp")(__dirname + '/public', 'index.html', port, ip);
//port and ip is opthional

Creat a public folder and make in a index.html

You use it tags

  <script src="https://cdn.jsdelivr.net/npm/losand@1.5.0/losand.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/dsand@0.6.5/dsand.min.js"></script>
  <script src="https://cdn.jsdelivr.net/npm/dsand@0.6.5/pvp.js"></script>
  <script>
    _($.role).draw({
      pvpCE (channel) {
        /* Anything do when connection Established
           Channel is WebRTC Data Channel 
        */
        $(channel).class("hear").on("message");
      },
      hear (e) {
        alert(e.data);
      }
    })
    PvP()()();
  </script>
node server.js

and access the two clients;

Usage on BrowserSide PvP function

PvP(
  // 1st Negotiation info
  {
  blockedUserList: [],
  gameRating: 1000,
  friendOnry: true
})(
  // 2nd Custom Origin
  "https://test.io/"
)(
  // 3rd STUN Address or TURNServer Authentication info Object
  "stun:l.google...",
  {
    url: "turn:...",
    credential: "...",
    username: ""
  }
)

// $.pvp get's WebRTC DataChannel Object
$.pvp.send("hello");
0.6.5

5 years ago

0.6.3

5 years ago

0.5.5

5 years ago

0.4.5

5 years ago

0.4.2

5 years ago

0.4.0

6 years ago

0.3.6

6 years ago

0.3.5

6 years ago

0.3.3

6 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.911

6 years ago

0.0.91

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.75

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.55

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.29

6 years ago

0.0.2

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.1

6 years ago