Sleep in select() instead of usleep()
This allows us to handle commands from the client as soon as they
arrive, reducing the command-handling latency.
64 lines of code changed in 5 files:
Add separate loop to send updates to player
Now do_server() only needs to handle input from the clients. Periodic
updates are handled by send_player_updates().
55 lines of code changed in 3 files:
Stop double-subtracting player speed
Player speed is subtracted in do_server() when commands are processed
from the client. It is subtracted again in process_events(), because
players are just objects. This means that even when players are sitting
around, a command might not be processed immediately because the player
used up all their speed in process_events().
Player objects now process_object() at an effective speed of 1.0, as
long as they didn't consume all of their speed handling commands. This
allows the first command to always be processed immediately and reduces
latency.
11 lines of code changed in 2 files:
Remove extra call to handle_client()
0 lines of code changed in 1 file:
Remove unused writefds
3 lines of code changed in 1 file:
Refactor game loop
35 lines of code changed in 4 files:
Factor out code for 'goto' command
15 lines of code changed in 3 files:
Show correct drain message on death
3 lines of code changed in 3 files:
Disambiguate stat change messages
10 lines of code changed in 1 file:
Slow players down if they eat too much
18 lines of code changed in 1 file:
Add slow_living_by()
40 lines of code changed in 2 files:
Merge duplicate code
5 lines of code changed in 2 files:
Clarify warning
6 lines of code changed in 2 files:
Make warning more useful
7 lines of code changed in 1 file:
Move init_objects()
33 lines of code changed in 3 files:
Remove unused globals
0 lines of code changed in 1 file:
Refactor food apply method
Add MAX_FOOD. Factor common eating effects into eat_common(). Subject
dragons to cursed food effects. Update message sent to player when
eating too much food.
93 lines of code changed in 6 files:
Reset FLAG_CONFUSED
1 lines of code changed in 1 file:
Invert logic for clarity
8 lines of code changed in 1 file:
Clean up temporary files on exit
While here, document what is really going on in clean_tmp_files().
15 lines of code changed in 1 file:
Simplify MEMORY_DEBUG
Replace realloc() with a simple direct call to calloc() for each object
and avoid free list handling. This makes MEMORY_DEBUG more useful with
modern conveniences like -fsanitize=address.
While here update documentation for MEMORY_DEBUG.
23 lines of code changed in 3 files:
Check for object existence after running eventfunc
4 lines of code changed in 1 file:
Remove old weather parameters
0 lines of code changed in 1 file:
Improve handling of formula check to handle cauldron and tool differences.
39 lines of code changed in 3 files:
Add artifacts and formulae for black/white leather cloaks.
45 lines of code changed in 3 files:
Stop destroying items based only on die roll
Always look at the material type and resistances. Previously, immune
objects could still be destroyed by attacks; for example, ice storm
could cause an ice cube to unfreeze.
0 lines of code changed in 1 file:
Set FLAG_NO_PICK when weight is zero
Some parts of the code still only check for FLAG_NO_PICK. Fix this class
of bug by setting FLAG_NO_PICK automatically.
6 lines of code changed in 1 file:
Post-decrement food field
An item with one food left should not be removed immediately.
1 lines of code changed in 1 file:
Make objects in icecubes decay slower
12 lines of code changed in 1 file:
Refactor
40 lines of code changed in 1 file:
Fix build
3 lines of code changed in 2 files:
Deduplicate code
13 lines of code changed in 1 file:
Add login message for new characters with accounts
5 lines of code changed in 2 files:
Refactor
21 lines of code changed in 1 file:
Remove manual output socket buffer handling
Our manual buffer code doesn't handle partial writes. While logging in a
client, this sometimes causes the server to skip the tail of a partial
write, resulting in corrupt data being sent to the client.
Instead of handling this issue ourselves, grow the OS output socket
buffer to SOCKETBUFSIZE and disconnect the client if this buffer ever
gets filled, consistent with current behavior, only now it also works
during login.
32 lines of code changed in 6 files:
Avoid double-linking LIBS
1 lines of code changed in 1 file: