---
title: "Orizon Rpc - s&box library"
description: "A simple library to call rpc's and receive a response callback"
canonical: "https://sbox.watch/libraries/orizon/orizon_rpc/"
generated_at: "2026-07-22T23:22:23.039Z"
---

# Orizon Rpc

A simple library to call rpc's and receive a response callback

- Type: library
- Ident: orizon.orizon_rpc
- Creator: orizon
- Canonical: https://sbox.watch/libraries/orizon/orizon_rpc/
- Markdown: https://sbox.watch/libraries/orizon/orizon_rpc.md
- sbox.game: https://sbox.game/orizon/orizon_rpc/
- Generated: 2026-07-22T23:22:23.039Z

## Stats

- 24h momentum: +0
- Terry score: 43%
- Favorites: 2
- Upvotes: 2
- Downvotes: 0
- Updated: Feb 15, 2025
- Created: Feb 5, 2025
- Size: 17.7 KB
- Files: 15
- Tags: callback, networking, rpc

## Description

// Your data model
public struct YourData
{
 public SteamId SteamId { get; set; }
 public string FirstName { get; set;}
}

// Create your struct request
private record struct GetDataRequest : IRpcRequest
{
 public Guid CallbackId { get; set; }
 public int DataId { get; set; }
}

// Create your struct response
private record struct GetDataResponse : IRpcResponse
{
 public Guid CallbackId { get; set; }
 public YourData Data { get; set; }
}

// Called on the host
private static GetDataResponse OnGetDataRequest( GetDataRequest request )
{
 // Do your work here and return the result
 var data = ...

 return new GetDataResponse { Data = data };
}
In your custom script, e.g Character.cs
// Register your rpc callback here
protected override void OnStart()
{
 if ( IsProxy ) return;

 RpcServer.RegisterHandler<GetDataRequest, GetDataResponse>( OnGetDataRequest );
}

// Call this function on the client to get your data
public static async Task<YourData> GetDataAsync( int dataId )
{
 var request = new GetDataRequest { DataId = dataId };

 // Your data is store in the result variable
 var result = await RpcClient.SendRpc<GetDataRequest, GetDataResponse>( request );
 return result.Data;
}



## More by orizon

| Package | Ident | Players | Favorites | Upvotes | Score | Markdown |
| --- | --- | --- | --- | --- | --- | --- |
| Mongo Rest | orizon.mongo_rest | 0 | 0 | 2 | 43% | https://sbox.watch/libraries/orizon/mongo_rest.md |
