Commit Graph
154 Commits
Author SHA1 Message Date
ac-stef e96b97a5a5 fix updatefrommaster 2017-06-17 15:33:54 +02:00
ac-stef ef2b91c0ce more cubescript limits
the limits are hardcoded and require recompilation to change

* limit recursion depth
* limit loop iterations
* limit string lengths
* limit push/pop depth
* clean surplus whitespace from config files
* provide context for script errors

(limits accidental crashes, not intentionally malfunctioning code)
2017-06-08 19:00:04 +02:00
ac-stef dbcb040eeb menu code cleanup
* fix some memory leaks
* rename stuff
* fix crash

Removed commands and variables:

  chmenumdl (replaced by menumdl)

  scorefont (replaced by "menufont score mono")

  menuitemvar (better handled with fully dynamic menus)

Changed commands:

  menufont menu font

    Sets the font for a specific menu. If menu is "", the currently
    initialised menu is used. Example: menufont score mono

  menumdl menu mdl anim rotspeed scale

    Assumes the function of the previous chmenumdl. If menu is "", the
    currently initialised menu is used. Specifies, which model to render
    and how. If only menu is specified, no model is rendered.

DOCREF chmenumdl scorefont menufont menumdl menuitemvar
2017-06-06 13:17:20 +02:00
ac-stef d81071f200 provide HOME for all
...menus
2017-06-04 17:43:44 +02:00
ac-stef 8ece94d5bb allow menu checkboxes to change position
and: fix enumsounds, kill some CR, cleanup

menuitemcheckbox <text> <value> <action> <position>

  Now takes an optional fourth parameter "position" in the range from 0
  to 100, default 0, which moves the position of the checkbox over the
  width of a text input or slider, with 100 being left and 0 being right.

DOCREF menuitemcheckbox
2017-05-24 02:09:17 +02:00
ac-stef 1afd7515ab simplify masterserver type selection
Use a plain cubescript variable instead of a commandline switch.

mastertype
  0: classic direct TCP connection
  1: HTTP connection (via proxy) (default)

DOCREF mastertype "--mastertype="
2017-05-22 20:44:58 +02:00
ac-stef 2f99b368f0 allow mnemonics for execution context levels
scriptcontext and isolatecontext now allow plain text mnemonics for
context level arguments (one of CORE, CFG, PROMPT, MAPCFG, MDLCFG)

also:

- cleanup (some dead code and dead prototypes removed)
- some stuff renamed
- script errors now show context levels
- conc is no longer thread-safe (but slightly faster)

DOCREF scriptcontext isolatecontext
2017-05-18 16:19:01 +02:00
ac-stef b650fca2ca persistidents cleanup
Restore the old persistidents system from AC 1.0, since it's working as
intended - if used properly.

As a reminder:

  * aliases created by "const" and "tempalias" are never persistent
  * aliases created or altered by "alias" or "=" become persistent, if
    the persistidents flag is set during that operation
  * persistidents if false during the execution of almost all config files
    during game start - those files can create aliases with default values
    which will not be persistent (until changed later while the flag is
    set)
  * before saved.cfg is executed, the flag is set and stays set all
    throughout the game - which means, that all changes (from menus, for
    example) will change the altered alias to "persistent"
  * exceptions for map or model config files are unnecessary, since those
    run restricted and can't create aliases anyway
  * exceptions are necessary for "late run" config files like those in
    config/opt/

The new command "persistidents" may be used to manually set or clear the
flag. It also returns the current state of the flag. If used in a config
file, the flag is restored to its original value when the file ends
execution.

In short: only late-run config files (meaning: run after saved.cfg was
restored) may need to manually set/reset the flag. Use const and tempalias
where appropriate and clear persistidents before creating an alias with a
not-to-save default value that may be changed and made persistent later.

DOCREF persistidents
2017-05-05 15:50:59 +02:00
ac-stef 8e08cddaa7 improve cutcolorstring
now takes the width of characters into account

