Esempio n. 1
0
 /// <summary>
 /// Adds an entry
 /// </summary>
 /// <param name="pde"></param>
 public static void Add(PlayerDatabaseEntry pde)
 {
     if (_entries == null)
     {
         Load();
     }
     _entries.Add(pde);
 }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="args"></param>
        static void Main(string[] args)
        {
            // On the server a logon manager needs to be defined. Write a logonmanager class that handles logins
            NetLobby.LogonManager = new LogonManager(NetLobby.KeySize, "There is no secret.");
            StopRunningSemaphore  = new ManualResetEvent(false);

            PlayerDatabase.Add(PlayerDatabaseEntry.Generate("test", "pass", NetLobby.KeySize));

            var listener = new Listener();

            listener.OnConnected    += new Listener.ConnectionDelegate(listener_OnConnected);
            listener.OnDisconnected += new Listener.ConnectionDelegate(listener_OnDisconnected);

            listener.Start();
            Console.WriteLine(">> Server started. <<");

            // Runs this server until IsRunning is set to false
            StopRunningSemaphore.WaitOne();
            listener.IsRunning = false;
            Console.WriteLine(">> Server terminated. <<");
        }
 /// <summary>
 /// Adds an entry
 /// </summary>
 /// <param name="pde"></param>
 public static void Add(PlayerDatabaseEntry pde)
 {
     if (_entries == null)
         Load();
     _entries.Add(pde);
 }