Commit graph

150 commits

Author SHA1 Message Date
LJ Sonic
0ade3ae0bc Move tic and net command handling to new files 2023-07-27 15:38:45 +02:00
LJ Sonic
0b17e3c418 Move netcode files to a new folder 2023-07-27 15:38:42 +02:00
SteelT
a90151570f Replace the alias if an alias already exists
Reduces wasting memory by having multiple aliases with the same name
2023-07-16 15:44:48 -04:00
SteelT
c55b2f2943 Print list of existing alias commands 2023-07-16 15:34:30 -04:00
SteelT
464110ed81 Add CV_TrueFalse as possible value types for console variables
This also adds support for using true/false as value aliases for On/Off, Yes/No or 1/0
2023-07-13 01:02:15 -04:00
spherallic
9499cb5409 Merge branch 'next' into public_next 2023-04-12 19:51:17 +02:00
sphere
2df3fb53da Merge branch 'strong-lua-command-restrictions' into 'next'
Fix up Lua command/cvar safety

See merge request STJr/SRB2!1943
2023-04-12 17:50:01 +00:00
spherallic
9d6456c326 Merge branch 'next' into public_next 2023-04-02 19:33:16 +02:00
spherallic
1470d099e3 Update copyright year & credits 2023-03-31 14:53:31 +02:00
James R
07e4497320 Add COM_LUA to a bunch of commands
These commands be run from Lua:

- add
- addfile
- addfolder
- archivetest
- ban
- banip
- causecfail
- cecho
- cechoduration
- cechoflags
- changeteam
- changeteam2
- charability
- charspeed
- cheats
- clearbans
- clearscores
- connect
- countmobjs
- csay
- demote
- devmode
- displayplayer
- downloads
- drop
- droprate
- dumplua
- echo
- exitgame
- exitlevel
- gametype
- getallemeralds
- getplayernum
- god
- gravflip
- help
- hurtme
- isgamemodified
- jumptoaxis
- kick
- listwad
- login
- manual
- map
- mapmd5
- masterserver_update
- memdump
- memfree
- mod_details
- motd
- noclip
- nodes
- notarget
- numnodes
- numthinkers
- objectplace
- password
- pause
- ping
- playintro
- promote
- quit
- reloadbans
- resendgamestate
- resetcamera
- resetemeralds
- restartaudio
- retry
- rteleport
- runsoc
- savecheckpoint
- say
- sayteam
- sayto
- scale
- screenshot
- serverchangeteam
- setcontinues
- setlives
- setrings
- showbanlist
- showmap
- showscores
- showtime
- skynum
- startmovie
- stopdemo
- stopmovie
- suicide
- teleport
- toggle
- togglemodified
- toggletwod
- tunes
- version
- vid_info
- vid_modelist
- vid_nummodes
- weather
2023-03-15 17:22:56 -07:00
James R
49f1462f75 Only let Lua run commands registered with COM_LUA 2023-03-15 16:40:21 -07:00
James R
8a6f2e568b Add a flags parameter to COM_AddCommand 2023-03-15 16:40:21 -07:00
James R
0405df1a47 Merge COM_SAFE with other COM flags
Renames COM_SAFE to COM_LUA.
2023-03-15 16:40:21 -07:00
James R
15e3d0e667 Fix toggle command and add command being able to bypass Lua restriction 2023-03-15 16:40:21 -07:00
James R
5d08bfd706 Rename CV_NOLUA to CV_ALLOWLUA, opt IN to Lua mutability 2023-03-15 16:40:21 -07:00
James R
a39f69c9c7 Reset com_flags at end of COM_BufExecute
Fixes com_flags being discarded after the first command in
a chain (semicolon list).
2023-03-15 16:40:21 -07:00
James R
e48786961a exec: pass on com_flags 2023-03-15 16:40:21 -07:00
spherallic
4a1e99729b Merge branch 'next' into public_next 2023-01-31 15:47:11 +01:00
Eidolon
e5dea805fa Revert "Merge branch 'gamepad-refactor' into next"
This reverts commit 696e2ab909, reversing
changes made to d98d59494f.
2023-01-26 19:26:28 -06:00
Eidolon
bbd4cff75c Revert "Merge branch 'gamepadtweaks' into 'next'"
This reverts commit 96bfd8cea7, reversing
changes made to 24f9ec4ec4.
2023-01-26 19:24:21 -06:00
LJ Sonic
379cc4207a Revert "Merge branch 'netcode-refactor' into merging"
This reverts merge request !1920
2023-01-15 17:57:23 +00:00
LJ Sonic
41fb0c8943 Merge branch 'netcode-refactor' into merging 2023-01-15 17:45:06 +01:00
LJ Sonic
7c2fe20cd5 Move tic and net command handling to new files 2023-01-05 22:51:17 +01:00
spherallic
ca8842fa45 Merge branch 'next' into gamepadtweaks 2023-01-04 09:01:55 +01:00
Arthur
636e6d8c14 MSVC project file works again! Supports Visual Studio 2022.
Also fixed issues with the d_netcmd.c file/folder adding logic.
2022-12-31 19:35:07 -05:00
LJ Sonic
717e0d5a17 Move netcode files to a new folder 2022-12-31 14:10:19 +01:00
spherallic
1964869c69 Remove redundant control axes & cleanup 2022-12-22 01:40:33 +01:00
Eidolon
4c72154d4f Merge remote-tracking branch 'local-SRB2/next' into public_next 2022-12-08 21:26:28 -06:00
Eidolon
aac04b818c Merge branch '22-safe-addfolder' into 'public_next'
Path security checks for addfile, addfolder and exec