also: fix wraparound for docrefs
2017-04-24 21:48:57 +02:00
aurhat 7ca26bc458 Change limit of chars in server name used by sbconnect 2017-02-12 21:31:00 +01:00
aurhat 72dfcd73fe Cleanup
"showminremain" enabled by default, "fovcompat" removed.

DOCREF showminremain fovcompat
2016-10-14 21:49:53 +02:00
ac-stef 0fd9603dcc switch to connected server in serverinfo display by pressing 'c'
one more undocumented feature :)
2016-08-16 23:03:45 +02:00
aurhat 3b0813412b Show on serverbrowser number of all players on the servers 2016-05-21 11:42:35 +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
aurhat fa047595b6 Add header to alternate views in serverbrowser
Also clean up SEARCH category.
2015-09-21 20:33:50 +02:00
ac-stef 68c3ea43b1 improved http error handling
* don't treat 404 as http error
* real errors return -1 and disconnect
* -1 is treated as real error
2015-09-07 14:53:57 +02:00
ac-stef 7bdd91bc9f improved timeout handling and progress bar for autodownloads
http get now uses two timeout values: one for the max time since last
server response, and one for total download time.

When AC is waiting for a server response (before a http header was
received), the progress bar will show the timeout "completion".
2015-09-07 14:53:57 +02:00
ac-stef 50369fe920 use new http get to retrieve list from masterserver
curl ite domum
2015-09-07 14:53:56 +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
aurhat c27e5e05d2 Fix displaying LAN servers
LAN servers should be always visible, when user opens serverbrowser with
LAN servers only. And don't allow to switch from there to alternate views,
because for searchlan = 2 it doesn't make sense.
2015-08-22 13:50:20 +02:00
ac-stef 06f59e0559 use safe strings
(cleanup)
2015-08-21 15:51:36 +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 fe6f9e92a7 tab and formfeed cleanup 2015-06-10 14:28:50 +02:00
ac-stef f3e72b8fb7 remove gettext
DOCREF gettext
2015-06-10 14:28:50 +02:00
ac-stef cb9169ab0a remove double filtering of richtext
cubescript quotes ("") already filter richtext
2015-06-10 14:27:52 +02:00
ac-stef 47f71f1288 allow symbolic arguments for some commands
* new command "listoptions" lists the argument options for several
  argument types like entities, weapons and teamnames
* "burstshots", "weapon", "magcontent", "magreserve", "fragmessage" and
  "gibmessage" now allow guns to be specified by name
* "addpunct" allows plaintext arguments like "brackets" and "quotes"
* the "team" command now understands numeric teams
* entity types can now be specified by type index number
* removed some lists from the config files (now provided by listoptions)
* added argument completion for several commands
* change nextprimary from integer to string variable

DOCREF listoptions burstshots weapon addpunct
DOCREF fragmessage gibmessage magcontent magreserve
DOCREF nextprimary
2015-02-23 18:52:04 +01:00
aurhat 6e0e7bb333 Optimize and fix autodownload feature
The commit:
1. fixes value of download speed in KB;
2. introduces unique names of progress_callback() functions;
3. removes one unnecessary write_callback() function;
4. removes duplicated code/info in loadmodel().
2014-11-26 21:05:07 +01:00
aurhat b6a5418c24 Add alternative views in serverbrowser and improve favourites
Alternative views in the serverbrowser are implemented with use favourites.
Categories (names) of favourite servers, which will be displayed on the
views, have to be included in "serverbrowseraltviews" alias (accessible
in menu).
Switching between views is possible with use Alt + Mouse wheel and
Alt + Up/Down (or eventually "[" and "]", if they are dedicated keys
on your keyboard).

