示例#1
0
        public static void RunCallbacks(int pipe)
        {
            CallbackMsg_t callbackmsg = new CallbackMsg_t();

            if (Steamworks.GetCallback(pipe, ref callbackmsg))
            {
                LastActivePipe = pipe;

                ICallback callback;
                if (registeredCallbacks.TryGetValue(callbackmsg.m_iCallback, out callback))
                {
                    callback.Run(callbackmsg.m_pubParam);
                }
                else if (unhandledCallback != null)
                {
                    unhandledCallback.Run(callbackmsg);
                }

                Steamworks.FreeLastCallback(pipe);
            }
        }
示例#2
0
        public static void RunCallbacks(int pipe)
        {
            CallbackMsg_t callbackmsg = new CallbackMsg_t();

            if (Steamworks.GetCallback(pipe, ref callbackmsg))
            {
                if (callbackmsg.m_iCallback == SteamAPICallCompleted_t.k_iCallback)
                {
                    RunAPICallbacks(pipe, ( SteamAPICallCompleted_t )Marshal.PtrToStructure(callbackmsg.m_pubParam, typeof(SteamAPICallCompleted_t)));
                }

                ICallback callback;
                if (registeredCallbacks.TryGetValue(callbackmsg.m_iCallback, out callback))
                {
                    callback.Run(callbackmsg.m_pubParam);
                }
                else if (unhandledCallback != null)
                {
                    unhandledCallback.Run(callbackmsg);
                }

                Steamworks.FreeLastCallback(pipe);
            }
        }