Esempio n. 1
0
        public static void Run <T>(string[] args) where T : MyObjectBuilder_SessionSettings, new()
        {
            if (DedicatedServer.ProcessArgs(args))
            {
                return;
            }


            if (Environment.UserInteractive)
            {
                MyPlugins.RegisterGameAssemblyFile(MyPerGameSettings.GameModAssembly);
                MyPlugins.RegisterGameObjectBuildersAssemblyFile(MyPerGameSettings.GameModObjBuildersAssembly);
                MyPlugins.RegisterSandboxAssemblyFile(MyPerGameSettings.SandboxAssembly);
                MyPlugins.RegisterSandboxGameAssemblyFile(MyPerGameSettings.SandboxGameAssembly);
                MyPlugins.RegisterFromArgs(args);
                MyPlugins.Load();
                bool resultRegisterAssemblies = MyObjectBuilderType.RegisterAssemblies();
                Debug.Assert(resultRegisterAssemblies, "Registering object builders types from assemblies failed.");
                resultRegisterAssemblies = MyObjectBuilderSerializer.RegisterAssembliesAndLoadSerializers();
                Debug.Assert(resultRegisterAssemblies, "Registering object builders serializers from assemblies failed.");
                ShowWindow(GetConsoleWindow(), SW_HIDE);
                MyConfigurator.Start <T>();
                MyPlugins.Unload();
                return;
            }
            else
            {
                MyServiceBase.Run(new WindowsService());
                return;
            }
        }
Esempio n. 2
0
        public static void Run <T>(string[] args) where T : MyObjectBuilder_SessionSettings, new()
        {
            if (DedicatedServer.ProcessArgs(args))
            {
                return;
            }


            if (Environment.UserInteractive)
            {
                MyPlugins.RegisterGameAssemblyFile(MyPerGameSettings.GameModAssembly);
                MyPlugins.RegisterSandboxAssemblyFile(MyPerGameSettings.SandboxAssembly);
                MyPlugins.RegisterSandboxGameAssemblyFile(MyPerGameSettings.SandboxGameAssembly);
                MyPlugins.RegisterFromArgs(args);
                MyPlugins.Load();
                ShowWindow(GetConsoleWindow(), SW_HIDE);
                MyConfigurator.Start <T>();
                MyPlugins.Unload();
                return;
            }
            else
            {
                MyServiceBase.Run(new WindowsService());
                return;
            }
        }
Esempio n. 3
0
        static MyCustomerBase IncluirFuncionarios(MyServiceBase baseDeServico)
        {
            Employee f1 = new Employee();
            Address  e1 = new Address();

            e1.IncluirAddress(1, "Rua dos bobos", "12345-010", "Vila dos Devs", "São Paulo", "SP", "0");

            f1.IncluirFuncionario("Maria", "999999999", e1, Employee.CargoFunc.Cabelereira);

            Employee f2 = new Employee();

            f2.IncluirFuncionario("Rosana", "999999998", e1, Employee.CargoFunc.Manicure);

            Employee f3 = new Employee();

            f3.IncluirFuncionario("Joana", "999999997", e1, Employee.CargoFunc.Esteticista);

            MyCustomerBase bf = new MyCustomerBase();

            //bf.IncluirUmFuncionario(f1);
            //bf.IncluirUmFuncionario(f2);
            //bf.IncluirUmFuncionario(f3);


            //bf.IncluirServicoDeUmFuncionario(1, baseDeServico.Servicos.FirstOrDefault(x => x.IdServico == 1));
            //bf.IncluirServicoDeUmFuncionario(2, baseDeServico.Servicos.FirstOrDefault(x => x.IdServico == 2));
            //bf.IncluirServicoDeUmFuncionario(2, baseDeServico.Servicos.FirstOrDefault(x => x.IdServico == 3));
            //bf.IncluirServicoDeUmFuncionario(3, baseDeServico.Servicos.FirstOrDefault(x => x.IdServico == 4));

            return(bf);
        }
Esempio n. 4
0
        static MyServiceBase IncluirMeusServicos()
        {
            Service s1 = new Service();

            s1.IncluirUmServico(1, "Corte de Cabelo", 59, 130);

            Service s5 = new Service();

            s5.IncluirUmServico(1, "Corte de Cabelo", 59, 130);

            Service s2 = new Service();

            s2.IncluirUmServico(2, "Manicure", 59, 20);

            Service s3 = new Service();

            s3.IncluirUmServico(3, "Pedicure", 59, 30);

            Service s4 = new Service();

            s4.IncluirUmServico(4, "Limpeza de pele", 59, 100);


            MyServiceBase bs = new MyServiceBase();

            bs.IncluirUmServico(s1);
            bs.IncluirUmServico(s2);
            bs.IncluirUmServico(s3);
            bs.IncluirUmServico(s4);
            bs.IncluirUmServico(s5);

            return(bs);
        }
 public MyServiceBase()
 {
     if (_instance == null)
     {
         // do the initialization
         _instance = this;
     }
 }
Esempio n. 6
0
 /// <summary>Register service method with a service binder with or without implementation. Useful when customizing the  service binding logic.
 /// Note: this method is part of an experimental API that can change or be removed without any prior notice.</summary>
 /// <param name="serviceBinder">Service methods will be bound by calling <c>AddMethod</c> on this object.</param>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static void BindService(grpc::ServiceBinderBase serviceBinder, MyServiceBase serviceImpl)
 {
     serviceBinder.AddMethod(__Method_Do, serviceImpl == null ? null : new grpc::DuplexStreamingServerMethod <global::GRPC.Bidirectional.Core.DoMessage, global::GRPC.Bidirectional.Core.DoMessage>(serviceImpl.Do));
 }
Esempio n. 7
0
 /// <summary>Creates service definition that can be registered with a server</summary>
 /// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
 public static grpc::ServerServiceDefinition BindService(MyServiceBase serviceImpl)
 {
     return(grpc::ServerServiceDefinition.CreateBuilder()
            .AddMethod(__Method_Do, serviceImpl.Do).Build());
 }