Coder Social home page Coder Social logo

tera-arise / arise Goto Github PK

View Code? Open in Web Editor NEW
27.0 7.0 1.0 45.73 MB

A game resurrection project for the final build of TERA EU.

Home Page: https://tera-arise.io

License: GNU Affero General Public License v3.0

C# 99.83% Smalltalk 0.12% Shell 0.05%
csharp dotnet gaming modding server tera web client xaml avalonia

arise's People

Contributors

alexrp avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

fatalitechtr

arise's Issues

Implement server-side bridge module provisioning

  • Randomization of packet codes.
  • Patching-in of data center key/IV.
  • Removal of game protection in server-side modules.
  • Patching of module validity duration checks.
  • Time-based module rotation.
  • Random module selection for game connections.

Implement essentials of the website

  • Some basic styling.
  • Background image and logo matching the launcher.
  • Some paragraphs describing the project.
  • Ability to list and view Markdown-based news articles.
  • Download page that grabs the latest release on arise-release by querying the GitHub API.

Explore replacing the game's Scaleform GFx UI with a new Avalonia UI

This is a very, very long term project that will require a lot of experimentation.

The idea is to completely rip out the ancient, slow, and ugly Scaleform GFx UI from the game. We would replace it with a new UI, written from scratch, using Avalonia.

Here's what I think we would roughly have to do:

  • Remove all calls to Scaleform GFx in the client.
  • Hook any functions necessary to get game notifications relevant to the UI subsystem.
  • Figure out how to forward relevant keyboard/mouse/controller input events to the UI subsystem.
  • Write an Avalonia platform backend that hooks into the game's rendering.
  • Actually implement the entire game UI. ๐Ÿ˜ฐ

For the Avalonia backend, I think we would basically just do a classic IDXISwapChain::Present() hook. In the hook, we make Avalonia render using Direct2D or Win2D, which should be fairly easy since Avalonia already has an official Direct2D backend that we can learn from. Using Direct2D is advantageous because it can interoperate with Direct3D.

Note: TERA only works with DirectX 11.0+ since the 64-bit upgrade. However, Direct2D/Direct3D interop will require Direct3D feature level 11.1. Unfortunately, the client currently hardcodes feature level 11.0 when calling D3D11CreateDevice(), so we will need to patch that.

Move generation of deployment manifest into client project

<!--
For production deployments, the data center revision is used as the official
release identifier visible to the launcher and users.
-->
<Target Name="WriteDeploymentManifest"
DependsOnTargets="GetDataCenterParameters">
<PropertyGroup>
<_ManifestJson>
<![CDATA[
{
"version": "$(DataCenterRevision)"
}
]]>
</_ManifestJson>
</PropertyGroup>

This is only used for deploying the client, so we should just generate it as part of the normal build.

- name: Extract build version
id: version
run: |
dotnet build -t:WriteDeploymentManifest
echo version=`jq .version manifest.json -r` >> $GITHUB_OUTPUT

Ability to specify an external vendoring project during build

There needs to be a way to point the build system to a 'vendor project' that can control a few things:

  • The certificate authority for mTLS.
  • The data center key and IV.
  • The game revision number.
  • The path to grab news articles from.

Usage should look something like ./cake -c Release --vendor path/to/vendor.proj. The build system will build that project (if necessary) and then grab whatever it needs from it using well-known target names. If --vendor is not specified, the defaults in this repository will be used, which should be fine for development/contribution purposes.

As part of this effort, also make sure that we remove stuff like this from the repository:

Implement game network and protocol layer

  • Simplified abstractions around QUIC connections and streams.
  • mTLS with strict verification based on the certificates we generate.
  • Automatic packet serialization system based on dynamic code generation.
  • Operation code mappings directed by the bridge module.
  • Handler dispatch system based on reflection?

Complete the upgrade to .NET 8

  • Update global.json.
  • Update all packages in Directory.Packages.props.
  • Update all tools in dotnet-tools.json.
  • Update diagnostic rules in .globalconfig.
  • Maybe other stuff I'm forgetting.

Implement essentials of the launcher

  • Main window with background image, logo, music, and news articles.
  • Gateway and world server URI input (for non-vendored builds only).
  • Account creation, authentication, email/password change, password recovery, and deletion flows.
  • Account status display (unverified, incomplete email change, deletion countdown, ban reason/countdown).
  • Installation, update, and repair flows for TERA.
  • Update and repair flows for TERA Arise.
  • Game launch flow.

