Пример #1
0
        private static void launchThreads(string ip, int port, Services.Services servicesSrc)
        {
            // Creating new thread containing TCPServer
            Thread players = new Thread(delegate()
            {
                // replace the IP with your system IP Address...
                Server myserver = new Server(ip, port, servicesSrc);
            });

            // Launching thread
            players.Start();


            // Creating new thread containing TCPServer
            Thread admin = new Thread(delegate()
            {
                // replace the IP with your system IP Address...
                AdminServer adminServer = new AdminServer(ip, port + 1, servicesSrc);
            });

            // Launching thread
            admin.Start();

            Thread consoleAdmin = new Thread(delegate()
            {
                // replace the IP with your system IP Address...
                ConsoleAdmin adminServer = new ConsoleAdmin(servicesSrc);
            });

            consoleAdmin.Start();
        }
 public HizmetlerController(IHostingEnvironment hostingEnvironment)
 {
     if (services == null)
     {
         services = new Services.Services();
     }
     _hostingEnvironment = hostingEnvironment;
 }
Пример #3
0
        public ActionResult About()
        {
            Services.Services Test1 = new Services.Services();

            ViewBag.Message = Test1.Test();

            //ViewBag.Message = "Your application description page.";

            return(View());
        }
Пример #4
0
        public MazeFeature(GameContext game, MetaContext meta, InputContext input, Services.Services services,
                           Prefabs.Prefabs prefabs)
        {
            Add(new ServiceRegistrationSystems(game, input, services));

            Add(new InputFeature(input, game));
            Add(new GameplayFeature(game, input, meta, prefabs));
            Add(new StatisticsFeature(game, meta));

            Add(new GameCleanupSystems(Contexts.sharedInstance));
            Add(new GameEventSystems(Contexts.sharedInstance));
        }
Пример #5
0
        // Constructor
        public AdminServer(string ip, int port, Services.Services servicesSrc)
        {
            servicesObject = servicesSrc;
            _ipAddr        = IPAddress.Parse(ip);
            _port          = port;

            server = new TcpListener(_ipAddr, _port);
            server.Start();

            printLog(serverNameInConsole, "Administration server successfully started!");

            // Method called by the thread forever
            StartListener();
        }
        public ServiceRegistrationSystems(Contexts contexts, Services.Services services)
            : base(nameof(ServiceRegistrationSystems))
        {
            GameContext  game  = contexts.game;
            InputContext input = contexts.input;

            Add(new RegisterServiceSystem <ILogService>(services.Logger, game.ReplaceLogger));
            Add(new RegisterServiceSystem <IViewService>(services.ViewService, game.ReplaceViewCreator));
            Add(new RegisterServiceSystem <ITimeService>(services.Time, game.ReplaceTime));
            Add(new RegisterServiceSystem <IInputService>(services.InputService, input.ReplaceInput));
            Add(new RegisterServiceSystem <IPhysicsService>(services.Physics, game.ReplacePhysics));
            Add(new RegisterServiceSystem <ICoroutineDirectorService>(services.CoroutineDirector, game.ReplaceCoroutineDirector));
            Add(new RegisterServiceSystem <IRegisterService <IViewController> >(services.CollidingViewRegister, game.ReplaceCollidingViewRegister));
            Add(new RegisterServiceSystem <IIdentifierService>(services.Identifiers, game.ReplaceIdentifiers));
        }
Пример #7
0
 public SetUp(Services.Services services)
 {
     _services = services;
 }
