示例#1
0
    public static string translation(string language, string txt)
    {
        string url = "/v1/translations?cultureCodes={0}&baseTexts={1}";

        url = string.Format(url, language, txt);
        return(PinHelper.get(url));
    }
示例#2
0
    public static string feeds(string last_time)
    {
        string url = "https://api.pinnaclesports.com/v1/feed?last={0}&oddsFormat=1";

        url = string.Format(url, last_time);
        return(PinHelper.get(url));
    }
示例#3
0
    public static string feeds_by_sport_id(string sport_id)
    {
        string url = "https://api.pinnaclesports.com/v1/feed?sportid={0}&oddsFormat=1";

        url = string.Format(url, sport_id);
        return(PinHelper.get(url));
    }
示例#4
0
    public static string feeds_by_sport_id(string sport_id, string last_time)
    {
        string url = "/v1/feed?sportid={0}&last={1}&odddsFormat=DECIMAL";

        url = string.Format(url, sport_id, last_time);
        return(PinHelper.get(url));
    }
示例#5
0
    public static string line(string sport_id, string league_id, string event_id, string period_number, string bet_type)
    {
        string url = "v1/line?sportId={0}&leagueId={1}&eventId={2}&periodNumber={3}&betType={4}&oddsFormat=1";

        url = string.Format(url, sport_id, league_id, event_id, period_number, bet_type);
        return(PinHelper.get(url));
    }
示例#6
0
    public static string isruning(string elapsed, string state, string id)
    {
        string url = "/v1/isrunning?elapsed={0}&state={1}&id={2}";

        url = string.Format(url, elapsed, state, id);
        return(PinHelper.get(url));
    }
示例#7
0
 public string GenerateCode(PinHelper <TranslatedMaterialGraph.NodeInfo> pin)
 {
     if (pin.Links.Count == 0)
     {
         return(GenerateDefaultValue(pin.Type));
     }
     return(GenerateCode(pin.Links[0].From.Node));
 }
示例#8
0
        private static void PickableOnPicked(ref Pickable __instance)
        {
            var name = __instance.m_itemPrefab.GetComponent <ItemDrop>().m_itemData.m_shared.m_name;

            ZLog.Log("Pickable awake with name " + name);
            if (PickablesToTrack.Contains(name))
            {
                PinHelper.AddSinglePin(__instance.transform.position, Minimap.PinType.Icon3, name);
            }
        }
示例#9
0
        /// <summary>
        /// Obtains an array of <see cref="SafeReference"/> from a variable number of typed references.
        /// </summary>
        /// <param name="func">The function to receive the array of <see cref="SafeReference"/>.</param>
        /// <param name="refs">A variable number of typed references.</param>
        /// <returns>The value returned by <paramref name="func"/></returns>
        public static TRet Create <TRet>(Func <SafeReference[], TRet> func, ArgIterator refs)
        {
            var arr = new SafeReference[refs.GetRemainingCount()];

            if (arr.Length > 0)
            {
                return(PinHelper <TRet> .PinRecursive(refs.GetNextArg(), refs, arr, func));
            }
            else
            {
                return(func(arr));
            }
        }
