public void Init(bool allowPacketRelay, OnNewP2PSession onNewP2PSession, OnSendP2PPacketFailed onSendP2PPacketFailed, OnP2PPacketReceived onP2PPacketReceived) { this._onNewP2PSession = onNewP2PSession; this._onSendP2PPacketFailed = onSendP2PPacketFailed; this._onP2PPacketReceived = onP2PPacketReceived; if (this._internalOnNewP2PSession == null) { this._internalOnNewP2PSession = new OnNewP2PSessionFromSteam(this.OnNewP2PSession); this._internalOnSendP2PPacketFailed = new OnSendP2PPacketFailedFromSteam(this.OnSendP2PPacketFailed); } Networking.SteamUnityAPI_SteamNetworking_SetCallbacks(Marshal.GetFunctionPointerForDelegate((Delegate)this._internalOnNewP2PSession), Marshal.GetFunctionPointerForDelegate((Delegate)this._internalOnSendP2PPacketFailed)); Networking.SteamUnityAPI_SteamNetworking_AllowP2PPacketRelay(this._networking, allowPacketRelay); this._isInitialized = true; }
public void Init(bool allowPacketRelay, OnNewP2PSession onNewP2PSession, OnSendP2PPacketFailed onSendP2PPacketFailed, OnP2PPacketReceived onP2PPacketReceived) { this._onNewP2PSession = onNewP2PSession; this._onSendP2PPacketFailed = onSendP2PPacketFailed; this._onP2PPacketReceived = onP2PPacketReceived; if (this._internalOnNewP2PSession == null) { this._internalOnNewP2PSession = new OnNewP2PSessionFromSteam(this.OnNewP2PSession); this._internalOnSendP2PPacketFailed = new OnSendP2PPacketFailedFromSteam(this.OnSendP2PPacketFailed); } Networking.SteamUnityAPI_SteamNetworking_SetCallbacks(Marshal.GetFunctionPointerForDelegate((Delegate) this._internalOnNewP2PSession), Marshal.GetFunctionPointerForDelegate((Delegate) this._internalOnSendP2PPacketFailed)); Networking.SteamUnityAPI_SteamNetworking_AllowP2PPacketRelay(this._networking, allowPacketRelay); this._isInitialized = true; }