23 Commits
Author SHA1 Message Date
kai bd017fc91f fix gitignore fah 2026-10-25 08:56:20 +00:00
kai a391673eb6 wowie zowie wowie zowie 2026-10-25 08:51:39 +00:00
flowtron 93c36d816f miscellaneous 2022-04-06 17:53:37 +02:00
flowtron eade03c8dd miscellaneous technical tweaks 2022-03-09 09:47:00 +01:00
RonaldReagan 04c13a9c36 Add .DS_Store to gitignore 2021-05-21 21:53:52 -06: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 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 271d5b3929 always use a profile directory
If none is specified by commandline, "profile/" is used. This way,
downloaded files don't mix with the original install files.
2017-05-22 19:53:01 +02:00
ac-stef 381e770210 add authsetup command
authsetup contains all the funtionality needed to generate, load and save
private and public keys, and to lock and unlock the private key with a
password.

Private and public keys are used to authenticate the player to servers,
and are loaded from config/authprivate.cfg. Private keys can be stored
in an "encrypted with password" version - in which case the player has
to enter the password after game start. To prevent brute-force cracking
of the password, the key-derivation function uses a constant time to
encode (usually several seconds). Because of that, the decoding at game
start can be done in the background.

The private key is actually itself a public key generated from the
prepriv key. The prepriv key should be kept away from the computer, either
as hardcopy or on a thumbdrive. The prepriv key is not required to play
the game. It can be used to prove ownership of the private key, in case
the private key gets stolen. It can also be used to regenerate private
and public keys, in case they are lost. The prepriv key can also be
encrypted by its own password.

authsetup
  checks private and public key and returns "1", if they match.

authsetup pre preprivhex [psalthex pwdcfg]
  loads prepriv key into memory. optionally supports encrypted keys.

authsetup priv privhex [salthex pwdcfg]
  loads private key into memory. optionally supports encrypted keys.

authsetup pub pubhex
  loads public key into memory.

authsetup ppass preprivpass
  decrypts prepriv key with password

authsetup pass privpass
  decrypts private key with password

authsetup passd privpass [commandwhendone]
  decrypts private key with password in background. optionally executes
  cubescript command when done.

authsetup needpass
  returns "1" if the private key needs decryption.

authsetup genpre [prelen]
  generates new prepriv key.

authsetup genpriv
  generates private key from prepriv key.

authsetup genpub
  generates public key from private key.

authsetup newppass preprivpass [preprivfilename]
  encrypts prepriv key with new password and saves the result to file.
  The default filename is config/authpreprivate.cfg and an existing file
  gets overwritten - but the former file content is kept and also written,
  each line commented out.

authsetup newpass privpass [privatefilename]
  encrypts private key with new password and saves the encrypted private
  key and the public key to file. The default filename is
  config/authprivate.cfg and an existing file gets overwritten - but the
  former file content is kept and also written, each line commented out.

authsetup unarmed
  sets private and public keys to a fixed value. For testing only.
  Can be used to "log out".

authmemusage, authrounds, authmaxtime are only used, when new passwords are
  created (authsetup new[p]pass). authmemusage is the number of megabytes
  of RAM that are used for the password hash calculation. If authrounds
  is zero (as is default), then the hash algorithm calculates as many
  rounds as possible in the number of milliseconds specified in
  authmaxtime. If authrounds is a positive number, then that is the number
  of rounds to be done, regardless the required time. Note that, since the
  password hash algorithm is not endianness-aware, it is not possible to
  move an encrypted password to a machine with different endianness.
  Moving between 32- and 64-bit machines should be no problem.

  FIXME: the command is not blocked against use in multiplayer. It has to
         be determined later, if this is a problem or feature. Especially
         the background password calculation may be a problem.

DOCREF authsetup cryptodebug authmemusage authrounds authmaxtime
2016-08-26 14:28:54 +02:00
ac-stef 8c7baa979c add SHA512 hash function and an entropy collector
SHA512 was adapted from a few public domain sources and pseudocode from
wikipedia. The entropy collector gathers entropy from keyboard events and
mouse movement - and, just for fun, from screenshots.
The entropy pool is saved at program exit and reloaded at program start.
Entropy is used to re-seed the pseudorandom generator (not that it would
make a difference).
2016-08-26 14:28:53 +02:00
ac-stef a807716ecf convert official maps to format 10
* renamed (temporarily) to dev_*
* embedded all config files
* changed as many clip entities to tagged clips as possible

