public ClientSideMessageProcessor(ServerConnection connection, History history)
        {
            ServerConnection = connection;
            History = history;
            ServerConnection.MessageRecieved += ConnectionMessageRecieved;

            // I wish there were a public constructor for TraceListenerCollection, but there is not
            ConstructorInfo constructor = typeof(TraceListenerCollection).GetConstructor(
                BindingFlags.Instance | BindingFlags.NonPublic, null, new Type[] { }, null);
            ChatListeners = (TraceListenerCollection)constructor.Invoke(new object[0] { });
        }
예제 #2
0
        public World(Listener listener, int worldId, History history)
        {
            History = history;
            CubeClients = new Dictionary<int, HashSet<ClientConnection>>();
            ClientCubes = new Dictionary<ClientConnection, HashSet<int>>();
            Listener = listener;
            Weather = new ToClient.TimeAndWeather(
                Global.Now, 0, DefaultDay, DefaultNight, DefaultCusp, DefaultSun, 0, 0);
            _worldId = worldId;

            Possession = new Dictionary<int, ClientConnection>();
            Party = new Dictionary<string, HashSet<string>>();
            Users = new Dictionary<string, ClientConnection>();
            Load();
        }