Skip to content

Duinrahaic/XSSocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Features

XSSocket is an XSOverlay API connector for .Net. It allows you to connect to the XSOverlay API and send and receive data.

  • Send and receive data to the XSOverlay API
  • Events for connection status and data received
  • Enhanced object classes for ease-of-use
  • Fully supports XSOverlay WebSocket API

Usage

public static async Task Main(string[] args)
{
    XSSocket connector = new XSSocket("Demo"); // create a new connector with the source app name "Demo"
    connector.ConnectAsync().ConfigureAwait(false);
    while (connector.State == WebSocketState.Connecting)
    {
        Console.WriteLine("Connecting...");
        await Task.Delay(1000); // wait 1 second
    }
    
    if (connector.State == WebSocketState.Open)
    {
        Console.WriteLine("Connected!");
    }
    else
    {
        Console.WriteLine($"Connection failed with state: {connector.State}");
    }

    Console.WriteLine("Sending Notification...");
    
    
    XSNotificationObject notificationObject =
        new XSNotificationObject()
        {
            title = "Hello World",
            content = "This is a test notificationObject",
            sourceApp = "Demo"
        };
    await connector.SendNotification(notificationObject);
    await Task.Delay(1000); // wait 1 second
    
    
    Console.WriteLine("Disconnecting...");

    connector.Disconnect();
}

Nuget

Nuget is available here

Installation

  1. Open a command line and switch to the directory that contains your project file.
  2. Use the following command to install a NuGet package: dotnet add package XSSocket

Demo

The demo project is a simple console application that connects to the XSOverlay API and demonstrates how to utilize various features of the connectors and the API.

Discord

For questions on XSOverlay or the API, you may join the Discord server for discussion or read the documentation.

About

A .Net Websocket Connector for XSOverlay

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages