mezon-js-protobuf 1.10.39 → 1.10.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,43 +1,43 @@
1
- Mezon JavaScript Protobuf adapter
2
- ========================
3
-
4
- > Websocket adapter adding protocol buffer support to the [mezon-js](https://www.npmjs.com/package/mezon-js) client.
5
-
6
- [Mezon](https://github.com/mezon/mezon) is an open-source server designed to power modern games and apps. Features include user accounts, chat, social, matchmaker, realtime multiplayer, and much [more](https://mezon.vn).
7
-
8
-
9
- ## Getting Started
10
-
11
- 1. Import the adapter into your project:
12
-
13
- ```shell
14
- yarn add "mezon-js-protobuf"
15
- ```
16
-
17
- 2. Pass the Protobuf adapter to build the socket object.
18
-
19
- ```js
20
- import {Client} from "mezon-js";
21
- import {WebSocketAdapterPb} from "mezon-js-protobuf"
22
-
23
- const useSSL = false; // Enable if server is run with an SSL certificate.
24
- const client = new Client("defaultkey", "127.0.0.1", 7350, useSSL);
25
-
26
- const trace = false;
27
- const socket = client.createSocket(useSSL, trace, new WebSocketAdapterPb());
28
- ```
29
-
30
- 3. Use the WebSocket:
31
-
32
- ```js
33
- socket.ondisconnect = (evt) => {
34
- console.info("Disconnected", evt);
35
- };
36
-
37
- const session = await socket.connect(session);
38
- // Socket is open.
39
- ```
40
-
41
- ### License
42
-
43
- This project is licensed under the [Apache-2 License](https://github.com/nccasia/mezon-js/blob/master/LICENSE).
1
+ Mezon JavaScript Protobuf adapter
2
+ ========================
3
+
4
+ > Websocket adapter adding protocol buffer support to the [mezon-js](https://www.npmjs.com/package/mezon-js) client.
5
+
6
+ [Mezon](https://github.com/mezon/mezon) is an open-source server designed to power modern games and apps. Features include user accounts, chat, social, matchmaker, realtime multiplayer, and much [more](https://mezon.vn).
7
+
8
+
9
+ ## Getting Started
10
+
11
+ 1. Import the adapter into your project:
12
+
13
+ ```shell
14
+ yarn add "mezon-js-protobuf"
15
+ ```
16
+
17
+ 2. Pass the Protobuf adapter to build the socket object.
18
+
19
+ ```js
20
+ import {Client} from "mezon-js";
21
+ import {WebSocketAdapter} from "mezon-js-protobuf"
22
+
23
+ const useSSL = false; // Enable if server is run with an SSL certificate.
24
+ const client = new Client("defaultkey", "127.0.0.1", 7350, useSSL);
25
+
26
+ const trace = false;
27
+ const socket = client.createSocket(useSSL, trace, new WebSocketAdapter());
28
+ ```
29
+
30
+ 3. Use the WebSocket:
31
+
32
+ ```js
33
+ socket.ondisconnect = (evt) => {
34
+ console.info("Disconnected", evt);
35
+ };
36
+
37
+ const session = await socket.connect(session);
38
+ // Socket is open.
39
+ ```
40
+
41
+ ### License
42
+
43
+ This project is licensed under the [Apache-2 License](https://github.com/nccasia/mezon-js/blob/master/LICENSE).