On ac_toxic and ac_venison all other clip entities also have been
optimised. Some bugs and unnecessary quirks on venison have been removed.

* toxic now uses 135 clipped entities (instead of 221)
* venison now uses 115 clipped entities (instead of 393)
2016-07-23 19:13:38 +02:00
aurhat 048e951a38 Update .gitignore's 2015-07-15 21:57:05 +02:00
ac-stef e318ecd68e integrated automatic embedded map config files
This patch enables an option to keep the map config embedded in the map
file - with autogenerated content. Any changes to map config data will be
written with the map. This includes data by loadnotexture, loadsky,
mapmodel, texture, fog, fogcolour, mapsound and shadowyaw. Once enabled,
all changes with those commands become persistent to the map.

New variables:

mapsoundchanged
  Set to "1" with every command that changes mapsound slots. Should be
  used to trigger a rebuild of mapsound menus.

New/changed commands:

mapsound
  Now returns the number of the created slot.

mapmodel
  Now returns the number of the created slot.

texture
  Now returns the number of the created slot.

loadsky
  Is now a builtin string variable (instead of a command), which means,
  that the current value can easily be retrieved or edited.
  The skymap name in the argument is now required to start with
  "textures/skymaps/" - but that part of the path can be omitted.
  examples:
    loadsky steini/steini2 (loads textures/skymaps/steini/steini2_*)
    loadsky textures/skymaps/steini/steini2 (same)
    loadsky ../foo/bar (loads textures/foo/bar_*)
    echo $loadsky

getnotexture
  Returns the current "notexture" path. (Set by loadnotexture)

dumpmapconfig (available for debug binaries only)
  Writes the current automatically generated map config to
  dumpmapconfig.txt.

DOCREF mapsoundchanged mapsound mapmodel texture loadsky getnotexture
2015-05-18 14:46:03 +02:00
ac-stef 03f974b2bc additional text attributes for mapmodels
This adds a means to store additional attributes for mapmodels, including
a caching mechanism, so the mapmodels don't have to be loaded to access
the information. The goal is, to provide fully automatic mapmodel menus
for map editing who also add information about downloaded mapmodels.

Model attributes are extracted everytime, when a model is loaded. At game
end, all available data is written to config/mapmodelattributes.cfg and
restored at next startup. On release, a file with all (but only) official
models should be included. Since autodownloaded models are usually "loaded"
after download, those are automatically added to the database. If someone
adds models manually to the directories (media pack, w/e), the command
"loadallmapmodels" can be used to try to find all available models. The
only way to delete something from the database, is to delete the file
config/mapmodelattributes.cfg when the game is closed.

The current list of attributes is:

keywords
  List of one or more menu topics to list the model under. Check
  config/menus_edit.cfg for available keywords. Unknown keywords will
  be listed separately.

desc
  Short name or description of the model. Will be used as menu entry.

usage
  Important information for how to use that specific model.

author
  Who created the mapmodel. If it's a derivative of another model, state
  the author of the mod (refer to the original author under "license", if
  you like). Always use the exact same spelling for the same author, to
  allow menus to automatically group models by author.

license
  Free-text attribute for license info or info about additional
  contributors (or original authors for derivated works).

distribution
  One of "official", "autodownload" or "manual". Other values default to
  "manual". This is used to determine, if a map contains only original
  media or media that can be download automatically.

version
  Single numerical value to separate older from newer versions. Defaults
  to zero. Higher numbers mean "newer". Maybe someone manages to implement
  a versioning system for custom media in the future...

New commands:

mdlattribute <attr> <value>
  To be used in model config files. Adds a value for a specified
  attribute to the model.

mapmodelregister <modelpath> <attr1> <attr2> ...
  Adds values for all attributes to a specific mapmodel. This is used to
  restore the cached values from config/mapmodelattributes.cfg during
  game start. Does not actually verify of load the model.

