p2pConfig
Namespace: SynicSugar.P2P
This is used like p2pConfig.Instance.XXX().
Description
This is config class for p2p.
This script is Mono's Singleton attached to NetworkManager. To generate NetworkManager, right-click on the Hierarchy and click SynicSugar/NetworkManager.
NetworkManager has DontDestroy, so ConnectManager will not be destroyed by scene transitions.
If this is no longer needed, we call CancelCurrentMatchMake, ConnectHub.Instance.CloseSession(CancellationTokenSource) or ConnectHub.Instance.ExitSession(CancellationTokenSource).
Properity
API | description |
---|---|
packetReliability | The delivery reliability of a packet |
AllowDelayedDelivery | Whether users that no connection with local user receives or discards this local user's packet. |
UseDisconnectedEarlyNotify | Notify at the step of a connection interrupted |
RPCBatchSize | Frequency of sending RPC in a frame |
LargePacketBatchSize | Frequency of sending LargePacket(Target)RPC in a frame |
SynicReceiverBatchSize | Frequency of getting (Synic) packet |
autoSyncInterval | Sending new value interval of SyncVar |
AutoRefreshPing | If true, update ping automatically |
SamplesPerPing | Number of samples used for a ping |
PingAutoRefreshRateSec | Interval sec to update ping automatically |
relayControl | The way to connection |
Function
API | description |
---|---|
SetRelayControl | Change the way to connection |
GetNetworkCore | Get instance to manage connection script |
using SynicSugar.P2P;
public class p2pConfigManager {
void Setp2pConfig(){
p2pConfig.Instance.interval_sendToAll = 10;
}
}