AbyssIrc.Server.Core 0.1.14

There is a newer version of this package available.
See the version list below for details.
dotnet add package AbyssIrc.Server.Core --version 0.1.14
                    
NuGet\Install-Package AbyssIrc.Server.Core -Version 0.1.14
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AbyssIrc.Server.Core" Version="0.1.14" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="AbyssIrc.Server.Core" Version="0.1.14" />
                    
Directory.Packages.props
<PackageReference Include="AbyssIrc.Server.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add AbyssIrc.Server.Core --version 0.1.14
                    
#r "nuget: AbyssIrc.Server.Core, 0.1.14"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=AbyssIrc.Server.Core&version=0.1.14
                    
Install AbyssIrc.Server.Core as a Cake Addin
#tool nuget:?package=AbyssIrc.Server.Core&version=0.1.14
                    
Install AbyssIrc.Server.Core as a Cake Tool

AbyssIrc.Server.Core

NuGet License: MIT

Core server components and framework for the AbyssIrc server ecosystem.

Overview

AbyssIrc.Server.Core provides the fundamental server infrastructure for building a modular, extensible IRC server. This library sits between the low-level protocol implementation (AbyssIrc.Network) and the full server application, offering a robust framework for IRC server functionality while maintaining a clean separation of concerns.

Features

  • Service Layer: Core services for IRC server functionality
  • Session Management: User session creation, tracking, and lifecycle management
  • Command Handling: Framework for processing IRC commands and generating responses
  • Event System Integration: Server-specific events and handlers
  • Server Configuration: Server-specific configuration management
  • Template Processing: Server message template processing
  • Extension Framework: Pluggable architecture for extending server functionality

Installation

Via NuGet

# Install via .NET CLI
dotnet add package AbyssIrc.Server.Core

# Install via Package Manager
Install-Package AbyssIrc.Server.Core

Via PackageReference in .csproj


<ItemGroup>
  <PackageReference Include="AbyssIrc.Server.Core" Version="0.1.0"/>
</ItemGroup>

Usage Examples

Service Registration

// Register core IRC server services
services.AddSingleton<ISessionManagerService, SessionManagerService>();
services.AddSingleton<IIrcManagerService, IrcManagerService>();
services.AddSingleton<ITextTemplateService, TextTemplateService>();
services.AddSingleton<IStringMessageService, StringMessageService>();
services.AddSingleton<ISchedulerSystemService, SchedulerSystemService>();

Command Handlers

// Create a command handler
public class PingPongHandler : BaseHandler, IIrcMessageListener
{
    public PingPongHandler(ILogger<PingPongHandler> logger, IServiceProvider serviceProvider)
        : base(logger, serviceProvider)
    {
    }

    public Task OnMessageReceivedAsync(string id, IIrcCommand command)
    {
        return command switch
        {
            PingCommand pingCommand => HandlePingCommand(id, pingCommand),
            PongCommand pongCommand => HandlePongCommand(id, pongCommand),
            _ => Task.CompletedTask
        };
    }

    private async Task HandlePingCommand(string id, PingCommand pingCommand)
    {
        var session = GetSession(id);
        await SendIrcMessageAsync(id, new PongCommand(ServerData.Hostname, pingCommand.Token));
    }

    // Additional handler methods...
}

Session Management

// Using the session manager
public async Task ProcessNewConnection(string connectionId, string ipEndpoint)
{
    // Add a new session
    _sessionManagerService.AddSession(connectionId, ipEndpoint);

    // Get an existing session
    var session = _sessionManagerService.GetSession(connectionId);

    // Query sessions
    var operatorSessions = _sessionManagerService.GetSessions()
        .Where(s => s.IsOperator)
        .ToList();
}

Sending IRC Messages

// Send messages to clients
await SendIrcMessageAsync(
    sessionId,
    new RplWelcomeCommand(ServerData.Hostname, session.Nickname, "Welcome to the IRC network!")
);

await SendIrcMessageAsync(
    sessionId,
    new RplMotdStart.Create(ServerData.Hostname, session.Nickname)
);

foreach (var line in _motdLines)
{
    await SendIrcMessageAsync(
        sessionId,
        new RplMotd(ServerData.Hostname, session.Nickname, _textTemplateService.TranslateText(line))
    );
}

Service Interfaces

Key service interfaces that form the server's architecture:

  • ISessionManagerService: Manages user connections and sessions
  • IIrcManagerService: Core IRC command processing and dispatch
  • ITextTemplateService: Template processing for server messages
  • ISchedulerSystemService: Task scheduling for maintenance operations
  • IEventDispatcherService: Event routing and handling

Dependency on Other AbyssIrc Packages

AbyssIrc.Server.Core has the following dependencies:

  • AbyssIrc.Core: Fundamental types, utilities, and infrastructure
  • AbyssIrc.Network: IRC protocol implementation and command definitions

Requirements

  • .NET 9.0 or later
  • Compatible with Windows, Linux, and macOS

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! If you're interested in improving AbyssIrc.Server.Core:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

For more information on AbyssIrc and related projects, visit the AbyssIrc GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.2.4 178 4/14/2025
0.2.3 140 4/7/2025
0.2.2 83 4/5/2025
0.2.1 106 4/4/2025
0.2.0 108 4/4/2025
0.1.15 147 4/3/2025
0.1.14 154 4/3/2025
0.1.9 138 4/3/2025
0.1.8 148 4/3/2025
0.1.7 148 4/2/2025