mapmodelattributes <modelpath> <attr>
  Returns the value of a specific attribute of a mapmodel. If modelpath
  is a number, it is interpreted as index for the list of models in the
  current map config. If no attribute name is specified, all attributes
  are printed to the console instead.

getmapmodelattributes <list of attribute names>
  Returns a table of all known mapmodels. Each model is listed with the
  modelpath and the values for the requested attributes. To be used
  instead of a fixed table in menu_edit.cfg. In addition to attribute
  names, the function also allows the keywords "explodekeywords" and
  "sortby:" as arguments. If "explodekeywords" is given, all mapmodels
  with more than one keyword are listed multiple times, once for each
  keyword. If an attribute name is preceeded by "sortby:" the list will
  be sorted by this table column. If "sortby:" is used several times,
  this first sort will have highest priority. The list is always sorted
  by path by default.

  example:
    getmapmodelattributes sortby: author sortby: desc explodekeywords

loadallmapmodels
  Tries to load mapmodels from /all/ paths below packages/models/mapmodels.
  Will throw a lot of error messages, because not all directories contain
  models to load. This command can be used to build or rebuild the
  complete list of all available mapmodels. It is only necessary, if models
  are added manually to the directories, since every mapmodel gets added
  to the list when it is loaded - which takes care of all automatically
  downloaded models.

DOCREF mdlattribute mapmodelregister mapmodelattributes
DOCREF getmapmodelattributes loadallmapmodels
2015-05-17 00:24:38 +02:00
aurhat beeba9ad76 Add Code::Blocks project for Linux 2015-04-06 12:24:50 +02:00
ac-stef 39cbee947d Merge branch 'master' into next 2015-02-08 16:17:04 +01:00
ac-stef fdb7dbd243 new script to check all parts of an installation
also stripped assaultcube.sh, server.sh and install_or_remove_menuitem.sh
of unnecessary or just wrong stuff

added script to generate checksum file packages/misc/checksums_md5.txt,
which is used by check_install.sh to look for missing and modified files
2015-01-18 14:48:47 +01:00
ac-stef 41fd31deed create config files in the user's home dir from a zip template
This new feature reads a list of config files from a zip file named
config/configtemplates.zip and checks each file, if it is already
existing in the game's search path. If it can not be found, it will
be created in the user's home dir (where saved.cfg gets written).

Before this, the config files were installed with the rest of the game,
and if the user customised any of the files, he most likely did not move
the file to his personal directory first. A re-install in the same place
would then overwrite the customised file.

This feature creates the files where they will usually not be overwritten.

To use the feature, before packaging the game, the files
 config/autoexec.cfg
 config/favourites.cfg
 config/pcksources.cfg
have to be archived into a zip file
 config/configtemplates.zip

The zip file should not contain directories. It should not be checked
into git. The original single config files should not be distributed
with the package.
2014-10-05 23:30:29 +02:00
ac-stef fabfb73c83 added mandatory client log file
- a client will now write all os console messages to "clientlog.txt"
- at every game start, the log file gets rotated (with five old logs kept)
- commandline parameter "-N" can be used to limit the number of lines
  (after the lines are logged, the file is closed)
2014-09-22 00:24:09 +02:00
ac-stef ec97e75b51 makefile with easier customisation
This makefile allows changing the compiler to g++ or requesting debug
binaries without editing the makefile.

The makefile sets default values for CXX and ACDEBUG, then reads values
from the file Makefile_local (if it exists). A commandline parameter
overrules both.

Makefile_local is not part of the repository, so it can be changed without
git caring (or nagging) about it. It is listed in .gitignore.

To switch to g++, create a file "Makefile_local" with the content
"CXX=g++".

To compile debug binaries, type "make clean install ACDEBUG=yes".

When g++ is used, "fast-math" is now enabled.
2014-05-14 16:31:14 +02:00
aerkefiende 332b62c9df Changes to .gitignore file
Listed all files created when starting without home argument
2014-03-25 21:43:06 +01:00
aerkefiende 1fb6d5a05b Updated .gitignore
Ignoring files that are created after make/make install
2014-03-23 21:35:06 +01:00
RandumKiwi 9e1b08759c travis IRC 2014-01-27 17:40:51 +13:00