Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiauth #3

Open
wants to merge 31 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
85fab17
check launcher data dir
DEATHB4DEFEAT Jan 31, 2025
1bf0687
Fix poly pooling (#5645)
metalgearsloth Feb 1, 2025
bd69d51
Version: 242.0.1
metalgearsloth Feb 2, 2025
2719b9f
Tweak grid state slightly (#5644)
metalgearsloth Feb 3, 2025
fc55c8e
Add saved BUI positions (#5650)
metalgearsloth Feb 3, 2025
6a336d2
Version: 243.0.0
metalgearsloth Feb 3, 2025
c4a5752
Shared portion of PvsOverrideSystem to allow for usage in shared (#5651)
ScarKy0 Feb 4, 2025
d2aa8ec
Fixing guidebook not resizable from left and right (#5618)
PROG-MohamedDwidar Feb 8, 2025
51971d0
Revert basewindow change (#5664)
metalgearsloth Feb 8, 2025
1a7e490
Version: 243.0.1
metalgearsloth Feb 8, 2025
ae7725a
Add compreg methods to entitymanager (#5655)
metalgearsloth Feb 10, 2025
6979a63
Add CreateWindowCenteredRight method (#5666)
metalgearsloth Feb 11, 2025
9e9ac56
Bump physics speed cap (#5667)
metalgearsloth Feb 11, 2025
a734bc5
Avoid unnecessary UpdateState calls for BUIs (#5670)
metalgearsloth Feb 12, 2025
bb9517f
Check equatable on client-predicted BUI states (#5671)
metalgearsloth Feb 12, 2025
fea592e
Version: 244.0.0
metalgearsloth Feb 12, 2025
d442d90
no more (#5676)
MilonPL Feb 13, 2025
afaef64
Fix MappingDataNode.TryAddCopy() (#5677)
ElectroJr Feb 14, 2025
55571ef
Version: 245.0.0
ElectroJr Feb 14, 2025
0c41a04
Move `ParseObject` method into a public class for content to use (#5674)
Simyon264 Feb 14, 2025
7016fac
Tweak UserInterfaceComponent shutdown to prevent bugs (#5678)
ElectroJr Feb 14, 2025
fec81bc
Add more info to AnchorEntity debug assert (#5668)
Tayrtahn Feb 16, 2025
e163c49
fix: fixed EntityPrototypeView not reacting on SetPrototype when Ente…
Fildrance Feb 16, 2025
c011eff
Increase audio despawn buffer (#5665)
metalgearsloth Feb 16, 2025
bcb5c2d
Version: 245.1.0
metalgearsloth Feb 16, 2025
ea1cc5e
Planet lighting pre-reqs (#5490)
metalgearsloth Feb 16, 2025
9d1b15a
Version: 246.0.0
metalgearsloth Feb 16, 2025
d418c66
allow connecting with multiple of whitelisted auth servers
DEATHB4DEFEAT Feb 23, 2025
fc63700
merge RT v246.0.0
DEATHB4DEFEAT Feb 23, 2025
92d3470
readme
DEATHB4DEFEAT Feb 23, 2025
dcfc211
Merge branch 'master' of https://github.com/Simple-Station/Supermatte…
DEATHB4DEFEAT Feb 23, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions MSBuild/Robust.Engine.Version.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<Project>
<!-- This file automatically reset by Tools/version.py -->
<PropertyGroup><Version>242.0.0</Version></PropertyGroup>
</Project>
<Project>
<!-- This file automatically reset by Tools/version.py -->
<PropertyGroup>
<Version>0.0.1</Version>
</PropertyGroup>
</Project>
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,23 @@
![Robust Toolbox](https://raw.githubusercontent.com/space-wizards/asset-dump/3dd3078e49e3a7e06709a6e0fc6e3223d8d44ca2/robust.png)
Supermatter Engine is a game engine primarily being developed for [Space Station 14](https://github.com/Simple-Station/Einstein-Engines).

Robust Toolbox is an engine primarily being developed for [Space Station 14](https://github.com/space-wizards/space-station-14), although we're working on making it usable for both [singleplayer](https://github.com/space-wizards/RobustToolboxTemplateSingleplayer) and [multiplayer](https://github.com/space-wizards/RobustToolboxTemplate) projects.

Use the [content repo](https://github.com/space-wizards/space-station-14) for actual development, even if you're modifying the engine itself.
Use the [content repo](https://github.com/Simple-Station/Einstein-Engines) for actual development, even if you're modifying the engine itself.

## Project Links

[Website](https://spacestation14.io/) | [Discord](https://discord.gg/t2jac3p) | [Forum](https://forum.spacestation14.io/) | [Steam](https://store.steampowered.com/app/1255460/Space_Station_14/) | [Standalone Download](https://spacestation14.io/about/nightlies/)
[Website](https://simplestation.org/) | [Discord](https://discord.gg/X4QEXxUrsJ) | [Steam](https://store.steampowered.com/app/1255460/Space_Station_14/) | [Standalone Download](https://spacestation14.io/about/nightlies/)

## Documentation/Wiki

The [wiki](https://docs.spacestation14.io/) has documentation on SS14s content, engine, game design and more. We also have lots of resources for new contributors to the project.

## Contributing

We are happy to accept contributions from anybody. Get in Discord or IRC if you want to help. We've got a [list of issues](https://github.com/space-wizards/RobustToolbox/issues) that need to be done and anybody can pick them up. Don't be afraid to ask for help either!
We are happy to accept contributions from anybody. It is recommended to join our Discord if you want to help. We've got a [list of issues](https://github.com/Simple-Station/SupermatterEngine/issues) that need to be done and anybody can pick them up. Don't be afraid to ask for help either!

## Building

This repository is the **engine** part of SS14. It's the base engine all SS14 servers will be built on. As such, it does not start on its own: it needs the [content repo](https://github.com/space-wizards/space-station-14). Think of Robust Toolbox as BYOND in the context of Space Station 13.
This repository is the **engine** part of SS14. It's an engine SS14 servers are built on. As such, it does not start on its own: it needs the [content repo](https://github.com/Simple-Station/Einstein-Engines). Think of SME as BYOND in the context of Space Station 13.

## Legal Info

See [legal.md](https://github.com/space-wizards/RobustToolbox/blob/master/legal.md) for licenses and copyright.
See [legal.md](https://github.com/Simple-Station/SupermatterEngine/blob/master/legal.md) for licenses and copyright.
101 changes: 100 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ END TEMPLATE-->

### Bugfixes

* Fixed prototype reloading/hotloading not properly handling data-fields with the `AlwaysPushInheritanceAttribute`
*None yet*

### Other

Expand All @@ -54,6 +54,105 @@ END TEMPLATE-->
*None yet*


## 246.0.0

### Breaking changes

* The fixes to renderer state may have inadvertantly broken some rendering code that relied upon the old behavior.
* TileRenderFlag has been removed and now it's just a byte flag on the tile for content usage.

### New features

* Add BeforeLighting overlay draw space for overlays that need to draw directly to lighting and want to do it immediately beforehand.
* Change BlurLights to BlurRenderTarget and make it public for content usage.
* Add ContentFlag to tiles for content-flag usage.
* Add a basic mix shader for doing canvas blends.
* Add GetClearColorEvent for content to override the clear color behavior.

### Bugfixes

* Fix pushing renderer state not restoring stencil status, blend status, queued shader instance scissor state.


## 245.1.0

### New features

* Add more info to the AnchorEntity debug message.
* Make ParseObject public where it will parse a supplied Type and string into the specified object.

### Bugfixes

* Fix EntityPrototypeView not always updating the entity correctly.
* Tweak BUI shutdown to potentially avoid skipping closing.

### Other

* Increase Audio entity despawn buffer to avoid clipping.


## 245.0.0

### Breaking changes

* `BoundUserInterface.Open()` now has the `MustCallBase` attribute

### Bugfixes

* Fixed an error in `MappingDataNode.TryAddCopy()`, which was causing yaml inheritance/deserialization bugs.


## 244.0.0

### Breaking changes

* Increase physics speedcap default from 35m/s to 400m/s in-line with box2d v3.

### New features

* Add EntityManager overloads for ComponentRegistration that's faster than the generic methods.
* Add CreateWindowCenteredRight for BUIs.

### Bugfixes

* Avoid calling UpdateState before opening a BUI.


## 243.0.1

### Bugfixes

* Fixed `BaseWindow` sometimes not properly updating the mouse cursor shape.
* Revert `BaseWindow` OnClose ordering due to prior reliance upon the ordering.


## 243.0.0

### Breaking changes

* RemoveChild is called after OnClose for BaseWindow.

### New features

* BUIs now have their positions saved when closed and re-used when opened when using the `CreateWindow<T>` helper or via manually registering it via RegisterControl.

### Other

* Ensure grid fixtures get updated in client state handling even if exceptions occur.


## 242.0.1

### Bugfixes

* Fixed prototype reloading/hotloading not properly handling data-fields with the `AlwaysPushInheritanceAttribute`
* Fix the pooled polygons using incorrect vertices for EntityLookup and MapManager.

### Internal

* Avoid normalizing angles constructed from vectors.


## 242.0.0

### Breaking changes
Expand Down
6 changes: 6 additions & 0 deletions Resources/EnginePrototypes/Shaders/stockshaders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
kind: canvas
light_mode: unshaded

# Simple mix blend
- type: shader
id: Mix
kind: canvas
blend_mode: Mix

- type: shader
id: shaded
kind: canvas
Expand Down
96 changes: 96 additions & 0 deletions Robust.Benchmarks/EntityManager/HasComponentBenchmark.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Engines;
using JetBrains.Annotations;
using Robust.Shared.Analyzers;
using Robust.Shared.GameObjects;
using Robust.Shared.Map;
using Robust.UnitTesting.Server;

namespace Robust.Benchmarks.EntityManager;

[Virtual]
public partial class HasComponentBenchmark
{
private static readonly Consumer Consumer = new();

private ISimulation _simulation = default!;
private IEntityManager _entityManager = default!;

private ComponentRegistration _compReg = default!;

private A _dummyA = new();

[UsedImplicitly]
[Params(1, 10, 100, 1000)]
public int N;

[GlobalSetup]
public void GlobalSetup()
{
_simulation = RobustServerSimulation
.NewSimulation()
.RegisterComponents(f => f.RegisterClass<A>())
.InitializeInstance();

_entityManager = _simulation.Resolve<IEntityManager>();
var map = _simulation.CreateMap().Uid;
var coords = new EntityCoordinates(map, default);
_compReg = _entityManager.ComponentFactory.GetRegistration(typeof(A));

for (var i = 0; i < N; i++)
{
var uid = _entityManager.SpawnEntity(null, coords);
_entityManager.AddComponent<A>(uid);
}
}

[Benchmark]
public void HasComponentGeneric()
{
for (var i = 2; i <= N+1; i++)
{
var uid = new EntityUid(i);
var result = _entityManager.HasComponent<A>(uid);
Consumer.Consume(result);
}
}

[Benchmark]
public void HasComponentCompReg()
{
for (var i = 2; i <= N+1; i++)
{
var uid = new EntityUid(i);
var result = _entityManager.HasComponent(uid, _compReg);
Consumer.Consume(result);
}
}

[Benchmark]
public void HasComponentType()
{
for (var i = 2; i <= N+1; i++)
{
var uid = new EntityUid(i);
var result = _entityManager.HasComponent(uid, typeof(A));
Consumer.Consume(result);
}
}

[Benchmark]
public void HasComponentGetType()
{
for (var i = 2; i <= N+1; i++)
{
var uid = new EntityUid(i);
var type = _dummyA.GetType();
var result = _entityManager.HasComponent(uid, type);
Consumer.Consume(result);
}
}

[ComponentProtoName("A")]
public sealed partial class A : Component
{
}
}
51 changes: 42 additions & 9 deletions Robust.Client/Console/Commands/LauncherAuthCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Robust.Client.Utility;
using Robust.Shared.Console;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Network;

namespace Robust.Client.Console.Commands
Expand All @@ -15,31 +16,61 @@ internal sealed class LauncherAuthCommand : LocalizedCommands
[Dependency] private readonly IGameControllerInternal _gameController = default!;

public override string Command => "launchauth";
public override string Help => "Usage: launchauth <optional username> <optional server id> <optional server url>";

public override void Execute(IConsoleShell shell, string argStr, string[] args)
{
var wantName = args.Length > 0 ? args[0] : null;
string? username = null;
string? serverId = null;
string? serverUrl = null;
if (args.Length > 0)
username = args[0];
if (args.Length > 1)
serverId = args[1];
if (args.Length > 2)
serverUrl = args[2];

var basePath = UserDataDir.GetRootUserDataDir(_gameController);
var launcherDirName = Environment.GetEnvironmentVariable("SS14_LAUNCHER_APPDATA_NAME") ?? "launcher";
var dbPath = Path.Combine(basePath, launcherDirName, "settings.db");

#if USE_SYSTEM_SQLITE
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3());
#endif
#if USE_SYSTEM_SQLITE
SQLitePCL.raw.SetProvider(new SQLitePCL.SQLite3Provider_sqlite3());
#endif
using var con = new SqliteConnection($"Data Source={dbPath};Mode=ReadOnly");
con.Open();
using var cmd = con.CreateCommand();
cmd.CommandText = "SELECT UserId, UserName, Token FROM Login WHERE Expires > datetime('NOW')";
cmd.CommandText = "SELECT UserId, UserName, Token, Server, ServerUrl FROM Login WHERE Expires > datetime('NOW')";

if (wantName != null)
if (username != null)
{
cmd.CommandText += " AND UserName = @userName";
cmd.Parameters.AddWithValue("@userName", wantName);
cmd.Parameters.AddWithValue("@userName", username);
}

cmd.CommandText += " LIMIT 1;";
if (serverId != null)
{
cmd.CommandText += " AND Server = @serverId";
cmd.Parameters.AddWithValue("@serverId", serverId);
if (serverId == IAuthManager.CustomServerId)
{
if (serverUrl == null)
{
shell.WriteLine("Custom server requires a URL");
return;
}

cmd.CommandText += " AND ServerUrl = @serverUrl";
cmd.Parameters.AddWithValue("@serverUrl", serverUrl);
}
else if (serverUrl != null)
{
shell.WriteLine("Server URL is only valid for custom servers");
return;
}
}

cmd.CommandText += " LIMIT 1;";
using var reader = cmd.ExecuteReader();

if (!reader.Read())
Expand All @@ -51,11 +82,13 @@ public override void Execute(IConsoleShell shell, string argStr, string[] args)
var userId = Guid.Parse(reader.GetString(0));
var userName = reader.GetString(1);
var token = reader.GetString(2);
serverUrl = reader.GetString(4);

_auth.Token = token;
_auth.UserId = new NetUserId(userId);
_auth.UserServer = new("unset", new(serverUrl));

shell.WriteLine($"Logged into account {userName}");
shell.WriteLine($"Logged into account {userName}@{reader.GetString(3)} ({serverUrl})");
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion Robust.Client/GameControllerOptions.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using Robust.Shared;
using Robust.Shared.Utility;

Expand All @@ -19,7 +20,7 @@ public sealed class GameControllerOptions
/// <summary>
/// Name the userdata directory will have.
/// </summary>
public string UserDataDirectoryName { get; init; } = "Space Station 14";
public string UserDataDirectoryName { get; init; } = Environment.GetEnvironmentVariable("SS14_LAUNCHER_DATADIR") ?? "SimpleStation14";

/// <summary>
/// Name of the configuration file in the user data directory.
Expand Down
Loading
Loading