Dev (#14)
* Fixed dependency * Updates to NeoDictionary * Changes to NeoDictionary * Started working on a Git implementation to integrate into Game Engines in the future * Added commit functionality to the git library * New changes * Added select for NeoDictionary.cs * Fixed issue with previous new method * Added a Benchmarking Tool to be used mostly in game engines * Added IndexOf to NeoDictionary.cs * Added new method for BenchmarkUtility.cs * added an instacedobject class * Added a new shuffle method for lists * fixed return type * Added new Changelog generator * Added new Game logic library to assist with game projects * Added Web Project * Added Nuget package configs * Add workflow for publishing game library NuGet package * Add README for OmegaLeo's Helper Library * Updated Website to reflect all libraries * Fixed missing library in Changelog * Added Contributing and Code of Conduct * Fixed web project * new documentation changes * fix packages * Fixed DocumentationHelper package dependencies * Added Serilog * Added logging * Fixed documentation * Added logging for cache * fixed documentation * Updated README.md * Update README.md Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update OmegaLeo.HelperLib.Web/Controllers/HomeController.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update OmegaLeo.HelperLib.Web/Controllers/HomeController.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix error * changes for Github Packages * Cleanup * Started working on a SteamWorks integration * Added logging * Started working on a Steam library --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit was merged in pull request #14.
This commit is contained in:
@@ -2,14 +2,25 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<TargetFramework>net9.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\OmegaLeo.HelperLib.Changelog\OmegaLeo.HelperLib.Changelog.csproj" />
|
||||
<ProjectReference Include="..\OmegaLeo.HelperLib.Steamworks\OmegaLeo.HelperLib.Steamworks.csproj" />
|
||||
<ProjectReference Include="..\OmegaLeo.HelperLib\OmegaLeo.HelperLib.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="steam_appid.txt">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -2,101 +2,121 @@
|
||||
|
||||
// /media/omegaleo/Development/Library Dev/HelperLib
|
||||
|
||||
using System.Reflection;
|
||||
using OmegaLeo.HelperLib.Extensions;
|
||||
using OmegaLeo.HelperLib.Helpers;
|
||||
using LibGit2Sharp;
|
||||
using OmegaLeo.HelperLib.Changelog.Tools;
|
||||
using OmegaLeo.HelperLib.Git;
|
||||
using OmegaLeo.HelperLib.Git.Models;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using OmegaLeo.HelperLib.Steamworks;
|
||||
|
||||
Console.WriteLine("Insert repo path to check changes:");
|
||||
var repo = Console.ReadLine();
|
||||
|
||||
if (repo.IsNullOrEmpty())
|
||||
public class Program
|
||||
{
|
||||
repo = "/media/omegaleo/Development/Library Dev/HelperLib";
|
||||
}
|
||||
|
||||
var git = new GitClient(repo);
|
||||
|
||||
var result = BenchmarkUtility.Record(() =>
|
||||
{
|
||||
var changes = git.GetChanges();
|
||||
|
||||
if (changes.FolderName.IsNotNullOrEmpty())
|
||||
public static void Main()
|
||||
{
|
||||
RecursiveOutput(new List<ChangeFolder>() { changes });
|
||||
|
||||
var option = 99;
|
||||
|
||||
while (option != 0)
|
||||
using var loggerFactory = LoggerFactory.Create(builder =>
|
||||
{
|
||||
ShowOptions();
|
||||
if (option != 99)
|
||||
{
|
||||
switch (option)
|
||||
builder
|
||||
.SetMinimumLevel(LogLevel.Information)
|
||||
.AddSimpleConsole(options =>
|
||||
{
|
||||
case 1:
|
||||
Console.WriteLine("Write the commit message");
|
||||
var msg = Console.ReadLine();
|
||||
options.SingleLine = true;
|
||||
options.TimestampFormat = "HH:mm:ss ";
|
||||
});
|
||||
});
|
||||
|
||||
while (msg.IsNullOrEmpty())
|
||||
{
|
||||
Console.WriteLine("Empty message detected, please write a commit message...");
|
||||
msg = Console.ReadLine();
|
||||
}
|
||||
var steamLogger = loggerFactory.CreateLogger<SteamManager>();
|
||||
var achievementLogger = loggerFactory.CreateLogger<AchievementManager>();
|
||||
|
||||
var signature = new Signature("Nuno 'Omega Leo' Diogo", "nunodiogo@omegaleo.pt",
|
||||
DateTimeOffset.Now);
|
||||
git.Commit(msg, signature);
|
||||
SteamManager.ConfigureLogger(steamLogger);
|
||||
SteamManager.ConfigureAppId(480); // 480 is the AppId for Spacewar, a test app provided by Valve
|
||||
|
||||
break;
|
||||
case 2:
|
||||
git.Push();
|
||||
break;
|
||||
default:
|
||||
Console.WriteLine("Invalid Option!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int.TryParse(Console.ReadLine(), out option);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("No changes found in specified repository");
|
||||
}
|
||||
});
|
||||
|
||||
Console.WriteLine($"Time for checking for changes: {result} ms");
|
||||
|
||||
Console.ReadLine();
|
||||
|
||||
|
||||
void RecursiveOutput(List<ChangeFolder> folders, int depth = 0)
|
||||
{
|
||||
foreach (var folder in folders)
|
||||
{
|
||||
Console.WriteLine($"{new string('\t', depth)}>{folder.FolderName}");
|
||||
if (folder.SubFolders.Any())
|
||||
var steam = SteamManager.Instance;
|
||||
if (steam.IsSteamworksInitialized)
|
||||
{
|
||||
RecursiveOutput(folder.SubFolders, depth + 1);
|
||||
steamLogger.LogInformation("Welcome {SteamName}", steam.GetSteamName());
|
||||
}
|
||||
|
||||
foreach (var change in folder.ChangesInFolder)
|
||||
steamLogger.LogInformation("--- Steam wrapper smoke tests ---");
|
||||
|
||||
// Utils (read-only)
|
||||
steamLogger.LogInformation("Utils available: {Available}", steam.Utils.IsAvailable);
|
||||
if (steam.Utils.IsAvailable)
|
||||
{
|
||||
Console.WriteLine($"{new string('\t', depth + 1)}>{Path.GetFileName(change.Path)} ({change.Status})");
|
||||
steamLogger.LogInformation("AppId: {AppId}, Country: {Country}, Overlay: {Overlay}",
|
||||
steam.Utils.GetAppId(),
|
||||
steam.Utils.GetIpCountry(),
|
||||
steam.Utils.IsOverlayEnabled());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ShowOptions()
|
||||
{
|
||||
Console.Clear();
|
||||
Console.WriteLine(new string('=', 20));
|
||||
Console.WriteLine("What do you want to do in this repository?");
|
||||
Console.WriteLine("1. Commit all changes");
|
||||
Console.WriteLine("2. Push");
|
||||
// Friends (read-only)
|
||||
steamLogger.LogInformation("Friends available: {Available}", steam.Friends.IsAvailable);
|
||||
if (steam.Friends.IsAvailable)
|
||||
{
|
||||
// 65535 tests all friend relationship flags for quick smoke coverage.
|
||||
var friendCount = steam.Friends.GetFriendCount(65535);
|
||||
steamLogger.LogInformation("Friend count (all flags): {FriendCount}", friendCount);
|
||||
}
|
||||
|
||||
// Remote storage (read-only)
|
||||
steamLogger.LogInformation("RemoteStorage available: {Available}", steam.RemoteStorage.IsAvailable);
|
||||
if (steam.RemoteStorage.IsAvailable)
|
||||
{
|
||||
steamLogger.LogInformation("Cloud enabled: {Enabled}, file count: {Count}",
|
||||
steam.RemoteStorage.IsCloudEnabledForApp(),
|
||||
steam.RemoteStorage.GetFileCount());
|
||||
}
|
||||
|
||||
// User stats (safe read/request)
|
||||
steamLogger.LogInformation("UserStats available: {Available}", steam.UserStats.IsAvailable);
|
||||
if (steam.UserStats.IsAvailable)
|
||||
{
|
||||
var globalStatsCall = steam.UserStats.RequestGlobalStats(7);
|
||||
steamLogger.LogInformation("RequestGlobalStats call handle: {Handle}", globalStatsCall);
|
||||
}
|
||||
|
||||
// UGC (safe query/subscription read)
|
||||
steamLogger.LogInformation("UGC subscribed count: {Count}", steam.Ugc.GetNumSubscribedItems());
|
||||
var ugcQuery = steam.Ugc.CreateQueryAllUgcRequest(queryType: 0, matchingType: 0, creatorAppId: 480, consumerAppId: 480, page: 1);
|
||||
if (ugcQuery != 0)
|
||||
{
|
||||
var ugcCall = steam.Ugc.SendQueryUgcRequest(ugcQuery);
|
||||
steamLogger.LogInformation("UGC query handle: {QueryHandle}, call handle: {CallHandle}", ugcQuery, ugcCall);
|
||||
steam.Ugc.ReleaseQueryUgcRequest(ugcQuery);
|
||||
}
|
||||
else
|
||||
{
|
||||
steamLogger.LogWarning("UGC query handle returned 0 (unsupported on this runtime or invalid params).");
|
||||
}
|
||||
|
||||
// Matchmaking (safe request)
|
||||
steamLogger.LogInformation("Matchmaking available: {Available}", steam.Matchmaking.IsAvailable);
|
||||
if (steam.Matchmaking.IsAvailable)
|
||||
{
|
||||
steam.Matchmaking.AddRequestLobbyListResultCountFilter(10);
|
||||
var lobbyListCall = steam.Matchmaking.RequestLobbyList();
|
||||
steamLogger.LogInformation("RequestLobbyList call handle: {Handle}", lobbyListCall);
|
||||
}
|
||||
|
||||
// Remote Play
|
||||
steamLogger.LogInformation("RemotePlay sessions: {SessionCount}", steam.RemotePlay.GetSessionCount());
|
||||
|
||||
// Other read-only status checks
|
||||
steamLogger.LogInformation("Screenshots hooked: {Hooked}", steam.Screenshots.IsScreenshotsHooked());
|
||||
steamLogger.LogInformation("Music enabled: {Enabled}, playing: {Playing}, volume: {Volume}",
|
||||
steam.Music.IsEnabled(), steam.Music.IsPlaying(), steam.Music.GetVolume());
|
||||
if (steam.Video.IsBroadcasting(out var viewers))
|
||||
{
|
||||
steamLogger.LogInformation("Video broadcasting viewers: {Viewers}", viewers);
|
||||
}
|
||||
else
|
||||
{
|
||||
steamLogger.LogInformation("Video broadcasting is not active.");
|
||||
}
|
||||
|
||||
steamLogger.LogInformation("--- End smoke tests ---");
|
||||
|
||||
// Call this in your game loop (Unity Update, Godot _Process, etc.)
|
||||
steam.Update();
|
||||
|
||||
var achievements = new AchievementManager(achievementLogger);
|
||||
achievements.UnlockAchievement("NEW_ACHIEVEMENT_0_4");
|
||||
|
||||
steam.Shutdown();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
480
|
||||
Reference in New Issue
Block a user