1 #summary The Hedgewars URL scheme handler |
1 #summary The Hedgewars URL scheme handler |
2 |
2 |
3 hwplay://ip:port?room=name |
3 == Overview == |
|
4 `hwplay` is an unofficial URL scheme for specifying a server and optionally a room. Hedgewars is able to interpret these URLs to automatically join the specified server and room. |
4 |
5 |
5 WIP |
6 `hwplay` URLs are useful if you want to play on a server other than the official one. |
|
7 |
|
8 == Usage == |
|
9 You can share a `hwplay` URL with other players so they join your server more easily. |
|
10 |
|
11 Since `hwplay` is an unofficial URL scheme, your browser and other software needs to learn first how to interpret these URLs. |
|
12 Applications might ask you which program to use with a `hwplay` URL. You have to point these to the Hedgewars program (`hedgewars.exe` on Windows, `hedgewars` on GNU/Linux and Mac OS). |
|
13 |
|
14 `hwplay` URLs are completely optional, you can of course join any server without a `hwplay` URL as long you know its hostname / IP address and port number (46631 by default). |
|
15 |
|
16 == Creating `hwplay` URLs == |
|
17 When you are about to start a server in Hedgewas (Main menu → Network game → Local network → Start server), Hedgewars will create a `hwplay` URL for you and copy it into the clipboard if you click on the “invite” button. |
|
18 |
|
19 Note the generated URL might only work in your LAN, so please check the IP address. You can obtain your Internet IP address on http://myip.is/ (for example). |
|
20 |
|
21 Of course, you can also try to create the URLs from hand (see below). |
|
22 |
|
23 == Syntax == |
|
24 The syntax of the “hwplay” URL scheme is: |
|
25 |
|
26 `hwplay://<HOST>[:<PORT NUMBER>[?room=<ROOM NAME>]]` |
|
27 |
|
28 Parts in square brackets are optional. |
|
29 Parts enclosed in less-then and greater-than signs are parameters, where |
|
30 |
|
31 * `<HOST>` is the IP address or host name of the server |
|
32 * `<PORT NUMBER>` stands for the TCP port number of the server |
|
33 * `<ROOM NAME>` is the name of a room in the server |
|
34 |
|
35 If the port number is omitted, Hedgewars assumes the default port 46631. |
|
36 If the room name is given, the user will automatically join this room. If it is not given, the user will start in the lobby of the server. |
|
37 |
|
38 == Examples == |
|
39 Here are some example `hwplay` URLs: |
|
40 |
|
41 * `hwplay://netserver.hedgewars.org`: Points to the lobby of the official server. This is the same as if you'd click on the “official server” button in the main menu |
|
42 * `hwplay://192.168.43.6:54321`: Points to the lobby on a LAN server with IP 192.168.42.6, port number 54321 |
|
43 * `hwplay://example.org?room=MyRoom`: Points to “MyRoom” on the server “example.org” |
|
44 * `hwplay://example.com:59000`: Points to the server “example.com”, port number 59000 |