Commit Graph
126 Commits
Author SHA1 Message Date
drian b615fe449e Merge remote-tracking branch 'remotes/origin/next' into release_v1.3 2021-02-10 21:00:09 +01:00
ac-stefandaurhat e75dfbe4c7 fix/finish SDL2 port
* implement gamma
* menu keys fixed
* add support for horizontal mousewheel and some more mouse buttons
* fix keyrepeat
* fix window resizing
* fix compiler warnings
* use SDL to access clipboard
* remove X11-dependency
* some surplus SDL headers removed
* fix setdesktopres
* fix vsync
* improve fullscreentoggle on linux
* remove togglegrab
2018-02-10 11:28:49 +01:00
Jani-Markus Maunusandaurhat f86579533a Ported AC to SDL2 2018-02-10 11:28:48 +01: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 f581506960 no more static buffers for iptoa and iprtoa 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 7dc72aebb1 add basic functions for game mode bitmasks 2017-06-27 15:15:22 +02:00
ac-stef 63668e0dda add support for a geolocation table
including two converter scripts to use Geolite2 and Webnet77 tables
2017-06-27 15:15:21 +02:00
ac-stef 1ca4ce54eb some server changes
tbc
2017-06-27 15:15:20 +02:00
ac-stef db9bd67be9 protocol bump
no longer compatible with 1.2.0.2

also: nade effect quantisation fixed
2017-06-27 15:15:20 +02:00
ac-stef 03e21b097d fix stuff found by cppcheck
almost 3000 lines of "errors" contained one actual memleak, one actually
unused variable and three actual ambiguous code parts

from cppcheck website: "The goal is to detect only real errors in the
 code (i.e. have zero false positives)." :)

thx for finding five problems in our code
2017-06-17 12:40:35 +02:00
ac-stef b0dc65e50b add debug checks to verify proper calling threads for functions
for some functions, it matters...
2017-05-24 11:25:15 +02:00
ac-stef a97d69bc0e relocate string sort functions 2017-05-22 20:52:45 +02:00
ac-stef 824d460262 write more data to clientlog in case of crash
write the stackdump and the cubescript history (if available)
at least try to close the clientlog file
2017-05-11 17:47:21 +02:00
ac-stef 64a7eef335 some fixes 2016-11-01 00:40:07 +01:00
ac-stef bc2a091f95 show map timestamp in map info menu
also: more stuff in the map settings menu

getmaptimestamp fmt

  Returns the "last written" timestamp of the current map in the requested
  format. If fmt starts with "U", the time is given as UTC, otherwise
  as local time. If fmt is empty, or not given or just the "U", the format
  defaults to "YYYYMMDD_hh.mm.ss". Use "%c" to get something nicer.

DOCREF getmaptimestamp
2016-09-04 15:00:00 +02:00
ac-stef c7c02521ad add thread-safe variant of timestring() 2016-09-04 13:45:14 +02:00
ac-stef 89f1f69eec readmapsthread
server: load all maps into memory, scan for more maps
in the background
2016-08-26 14:27:51 +02:00
ac-stef c70808e5a4 more detailed entstats
Shows some results of the new map quality checks. tbc
2016-08-26 14:08:56 +02:00
ac-stef a33577c039 sort mapmodel entities during map save
* sort colored lights behind white ones to avoid a light bug
* sort all clipped entities to the end of the list to speed up physics
* sort all pickups and playerstarts to use smaller index numbers to
  use less bandwidth
2016-08-26 14:08:55 +02:00
ac-stef c54eb7f173 calcmapareastats()
new metrics to assess map geometry
2016-08-26 14:08:55 +02:00
ac-stef e1ce0979d0 rewrite calculation of map geometry bounding box
and rename client-side struct "mapdims" to clmapdims (to avoid confusion
with server-side data)
2016-08-26 14:08:55 +02:00
ac-stef 32ffd3a4cd replace non-thread-safe functions
replace all uses of strtok, localtime, gmtime and readdir

on platforms without safe versions, use homebrew or unsafe...
2016-02-28 23:14:47 +01:00
ac-stef 697197bd5b generalise sorting of lists of integer sets 2016-02-07 18:34:31 +01:00
Jani-Markus Maunusandac-stef d570eccd16 fixed missing include for Windows build 2015-09-19 15:43:43 +02:00
ac-stef 12a05d41e9 add interface for timedwait on semaphores
According to SDL documentation, the SDL implementation of timedwait may
suck on some platforms, so it should only be used, where high CPU usage
during the wait is no issue.

getpckserver() will now only wait for one second for access to the
package server list and return an error instead of waiting indefinitely.
2015-09-17 16:40:59 +02:00
ac-stef ecc63d7047 more thread wrapper functions
Add code to detach threads without losing any ressources.
(use POSIX libs when SDL is not available)
2015-09-15 13:18:03 +02:00
ac-stef 7988443b1d partial autodownload rewrite
* own source file for autodownload
* use cleaned up zip functions
* use new http get function (no more curl)
* enforce strict file naming rules and file size limits
* ping all package servers on every game start to determine ping times
* support media file update lists (also kept on package servers)
* allow users to manually prioritise package servers
* automatically select server with newest media file revision

new or changed commands:

