1 #summary The Hedgewars URL scheme handler |
1 #summary The Hedgewars URL scheme handler |
2 |
2 |
3 = URL scheme handler = |
3 = URL scheme handler = |
4 |
4 |
5 == Overview == |
5 == Overview == |
6 `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. |
6 Hedgewars supports an URL scheme for Hedgewars servers and rooms. These are basically links which allow you to join a server (and optionally a room) by using a simple link. These are called “`hwplay` URLs” and can look like this: |
7 |
7 |
8 `hwplay` URLs are useful if you want to play on a server other than the official one. |
8 `hwplay://hedgewars.example.org` |
|
9 |
|
10 If your system is set-up to handle `hwplay` URLs, they will open Hedgewars and make it join the given server and room. |
|
11 |
|
12 Here's an example link, try it to see if `hwplay` URLs work for you: |
|
13 |
|
14 [hwplay://netserver.hedgewars.org] |
9 |
15 |
10 == Usage == |
16 == Usage == |
11 You can share a `hwplay` URL with other players so they join your server more easily. |
17 You can share a `hwplay` URL with other players so they join your server more easily. |
12 |
18 |
13 Since `hwplay` is an unofficial URL scheme, your browser and other software needs to learn first how to interpret these URLs. |
19 Your browser and other software needs to learn first how to deal with `hwplay`. |
14 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). |
20 The easiest way is to click on “Assign file types” in the Settings menu, Advanced tab, this should set it up automatically for you. |
|
21 |
|
22 If an application (like a browser) is confused about `hwplay`, point it to the Hedgewars program (`hedgewars.exe` on Windows, `hedgewars` on GNU/Linux and Mac OS). |
15 |
23 |
16 Hedgewars itself also can use a `hwplay` URL as a command-line argument. See [CommandLineOptions#Frontend] for more information. |
24 Hedgewars itself also can use a `hwplay` URL as a command-line argument. See [CommandLineOptions#Frontend] for more information. |
17 |
25 |
18 `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). |
26 `hwplay` URLs are of course optional, you can join any server from the main menu by selecting the network game, then “local network”, then by selecting a server from the list or entering its address directly after clicking on the “Connect to” button. |
19 |
27 |
20 == Creating `hwplay` URLs == |
28 == Creating `hwplay` URLs == |
21 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. |
29 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. You can copy it into the clipboard if you click on the “invite” button. |
22 |
30 |
23 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). |
31 Note the generated URL might only work in your LAN and not world wide, so please check the IP address. You can obtain your Internet IP address on http://myip.is/ (for example). |
24 |
32 |
25 Of course, you can also try to create the URLs from hand (see below). |
33 Of course, you can also try to create the URLs from hand (see below). |
26 |
34 |
27 == Syntax == |
35 == Syntax == |
28 The syntax of the “hwplay” URL scheme is: |
36 The syntax of the “hwplay” URL scheme is: |
41 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. |
49 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. |
42 |
50 |
43 == Examples == |
51 == Examples == |
44 Here are some example `hwplay` URLs: |
52 Here are some example `hwplay` URLs: |
45 |
53 |
46 * `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 |
54 * [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 |
47 * `hwplay://192.168.43.6:54321`: Points to the lobby on a LAN server with IP 192.168.42.6, port number 54321 |
55 * `hwplay://192.168.43.6:54321`: Points to the lobby on a LAN server with IP 192.168.42.6, port number 54321 |
48 * `hwplay://example.org?room=MyRoom`: Points to the room called “MyRoom” on the server “example.org” |
56 * `hwplay://example.org?room=MyRoom`: Points to the room called “MyRoom” on the server “example.org” |
49 * `hwplay://example.com:59000`: Points to the server “example.com”, port number 59000 |
57 * `hwplay://example.com:59000`: Points to the server “example.com”, port number 59000 |