r2northstar / northstarlauncher Goto Github PK
View Code? Open in Web Editor NEWLauncher used to modify Titanfall 2 to allow mods to be loaded
License: MIT License
Launcher used to modify Titanfall 2 to allow mods to be loaded
License: MIT License
This is not needed when running within a container since logs will be read from stdout/stderr and managed by the host.
Benefits:
I'm currently thinking of implementing this by passing a config struct to the ns init function containing references to functions which resolve paths, read input, and write output. The bulk of the logic will still be in the DLL, and it will be possible to make the DLL standalone and inject it with other methods simply by having a default implementation there.
https://discord.com/channels/920776187884732556/943369531538173993/943574689035456512
... I'll also work on reworking the launcher exe to deal with paths and input/output and pass that config via a struct to the dll init function (although bob hasn't decided if he wants this in the end or not), making the dll use absolute paths for all ns stuff, and making it detect the titanfall path from either the current dir, the registry (for the installations using EAInstaller's touchup; i.e., steam and origin), or a command line flag / env var, which will allow use to have ns/tf2/ns mods/data in separate folders (greatly simplifying the install process, development, running multiple dedicated servers, and my container image entrypoint) (all of this is still tentative; it depends on how busy I am and whether tf2 itself works fine this way)
Note that I still haven't fully decided if I'm going to take this approach; I'm still in the phase of experimenting with possible solutions, and I'm also somewhat busy right now.
At startup locate old logfiles and gzip them to save disk space.
We forgot to update the version resource in the launcher on v1.4.0
release.
(Lines 64, 65, 82, 87)
We probably wanna add that to some release checklist, maybe even do a safety check in CI to make sure values on those lines and release tag match up.
Forgive me for not putting more, but it starts at the bottom 50 lines,
nslog2022-02-09 21-22-44.txt
To prevent players from running into issues due to using older versions of the client, Northstar launcher should do an update check every time it is launched.
A possible setup would having a file called VERSION.txt
inside the release zip that contains the current version. That value is then compared to and endpoint on master server (like /client-version
) and a warning is displayed if the versions don't match up.
Warning should however be skippable.
A failed connection to master server should also display a warning but that too should be skippable (to prevent DoSing all clients by just taking down server).
Additionally by exposing the newest/desired client version via master server, 3rd party master servers could also request older clients if they themselves are not up to date (due to breaking changes).
Some form of CI to build launcher binaries on every commit would help a lot with testing pre-releases and pull requests.
Would also be useful in the future when doing packaged releases on the main release repo.
Right now, this launcher requires Titanfall2-unpacked.exe
to be present with it in the zip file, which means distributing Respawn/EA owned assets.
I think it would be safer for the project if the launcher automatically unpacks/patches Titanfall2.exe
into Titanfall2-unpacked.exe
if the latter is missing, then launches it. This way you don't need to distribute the asset with the launcher.
Additionally, it could help speed up packaging new releases, because you don't need to include Titanfall2-unpacked.exe
In order to reduce the damage any undetected exploit can do we should try to intercept filesystem calls of the Titanfall2 install and ensure that they are within the Titanfall2\
.
This way any damage done by an exploit would be limited to within the Titanfall2
which both reduces the amount of damage it could do to the system as well reducing the amount of information it could leak from the users system, as the game install folder typically contains very little private information.
In order to test whether such an implementation was successful, place a known working .bik
menu video a folder above Titanfall2\
.
So it would look as follows:
.
├───other-Steam/Origin-games
├───some-menu-video.bik
└───Titanfall2
Then launch Northstar and from the main menu inside the console run
script_ui DisableBackgroundMovie(); script_ui PlayVideo("../../../bik-filename-without-the-dot-bik", 0, 0, 0, 0, false)
If the video plays, the game can still read files outside the install folder meaning the implemented hook was not successful.
Titanfall2\
like Documents\Respawn\Titanfall2\local\settings.cfg
that the game still needs to be able to accessIf there's anything sensitive in the Titanfall2
by default we should also restrict access to that part.
(Anything Origin related in their that contains sensitive stuff like authentication tokens etc?)
We should create our own external console window, as the one we use right now makes it tricky to have a console window when invoked from another application.
As the title says, if a mod overrides the northstar_client_localisation text files, the game will crash when exiting a match.
Recreation:
Notes:
Recreation was performed using this mod: https://github.com/Erodynamics/TF2Translation.JPtoEN/releases/tag/v1.0.1
This would allow mods to save data, allowing for better banlists, and other functions. Since there doesn't seem to be a way to do this due to Respawn's modification of Squirrel, the easiest option is probably to add the functions here similarly to how functions like NSSetModEnabled work
Alt-tabbing and sharing screens on Discord can be a pain with the console window open, and not many people are going to use it anyways, so a command-line argument that can be placed into origin's launch args or into the Northstar arguments text file would be really nice to have. Also, when starting Northstar without Origin or EA Desktop open, when it opens the app it should be minimised or hiding in the system tray.
It might be a good idea to replace this with a snprintf + proper error checking in the future, but it won't overflow with any reasonable version (and we control that), so it's probably ok to leave it for now.
Originally posted by @pg9182 in #113 (comment)
Cause: Not sure, but I was in an LTS match, and as soon as the next game started it crashed the client
I am not very gifted in the field of coding and whatnot but I'm having a rather consistent issue. Simply skipping the killcam and respawning results in a crash to desktop. Crash log attached
nslog2022-01-23 17-27-19.txt
.
Dedicated server seemingly crashing on dropship spawn.
As discovered during testing, we'll need to build the version number into the DLL so we can still extract it even when launched via vanilla titanfall 2 and the launcher proxy or wsock32 stub (i.e., steam).
TLDR: I got the dlls I created for my Docker container working on Windows, drastically reducing the resource usage of the dedicated server by eliminating the need for softwared3d11 (and the multiple gigabytes of memory usage) or a GPU. This will serve as an interim solution until @Mauler125 gets around to the patches for completely eliminating matsys.
Currently, you can simply copy the stubs into the bin/x64_retail
dir, replacing the existing ones. I am planning to add functionality to load the DLLs explicitly from the bin/x64_dedi
(or bin/x64_stubs
maybe) dir instead (once they're loaded, windows resolves relative imports by the base module name, so we've effectively replaced the real DLLs) to streamline the process and eliminate the need to replace base game files.
pg9182/northstar-dedicated@6b5645e/src/d3d11
pg9182/northstar-dedicated@6b5645e/src/gfsdk
R2Northstar/Northstar#149 (comment)
Discord > #server-hosting > #windows-stubs : 943573635992547378
so as discussed on VC, I'll put the stubs in a new NorthstarStubs repo with CI and binary releases, then bob'll adopt it into the org and give me admin on that repo, then I'll open a PR to load the stubs in the launcher from bin/x64_dedi (if it exists) for dedi, then I'll open a PR to add the stubs to the release packages
Discord > #server-hosting > #windows-stubs : 943582877189292094
[as further discussed], we'll keep the softwared3d11 flag, but make the stubs the default (softwared3d11 will disable them but print a warning message)
I'm attempting to run the server under AMP by CubeCoders as a generic module. This runs under the Network Service user. I'm able to start the server fine using the same files outside of AMP, but get the attached error when attempting inside. I am more than willing/capable to diagnose the AMP side, but would appreciate any guidance on the NorthStar side. Can you please shed some light on where I might look for the cause?
VirusTotal deems the .dll file malware.
obv. a false positive, as previously with NorthstarLauncher.exe
i've contacted MaxSecure about whitelisting the file, so i'll wait for an email response.
We had a bunch of contributors complaining by now that clang-format messed up their technically well-formatted code.
We should make sure that clang-format enforces code style while also not creating weird formatting situations on supposedly well formatted code.
Useful tool: https://zed0.co.uk/clang-format-configurator/
By adding a way for mods to read chat messages mods can then be used to perform actions based on a message sent in chat.
For example currently there are already mods that allow you to vote skip maps like Takyon.PlayerVote by issuing a command like !skip
via the console.
The issue is that the console is not the most accessible place to issue such commands.
Depending on the command it might not be wise to broadcast the message back to other players. So allowing a server mod to prevent forwarding such a message might be another thing worth investigating.
Adding version info via a version resource would allow third party update checkers to easily check which version is installed
I was able to play when I first installed it but now it loads the screen that you would normally see the animation and Menu. I get the animation but no menu. There is an error on the console:
[info] Enabling hook OnCommandSubmittedHook
[info] Building custom scripts.rson
[info] changing mod search path from E:\Titanfall 2\Titanfall2\R2Northstar\mods\Northstar.Custom\mod to R2Northstar/mods\Northstar.Client
[info] changing mod search path from E:\Titanfall 2\Titanfall2\R2Northstar\mods\Northstar.Client\mod to R2Northstar/mods\Northstar.Custom
[info] changing mod search path from E:\Titanfall 2\Titanfall2\R2Northstar\mods\Northstar.Custom\mod to R2Northstar/mods\Northstar.Client
[info] changing mod search path from E:\Titanfall 2\Titanfall2\R2Northstar\mods\Northstar.Client\mod to R2Northstar/mods\Northstar.Custom
[info] changing mod search path from E:\Titanfall 2\Titanfall2\R2Northstar\mods\Northstar.Custom\mod to R2Northstar/mods\Northstar.Client
[error] CLIENT SCRIPT COMPILE ERROR Undefined variable "IsNorthstarServer"
[error] ui/openinvites.nut line [205] column [50]
[info] DestroyVM UI 0x626e700
[info] Building KeyValues for file playlists_v2.txt
[info] MountVPK vpk/client_mp_common.bsp
[info] MountVPK R2Northstar/mods\Northstar.Custom\vpk\client_mp_northstar_common.bsp
[info] 0x45cee80
[info] MountVPK vpk/client_mp_common.bsp
[info] MountVPK R2Northstar/mods\Northstar.Custom\vpk\client_mp_northstar_common.bsp
[info] 0x45cee80
Should add a field to the plugin manifest to control whether it should be loaded on client and/or server
When using the 1.0.1 version of the release, some(?) servers will not show up in the server browser although it is listed in the console.
(using custom masterserver in this pic, but it doesn't work even with bob's official server for me.)
reverting northstar.client mod back to 1.0.0 version solved the issue, server is properly displayed and connectable.
When using the key to deploy my anti-titan weapon, it deploys my secondary sidearm and vice versa. Also, when using the switch weapon bind, it toggles between the anti-titan weapon and primary where is should toggle between side arm and primary. I think the logic should adhere to what the standard TF2 game has unless there is a really good reason to change this?
As of 1a7b41c (unreleased).
I haven't checked it yet, but my hunch is that it's a regression related to this https://github.com/R2Northstar/NorthstarLauncher/pull/73/files#diff-fc1e49c087e0aa0e7e432a10288ddbd465d6ed30ccb5946c2deea666386e974aR52.
Also:
The dedicated server should export metrics. I will probably work on an initial version of this in my docker image, but I may end up just directly implementing it in the launcher itself.
Some ideas for useful metrics:
northstar_instance_ticks_total
northstar_instance_uptime_seconds
northstar_instance_info{arguments, game_port, auth_port}
(more?) = 1 (maybe?)northstar_match_player_count
northstar_match_player_limit
northstar_match_info{playlist_name, map_name}
= 1northstar_match_duration_seconds
northstar_network_client_latency_milliseconds{uid}
(maybe?)northstar_network_receive_bytes
northstar_network_transmit_bytes
northstar_network_receive_packets
northstar_network_transmit_packets
northstar_cpu_seconds_total
northstar_memory_physical_bytes
northstar_memory_virtual_bytes
The launcher should send a user agent with all requests just in case we ever need to make backwards-incompatible changes.
More specifically, this should be the launcher version, not the mod version, and dev builds should still specify the last released version.
The game becomes unresponsive when tabbing out on fullscreen.
Add some build documentation so people can easily compile their own modified launchers
hey all,
i'm trying to compile this launcher from source, and i can't seem to get it to build. the first error is that it's somehow not detecting i have curl installed, as it keeps complaining:
D:\git repos i stole lol\NorthstarLauncher\NorthstarDedicatedTest\masterserver.cpp(6,10): fatal error C1083: Cannot open include file: 'libcurl/include/curl/curl.h': No such file or directory
it's also complaining a lot about rapidjson, as it keeps saying:
C:\src\vcpkg\installed\x86-windows\include\rapidjson\document.h(665,59): error C2248: 'rapidjson::GenericMemberIterator<false,Encoding,Allocator>::Iterator': cannot access private typedef declared in class 'rapidjson::GenericMemberIterator<false,Encoding,Allocator>'
with
[
Encoding=rapidjson::UTF8<char>,
Allocator=rapidjson::MemoryPoolAllocator<rapidjson::CrtAllocator>
]
if i could get some help with this, that'd be amazing.
When keeping the game open for an hour while staying in lobby, windows becomes unresponsive with lagging mouse movement.
Not entirely sure what causes this yet, but sometimes the logger seem to not initialize correctly, leading to none of the spdlog::info
messages being written to console. It's pretty annoying during debugging.
See title
I'm looking into this in #wineserver cpu usage
and will update this issue once I have definite details.
In the CHudChat::AddGameLine
hook:
NorthstarLauncher/NorthstarDedicatedTest/clientchathooks.cpp
Lines 18 to 28 in 13dcc7d
If squirrel->setupfunc
does not error but IsFirstHud
returns false, squirrel->call
will never be called. The function that squirrel->setupfunc
pushes to the stack will never be popped, leaking memory.
This will happen roughly four times for each chat message, since CHudChat::AddGameLine
is called for every chat hud and IsFirstHud
returns false for all but one of them.
This keeps happening on death of my player. (Not every time). It's always failing to read from 0x00001720
Scrolling up in the logs as stated in the documentation lead me to this error
[2022-02-21 14:33:55.787] [info] [CLIENT SCRIPT] FULL OBITUARY INFO COULD NOT BE RESOLVED
[2022-02-21 14:33:55.788] [info] [CLIENT SCRIPT] attacker: entity (0: class C_World [0])
[2022-02-21 14:33:55.789] [info] [CLIENT SCRIPT] attacker classname: class C_World
[2022-02-21 14:33:55.789] [info] [CLIENT SCRIPT] attackerOwner: null
[2022-02-21 14:33:55.790] [info] [CLIENT SCRIPT] victim: entity (11: player [11])
[2022-02-21 14:33:55.790] [info] [CLIENT SCRIPT] victim classname: player
[2022-02-21 14:33:55.790] [info] [CLIENT SCRIPT] victimOwner: null
[2022-02-21 14:33:55.791] [info] [CLIENT SCRIPT] scriptDamageType: 0
[2022-02-21 14:33:55.791] [info] [CLIENT SCRIPT] damageSourceId: 206
[2022-02-21 14:33:55.791] [info] [CLIENT SCRIPT] sourceDisplayName: #DEATH_FALL
The current icon is only 32x32 pixels large
I don't know the limitations on icon size in win32 but we can definitely go higher than that. I'd suggest using a downscaled version from @xamionex updated version.
Description:
On vanilla Titanfall 2, respawning is disabled right after the "epilogue" banner being displayed during gameplay, while on Northstar, respawns get disabled on the "defeat" banner.
Priority:
low
Reasoning:
To ensure parity in behavior
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.