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

# Orizon Rpc

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

- Тип: библиотека
- Идентификатор: orizon.orizon_rpc
- Автор: orizon
- Канонический URL: https://sbox.watch/ru/libraries/orizon/orizon_rpc/
- Markdown: https://sbox.watch/ru/libraries/orizon/orizon_rpc/index.md
- sbox.game: https://sbox.game/orizon/orizon_rpc/
- Создано: 2026-10-09T14:02:17.514Z

## Статистика

- динамика за 24 ч: +0
- Terry Score: 43%
- Избранное: 2
- Положительные оценки: 2
- Отрицательные оценки: 0
- Обновлено: 15 февр. 2025 г.
- Создано: 5 февр. 2025 г.
- Размер: 17.7 KB
- Файлы: 15
- Теги: callback, networking, rpc

## Описание

// 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 | Идентификатор | Игроки | Избранное | Положительные оценки | Оценка | Markdown |
| --- | --- | --- | --- | --- | --- | --- |
| Mongo Rest | orizon.mongo_rest | 0 | 0 | 2 | 43% | https://sbox.watch/ru/libraries/orizon/mongo_rest/index.md |
