AbyssIrc.Server.Core
0.1.15
See the version list below for details.
dotnet add package AbyssIrc.Server.Core --version 0.1.15
NuGet\Install-Package AbyssIrc.Server.Core -Version 0.1.15
<PackageReference Include="AbyssIrc.Server.Core" Version="0.1.15" />
<PackageVersion Include="AbyssIrc.Server.Core" Version="0.1.15" />
<PackageReference Include="AbyssIrc.Server.Core" />
paket add AbyssIrc.Server.Core --version 0.1.15
#r "nuget: AbyssIrc.Server.Core, 0.1.15"
#addin nuget:?package=AbyssIrc.Server.Core&version=0.1.15
#tool nuget:?package=AbyssIrc.Server.Core&version=0.1.15
AbyssIrc.Server.Core
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 sessionsIIrcManagerService
: Core IRC command processing and dispatchITextTemplateService
: Template processing for server messagesISchedulerSystemService
: Task scheduling for maintenance operationsIEventDispatcherService
: 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:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
For more information on AbyssIrc and related projects, visit the AbyssIrc GitHub repository.
Product | Versions 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. |
-
net9.0
- AbyssIrc.Core (>= 0.1.15)
- AbyssIrc.Protocol.Messages (>= 0.1.15)
- Microsoft.Extensions.DependencyInjection (>= 9.0.3)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.3)
- Microsoft.Extensions.Logging (>= 9.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.