public void Set(SteamAPICall_t hAPICall, APIDispatchDelegate func = null) { // Unlike the official SDK we let the user assign a single function during creation, // and allow them to skip having to do so every time that they call .Set() if (func != null) { m_Func = func; } if (m_Func == null) { throw new Exception("CallResult function was null, you must either set it in the CallResult Constructor or in Set()"); } if (m_hAPICall != SteamAPICall_t.Invalid) { NativeMethods.SteamAPI_UnregisterCallResult(m_pCCallbackBase.AddrOfPinnedObject(), (ulong)m_hAPICall); } m_hAPICall = hAPICall; if (hAPICall != SteamAPICall_t.Invalid) { NativeMethods.SteamAPI_RegisterCallResult(m_pCCallbackBase.AddrOfPinnedObject(), (ulong)hAPICall); } }
public CallResult(APIDispatchDelegate myFunc) : this() { if (myFunc != null) { m_Func = myFunc; } }
public CallResult(APIDispatchDelegate <T> func = null) { this.m_pVTable = IntPtr.Zero; this.m_hAPICall = SteamAPICall_t.Invalid; this.m_size = Marshal.SizeOf(typeof(T)); this.m_Func = func; this.BuildCCallbackBase(); }
public void Create(bool inviteOnly, APIDispatchDelegate <LobbyCreated_t> callResult) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) SteamAPICall_t val = SteamMatchmaking.CreateLobby((ELobbyType)((!inviteOnly) ? 1 : 0), 256); _lobbyCreatedExternalCallback = callResult; _lobbyCreated.Set(val, (APIDispatchDelegate <LobbyCreated_t>)null); State = LobbyState.Creating; }
public void Join(CSteamID lobbyId, APIDispatchDelegate <LobbyEnter_t> callResult) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (State == LobbyState.Inactive) { State = LobbyState.Connecting; _lobbyEnterExternalCallback = callResult; SteamAPICall_t val = SteamMatchmaking.JoinLobby(lobbyId); _lobbyEnter.Set(val, (APIDispatchDelegate <LobbyEnter_t>)null); } }
public void Set(SteamAPICall_t hAPICall, APIDispatchDelegate <T> func = null) { if (func != null) { this.m_Func = func; } if (this.m_Func == null) { throw new Exception("CallResult function was null, you must either set it in the CallResult Constructor or in Set()"); } if (this.m_hAPICall != SteamAPICall_t.Invalid) { NativeMethods.SteamAPI_UnregisterCallResult(this.m_pCCallbackBase.AddrOfPinnedObject(), (ulong)this.m_hAPICall); } this.m_hAPICall = hAPICall; if (hAPICall != SteamAPICall_t.Invalid) { NativeMethods.SteamAPI_RegisterCallResult(this.m_pCCallbackBase.AddrOfPinnedObject(), (ulong)hAPICall); } }
internal CallResult(ulong Handle, APIDispatchDelegate Callback) { VTable = new CallbackBaseVTable { RunCallback = OnRunCallback, RunCallResult = OnRunCallResult, GetCallbackSize = OnGetCallbackSize }; VTablePointer = AllocHGlobal(SizeOf(typeof(CallbackBaseVTable))); StructureToPtr(VTable, VTablePointer, false); CallbackBase = new CallbackBase { VTablePointer = VTablePointer, CallbackFlags = 0, Callback = GetCallbackIdentity(typeof(T)) }; CallbackBasePointer = Alloc(CallbackBase, GCHandleType.Pinned); this.Callback = Callback; if ((this.Handle = Handle) != 0UL) { RegisterCallResult(CallbackBasePointer.AddrOfPinnedObject(), Handle); } }
public void Set(SteamAPICall_t hAPICall, APIDispatchDelegate newFunc = null) { if (newFunc != null) { m_Func = newFunc; } if (m_Func == null) { throw new Exception("CallResult function was null, you must either set it in the CallResult Constructor or in Set()"); } if (m_hAPICall != SteamAPICall_t.Invalid) { Cancel(); } m_hAPICall = hAPICall; if (hAPICall != SteamAPICall_t.Invalid) { CallbackDispatcher.RegisterCallResult(this, hAPICall); } }
public APICallCallback(APIDispatchDelegate myFunc, int iCallback) : this( iCallback ) { this.OnRun += myFunc; }
public CallResult(APIDispatchDelegate func = null) { m_Func = func; BuildCCallbackBase(); }
/// <summary> /// Creates a new async CallResult. You must be calling SteamAPI.RunCallbacks() to retrieve the callback. /// <para>Returns a handle to the CallResult. This must be assigned to a member variable to prevent the GC from cleaning it up.</para> /// </summary> public static CallResult <T> Create(APIDispatchDelegate func = null) { return(new CallResult <T>(func)); }
public void Set(SteamAPICall_t hAPICall, APIDispatchDelegate func = null) { }
// Methods public static CallResult <T> Create(APIDispatchDelegate func = null) => default;
} // Dummy constructor public CallResult(APIDispatchDelegate func = null) { }
public CallResult(APIDispatchDelegate myFunc, SteamAPICall_t hAPICall) : this(myFunc) { Set(hAPICall); }
public APICallCallback(APIDispatchDelegate myFunc, UInt64 apicallhandle) : this( myFunc ) { SetAPICallHandle(apicallhandle); }
public APICallCallback(APIDispatchDelegate myFunc) : this() { this.OnRun += myFunc; }
public static CallResult <T> Create(APIDispatchDelegate <T> func = null) => new CallResult <T>(func);