You are viewing a potentially older version of this package. View all versions.
AndrewLin-Alpha-0.0.6 icon

Alpha

Alpha: A mod for On-Together to provide common utilities and features.

Date uploaded 2 weeks ago
Version 0.0.6
Download link AndrewLin-Alpha-0.0.6.zip
Downloads 129
Dependency string AndrewLin-Alpha-0.0.6

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2305 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2305

README

Alpha

A shared BepInEx mod for On Together that provides common utilities and a command framework for other mods to build on.


In-Game Commands

Alpha registers its own /alpha namespace commands. Type them in chat — they are intercepted locally and not sent to other players.

Command Short Description
/alphaserverinfo /asi Show lobby name, code, player count, and host info
/alphawhois [player] /awi Show info about a player (name, Steam ID, position)
/alphamyposition /amp Show your current world position
/alphaaddnotification <message> /aan Post a local notification to your own chat
/alphahelp /ah List all Alpha commands

Features

Chat Command Framework

Alpha exposes a static AlphaPlugin.CommandManager (ChatCommandManager) that any mod can use to register in-game slash commands.

Implementing a command:

public class MyCommand : IChatCommand
{
    public string Name        => "mycmd";
    public string ShortName   => "mc";          // optional short alias
    public string Description => "Does something cool.";
    public string Namespace   => "mymod";        // used for grouping and auto-help

    public void Execute(string[] args) { /* ... */ }
}

Registering in your plugin's Awake():

AlphaPlugin.CommandManager?.Register(new MyCommand());

When the first command for a namespace is registered, a /{namespace}help command (and short form /{ns[0]}h) is automatically created for that namespace.

Built-in help usage:

/{mymod}help
/{mymod}help verbose       — includes descriptions
/{mymod}help mycmd         — looks up a single command

Chat Utilities (ChatUtils)

Method Description
AddGlobalNotification(text) Displays a notification in the in-game global chat.
SendMessageAsync(userName, text, isLocal) Sends a chat message (truncated to 250 chars).
SendChunkedMessageAsync(userName, text, isLocal, strategy) Splits long text into ≤250-char chunks and sends each one. Strategy: "word" (default) or "hard".
CleanTMPTags(input) Strips TextMeshPro formatting tags (e.g. <#ff0000>, <b>) from a string.
CleanCommand() Hides a slash command from chat after it is processed (clears the input field).
UISendMessage(text) Injects text into the chat input field and submits it programmatically.

Time Utilities (TimeUtils)

Method Description
TryParseDuration(input, out TimeSpan result) Parses ISO 8601 durations (1h30m, 15s, PT1H30M) and hh:mm:ss / TimeSpan strings. Returns false if unparseable.

Example:

if (TimeUtils.TryParseDuration("10m", out TimeSpan duration))
    // duration == TimeSpan.FromMinutes(10)

String Chunking (IStringChunker)

Breaks arbitrary text into segments no longer than a given character limit.

Implementation Behaviour
WordBoundaryChunker Splits on whitespace; avoids cutting words mid-word.
HardCutChunker Hard-cuts at the character limit, no word awareness.

Player Utilities (PlayerUtils)

Method Description
GetUserName() Returns the local player's display name (may contain TMP tags).
GetUserNameNoFormat() Returns the display name with TMP tags stripped.

Main-Thread Dispatch

AlphaPlugin.RunOnMainThread(() => { /* runs on Unity main thread next Update */ });

Useful for scheduling Unity API calls from background threads (e.g. WebSocket handlers).


Configuration

All settings are managed by BepInEx and can be changed in BepInEx/config/com.andrewlin.ontogether.alpha.cfg.

Section Key Default Description
General EnableFeature true Master enable/disable switch for Alpha.
General ShowCommand false Keep the slash command visible in chat after execution.

Installation

Install via Thunderstore / r2modman, or drop the .dll into BepInEx/plugins/.

Dependency: BepInEx-BepInExPack-5.4.2305


License

MIT

CHANGELOG

Changelog

All notable changes to Alpha will be documented here. The format follows Keep a Changelog.


[0.0.6] - 2026-03-29

Added

  • TimeUtilsTryParseDuration(string, out TimeSpan) parses ISO 8601 duration strings (1h30m, 15s, PT1H30M) and hh:mm:ss / TimeSpan formats. Extracted from Remind.ScheduledTaskManager so any mod can share the same duration-parsing logic without a dependency on Remind.

  • In-game commands registered under the alpha namespace:

    • /alphaserverinfo (/asi) — show lobby name, code, player count, and host.
    • /alphawhois [player] (/awi) — show info about a player (name, Steam ID, position).
    • /alphamyposition (/amp) — show your current world position.
    • /alphaaddnotification <message> (/aan) — post a local notification to your own chat.
    • /alphahelp (/ah) — list all Alpha commands.

[0.0.2] - 2026-03-18

Added

  • PlayerUtils querying for other players
  • SteamUtils for getting steam informations
  • PlayerDetail that contains everything known about a player

[0.0.1] - 2026-03-18

Added

  • AlphaPlugin — BepInEx plugin entry point providing shared static state for consuming mods:

    • Static CommandManager (ChatCommandManager) for cross-mod slash command registration.
    • RunOnMainThread(Action) for scheduling Unity main-thread work from background threads.
    • BepInEx config entries: EnableFeature, ShowCommand, CleanChatSinkTags, GlobalMessageLimitCount, LocalMessageLimitCount, ChatLogLocalRange.
  • IChatCommand — Interface for implementing in-game slash commands with Name, ShortName, Description, Namespace, and Execute(string[]).

  • ChatCommandManager — Registers and dispatches IChatCommand implementations; auto-creates a /{namespace}help (and short-form /{ns[0]}h) command the first time any command for a new namespace is registered.

  • ChatCommandArgs — Parses /command arg1 arg2 … chat input into a structured Name + Args record with TryParse.

  • NamespaceHelpCommand — Auto-generated help command per namespace; supports plain listing, verbose (with descriptions), and single-command lookup.

  • ChatUtils:

    • AddGlobalNotification — posts a notification to the in-game chat.
    • SendMessageAsync — sends a chat message (capped at 250 characters).
    • SendChunkedMessageAsync — splits long messages into ≤250-char chunks using a pluggable chunking strategy.
    • CleanTMPTags — strips TextMeshPro formatting tags from strings.
    • CleanCommand — hides processed slash commands from the chat input field.
    • UISendMessage — programmatically injects and submits text via the UI input field.
  • IStringChunker — Interface for splitting text into bounded-length segments.

    • WordBoundaryChunker — splits on whitespace, preserving whole words.
    • HardCutChunker — hard-cuts at the character limit.
  • PlayerUtils:

    • GetUserName / GetUserNameNoFormat — local player display name (raw and TMP-stripped).
  • TextChannelManagerPatch — Harmony patches on TextChannelManager:

    • OnEnterPressed prefix — intercepts slash commands and routes them through CommandManager.
    • AddNotification postfix — strips TMP tags for notification sinks.
    • SendMessageAsync postfix — strips TMP tags from outgoing messages when CleanChatSinkTags is enabled.
    • OnChannelMessageReceived postfix — relays incoming messages to sinks, filtered by ban/mute list, self-filter, and local-range distance.