Exemplo n.º 1
0
        private void OnCmdAddInstance(RouterMessage msg)
        {
            //Decode arguments and create logger
            ManagerAddInstance  args   = msg.DeserializeAs <ManagerAddInstance>();
            MasterCommandLogger logger = new MasterCommandLogger(msg);

            //Find package
            if (!session.packages.ContainsKey(args.package_name))
            {
                logger.FinishFail("Could not find that package on the server.");
                return;
            }
            ManagerPackage package = session.packages[args.package_name];

            //Run
            try
            {
                session.CreateNewInstance(package, logger, args.count, true);
            }
            catch (Exception ex)
            {
                logger.FinishFail($"Unexpected error: {ex.Message}{ex.StackTrace}");
            }
        }
Exemplo n.º 2
0
 public ChannelReader <RouterMessage> AddInstance(ManagerAddInstance cmd)
 {
     return(SendMessageGetResponseChannelSerialized(MasterConnectionOpcodes.OPCODE_MASTER_M_ADDINSTANCE, cmd));
 }