The commit also:
1. adds MATCH category to favourites;
2. shows category name in settings of favourites;
3. shows weights in serverbrowser instead of favourites image,
when showweights = 1;
4. cleans up some tabs.
2014-11-11 21:07:19 +01:00
aurhat 931c442f67 Improve "favourite servers" feature
The commit:
1. does serverdescription keyword case insensitive for
showonlyfavourites > 0;
2. fixes typo in argument of alias in keyword;
3. fixes disabling background color for servers of the category, when
alpha is changed to 0;
4. shows 0 instead of 10 in info about digit, which toggles 10th category;
5. adds info about "image" attribute in favourites.cfg;
6. adds new feature: "Search for servers".
2014-10-04 20:25:44 +02:00
aurhat 69cbf95401 Prevent displaying remote servers on startup of LAN servers browser
After startup of LAN servers browser there appeared sometimes also remote
servers, instead of only LAN servers.
I such case "si.lastpingmillis=servermenumillis" for all remote servers.
So this commit changes a little existing condition, to prevent above
problem.
2014-07-08 22:51:33 +02:00
ac-stef 29dd50bde6 fix: keep path and uppercase in demo filenames
votes now distinguish between demo and map votecalls and filter the
filename appropriately

also: remove paths from map names cleanly
2014-05-25 00:35:22 +02:00
ac-stef a0286d2b3f replace textfilter functions with one-fits-all version
* replaces filtertext() with a version with a dozen of single filters
  that can be used in any combination
* defines classes of allowed characters for strings for various uses
  (see protocol.h line 153ff)
* now the allowed charset of, for example, player names is defined
  in one location only
* fixes issue #58
2014-05-24 12:59:19 +02:00
ac-stef eb60302e67 cleanup
- fix possible crash in conc (but it's still an ugly hack)
- fix noob usage of strcmp
- flag some memory leaks (it would be nice, if the author(s) would clean
   up the mess himself)
- fix crash in substr
- whitespace cleanup

there are plenty more memory leaks in command.cpp - for example, every
goto in cubescript does not clean up anything
2014-05-14 22:54:37 +02:00
Lucas GAUTHERON 8361e43415 escape special characters in MS requests
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7685 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-12-16 12:50:50 +00:00
RandumKiwi 86a63fc554 Fix for some buggy libcurl versions (linux).
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7656 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-11-10 18:54:27 +00:00
Lucas GAUTHERON 994061553e gma no longer known
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7641 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-11-09 15:16:40 +00:00
Lucas GAUTHERON f0b6fe3249 clfail fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7640 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-11-09 15:14:59 +00:00
Lucas GAUTHERON ab294c1b2d MS now writes to servers.cfg directly and progress bar is fixed
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7638 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-11-09 14:07:51 +00:00
Ronald Reagan ae80a42505 Adding grenadier's HTTP MS fix
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7637 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-11-09 02:20:23 +00:00
Ronald Reagan de65e51bd0 Adding --mastertype switch. Allows switching between UDP and HTTP style masterserver
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7633 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-11-08 05:53:01 +00:00
Lucas GAUTHERON 2070fe4b79 MS: serverlist requested with HTTP
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7601 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-10-12 21:09:42 +00:00
Bukz 7480f036d3 persistidents fixes (plz review/test)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@7213 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2013-02-16 01:43:47 +00:00
sireus b33116712c sane(r) command signatures (warning: huge commit)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6908 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-10-06 22:49:49 +00:00
sireus bd9a5b801a fixed windows build errors
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6796 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-04-25 17:31:20 +00:00
sireus 9e1437e9bc configurable masterserver port
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6791 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-04-20 16:49:39 +00:00
sireus 34e56ae7d1 use var lang instead of alias LANG, and some cleanup in language detection
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6774 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-03-30 12:44:07 +00:00
Rafael Barreto aa10c09bd3 sending defs to ms
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6756 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2012-02-09 16:16:16 +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
Lucas GAUTHERON 3a9d59ceb3 colored ping in serverbrowser?
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6421 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2011-05-11 15:50:15 +00:00
flowtron 9aac0c29e0 fix connect-by-console not working w/o updatefrommaster - Brahma, please re-check your fix is still working!
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5820 e016b1c5-ed68-44aa-a2f7-31cac88cffde
2010-11-09 21:40:44 +00:00