示例#10
0
        public void Start()
        {
            _visualStudio = FindTargetVs();

            var dte = GetDTE2(_visualStudio);

            //VisualStudioの設定変更
            ChangeVisualStudioSetting?.Invoke(_visualStudio, PinHelper.GetAppVar(dte));

            //ブレイクを全部無効にする
            if (!ContinueDebuging)
            {
                _breaks = _visualStudio.Type(GetType()).DisableBreak(PinHelper.GetAppVar(dte));
            }

            //ビルド
            dte.Solution.SolutionBuild.Build(true);

            //ブレイクを設定
            var injectionBreak = dte.Debugger.Breakpoints.Add(InjectionBreakPoint);

            dte.Debugger.Go();
            if (injectionBreak.Count == 1)
            {
                injectionBreak.Item(1).Delete();
            }
            //対象のプロセスID
            _uwpProcessId = dte.Debugger.CurrentProcess.ProcessID;

            //ファイルをコピー
            var dir = Path.GetDirectoryName(System.Diagnostics.Process.GetProcessById(_uwpProcessId).MainModule.FileName);

            DllControl.InstallDll(dir, typeof(Friendly.Core.VarAddress).Assembly);
            DllControl.InstallDll(Path.Combine(dir, "Friendly.UWP.Core.dll"), Resources.Friendly_UWP_Core);

            //インジェクション
            var exp = "System.Reflection.IntrospectionExtensions.GetTypeInfo(System.Type.GetType(\"Friendly.UWP.Core.FriendlyExecutor, Friendly.UWP.Core, Version=0.0.1.0, Culture=neutral, PublicKeyToken=e8e68ab53559cf51\")).GetDeclaredMethod(\"Start\").Invoke(null, new object[] { \"" + Uri + "\" });";

            dte.Debugger.GetExpression(exp);

            //ディタッチ
            if (ContinueDebuging)
            {
                dte.Debugger.Go(false);
            }
            else
            {
                dte.Debugger.Go(false);
            }
        }
示例#11
0
    public static string place(string unique_id, string is_better_line, string win_risk_state, string sport_id, string event_id, string period_number, string line_id, string bet_type, string team, string stake)
    {
        string       url       = "/v1/bets/place";
        BsonDocument doc_param = new BsonDocument();

        doc_param.Add("uniqueRequestId", Guid.NewGuid().ToString());
        doc_param.Add("acceptBetterLine", "TRUE");
        doc_param.Add("winRiskStake", "WIN");
        doc_param.Add("sportId", sport_id);
        doc_param.Add("eventId", event_id);
        doc_param.Add("lineId", line_id);
        doc_param.Add("periodNumber", period_number);
        doc_param.Add("betType", bet_type);
        doc_param.Add("team", team);
        doc_param.Add("stake", stake);
        doc_param.Add("oddsFormat", "DECIMAL");
        return(PinHelper.post(url, doc_param.ToString()));
    }
示例#12
0
    public static string bets()
    {
        string url = "/v1/bets";

        return(PinHelper.get(url));
    }
 public MaterialCompilationException(PinHelper <TranslatedMaterialGraph.NodeInfo> pin, Exception innerException) :
     base(
         "Failed to compile material", innerException)
 {
     Pins = new[] { new Connection(pin.Node?.Id ?? 0, pin.Id) };
 }
示例#14
0
 /// <summary>
 /// Pins an object on the heap, so its address will not be changed by GC.
 /// </summary>
 /// <param name="o">The object to pin.</param>
 /// <param name="act">The action during which the object will stay pinned.</param>
 public static void Pin(object o, Action <object> act)
 {
     PinHelper.Pin(o, act);
 }
示例#15
0
    public static string feeds()
    {
        string url = "https://api.pinnaclesports.com/v1/feed?oddsFormat=1";

        return(PinHelper.get(url));
    }
示例#16
0
    public static string currencies()
    {
        string url = "https://api.pinnaclesports.com/v1/currencies";

        return(PinHelper.get(url));
    }
示例#17
0
    public static string leagues()
    {
        string url = "https://api.pinnaclesports.com/v1/leagues?sportid=29";

        return(PinHelper.get(url));
    }
