Ejemplo n.º 1
0
    {/// <summary>
     ///     The server instance.
     /// </summary>

        /// <summary>
        ///     Main entry point of the server which starts a single server.
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            var speedDate = new SpeedDate("appsettings.json");

            speedDate.Start();

            System.Console.ReadLine();

            ////new Thread(new ThreadStart(ConsoleLoop)).Start();


            //var input = "";
            //while (input != "x")
            //{
            //input = System.Console.ReadLine()?.ToLower();
            //    _masterServer.HandleCommand(input);
            //}
            //while (true)
            //{
            //    server.DispatcherWaitHandle.WaitOne();
            //    server.ExecuteDispatcherTasks();
            //}
        }
Ejemplo n.º 2
0
        //security check.... prevents cross-site request forgeries....stack overflow... description
        public ActionResult CreateSpeedDate(SpeedDates input)
        {
            if (ModelState.IsValid)
            {
                using (var db = new FurryEntities())
                {
                    var speedDates    = db.SpeedDates.FirstOrDefault(x => x.SpeedDateId == input.SpeedDateId);
                    var newSpeedDates = new SpeedDate();
                    if (speedDates == null)
                    {
                        newSpeedDates.SpeedDateId = Guid.NewGuid();
                        newSpeedDates.PostTime    = DateTime.Now;
                        if (input != null)
                        {
                            var cookievalue =
                                FormsAuthentication.Decrypt(Request.Cookies[FormsAuthentication.FormsCookieName].Value);
                            newSpeedDates.UserId      = new Guid(cookievalue.UserData);
                            newSpeedDates.Title       = input.Title;
                            newSpeedDates.Description = input.Description;
                            newSpeedDates.City        = input.City;
                            newSpeedDates.State       = input.State;
                            if (input.JsonAttributes != null)
                            {
                                newSpeedDates.JsonAttributes = input.JsonAttributes;
                            }
                        }
                        //nullable properties that may or may not have a value
                        db.SpeedDates.Add(newSpeedDates);             //adds complete 'newSpeedDate' to the table
                        db.SaveChanges();                             //saves information in db
                        return(RedirectToAction("MainPage", "Home")); //sends them straight to 'home index'
                    }
                } //closing using statement destroys db connection

                //if model state is invalid, returns to register and passes existing 'input' back
            }
            return(View(input));
        }
Ejemplo n.º 3
0
 public Spawner(string configFile)
 {
     _speedDate          = new SpeedDate(configFile);
     _speedDate.Started += () => Connected?.Invoke();
 }
Ejemplo n.º 4
0
 public GameServer(string configFile)
 {
     _speedDate = new SpeedDate(configFile);
 }
Ejemplo n.º 5
0
 public GameClient(string configFile)
 {
     _speedDate          = new SpeedDate(configFile);
     _speedDate.Started += () => Connected?.Invoke();
 }