Ejemplo n.º 1
0
 public PersistenceClient(IEnvironmentClient environment)
 {
     m_Environment   = environment;
     m_RailClient    = new RailClient(Registry.Client(environment));
     Room            = m_RailClient.StartRoom();
     RpcSyncHandlers = new RPCSyncHandlers();
 }
Ejemplo n.º 2
0
        private static void DisplayClientRpcInfo()
        {
            if (!Imgui.TreeNode("Client synchronized method calls"))
            {
                return;
            }

            if (CoopClient.Instance?.Persistence?.RpcSyncHandlers == null)
            {
                Imgui.Text("Coop client not connected.");
            }
            else
            {
                RPCSyncHandlers manager = CoopClient.Instance?.Persistence?.RpcSyncHandlers;

                foreach (MethodCallSyncHandler handler in manager.Handlers)
                {
                    if (!Imgui.TreeNode(handler.MethodAccess.ToString()))
                    {
                        continue;
                    }
#if DEBUG
                    Imgui.Columns(2);
                    Imgui.Separator();
                    Imgui.Text("Requested on");

                    foreach (MethodCallSyncHandler.Statistics.Trace trace in handler.Stats.History)
                    {
                        Imgui.Text(trace.Tick.ToString());
                    }

                    Imgui.NextColumn();
                    Imgui.Text("Request");
                    Imgui.Separator();
                    foreach (MethodCallSyncHandler.Statistics.Trace trace in handler.Stats.History)
                    {
                        Imgui.Text(trace.Call.ToString());
                    }

                    Imgui.Columns();
                    Imgui.TreePop();
#else
                    DisplayDebugDisabledText();
#endif
                }
            }

            Imgui.TreePop();
        }