Update to Avalonia 11.0

<PackageVersion Include="Avalonia.Diagnostics"
Version="11.0.0-preview4" />
<PackageVersion Include="Avalonia.Skia"
Version="11.0.0-preview4" />
<PackageVersion Include="Avalonia.Themes.Fluent"
Version="11.0.0-preview4" />
<PackageVersion Include="Avalonia.Win32"
Version="11.0.0-preview4" />

<!-- TODO: https://github.com/AvaloniaUI/Avalonia/issues/9549 -->
<TargetFramework>$(TargetFramework)-windows10.0.18362.0</TargetFramework>

<!-- TODO: https://github.com/AvaloniaUI/Avalonia/issues/9539 -->
<ProjectReference Include="../launcher/launcher.csproj"
ExcludeAssets="buildTransitive" />

See: https://github.com/AvaloniaUI/Avalonia/milestone/13

Harden the shipped TERA executable by patching

  • Remove support for the damage meter named pipe.
  • Make S1DataDB::Initialize crash unless we've hooked it appropriately.
  • Make S1Connection::{Connect,Disconnect}, S1ConnectionManager::SendPacket, and S1CommandQueue::RunCommands crash unless we've hooked it appropriately.
  • Make isCompanyDomain and isDevDomain always return false without even checking network configuration.

Maybe other stuff?

Update EmailValidation to get rid of our own `EmailAttribute`

// TODO: https://github.com/jstedfast/EmailValidation/issues/41
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public sealed class EmailAttribute : ValidationAttribute
{
protected override ValidationResult? IsValid(object? value, ValidationContext validationContext)
{
return value == null || EmailValidator.Validate((string)value, true, true)
? ValidationResult.Success
: new ValidationResult(
"Email address format is invalid.",
validationContext?.MemberName is string name ? new[] { name } : null);
}
}

Depends on:

Make `MapSpatialIndex` load geometry data non-eagerly

I'm thinking that we could keep a Dictionary<(int ZoneX, int ZoneY), SoftReference<SpatialZone>> or similar (SoftReference<T>). This would let the geometry data get unloaded when there are no strong references to it. This only works well if we hand out SpatialZone references to callers, which we might not want to do. ๐Ÿค”

An alternative would be to use a MemoryCache with custom eviction logic. For example, we could say that a SpatialZone that hasn't been queried in a while is probably fine to unload.

Implement high-resolution timer infrastructure for task scheduling

Task.Delay() has around ~15 ms of overhead on Windows and ~10 ms on Linux. This is likely to be too much for some combat simulation tasks in the world server.

On Windows, we can implement a custom timer queue backed by CreateWaitableTimerExW (with the CREATE_WAITABLE_TIMER_HIGH_RESOLUTION flag) and SetWaitableTimer (with negative lpDueTime to avoid clock skew).

On Linux, we can use clock_nanosleep (with CLOCK_MONOTONIC_RAW to avoid clock skew) in a dedicated thread. We would need to send the thread a signal with pthread_kill when the due time needs to be updated.

Consider partial trimming in client releases

c9afc56 removed trimming from the build system. While full trimming is impractical for us, we could explore partial trimming. I think we only do reflection on our own assemblies, so there should be no issue with trimming any third-party assemblies that declare themselves trimmable.

Right now, a client release archive with maximum compression is around 171 MB, which seems rather excessive.

Implement gateway API for account creation

This will be needed by the launcher. As with articles (#8), we don't want to have to open a game connection to create an account. The same should probably be the case for changing password, and similar tasks.

Generate Systemd unit files as part of Arise.Server.Daemon build

- name: Generate unit file
run: |
sed -e "s/ENVIRONMENT/${{ inputs.environment }}/g" -e "s/ROLE/${{ inputs.role }}/g" arised.service > arised-${{ inputs.role }}.service
working-directory: src/server/daemon
- name: Upload unit file
uses: appleboy/[email protected]
with:
host: ${{ inputs.environment }}.${{ inputs.role }}.tera-arise.io
fingerprint: ${{ secrets.SSH_FINGERPRINT }}
username: root
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: src/server/daemon/arised-${{ inputs.role }}.service
strip_components: 3
target: /etc/systemd/system

This is the only part of the workflow that litters untracked files in the source tree. We should generate these files as part of the regular build and grab them from the output directory.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.