示例#18
0
        /// <summary>
        /// 工作线程
        /// </summary>
        private void WorkerThread()
        {
            VideoSourceFinishedReasonType reasonToStop = VideoSourceFinishedReasonType.StoppedByUser;

            // grabber
            Grabber grabber = new Grabber(this);

            // objects
            object graphObject   = null;
            object grabberObject = null;

            // interfaces
            IGraphBuilder  graph         = null;
            IBaseFilter    sourceBase    = null;
            IBaseFilter    grabberBase   = null;
            ISampleGrabber sampleGrabber = null;
            IMediaControl  mediaControl  = null;
            IMediaEventEx  mediaEvent    = null;

            try
            {
                // get type for filter graph
                Type type = Type.GetTypeFromCLSID(Clsid.FilterGraph);
                if (type == null)
                {
                    throw new VideoSourceException("Failed creating filter graph");
                }

                // create filter graph
                graphObject = Activator.CreateInstance(type);
                graph       = (IGraphBuilder)graphObject;

                // create source device's object
                graph.AddSourceFilter(Source, "source", out sourceBase);
                if (sourceBase == null)
                {
                    throw new VideoSourceException("Failed creating source filter");
                }

                // get type for sample grabber
                type = Type.GetTypeFromCLSID(Clsid.SampleGrabber);
                if (type == null)
                {
                    throw new VideoSourceException("Failed creating sample grabber");
                }

                // create sample grabber
                grabberObject = Activator.CreateInstance(type);
                sampleGrabber = (ISampleGrabber)grabberObject;
                grabberBase   = (IBaseFilter)grabberObject;

                // add grabber filters to graph
                graph.AddFilter(grabberBase, "grabber");

                // set media type
                AMMediaType mediaType = new AMMediaType();
                mediaType.MajorType = MediaType.Video;
                mediaType.SubType   = MediaSubType.RGB24;
                sampleGrabber.SetMediaType(mediaType);

                // connect pins
                int pinToTry = 0;

                IPin inPin  = PinHelper.GetInPin(grabberBase, 0);
                IPin outPin = null;

                // find output pin acceptable by sample grabber
                while (true)
                {
                    outPin = PinHelper.GetOutPin(sourceBase, pinToTry);

                    if (outPin == null)
                    {
                        Marshal.ReleaseComObject(inPin);
                        throw new VideoSourceException("Cannot find acceptable output video pin in the given source");
                    }

                    if (graph.Connect(outPin, inPin) < 0)
                    {
                        Marshal.ReleaseComObject(outPin);
                        outPin = null;
                        pinToTry++;
                    }
                    else
                    {
                        break;
                    }
                }

                Marshal.ReleaseComObject(outPin);
                Marshal.ReleaseComObject(inPin);

                // get media type
                if (sampleGrabber.GetConnectedMediaType(mediaType) == 0)
                {
                    VideoInfoHeader vih = (VideoInfoHeader)Marshal.PtrToStructure(mediaType.FormatPtr, typeof(VideoInfoHeader));

                    grabber.Width  = vih.BmiHeader.Width;
                    grabber.Height = vih.BmiHeader.Height;
                    mediaType.Dispose();
                }

                // let's do rendering, if we don't need to prevent freezing
                if (!PreventFreezing)
                {
                    // render pin
                    graph.Render(PinHelper.GetOutPin(grabberBase, 0));

                    // configure video window
                    IVideoWindow window = (IVideoWindow)graphObject;
                    window.put_AutoShow(false);
                    window = null;
                }

                // configure sample grabber
                sampleGrabber.SetBufferSamples(false);
                sampleGrabber.SetOneShot(false);
                sampleGrabber.SetCallback(grabber, 1);

                // disable clock, if someone requested it
                if (!ReferenceClockEnabled)
                {
                    IMediaFilter mediaFilter = (IMediaFilter)graphObject;
                    mediaFilter.SetSyncSource(null);
                }

                // get media control
                mediaControl = (IMediaControl)graphObject;

                // get media events' interface
                mediaEvent = (IMediaEventEx)graphObject;
                IntPtr   p1, p2;
                DsEvCode code;

                // run
                mediaControl.Run();

                while (!stopEvent.WaitOne(0, false))
                {
                    Thread.Sleep(100);

                    if (mediaEvent != null)
                    {
                        if (mediaEvent.GetEvent(out code, out p1, out p2, 0) >= 0)
                        {
                            mediaEvent.FreeEventParams(code, p1, p2);

                            if (code == DsEvCode.Complete)
                            {
                                reasonToStop = VideoSourceFinishedReasonType.EndOfStreamReached;
                                break;
                            }
                        }
                    }
                }

                // stop
                mediaControl.Stop();
            }
            catch (Exception ex)
            {
                // provide information to clients
                if (VideoSourceException != null)
                {
                    VideoSourceException(this, new VideoSourceExceptionEventArgs(ex.Message));
                }
            }
            finally
            {
                // release all objects
                graph         = null;
                grabberBase   = null;
                sampleGrabber = null;
                mediaControl  = null;
                mediaEvent    = null;

                if (graphObject != null)
                {
                    Marshal.ReleaseComObject(graphObject);
                    graphObject = null;
                }
                if (sourceBase != null)
                {
                    Marshal.ReleaseComObject(sourceBase);
                    sourceBase = null;
                }
                if (grabberObject != null)
                {
                    Marshal.ReleaseComObject(grabberObject);
                    grabberObject = null;
                }
            }

            if (VideoSourceFinished != null)
            {
                VideoSourceFinished(this, new VideoSourceFinishedEventArgs(reasonToStop));
            }
        }
