mmlib/mmat: replace some variables by literal constants
[mmondor.git] / mmsoftware / mystic_ships / README
CommitLineData
188ad89f 1$Id: README,v 1.3 2014/06/30 18:46:19 mmondor Exp $
1c9bfc20 2
f21437ba
MM
3
4TODO
5====
6
7SERVER
8
f21437ba
MM
9- Implement authentication credentials checking, limit same user to one
10 connection only
11- Limit connections per ip address in number and frequency
188ad89f 12- Implement and test using OpenSSL. Verify if the overhead
1c9bfc20 13 is negligeable enough to be worth keeping.
f21437ba
MM
14
15CLIENT
16
188ad89f 17- Perhaps use some OpenGL
f21437ba
MM
18
19
20NOTES
21=====
22
f21437ba
MM
23Since SDL_net does not provide non-blocking I/O (and it remains
24unclear if windows supports this properly), a decision was made to
25port to SDL an inter-thread messaging library I had done for use
26with POSIX threads, and to use multiple threads.
27
1c9bfc20 28One thread is used to send data to the server, another thread
f21437ba
MM
29to receive data form the server, yet another thread to deal with
30all user input events, and a main thread to receive all those events
31in an asynchroneous manner form the utility threads and run the
32main loop.
33
3404:21 <@lucca> one thread to send, one thread to receive, one thread to poll
35 for io events, and one thread to bring them all and in the darkness
36 bind them.
37
38:)
39
1c9bfc20
MM
40Ogg-vorbis is used for music, using SDL_mixer. Ship rotations
41are performed using SDL_gfx rotozoom.
f21437ba 42
188ad89f
MM
43zlib is used to compress the communication protocol, and an RC4
44variant is used to encrypt.
f21437ba
MM
45
46
47Threading limitations under win32
48=================================
49
50There seem to be bugs when using SDL with multiple threads under windows
51which I did not observe on unix systems. The docs specify that the main
52thread should perform the drawing, but it wasn't specified that another
53thread than the initial one would not be able to obtain all user input
54events on windows. Typed keys would not be received, for instance.
55
188ad89f
MM
56It then appears that most of the processing must be done in the
57main initial thread, while only networking related blocking functions,
58or CPU crunching tasks, can be delegated to slave threads.
f21437ba
MM
59
60
61Storing images and sound samples as part of the executable binary
62=================================================================
63
64I was able to include read-only (.rodata) and read-write (.data) into
65binaries directly from files using objcopy and linking them on NetBSD,
66Linux and cygwin-mingw. The SDL_image library, which I now successfully
67built for mingw, includes functions that can use RWops, and the SDL
68library allows to easily create RWops from memory buffers. Moreover, the
69SDL_mixer library also allows to do this to load sound samples. I should
70thus modify the makefiles and code to very easily use these features.
71
72The SDL_mixer library however does not allow by itself to do this easily
73with music files. However, thise generally being considerably larger,
74it should not be a problem and they can remain external.
75
f21437ba
MM
76
77Using a map
78===========
79
80We probably want to randomize the ship's positions on the map.
81Randomization in this respect could be done on a position in a
82circle of varied radius distance to the location of the actual
83ship. This would prevent clients from being able to exactly fire
84at the actual ship position using the map (which also would make
85cloaking useful against an unofficial client).
86