Commit Graph
4195 Commits
Author SHA1 Message Date
aurhat 07d8d7657a Remove attack animation of clients during grenade activation 2017-10-09 20:09:42 +02:00
aurhat 323d8e8dd4 Fix rising of fly spectator 2017-09-19 22:41:53 +02:00
aurhat eec68e3253 Fix eyeheight during 3rd-person spectating
During 3rd-person spectating eyeheight of player1 was decreased sometimes
from "above head" of spectated player to his eyeheight.
2017-09-19 22:15:57 +02:00
aurhat a8a7987b8f Disable AR crosshair increasing during spectating
Because shots in a row are calculated only for local player.
2017-09-11 23:49:31 +02:00
aurhat 803517e2ef Improve maps menus
Map message moved on the right.
2017-09-04 22:49:01 +02:00
ac-stef 2220bbc5e2 font rendering optimisations 2017-08-05 10:49:10 +02:00
ac-stef db2607cabb fix embedded scores in screenshots
embed game description and player scores in png and jpg comments

update enet.lib
2017-07-20 16:07:42 +02:00
ac-stef 58ff110908 fix remip for some border cases in editing
some cases need a little more area remipped - and in edit mode, we don't
need to be stingy
2017-07-19 21:00:27 +02:00
ac-stef 00ba55ecac fix singleplayer hitsounds
(for hitsound 1)
2017-07-19 18:22:11 +02:00
ac-stef 8bb71ee839 fix direction for moving entities by scrollwheel
the same mousewheel direction now always moves an entity away from or
towards the player

  entproperty

    if 100 is added to the attribute index parameter, the sign of the
    increment value is changed

  editaxis

    returns a value for the main axis of player orientation (X:11, Y:12,
    Z:13) and adds 100 if the player is looking in the negative
    direction of the axis

DOCREF entproperty editaxis
2017-07-15 17:27:55 +02:00
ac-stef 59c3d1756d add option to grey out menu items
greyed out menu items are a) grey and b) can't be operated

  menuitemgreyedout 0|1

    menu items added after this command are greyed out (1) or not (0)

DOCREF menuitemgreyedout
2017-07-09 11:30:29 +02:00
ac-stef cb51e9f422 untangle entity rendering
fix unbatched model roll
2017-06-27 15:15:25 +02:00
ac-stef 3a320de948 cleanup cpistol 2017-06-27 15:15:25 +02:00
ac-stef 1fe478aae4 cleanup protocol
...and get master to compile again

DOCREF hudextras mapstats_hud nextGameMode
2017-06-27 15:15:25 +02:00
aurhatandac-stef 3728773ec0 Remove akimboautoswitch
The problem is, that some players (especially SMG users) got on purpose
akimbo with intention to not use it, only in order to others don't get it.
Such behaviour is directed "piggishly" against other players and
impoverish the game/gameplay.
Now, if people don't want to use some akimbo, they should just to not
get it, for example jump over it.

DOCREF akimboautoswitch
2017-06-27 15:15:25 +02:00
aurhatandac-stef 69d8304315 Fix akimbo damage 2017-06-27 15:15:25 +02:00
ac-stef 2fa895ae90 use fov and roll values of remote player during spectating
spectfovremote 0|1
    '1' uses fov and scopefov of the spectated player, '0' uses spectfov
    and the local scopefov, default is '0'

  maxrollremote sets the maximum roll to be shown during spectating

