コード例 #1
0
 public ChatServer(IPAddress localaddr, int port, string logfile)
     : base(localaddr, port, logfile)
 {
     nickTable = new BidirectionalDict<Client, string>();
     OnDisconnect += Handle_OnDisconnect;
     OnConnect += DefaultHandle_OnConnect;
 }
コード例 #2
0
 public KeyboardManager()
 {
     _frame = 0;
     _bindings = new BidirectionalDict<string, KeyBinding>();
     _previous = InputSnapshot.With(Keyboard.GetState());
     _current = InputSnapshot.With(Keyboard.GetState());
     _repeatingBindingHistory = new Dictionary<string, int>();
 }
コード例 #3
0
 public GameServer(GameSettings settings)
     : base(IPAddress.Any, settings.Port, settings.LogFilename)
 {
     OnDisconnect += Handle_OnDisconnect;
     OnConnect += Handle_OnConnect;
     PlayerTable = new BidirectionalDict<string, Client>();
     Game = new Game(settings);
     Settings = settings;
 }
コード例 #4
0
        /// <summary>
        ///   Construct a basic server such that it is ready to be started, and possibly using the default connect
        ///   behavior.
        /// </summary>
        public BasicServer(IPAddress localaddr, int port, string logFileName = null, bool tailLog = true)
        {
            IsRunning = false;
            _localaddr = localaddr;
            _port = port;

            ClientTable = new BidirectionalDict<string, Client>();
            AuthTable = new DefaultDict<Client, bool>();

            Log = new FileLog(logFileName, Frequency.Burst);
            if (tailLog)
                Log.AddMirror(new ConsoleLog());
            Log.Info("Server initialized: <{0}>::{1}".format(localaddr, port));
        }