---
title: "Orizon Rpc - s&box library"
description: "A simple library to call rpc's and receive a response callback"
canonical: "https://sbox.watch/fr/libraries/orizon/orizon_rpc/"
generated_at: "2026-10-09T17:37:17.614Z"
---

# Orizon Rpc

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

- Type: bibliothèque
- Identifiant: orizon.orizon_rpc
- Créateur: orizon
- URL canonique: https://sbox.watch/fr/libraries/orizon/orizon_rpc/
- Markdown: https://sbox.watch/fr/libraries/orizon/orizon_rpc/index.md
- sbox.game: https://sbox.game/orizon/orizon_rpc/
- Généré: 2026-10-09T17:37:17.614Z

## Statistiques

- dynamique sur 24 h: +0
- Terry Score: 43%
- Favoris: 2
- Votes positifs: 2
- Votes négatifs: 0
- Mis à jour: 15 févr. 2025
- Créé: 5 févr. 2025
- Taille: 17.7 KB
- Fichiers: 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 | Identifiant | Joueurs | Favoris | Votes positifs | Score | Markdown |
| --- | --- | --- | --- | --- | --- | --- |
| Mongo Rest | orizon.mongo_rest | 0 | 0 | 2 | 43% | https://sbox.watch/fr/libraries/orizon/mongo_rest/index.md |
