Debian Codegraph @

examples/network/tcp_connection/README.md

raw symbols SCIP
1 # TCP/IP communication in Castle Game Engine using Indy components
2
3 The examples here demonstrate a cross-platform communication using TCP/IP with a "classic" client and server approach. The _Castle Game Engine_ shows the windows and user interface.
4
5 ## Network Communication
6
7 The server and client may be on different computers naturally, just make sure to set the proper host name or IP address in the client so that it can reach the server. The default is `localhost` -- so it works when client and server are on a single computer.
8
9 The client and server may be on different systems. For example, server may be on _Android_, and one of the clients on _Windows_ or _Linux_. Or the other way around. We did test various combinations, see screenshots below. All combinations should work.
10
11 Remember to enable server access in the firewall, if you have one. Windows automatically asks the whether to allow connections for server, you have to _"Allow"_ them to be able to connect.
12
13 ## Compiling
14
15 * You need [Indy](https://www.indyproject.org/).
16
17 Indy is not distributed with _Castle Game Engine_.
18
19 FPC users: See https://castle-engine.io/manual_network.php#section_indy about installing Indy.
20
21 Delphi users: No need to do anything, Indy is part of Delphi.
22
23 * Compiling from Delphi, or using CGE editor with Delphi compiler:
24
25 Should work out-of-the-box. Indy is part of Delphi, there's no need to do any special setup.
26
27 * Compiling from Lazarus:
28
29 These examples depend on the `castle_indy` package. Make sure you compile the `packages/castle_indy.lpk` in Lazarus (it depends on Indy package).
30
31 * Compiling from CGE editor, with FPC compiler:
32
33 Edit the `client/CastleEngineManifest.xml` and `server/CastleEngineManifest.xml` files and replace the `your/path/to/Indy10` example there with actual path to Indy units on your system. It can be an absolute path (like `c:/indy/` or `/home/me/indy`) or relative path (like `../../indy/`).
34
35 ## Screenshots
36
37 ![2 Clients and 1 Server](server_and_2_clients.png)
38 ![Server on Windows](server_windows.png)
39 ![Client on Android](client_android.jpg)