See merge request STJr/SRB2Internal!633
2022-12-07 00:43:31 +00:00
Jaime Ita Passos
46f7fa406f Refactor gamepad code
Implements the SDL Game Controller API, haptics, and axis bindings.
2022-11-14 00:37:08 -03:00
Eidolon
12c2ddb115 Merge branch 'uncappedrevengeance' into next
Uncapped

See merge request STJr/SRB2!1856

# Conflicts:
#	src/dummy/i_system.c
#	src/win32/win_sys.c
2022-11-08 21:13:50 -06:00
James R
76879299f9 Restrict exec path to srb2 directories 2022-10-14 22:10:24 -07:00
Sally Coolatta
6e5e74b25f Allow FPS cap values 2022-04-26 20:56:32 -05:00
SteelT
61b0c24cad Fix "unknown command" not being printed on dedicated 2022-03-22 13:09:29 -04:00
spherallic
14295ac7de 2022 2022-03-03 20:24:46 +01:00
sphere
ab044a270b Merge branch 'nolua-alias' into 'next'
Fix console aliases bypassing CV_NOLUA

Closes #619

See merge request STJr/SRB2!1573
2021-08-02 13:09:12 +00:00
James R
e30d4f954b Revert netvars after demo finishes playback
(Demos do not call CL_Reset BTW.)
2021-07-08 14:37:03 -07:00
James R
14c5d2c916 Warn if Lua attempted access NOLUA consvar
And quote variable name.
2021-07-05 18:39:12 -07:00
James R
18cbc1e370 Fix aliases bypass COM_SAFE 2021-07-05 18:31:04 -07:00
LJ Sonic
d325c7e6d3 The year is 2021 2021-05-07 17:45:56 +02:00
James R
aee963f4e9 Replace LUA_PushLightUserdata with LUA_PushUserdata
See 7df6a309 and 83a87042. I didn't realize that light
userdata's metatable is shared--like numbers or strings.
So it cannot be paired with a metatable.

I also made a few minor tweaks to Lua cvars, other than
accounting for the double pointer in the userdata.
2021-05-02 21:59:23 -07:00
James R
92aeadc36b It is impossible for a string to be allocated in this case 2021-04-25 22:01:40 -07:00
James R
85914cc7cd Free zstring when switching to preset value
This is only applicable for bounded cvars (MIN, MAX),
since otherwise there's no way to allocate a zstring.
2021-04-25 21:55:04 -07:00
Monster Iestyn
70939a7a3d Set "allocated" flag to off if setting a string from PossibleValue afterwards, or if not setting a new value at all. 2021-04-25 21:08:12 +01:00
James R
ba4b6ec400 Reset wait period for COM_BufInsertText 2020-10-21 12:34:26 -07:00
James R
cb8f6097cf Merge branch 'save-netvars' into 'next'
Save netvars

See merge request STJr/SRB2!1179
2020-10-12 19:03:01 -04:00
James R
4b5cb8025b Show revert value of cvar with help command 2020-10-09 16:28:03 -07:00
James R
b67807dd04 When save/loading config use revert value for netvars if you are not the server 2020-10-09 16:22:17 -07:00
James R
15008f31a7 Merge branch 'sanity-meter-empty' into 'next'
Replace cvar initializers with a macro

See merge request STJr/SRB2!1178
2020-10-08 22:02:25 -04:00
James R
355cc1a697 Merge branch 'autocomplete-aliases' into 'next'
Autocomplete aliases in console

See merge request STJr/SRB2!1113
2020-10-08 20:30:07 -04:00