|
| 1 | +# libwsjcppjson20client |
| 2 | + |
| 3 | + Automatically generated by wsjcpp-jsonrpc20. |
| 4 | + * Version: v0.0.4 |
| 5 | + * Date: 07 Oct 2020 |
| 6 | + |
| 7 | + Include script ```dist/libwsjcppjson20client.js``` |
| 8 | + Example connect: |
| 9 | +``` |
| 10 | +var client = new SomeClient(); |
| 11 | +client.bind('server', function(data) { console.log('server', data)}) |
| 12 | +client.bind('notify', function(data) { console.log('notify', data)}) |
| 13 | +client.bind('chat', function(data) { console.log('chat', data)}) |
| 14 | +client.bind('connected', function(data) { console.log('connected', data)}) |
| 15 | +client.bind('reconnecting', function(data) { console.log('reconnecting', data)}) |
| 16 | +client.bind('disconnected', function(data) { console.log('disconnected', data)}) |
| 17 | +client.bind('broken', function(data) { console.log('broken', data)}) |
| 18 | +client.bind('userdata', function(data) { console.log('userdata', data)}) |
| 19 | +client.bind('connected', function(data) { console.log('connected', data)}) |
| 20 | +// connect |
| 21 | +client.init({'baseUrl': 'ws://localhost:1234/'}) |
| 22 | +// disconnect |
| 23 | +client.deinit() |
| 24 | +``` |
| 25 | + |
| 26 | +<details> |
| 27 | +<summary>auth_login</summary> |
| 28 | + |
| 29 | +## auth_login |
| 30 | + |
| 31 | +Auth by login and password |
| 32 | + |
| 33 | +Access: unauthorized - **yes**, user - **no**, tester - **no**, admin - **no** |
| 34 | + |
| 35 | + #### Input params |
| 36 | + |
| 37 | + * login - string, required; User Login |
| 38 | + * password - string, required; User Password |
| 39 | + * client_app_name - string, optional; Client app name |
| 40 | + * client_app_version - string, optional; Client app version |
| 41 | + |
| 42 | + |
| 43 | + #### example call method |
| 44 | + |
| 45 | +``` |
| 46 | +client.auth_login({ |
| 47 | + "login": "", |
| 48 | + "password": "", |
| 49 | + "client_app_name": "", |
| 50 | + "client_app_version": "" |
| 51 | +}).done(function(r) { |
| 52 | + console.log('Success: ', r); |
| 53 | +}).fail(function(err) { |
| 54 | + console.error('Error:', err); |
| 55 | +}); |
| 56 | +``` |
| 57 | + |
| 58 | +</details> |
| 59 | + |
| 60 | +<details> |
| 61 | +<summary>auth_logoff</summary> |
| 62 | + |
| 63 | +## auth_logoff |
| 64 | + |
| 65 | +Logoff |
| 66 | + |
| 67 | +Access: unauthorized - **no**, user - **yes**, tester - **yes**, admin - **yes** |
| 68 | + |
| 69 | + #### Input params |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + #### example call method |
| 74 | + |
| 75 | +``` |
| 76 | +client.auth_logoff({ |
| 77 | +
|
| 78 | +}).done(function(r) { |
| 79 | + console.log('Success: ', r); |
| 80 | +}).fail(function(err) { |
| 81 | + console.error('Error:', err); |
| 82 | +}); |
| 83 | +``` |
| 84 | + |
| 85 | +</details> |
| 86 | + |
| 87 | +<details> |
| 88 | +<summary>auth_token</summary> |
| 89 | + |
| 90 | +## auth_token |
| 91 | + |
| 92 | +Auth by token |
| 93 | + |
| 94 | +Access: unauthorized - **yes**, user - **no**, tester - **no**, admin - **no** |
| 95 | + |
| 96 | + #### Input params |
| 97 | + |
| 98 | + * token - string, required; Token |
| 99 | + * client_app_name - string, optional; Client app name |
| 100 | + * client_app_version - string, optional; Client app version |
| 101 | + |
| 102 | + |
| 103 | + #### example call method |
| 104 | + |
| 105 | +``` |
| 106 | +client.auth_token({ |
| 107 | + "token": "", |
| 108 | + "client_app_name": "", |
| 109 | + "client_app_version": "" |
| 110 | +}).done(function(r) { |
| 111 | + console.log('Success: ', r); |
| 112 | +}).fail(function(err) { |
| 113 | + console.error('Error:', err); |
| 114 | +}); |
| 115 | +``` |
| 116 | + |
| 117 | +</details> |
| 118 | + |
| 119 | +<details> |
| 120 | +<summary>game_create</summary> |
| 121 | + |
| 122 | +## game_create |
| 123 | + |
| 124 | +Some example of description |
| 125 | + |
| 126 | +Access: unauthorized - **no**, user - **yes**, tester - **yes**, admin - **yes** |
| 127 | + |
| 128 | + #### Input params |
| 129 | + |
| 130 | + * uuid - string, required; object uuid |
| 131 | + * name - string, optional; Name of object |
| 132 | + * cost - integer, required; Name of object |
| 133 | + * age - integer, optional; Name of object |
| 134 | + * public - boolean, required; True if object is public |
| 135 | + * activated - boolean, optional; If object can handle |
| 136 | + * custom - json, optional; Some custom json |
| 137 | + |
| 138 | + |
| 139 | + #### example call method |
| 140 | + |
| 141 | +``` |
| 142 | +client.game_create({ |
| 143 | + "uuid": "", |
| 144 | + "name": "", |
| 145 | + "cost": 0, |
| 146 | + "age": 0, |
| 147 | + "public": "", |
| 148 | + "activated": "", |
| 149 | + "custom": "" |
| 150 | +}).done(function(r) { |
| 151 | + console.log('Success: ', r); |
| 152 | +}).fail(function(err) { |
| 153 | + console.error('Error:', err); |
| 154 | +}); |
| 155 | +``` |
| 156 | + |
| 157 | +</details> |
| 158 | + |
| 159 | +<details> |
| 160 | +<summary>server_api</summary> |
| 161 | + |
| 162 | +## server_api |
| 163 | + |
| 164 | +This method Will be return list of all handlers |
| 165 | + |
| 166 | +Access: unauthorized - **yes**, user - **yes**, tester - **yes**, admin - **yes** |
| 167 | + |
| 168 | + #### Input params |
| 169 | + |
| 170 | + |
| 171 | + |
| 172 | + #### example call method |
| 173 | + |
| 174 | +``` |
| 175 | +client.server_api({ |
| 176 | +
|
| 177 | +}).done(function(r) { |
| 178 | + console.log('Success: ', r); |
| 179 | +}).fail(function(err) { |
| 180 | + console.error('Error:', err); |
| 181 | +}); |
| 182 | +``` |
| 183 | + |
| 184 | +</details> |
| 185 | + |
0 commit comments