Class CustomRPC
Wrapper for Valheim's RPC calls implementing convenience delegate methods for client and server processing of packages.
Automatically compresses and slices big packages to fit into the Steam package limit.
All sending and processing of received packages is executed in Coroutines to ensure the game loop's execution.
Automatically compresses and slices big packages to fit into the Steam package limit.
All sending and processing of received packages is executed in Coroutines to ensure the game loop's execution.
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Jotunn.Entities
Assembly: Jotunn.dll
Syntax
public class CustomRPC : CustomEntity
Properties
| Improve this Doc View SourceIsProcessing
True, if this RPC is currently processing received data.
This is always true while executing the registered delegates.
Declaration
public bool IsProcessing { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsProcessingOther
True, if this RPC is processing received data outside the current delegate call.
This should only be used in the registered delegate methods to determine
if this RPC is already processing another package.
Declaration
public bool IsProcessingOther { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsReceiving
True, if this RPC is currently receiving data
Declaration
public bool IsReceiving { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsSending
True, if this RPC is currently sending data
Declaration
public bool IsSending { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
Name of the custom RPC as defined at instantiation
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceInitiate()
Initiates a RPC exchange with the server by sending an empty package.
Declaration
public void Initiate()
SendPackage(List<ZNetPeer>, ZPackage)
Send a package to a list of peers. Compresses and fragments the package if necessary.
Declaration
public void SendPackage(List<ZNetPeer> peers, ZPackage package)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<ZNetPeer> | peers | |
ZPackage | package |
SendPackage(Int64, ZPackage)
Send a package to a single target. Compresses and fragments the package if necessary.
Declaration
public void SendPackage(long target, ZPackage package)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | target | |
ZPackage | package |
SendPackageRoutine(List<ZNetPeer>, ZPackage)
Coroutine to send a package to a list of peers. Compresses and fragments the package if necessary.
Declaration
public IEnumerator SendPackageRoutine(List<ZNetPeer> peers, ZPackage package)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.List<ZNetPeer> | peers | |
ZPackage | package |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |
SendPackageRoutine(Int64, ZPackage)
Coroutine to send a package to a single target. Compresses and fragments the package if necessary.
Declaration
public IEnumerator SendPackageRoutine(long target, ZPackage package)
Parameters
Type | Name | Description |
---|---|---|
System.Int64 | target | |
ZPackage | package |
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |