Commit Graph

597 Commits

Author SHA1 Message Date
BobTheBob 32165afe41
Add `FUNCTION_AT` and `VAR_AT` macros (#416)
* add FUNCTION_AT and VAR_AT macros

* fix build issues oops

* fix formatting

* add PREDEFINED_VAR_AT

* change func name

* fixup formatting

* update to use DEFINED_VAR_AT
2023-02-23 00:19:48 +00:00
BobTheBob 6aaac4cd45
Implement `dedi_sendPrintsToClient` (#418)
* add CGlobals class and g_pGlobals, and update scripts to support

* don't automatically enable antispeedhack (oops)

* add dedicated.cpp

* format

* bad push oops

* reformat again

* implement dedi_sendPrintsToClient

* update formatting
2023-02-22 23:08:44 +00:00
BobTheBob 8468f509d4
Add additional properties to `CBasePlayer` (#329)
* add additional properties to CBasePlayer

* fixup names

* use hex offsets
2023-02-22 22:26:56 +00:00
p0358 9b1e2a0f48
Force-include `pch.h` to all files, remove explicit includes (#393)
* force-include "pch.h" in all units, as it will error if it's not included anyways

* remove #include "pch.h" from all files as it's not needed anymore now

* fix size of NSUserAgent to be consistent (it's 256 in version.cpp, caused compile error)

* Re-add explicit pch.h include to pch.cpp (and ran clang-format)

* drop pch.h inclusion from new files
2023-02-14 14:04:42 +00:00
BobTheBob 95b41b6f8c
Add `CGlobals` class and `g_pGlobals`, and update code to support (#411)
* add CGlobals class and g_pGlobals, and update scripts to support

* don't automatically enable antispeedhack (oops)

* add dedicated.cpp

* format

* bad push oops

* reformat again
2023-02-12 21:15:00 +00:00
Erlite b61ed18a86
Add Destroy callback for squirrel scripts. (#383)
* Add Destroy callback for squirrel scripts.

* Switch _call() to Call()
2023-02-09 00:44:44 +00:00
BobTheBob b77baa4d09
Do not load streaming files on dedicated server (#412)
dont load streaming files on dedicated server
2023-02-07 01:02:30 +00:00
BobTheBob 31a05c35e6
Flush loggers properly on dedicated server shutdown (#413)
flush loggers properly on dedicated server shutdown
2023-02-06 01:25:06 +01:00
BobTheBob f7b7de8a58
Allow `launchplaylist` to be used to start dedicated servers (#409)
allow launchplaylist to be used to start dedicated servers
2023-02-01 20:25:45 +00:00
Rémy Raes d418217e0a
feat: Remote mods directory (#403)
* feat: create remote mod directory

* feat: look for mods in remote mods directory
2023-01-30 10:44:37 +00:00
Glacir 2c02e7bc6a
Format content of `enabledmods.json` (#406)
Format enabledmods.json
2023-01-30 10:44:16 +00:00
BobTheBob 75ae0bf4f6
fix broken filters (#407) 2023-01-29 14:43:12 +00:00
uniboi 568f123134
remove debug logging (#402) 2023-01-26 09:04:55 +00:00
uniboi 9b6731de9a
Expose Cursor Position to UI vm (#387)
* add NSGetCursorPosition

* fix vs filters

* fix clang formatting

* Create wininfo.h

* Create wininfo.cpp

* add wininfo to compiler options

* add wininfo to filters

* move wininfo

* clamp position to screen size
2023-01-21 10:36:55 +00:00
p0358 3a61626271
Pedantic fix for #391 (use if-else instead of if) (#392)
Pedantic fix for previous commit (3cfd6f9) (use if-else instead of if)
2023-01-20 16:24:03 +00:00
BobTheBob 063260ca0b
Execute cfgs before server startup for gamemode being run (#398)
* run cfg to initialise gamemode on startup

* remove ; characters from mp_gamemode

* exec using _Cmd_Exec_f to avoid issues with semicolons in gamemode names
allowing additional commands to be run

* run from cfg/server/ rather than cfg/

* fixup formatting
2023-01-13 15:28:09 +01:00
uniboi 8bddf5bfe8
push vectors to stack correctly (#395)
push to stack correctly

Co-authored-by: Maya <RoyalBlue1@users.noreply.github.com>

Co-authored-by: Maya <RoyalBlue1@users.noreply.github.com>
2023-01-11 19:29:11 +00:00
BobTheBob d4f90eafc9
Fix overriding individual localisation strings being weird (#394)
* change how we load localisation to fix overriding individual
localisation strings

* fix formatting

* fix formatting again
2023-01-06 21:40:02 +01:00
p0358 3cfd6f96e3
Fix issues of restriction of chat message charset (#391) 2023-01-06 18:00:42 +00:00
GeckoEidechse 2f4a12aee9
Revert "add FCVAR_REPLICATED to ns_server_name" (#390)
Revert "add FCVAR_REPLICATED to ns_server_name (#386)"

This reverts commit ca2530b825.
2023-01-06 16:55:46 +00:00
pg9182 33eb3254ba
Restrict chat message charset (#389) 2023-01-05 23:03:37 +01:00
cat_or_not ca2530b825
add FCVAR_REPLICATED to ns_server_name (#386)
* add FCVAR_REPLICATED to ns_server_name

* add FCVAR_REPLICATED ns_server_desc too
2023-01-05 02:14:03 +00:00
Jack efc7befe1f
Improve response to UI VM compile errors (#388)
* log reaction to script compile errors

* move log line to make a bit more sense

* change log message and show console on non-fatal ui compile error

* improve SQSharedState struct and CSquirrelVM struct

Co-Authored-By: Maya <11448698+RoyalBlue1@users.noreply.github.com>

* Improve IsUIVM

Co-Authored-By: Maya <11448698+RoyalBlue1@users.noreply.github.com>

* Remove now-unnecessary showing of console

* remove extra logging

Co-authored-by: Maya <11448698+RoyalBlue1@users.noreply.github.com>
2023-01-04 21:12:53 +00:00
BobTheBob 4fb1ae07d8
generally cleanup authentication code and fix client state issues with rejection from local server (#360)
* generally cleanup authentication code and fix client state issues with
rejection from local server

* fix formatting

* fix formatting

* use client-provided uid for logging disconnect failure as it won't be
copied to player if authentication fails

* support loading savegame and use more reliable method for fixing
client rejection issues

* oops forgot to add rejectconnectionfixes.cpp

* fixup formatting
2023-01-04 00:36:51 +00:00
Erlite a4aab8da64
Add missing breaks to AsyncCall_External() (#382) 2022-12-26 15:51:53 +01:00
Erlite a3284252b9
Process all squirrel messages in the buffer instead of one per frame. (#381)
* Process all squirrel messages in the buffer instead of one per frame.

* Move on to the next message if no function is found,.
2022-12-26 15:51:42 +01:00
Erlite 2c5dd95395
Add NSGetLocalPlayerUID() function. (#371)
* Add NSGetLocalPlayerUID() function.

* Format fix.

* All VMS actually why not

* Add missing includes
2022-12-22 20:09:33 +01:00
Erlite 743bd2427e
Add NSDisconnectPlayer() function. (#376)
* Add NSDisconnectPlayer() function.

* Formatting tweaks
2022-12-22 20:07:08 +01:00
Emma Miler ff889f1682
Add NSGetModName (#366)
* Stackinfos

* Formatting

* Add option for depth

* Revert "Merge branch 'main' into stackinfos"

This reverts commit e9e8948d2a, reversing
changes made to d1cf18f716.

* Move macros header

* Add macro header to filters

* Fix merge conflict mistake

* Fix stuff

* I hate git

* create `NSGetCurrentModName`

* Fix merge issues
2022-12-22 20:05:45 +01:00
Emma Miler 64100065b5
Add script concommands (#373)
* Add script concommands

* Fix indent

* Formatting

* Formatting stuff

* Changes for review

* Fix typo

* Forgot to remove the return statement

* Formatting
2022-12-22 19:59:10 +01:00
Emma Miler 7cdf27e6df
Fix UI VM Destruction (again again) (#380) 2022-12-22 19:31:30 +01:00
Emma Miler 314166100f
Fix console not enabling (#379) 2022-12-22 16:06:49 +01:00
Emma Miler e04f3b36ac
Restructuring (#365)
* Remove launcher proxy

* Restructuring

* More restructuring

* Fix include dirs

* Fix merge

* Remove clang thing

* Filters

* Oops
2022-12-19 19:32:16 +01:00
Emma Miler 33f18a7359
Fix UI VM destruction (again) (#370) 2022-12-16 15:44:28 +01:00
Erlite f0285618c3
Implement HTTP requests for Squirrel scripts (#344)
* Native HttpRequestHandler to make HTTP requests from Squirrel

* Init handler & register SQ funcs

# Conflicts:
#	NorthstarDLL/NorthstarDLL.vcxproj
#	NorthstarDLL/NorthstarDLL.vcxproj.filters

* Allow redirects, fix crashing with buffer.

* Also read response header

* Remove leftover header debug stuffs

* Prevent private network requests unless -allowlocalhttp is in the command line.

* Minor tweak

* Support all HTTP methods, private network check changes.

* Add OPTIONS, timeout & user-agent overrides.

* Add -disablehttprequests, final tweaks.

* Fix one of the private ipv4 ranges

* Native HttpRequestHandler to make HTTP requests from Squirrel

* Init handler & register SQ funcs

# Conflicts:
#	NorthstarDLL/NorthstarDLL.vcxproj
#	NorthstarDLL/NorthstarDLL.vcxproj.filters

* Allow redirects, fix crashing with buffer.

* Also read response header

* Remove leftover header debug stuffs

* Prevent private network requests unless -allowlocalhttp is in the command line.

* Minor tweak

* Support all HTTP methods, private network check changes.

* Add OPTIONS, timeout & user-agent overrides.

* Add -disablehttprequests, final tweaks.

* Fix one of the private ipv4 ranges

* Update to latest and fix issues mentionned in previous PR

* Cleanup some return statements

* Also cache IsLocalHttpAllowed(), query param array work

* Cache command line args in ctor, more header/query array work

* Support for multiple values with same key in headers & query params

* Format check made this look disgusting, don't blame me.

* More format fixes

* Tweakerino

* Tell clang-format to segfault itself

* Add -disablehttpssl to ignore SSL verifications

* Fix headers being written to body with custom headers

* Remove useless comments
2022-12-13 17:51:39 +01:00
pg9182 5fde176a9a
Add platform information to User-Agent (#367)
* Add platform information to User-Agent.
* Identify dedicated servers in the User-Agent.
2022-12-11 18:47:55 -05:00
Emma Miler 08c30b23cd
Log function lookup failure on Call (#355)
* Log function lookup failure on Call

* Formatting

* Update squirrel.cpp

* format
2022-12-11 22:57:18 +01:00
Emma Miler 013548a64b
Remove launcher proxy (#363)
* Remove launcher proxy

* Remove project from solution
2022-12-11 22:52:39 +01:00
Erlite 652f5662f6
Make most mod-setting related funcs global. (#364)
Make most mod-setting related funcs global
2022-12-11 20:12:06 +01:00
BobTheBob 004fcecf05
Remove sv_cheats requirement from r_drawviewmodel (#328)
It's allowed in CS:GO, and already possible with mods anyways.
2022-12-08 19:09:36 -05:00
Emma Miler 778c93587a
Fix UI VM Destruction (#349)
The functions in question take a CSquirrelVM* instead of an HSquirrelVM*, which
causes IsUIVM() always returns false.
2022-12-08 19:03:57 -05:00
Emma Miler 2d59006262
Move include directory (#337)
* Move include directory to shared folder

This commit moves the `include` directory from the NorthstarDLL project folder to the solution folder. This allows both the DLL and Launcher project to target it properly.

* Fix filters

* Update memalloc.h

* Fix filters

* Update NorthstarLauncher.vcxproj

* Remove stuff from other PR

* Update NorthstarLauncher.vcxproj

* Update NorthstarLauncher.vcxproj

* Update NorthstarDLL.vcxproj
2022-12-02 23:00:33 +01:00
Jack be78dbacc5
Don't set initial dedicated server title to the profile name (#352)
Should help with #347
2022-12-01 20:57:50 +01:00
Emma Miler 69eece729c
Update exit value in hooks to valid code (#354) 2022-12-01 20:32:32 +01:00
Emma Miler a046eec2d9
Exit instead of abort on server compile error (#353)
* Exit instead of abort on server compile error

Dedicated server should almost never call abort in the event of a crash.

* Update NorthstarDLL/squirrel.cpp

* Update squirrel.cpp

* Update squirrel.cpp
2022-12-01 20:29:57 +01:00
wolf109909 4a00450e59
Fix script compile errors not being flushed to log file (#342)
Otherwise application will crash before finishing to write to log file.
2022-11-27 22:50:26 +01:00
Emma Miler 9ed73b5b98
Pre-init squirrel managers (#348)
* init

* Format
2022-11-27 21:27:42 +01:00
GeckoEidechse 3d7e310a32
Parse and expose region field from JSON server list (#232)
* Add parsing region field from JSON server list
* Add function to read server region from Squirrel
* Update logic to post-refactor code
* Make region field optional
2022-11-26 04:33:39 -05:00
GeckoEidechse c409332991
Bump used Actions version (#339)
Old version is being deprecated by GitHub
2022-11-22 12:25:31 +01:00
BobTheBob d082bdc9b3
Add support for querying player userinfo cvars in script (#293)
* add support for querying player userinfo cvars in script

* bring up to date with main

* add more native methods for getting userinfo kvs of different types

* update to main and use new sqfunc macros

* Revert "update to main and use new sqfunc macros"

This reverts commit 2eacc00fcb.

* use new macros for adding sq func

* improve formatting
2022-11-20 23:59:56 +00:00