Пример #8
0
        // Constructor
        static void Main(string[] args)
        {
            Services.Services servicesObject = new Services.Services();
            Console.WriteLine("Server Core - .NET Game - Team C");
            Console.WriteLine("==================================================");

            // Default IP and port
            var ipAddr     = "127.0.0.1";
            var port       = 32101;
            var tempString = "";

            // if some args were given at soft launch
            // First arg: IP Address of this server
            // Second arg: Server port
            // Default: 127.0.0.1 32101
            if (args.Length > 0 && args.Length == 2)
            {
                Console.WriteLine("Arg 0: " + args[0]);
                Console.WriteLine("Arg 1: " + args[1]);

                ipAddr = args[0];
                port   = Int32.Parse(args[1]);

                Console.WriteLine("==================================================");
                Console.WriteLine("Selected @IP: " + IPAddress.Parse(ipAddr) + '\n');
                Console.WriteLine("Selected port: " + port + '\n');
                Console.WriteLine("==================================================\n");
            }

            // If no args were given
            else
            {
                // Prompt user to type in @IP and port
                Console.WriteLine("If you want to set it to default, don't type anything, and press ENTER.");
                Console.Write("Please enter server IP Address (default: localhost): ");

                ipAddr = Console.ReadLine();
                if (String.IsNullOrWhiteSpace(ipAddr))
                {
                    ipAddr = "127.0.0.1";
                }

                Console.WriteLine("Selected @IP: " + IPAddress.Parse(ipAddr) + '\n');

                Console.Write("Please enter server port (default: 32101): ");

                tempString = Console.ReadLine();
                if (String.IsNullOrWhiteSpace(tempString))
                {
                    port = 32101;
                }

                else
                {
                    port = Int32.Parse(tempString);
                }

                Console.WriteLine("Selected port: " + port + '\n');
                Console.WriteLine("==================================================\n");
            }

            var status    = false;
            var isDefault = false;

            Console.WriteLine("Now, let's setup the game. Do you want to set it up by default? (Type Y or N): ");
            var setup = Console.ReadLine();

            while (status == false)
            {
                if (setup == "Y" || setup == "y")
                {
                    status    = true;
                    isDefault = true;
                }

                else if (setup == "N" || setup == "n")
                {
                    status    = true;
                    isDefault = false;
                }

                else
                {
                    Console.WriteLine("Now, let's setup the game. Do you want to set it up by default? (Type Y or N): ");
                    setup = Console.ReadLine();
                }
            }

            if (isDefault == true)
            {
                Console.WriteLine("Game settings set to default, see documentation.");
            }

            else
            {
                Console.WriteLine("Enter game name: ");
                servicesObject.CurrentGame.GameName = Console.ReadLine();

                Console.WriteLine("Game duration (nbr of rounds): ");
                servicesObject.CurrentGame.GameTour = Int32.Parse(Console.ReadLine());

                Console.WriteLine("Money to start with: ");
                servicesObject.CurrentGame.GameStartMoney = float.Parse(Console.ReadLine(), CultureInfo.InvariantCulture.NumberFormat);

                Console.WriteLine("Nbr of players: ");
                servicesObject.CurrentGame.PlayerNeeded = Int32.Parse(Console.ReadLine());
            }

            Console.WriteLine("Every settings are set, now launching the servers...");
            Console.WriteLine("==================================================\n");

            launchThreads(ipAddr, port, servicesObject);
        }
Пример #9
0
 public Wall(Services.Services services)
 {
     _services = services;
 }
Пример #10
0
 public FamilysController(Services.Services service)
 {
     _service = service;
 }
 public TechStoreBaseController()
 {
     Service = new Services.Services();
 }
 public MessagesController(Services.Services service)
 {
     _service = service;
 }
 public MembersController(Services.Services service)
 {
     _service = service;
 }
 public ConversationsController(Services.Services service)
 {
     _service = service;
 }
Пример #15
0
 public string Ordering(string EID)
 {
     Services.Services sv = new Services.Services();
     return(sv.Ordering(EID));
 }
 public MessagesController(Services.Services service)
 {
     _service = service;
 }
Пример #17
0
 public AllSystems(Contexts contexts, Services.Services services)
 {
     Add(new ServiceRegistrationSystems(contexts, services));
     Add(new GameplaySystems(contexts));
     Add(new GameEventSystems(contexts));
 }
Пример #18
0
 public ConsoleAdmin(Services.Services servicesSrc)
 {
     _services = servicesSrc;
     CommandHandler();
 }
 public FamilysController(Services.Services service)
 {
     _service = service;
 }
Пример #20
0
 public Feed(Services.Services services)
 {
     _services = services;
 }
 public ConversationsController(Services.Services service)
 {
     _service = service;
 }