示例#19
0
    // Update method. Start when this.enabled

    void Update()
    {
        if (isOpen)
        {
            string protocol_Version = "";
            int    readed           = ReadByte();
            if (readed == (int)Message.START_SYSEX)
            {
                // SYSEX Management on hold
                Debug.Log("Sysex");
                readed = ReadByte();
                switch (readed)
                {
                case (int)Sysex.CAPABILITY_RESPONSE:
                    ReadCapabilities();
                    if (reportAllDigitalPins)
                    {
                        ReportAllDigitalPorts();
                    }
                    //  if reportAllDigitalPins = true, enable report for all pins by default, else, pin are to be enabled when "pinMode" is used on them
                    // no automatic reporting for analog Pins as they need frequent readings
                    byte[] message = new byte[2];
                    message [1] = 1;
                    break;

                case (int)Sysex.ANALOG_MAPPING_RESPONSE:
                    mapAnalogs();
                    isReady = true;
                    break;

                default:
                    while (readed != (int)Message.SYSEX_END)
                    {
                        Debug.Log(readed);
                    }
                    break;
                }
            }
            if (readed == (int)Message.PROTOCOL_VERSION)
            {
                protocol_Version  = "";
                protocol_Version += ReadByte() + "." + ReadByte();
                Debug.Log("Protocol Version " + protocol_Version);
                readed = ReadByte();
            }
            while ((readed < 0xF0) && (readed > 0xDF))
            {
                int pin   = readed - (int)Message.ANALOG_MESSAGE;
                int value = ReadByte();
                value += ReadByte() * (int)Mathf.Pow(2, 7);
                ChangePinState(analogPins[pin], value);
                readed = ReadByte();                  // continue
            }
            while ((readed < 0xA0) && (readed > 0x8F))
            {
                // 0x91 & 0x90 -> 0x90
                int port = readed - (int)Message.DIGITAL_MESSAGE;
                int max  = Mathf.Min((port + 1) * 8 - 1, pins.Count);
                readed = ReadByte();
                for (int i = port * 8; i < max; i++)
                {
                    int value = readed & PinHelper.getPinMask(i % 8);
                    if (value != 0)
                    {
                        value = 1;
                    }
                    if (pins[i].currentMode != PinMode.ANALOG)
                    {
                        ChangePinState(i, value);
                    }
                }
                readed = ReadByte();
                if ((port + 1) * 8 < pins.Count)
                {
                    int value = readed & PinHelper.getPinMask(7);
                    if (value != 0)
                    {
                        value = 1;
                    }
                    ChangePinState(port * 8 + 8, value);
                }
                readed = ReadByte();                 //
            }
        }
    }
示例#20
0
    public static string balance()
    {
        string url = "/v1/client/balance";

        return(PinHelper.get(url));
    }
示例#21
0
 public static string GetType(PinHelper <TranslatedMaterialGraph.NodeInfo> pin)
 {
     return(GetType(pin.Type));
 }
示例#22
0
 public static void Pin(this TypedReference tr, TypedReferenceTools.TypedRefAction act)
 {
     PinHelper.Pin(tr, act);
 }