Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/docker_image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: OrionIrc Build docker image
name: Prima Build docker image

on:
push:
Expand Down
50 changes: 50 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Create docs

# Your GitHub workflow file under .github/workflows/
# Trigger the action on push to main
on:
push:
branches: [ main ]
repository_dispatch:
types: [version-updated]

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
actions: read
pages: write
id-token: write
contents: read

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Dotnet Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x

- run: dotnet tool update -g docfx
- run: docfx ./docs/docfx.json

- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: './docs/_site'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/versionize-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
id: versionize
continue-on-error: true
run: |
# Esegui versionize per generare il changelog e incrementare la versione

versionize
EXIT_CODE=$?
if [ $EXIT_CODE -eq 0 ]; then
Expand Down
75 changes: 75 additions & 0 deletions docs/docfx.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"metadata": [
{
"src": [
{
"src": "../src",
"files": [
"**/*.csproj"
],
"exclude": [
"**/bin/**",
"**/obj/**"
]
}
],
"dest": "api",
"disableGitFeatures": false,
"disableDefaultFilter": false
}
],
"build": {
"content": [
{
"files": [
"api/**.yml",
"api/index.md"
]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"images/**"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "_site",
"globalMetadata": {
"_appTitle": "Prima Ultima Online Emulator Documentation",
"_enableSearch": true,
"_enableNewTab": true,
"_disableContribution": false
},
"fileMetadataFiles": [],
"template": [
"default",
"templates/discordfx"
],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false
}
}
74 changes: 74 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# Orion IRC Server Documentation

![Version](https://img.shields.io/badge/version-0.4.0-blue)
![License](https://img.shields.io/badge/license-MIT-green)
![.NET](https://img.shields.io/badge/.NET-9.0-purple)

> IRC is not dead, long live IRC!

Welcome to the official documentation for Orion IRC Server, a modern, scalable IRC server built with .NET 9.0.

## Introduction

Orion is designed to provide robust IRC functionality while maintaining high performance and flexibility. It features a modular architecture that makes it easy to extend and customize.

## Getting Started

- [Quick Start Guide](./guides/quick-start.md)
- [Installation](./guides/installation.md)
- [Configuration](./guides/configuration.md)
- [Docker Deployment](./guides/docker.md)

## Core Components

Orion is built as a collection of modular components:

- [**Orion.Foundations**](./components/foundations.md): Base utilities, extensions, and common functionality
- [**Orion.Core.Server**](./components/core-server.md): Server-side core functionality
- [**Orion.Core.Server.Web**](./components/core-server-web.md): Web API and HTTP interface
- [**Orion.Irc.Core**](./components/irc-core.md): IRC protocol implementation
- [**Orion.Network.Core**](./components/network-core.md): Networking abstractions
- [**Orion.Network.Tcp**](./components/network-tcp.md): TCP implementation for network transports

## Advanced Topics

- [Event System](./advanced/event-system.md)
- [Network Transport Architecture](./advanced/network-transport.md)
- [IRC Command Handling](./advanced/command-handling.md)
- [Scripting with JavaScript](./advanced/scripting.md)
- [Text Templating](./advanced/text-templating.md)
- [Security Features](./advanced/security.md)

## Development

- [Building from Source](./development/building.md)
- [Adding New Commands](./development/adding-commands.md)
- [Creating Plugins](./development/creating-plugins.md)
- [Contributing Guidelines](./development/contributing.md)
- [Coding Standards](./development/coding-standards.md)

## API Reference

- [HTTP API Documentation](./api/http-api.md)
- [JavaScript API](./api/javascript-api.md)

## Troubleshooting

- [Common Issues](./troubleshooting/common-issues.md)
- [Logs and Diagnostics](./troubleshooting/logs-diagnostics.md)
- [Performance Tuning](./troubleshooting/performance-tuning.md)

## Community and Support

- [Community Resources](./community/resources.md)
- [Support Channels](./community/support.md)
- [Contributing to Orion](./community/contributing.md)

## Release Notes

- [Version History](./releases/version-history.md)
- [Roadmap](./releases/roadmap.md)

## License

Orion IRC Server is licensed under the MIT License. See the [LICENSE](https://github.com/tgiachi/orion/blob/main/LICENSE) file for details.
4 changes: 4 additions & 0 deletions docs/toc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- name: Docs
href: docs/
- name: API
href: api/
2 changes: 2 additions & 0 deletions src/Prima.Core.Server/Data/Config/Sections/ShardConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ public class ShardConfig

public string UoDirectory { get; set; } = "";

public string? ClientVersion { get; set; }

public string Name { get; set; } = "Prima Shard";

public string AdminEmail { get; set; } = "admin@primauo.com";
Expand Down
4 changes: 3 additions & 1 deletion src/Prima.Core.Server/Data/PrimaServerContext.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
using Microsoft.Extensions.DependencyInjection;
using Orion.Core.Server.Interfaces.Services.System;
using Prima.Core.Server.Data.Session;
using Prima.Core.Server.Data.Uo;
using Prima.Core.Server.Interfaces.Services;

namespace Prima.Core.Server.Data;

public static class PrimaServerContext
{
public static ClientVersion ClientVersion { get; set; }

public static IServiceProvider ServiceProvider { get; set; }

public static IEventLoopService EventLoopService => ServiceProvider.GetRequiredService<IEventLoopService>();


public static INetworkSessionService<NetworkSession> NetworkSessionService => ServiceProvider.GetRequiredService<INetworkSessionService<NetworkSession>>();
}
3 changes: 2 additions & 1 deletion src/Prima.Core.Server/Data/Session/NetworkSession.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Orion.Core.Server.Interfaces.Sessions;
using Prima.Core.Server.Data.Uo;
using Prima.Network.Interfaces.Packets;
using Prima.Network.Packets;

Expand Down Expand Up @@ -27,7 +28,7 @@ public class NetworkSession : INetworkSession
public string AccountId { get; set; }


public ClientVersionRequest ClientVersionRequest { get; set; }
public ClientVersion ClientVersion { get; set; }


public void Dispose()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using Orion.Foundations.Buffers;
using Orion.Foundations.Extensions;
using Prima.Core.Server.Extensions;
using Prima.UOData.Types;
using Prima.Core.Server.Types.Uo;

namespace Prima.UOData.Data;
namespace Prima.Core.Server.Data.Uo;

/*************************************************************************
* ModernUO *
Expand Down Expand Up @@ -65,6 +65,7 @@ public ClientVersion(int maj, int min, int rev, int pat, ClientType type = Clien
SourceString = ToStringImpl().Intern();
}


public ClientVersion(string fmt)
{
fmt = fmt.ToLower();
Expand Down
7 changes: 4 additions & 3 deletions src/Prima.Core.Server/Prima.Core.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="LiteDB" Version="5.0.21" />
<PackageReference Include="Orion.Core.Server" Version="0.24.0" />
<PackageReference Include="LiteDB" Version="5.0.21"/>
<PackageReference Include="Orion.Core.Server" Version="0.25.0"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Prima.Network\Prima.Network.csproj" />
<ProjectReference Include="..\Prima.Network\Prima.Network.csproj"/>

</ItemGroup>


Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Prima.UOData.Types;
namespace Prima.Core.Server.Types.Uo;

[Flags]
public enum ClientType
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Prima.UOData.Types;
namespace Prima.Core.Server.Types.Uo;

[Flags]
public enum ProtocolChanges
Expand Down
6 changes: 3 additions & 3 deletions src/Prima.Network/Prima.Network.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.4" />
<PackageReference Include="Orion.Core.Server" Version="0.24.0" />
<PackageReference Include="Orion.Network.Core" Version="0.24.0" />
<PackageReference Include="Orion.Network.Tcp" Version="0.24.0" />
<PackageReference Include="Orion.Core.Server" Version="0.25.0" />
<PackageReference Include="Orion.Network.Core" Version="0.25.0" />
<PackageReference Include="Orion.Network.Tcp" Version="0.25.0" />
</ItemGroup>

<ItemGroup>
Expand Down
21 changes: 20 additions & 1 deletion src/Prima.Server/Handlers/ConnectionHandler.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Prima.Core.Server.Data;
using Prima.Core.Server.Data.Session;
using Prima.Core.Server.Data.Uo;
using Prima.Core.Server.Handlers.Base;
using Prima.Core.Server.Interfaces.Listeners;
using Prima.Core.Server.Interfaces.Services;
Expand All @@ -22,7 +24,24 @@ protected override void RegisterHandlers()
public async Task OnPacketReceived(NetworkSession session, ClientVersionRequest packet)
{
session.Seed = packet.Seed;
session.ClientVersionRequest = packet;
session.ClientVersion = new ClientVersion(
packet.MajorVersion,
packet.MinorVersion,
packet.Revision,
packet.Prototype
);

if (PrimaServerContext.ClientVersion != session.ClientVersion)
{
Logger.LogWarning(
"Client version mismatch. Expected: {@expected}, Received: {@received}",
PrimaServerContext.ClientVersion,
session.ClientVersion
);
await session.Disconnect();
return;
}


session.FirstPacketReceived = true;
}
Expand Down
8 changes: 8 additions & 0 deletions src/Prima.Server/Interfaces/Services/IAssetService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Orion.Core.Server.Interfaces.Services.Base;

namespace Prima.Server.Interfaces.Services;

public interface IAssetService : IOrionService
{

}
3 changes: 2 additions & 1 deletion src/Prima.Server/Prima.Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,15 @@
<ProjectReference Include="..\Prima.Core.Server\Prima.Core.Server.csproj" />
<ProjectReference Include="..\Prima.Network\Prima.Network.csproj" />
<ProjectReference Include="..\Prima.UOData\Prima.UOData.csproj" />

</ItemGroup>

<ItemGroup>
<None Remove="Assets\header.txt" />
<EmbeddedResource Include="Assets\header.txt" />

<EmbeddedResource Include="Assets\Templates\*.hbs" />

<EmbeddedResource Include="Assets\Data\**\*" />
</ItemGroup>

Expand Down
Loading