DOCREF spectfovremote
2017-06-27 15:15:25 +02:00
ac-stef 3549310e42 better quantisation of position and velocity vectors 2017-06-27 15:15:25 +02:00
ac-stef 9231b9f0aa actually zoom the scope while spectating
to show off the new highres pos angles :)
2017-06-27 15:15:25 +02:00
ac-stef 0b44cf1c9c reduce compact pos packet size by two more bit 2017-06-27 15:15:25 +02:00
ac-stef 94d0203bc6 cleanup pos packets
* remove roll
* optimise for size
* new protocol data type: unsigned integer with known size
* highres yaw encoding
* double resolution for pitch angles -30°..30°
* half resolution for pitch angles -90°..-30° and 30°..90°
* proper rounding for pitch and yaw values
* same resolution for yaw and pitch for both pos packet types
* restore transmission of the velocity vector
2017-06-27 15:15:24 +02:00
ac-stef 7cddb6c7c6 add debug logging to demo recording
fix server hanging after 5th demo
fix incomplete demo slot cleanup
fix demo file size reporting (enddemorecord can't do it accurately, because
  the file is not complete, yet - so, round to megabytes, where the error
  doesn't show...)
include exact demo file size in "listdemos" report
2017-06-27 15:15:24 +02:00
ac-stef 7fe7e47317 improved demo recording
The demo data is collected, hashed and compressed fully in memory, mostly
in a worker thread.

While in memory, each demo is identified by an unique sequence number,
which is, for example, used to request a download by the client.

If so configured, the demo is written to file by the worker thread.

If F10 is pressed later than two minutes into the next game, instead of
downloading the last game, the current game is scheduled to be
automatically downloaded when it ends.

At the end of a game, all clients and the server sign the demo file.
2017-06-27 15:15:24 +02:00
ac-stef 2f80c5bae5 add channel for less important server messages
(so that the client can choose to not display them)
2017-06-27 15:15:24 +02:00
ac-stef 7d1edd0fa1 cleaned up demo filename nonsense
If a filename does not contain at least mode, map and timestamp (due to
messed up format strings), the default format is used to ensure unique
filenames.

server side: added server parameters

  demo_max_number
    number of demo files to hold in RAM

  demo_save
    enable/disable writing of demos to file

  demo_path
    demo file path and filename prefix

  demo_filenameformat
    format string to assemble demo information to a filename
    %g : gamemode (int)
    %G : gamemode (chr)
    %F : gamemode (full)
    %m : minutes remaining
    %M : minutes played
    %s : seconds remaining
    %S : seconds played
    %h : IP of server
    %H : hostname of server (client only)
    %n : mapName
    %w : timestamp (formatted by demo_timestampformat)

  demo_timestampformat
    timestamp format string (see strftime() for format options)
    if the string starts with 'U', UTC is used - otherwise local time

client side:

changed demonameformat and demotimeformat to SVARs

  demonameformat
    like demo_filenameformat

  demotimeformat
    like demo_timestampformat

removed demotimelocal getdemonameformat getdemotimeformat getdemotimelocal

DOCREF demonameformat demotimeformat
DOCREF demotimelocal getdemonameformat getdemotimeformat getdemotimelocal
2017-06-27 15:15:24 +02:00
ac-stef 2b10bf1e68 misc VS warning fixes 2017-06-27 15:15:24 +02:00
ac-stef 7d698c340c clean up ip byte mangling
for now, censored IPs just show a '0' at the end...
2017-06-27 15:15:24 +02:00
ac-stef df6719439b optionally reverse influence of previously played games modes
a negative modepenalty_weight value makes the server more likely to
suggest games with the same mode as was recently played

default is a positive value to more likely mix it up
2017-06-27 15:15:24 +02:00
ac-stef 00c05ef353 add debug access to server parameters
Server owners can overwrite values on a server, which then don't get
updated from file anymore. With a reset command, all parameters get read
from file again. Implemented as "serverextensions".

serverextension servpar::get parname
  print parname and value

serverextension servpar::set parname:value
  set parname to value
  also disables reading of this parameter from file (otherwise, the
  new value wouldn't last very long)

serverextension servpar::reset
  set all parameters to be read from file again

serverextension servpar::dump
  prints unsorted list of all parameters, values, limits and descriptions
2017-06-27 15:15:24 +02:00
ac-stef daf4b9d24a add server parameters for statistic and diagnostic purposes
Logged server parameters are checked for changes once a minute. If a
change is detected, it is logged.
2017-06-27 15:15:23 +02:00
ac-stef 49232e05e0 new commands to add modeinfo and artist info to maps
mapartist print|set|get|clear

  print:  prints the map artist player ID
  set:  sets the map artist player ID to the currently logged in player
  get:   returns the current map artist player ID
  clear:  erases an existing map artist record in the current map

modeinfo list|get|clear|<modelist> <modeflags>

  list:  lists current modeinfo entries
  get:  returns list of current modeinfo entries
  clear:  erases current list of modeinfo entries
  <modelist> <modeflags>:  specifies flags for a list of modes

DOCREF modeinfo mapartist
2017-06-27 15:15:23 +02:00
ac-stef cefe93ce18 don't autoplay maps from servermaps/incoming 2017-06-27 15:15:23 +02:00
ac-stef 0b656d2380 add server-side player vita database
The server keeps track of every player ID that ever connected successfully.
This database stores the last names and IPs used by the player and the
last countries the connections came from. Some stats are counted, like
"time connected" and "total tks". Most importantly, the database stores
rights (like admin) and restrictions (like ban). All rights and
restrictions are kept as dates (or timecodes), so, for example, if your
ban date is in the future, you are banned - and if it's in the past, you
can play. The collected stats are meant to help server owners at managing
players - especially, if they want to give someone admin rights.

The database is periodically saved to a file and read from that file on
startup. The default file is config/servervita.cfg and one backup is kept
in config/servervita_bak.cfg. During server start, if the regular file
can't be loaded, the backup is tried instead.

While the server is running, it checks periodically for a file named
config/servervita_update.cfg, and if the file exists, it is renamed to
a backup filename including a timecode and read and merged into the
database. The automatic rename makes sure, that a file is only read once.
Using such updates, a server owner can easily give several people admin
rights or for example, add clan tags for a whole list of IDs. (Yes, the
database also stores a clan tag for every ID...)

The database also stores two short comments for every ID. One can only be
read by server admins, but the other one is public. The public reason, for
example, can state a reason for a ban.

One database record takes up 264 bytes of RAM. During autosave, accounts,
that have not been used for a specified time (default 12 months), will
not be written. After a server restart, those old records will be gone.

Currently, there is no process in place, to also clean up old records
from RAM. Maybe, that'll be added later...
2017-06-27 15:15:23 +02:00
ac-stef 035d7caf2f thread-safe and fully buffered logging
Uses own thread to actually write to logs, so the main thread can't be
blocked by a slow logfile. Log entries are buffered in two ringbuffers,
one for the main thread and one for all other threads. The main thread
will copy the second buffer to the main buffer periodically. The main
thread buffer is read from the log worker thread.

Since two buffers are kept, there are now several functions to add a log
entry:

  mlog()
    for main thread functions only: will never block

  tlog()
    other threads only: may block, until main thread copied some entries

  xlog()
    automatically determines, which thread it's been called from and
    then writes to the proper buffer (will block accordingly)

To avoid improper usage, mlog and tlog verify, if they are used correctly.
(Only for debug builds. An assert triggers, if necessary.)
2017-06-27 15:15:23 +02:00
ac-stef dd295bb54a initialise server parameters from commandline
overwrite defaults with commandline parameters before first use
(log level settings used as an example)
2017-06-27 15:15:23 +02:00
ac-stef d6af5be3da add auth to client server connect protocol 2017-06-27 15:15:23 +02:00
ac-stef 0148c5b9a9 add new protocol data type for IP addresses
(to avoid casting IPs to signed integer)

also mute single number debug messages for compound data structures like
string and key: no longer print a debug message for every char of a string
2017-06-27 15:15:23 +02:00
ac-stef f581506960 no more static buffers for iptoa and iprtoa 2017-06-27 15:15:22 +02:00
ac-stef 2147d60934 option to dump maprot suggestions to file 2017-06-27 15:15:22 +02:00
ac-stef 5fee02c77b new maprot
Instead of a list of specific map+mode combinations the maprot now only
contains general rules for maps and game modes. The server then calculates
the list by itself when needed. The server accounts played maps and modes
(and map+mode combinations) and calculates the list specifically not to
overplay maps or modes.

May need further testing.
2017-06-27 15:15:22 +02:00
ac-stef 7486317497 add changeable server parameters
A list of parameters is read from config/serverparameters.cfg once per
minute and the values written to corresponding server data structures.

If the binary is compiled in debug mode, starting a dedicated server
will write a blank config file with all possible parameters and their
descriptions, sorted and grouped into chapters.

The name of the config file can be set with the commandline parameter -A.

So far, syntax errors are not reported. Instead, it's possible to dump
all current values to a file every time something changes.
2017-06-27 15:15:22 +02:00
ac-stef 3376c5e299 detect server config file changes by hashing
Checking only file sizes obviously misses content changes that don't
change the size.
2017-06-27 15:15:22 +02:00
ac-stef 110a209d4e move validmapname
add map name checks to servermap::load()
2017-06-27 15:15:22 +02:00
ac-stef 7dc72aebb1 add basic functions for game mode bitmasks 2017-06-27 15:15:22 +02:00
ac-stef b82a38b2e2 read-ahead for server info files
* poll and read motd and serverinfo along the other server config files
* "en" language setting is now immutable
2017-06-27 15:15:22 +02:00
ac-stef e147000ba2 replace some more strtok
also make sure, randomMT survives concurring use from different threads
2017-06-27 15:15:22 +02:00
ac-stef 5ec04b82e1 delegate checking and loading server config files to own thread
"readserverconfigsthread" gets triggered by poll_serverthreads() once a
minute to check the filesizes of all server config files. Altered files
get loaded into memory.
poll_serverthreads() in the main thread then processes the buffered files
one at a time. During processing, a semaphore is locked, so that other
threads can use the data structures derived from config files - if they
use the semaphore to lock the ressource.
Using the data from main thread can be done without using the semaphore,
since _all_ changes are done in the main thread.
If the main thread wants to update data that is locked by a thread, the
main thread will defer the changes for a minute. The main thread will
never lock.
2017-06-27 15:15:21 +02:00
ac-stef 1c109bfa62 new commandline parameter to specify path for server logfiles
use -H to set path
default is logs/
2017-06-27 15:15:21 +02:00
ac-stef 1d1230544b speed up logging
don't bother processing a line, if the level is too high for any queue
2017-06-27 15:15:21 +02:00
ac-stef 7c54645785 concatenate consecutive identical geoip ranges silently
slightly faster and wastes less RAM
also: better detection of entry overlapping
2017-06-27 15:15:21 +02:00