Exemplo 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);
 }
Exemplo 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. <<");
        }
Exemplo n.º 3
0
 /// <summary>
 /// Adds an entry
 /// </summary>
 /// <param name="pde"></param>
 public static void Add(PlayerDatabaseEntry pde)
 {
     if (_entries == null)
         Load();
     _entries.Add(pde);
 }