public TreeBrowsingForm(IServerPluginContext context)
 {
     InitializeComponent();
     this.Context     = context;
     this.CurrentNode = context.ServerWrapper.ShowRootNode();
     this.Text        = CurrentNode.NodeId;
 }
Esempio n. 2
0
        /// <inheritdoc/>
        public override void OnStop(IServerPluginContext context)
        {
            context.Logging.Application.Info(
                $@"{nameof(ExampleServerPluginEntry)}.{nameof(OnStop)} writing to the application log!");

            context.Logging.Plugin.Info(
                $@"{nameof(ExampleServerPluginEntry)}.{nameof(OnStop)} writing to the plugin log!");
        }
 public AggregationRunner(IServerNode node, IPluginProgressProvider progress, IServerPluginContext context)
 {
     this.Node             = node;
     this.Context          = context;
     this.ProgressProvider = progress;
     this.ActionLine       = GenerateLineString(node);
     this.ReportBuilder    = new StringBuilder();
     this.BoardLen         = node.Board.Length;
 }
Esempio n. 4
0
        /// <summary>
        /// Get the results from one particular node into the structure
        /// </summary>
        public static ReportLine CreateReportLineForNode(IServerNode node, IServerPluginContext context)
        {
            var result = new ReportLine();

            var OOP = context.ServerUtils.OOP;
            var IP  = context.ServerUtils.IP;


            //the board
            result.Board = node.Board;

            // Calculate IP and OOP ev and equity in the node.
            // The result for EV calculation is two ranges
            // one range is sums and the other is matchups
            // EV for a given hand can be calculated by dividing
            // sums by matchups.
            // The total EV in node can be obtained by diving
            // total sums in the node by total counters
            var evIP  = context.ServerWrapper.CalcEVInNode(IP, node);
            var evOOP = context.ServerWrapper.CalcEVInNode(OOP, node);

            result.EVOOPSums     = evOOP.TotalWins();
            result.EVOOPMatchups = evOOP.TotalMatchups();
            result.EVIPSums      = evIP.TotalWins();
            result.EVIPMatchups  = evIP.TotalMatchups();

            var eqIP  = context.ServerWrapper.CalcEquityInNode(IP, node);
            var eqOOP = context.ServerWrapper.CalcEquityInNode(OOP, node);

            result.EQOOPSums     = eqOOP.TotalWins();
            result.EQOOPMatchups = eqOOP.TotalMatchups();
            result.EQIPSums      = eqIP.TotalWins();
            result.EQIPMatchups  = eqIP.TotalMatchups();

            // If the node is action node (e.g. - not a street split node nor final node)
            // then we also compute how often given action is selected
            if (node.ActionPlayer != null)
            {
                // we ask server to list all children of a current node
                var actions = context.ServerWrapper.ShowChildren(node);
                foreach (var action in actions)
                {
                    // for each child we ask for the range of an action player
                    var rangeForAction = context.ServerWrapper.ShowRange(node.ActionPlayer, action);
                    // and store it in the result dictionary
                    // NodeText property denotes the action (e.g. CHECK or BET 100)
                    result.ActionFrequencies[action.NodeText] = rangeForAction.TotalWeights();
                    // Node name is stored separately to preserve the action's order
                    result.ActionNames.Add(action.NodeText);
                }
            }
            return(result);
        }
Esempio n. 5
0
        public void Initialize(IServerPluginContext context)
        {
            //Context is a container for many useful objects and operations including the server access,
            //cotrolling the viewer and many others.
            this.Context = context;

            // In this plugin we are interested in functionality of a PioViewer browser controller.
            IBrowserController controller = context.Controller;

            // This method is the C# way of registering to the event
            // In this case we register to an event, that is triggered on node selection change in the viewer
            controller.SelectedNodeChanged += Controller_SelectedNodeChanged;
        }
 public void Initialize(IServerPluginContext context)
 {
     this.Context = context;
 }
Esempio n. 7
0
 public void Initialize(IServerPluginContext context)
 {
     this.Context = context;
     MessageBox.Show("Hello world plugin has just been initialized");
 }
 public void Initialize(IServerPluginContext context)
 {
     this.Context = context;
     this.OOP     = context.ServerUtils.OOP;
     this.IP      = context.ServerUtils.IP;
 }