addpckserver hostname [priority]
  Adds a host name to the list of package servers. If a priority is given,
  it influences the sorting of servers. Servers with higher priority are
  queried first. If servers have the same priority, they are sorted by
  ping. Default priority is zero.

getpackageserver
  Returns a table with four columns of all configured package servers. The
  columns are: host name, priority, ping and resolved.
  "resolved" is a flag, indicating, if the server answered the ping during
  game start.

removed cubescript idents: sortpckservers gamestarts
DOCREF addpckserver getpckserver
2015-09-07 14:53:56 +02:00
ac-stef 826499c12d enable gcc to check arguments of printf-like functions
Check printf-like functions like conoutf, if format strings and argument
lists match.

This commit also fixes a lot of code parts that actually had mismatching
argument lists - or did things, that this check does not like.

numtime() was rewritten in an ugly but very portable fashion (it's
recommended to stay away from "long long" format entries, because errors
usually only come up at runtime).

(some code was copied from sauer)
2015-08-02 19:40:41 +02:00
ac-stef 010a7579be remove ability to write map file format 9
didn't work properly anymore anyway
2015-05-27 15:47:04 +02:00
ac-stef b1b789eefc rename transformoldentities
now that old entities also get re-scaled, "transformoldentitytypes" is
more appropriate
2015-05-18 14:59:41 +02:00
ac-stef ae82b6b22e add attr5..7, add mapmodel pitch and roll
Keys 5, 6 and 7 (in combination with the scrollwheel) can be used to alter
the new entity attributes.

Pressing editmeta (LCTRL by default) speeds up the scrolling.

(Parts of the roll code are borrowed from Alejandro V. Garcia's commit
"Model rotations, experimental" from January 2013)

Note: coop edit is now broken between "next" and older clients, but I
  don't want to bump the protocol just yet.
2015-05-18 14:59:41 +02:00
ac-stef b4b1c0bf91 add debug warning for unknown argument keywords
"weapon asault" will now print a warning to console.
2015-03-24 02:06:19 +01:00
ac-stef 348f640507 new tool functions 2015-02-08 17:39:15 +01:00
ac-stef 7e7834af2c wrapper functions for threading and semaphores
allow the standalone linux server to use posix libraries instead of SDL
(using SDL can be forced by defining AC_FORCE_SDL_THREADS)
2015-02-08 17:39:14 +01:00
ac-stef 4fdba4fa4a less ugly mapdims
replaced the mapdims array with a struct with properly identified members

also reduced the calclight postfilter to actually used map areas
2014-11-12 17:52:44 +01:00
ac-stef 3bbe1f9555 fix mandatory client logfile
The logfile can't be created before the commandline arguments are parsed,
because before that, the home directory is unknown. This patch logs
into a memory buffer which is then copied to the logfile as soon as
the logfile is created after processing the commandline arguments.

The memory buffer is created during the initialisation of global variables,
and destroyed after the logfile is created.
2014-10-06 12:43:32 +02:00
ac-stef c3d4713904 clean up map header handling
Older versions of ac did not obey the map header field "headersize".
When a map was written, only the "version" field was updated, even if
the new written header had a different size. Thanks to bigger headers
in map versions 7 & 8 (and now smaller headers again in 9), the headersize
of basically all official maps is bogus. This fix makes sure, only proper
headersizes are written. It also makes the game tolerate different (bigger)
headers - and keeps their content untouched. Future map format extensions
can use this to add header information without breaking existing map parsers.

This patch establishes a new map format 10, which is identical to format 9,
with the exception that the headersize field is guaranteed to be correct.
Format 10 also allows any amount of additional header data.

This patch also cleans up the transformation routines for old map entities.
2014-01-27 23:01:23 +01:00
Lucas GAUTHERON 2f55903ad0 messy patch tmp revert
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7491 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-05-27 17:25:21 +00:00
Lucas GAUTHERON bfd0d79d8f map restriction fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7490 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-05-26 20:43:01 +00:00
Lucas GAUTHERON 624dd348d7 make the server store more map data (more accurate pickup calculations)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7487 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-05-26 16:40:57 +00:00
Lucas GAUTHERON a7a1e46bcc merged branch
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7382 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-22 19:49:21 +00:00
Lucas GAUTHERON 704f6f8415 map check: linear rather than quadratic
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7342 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-03-10 19:35:59 +00:00
aerkefiende 06f73f4627 Replaced Tabs with 4 spaces in every source file
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6561 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-07-31 15:44:57 +00:00
Rafael Barreto f891f1dff3 ty tempest! changing diff from char to int
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6496 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-06-04 15:06:42 +00:00
Rafael Barreto 32712318da doing it better... (still testing the exploit, tbh)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6494 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-06-04 14:14:37 +00:00
Rafael Barreto a8401fd1e3 fixing that obvious map requirements exploit... (no more exploits for the next 6 months...)
@ other devs: check my fix... I expect to not block any good map

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6490 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-06-03 21:19:44 +00:00
flowtron 2d9edb6dc4 rewrite of radar-code
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6110 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-02-27 22:16:28 +00:00
flowtron 87d69da51f minor fixes & comments
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6101 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-02-14 18:02:48 +00:00
Lee Salzman 5243cdf249 gzstream closing fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5739 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-10-10 02:16:21 +00:00