示例#1
0
        public StriveService()
        {
            // This call is required by the Windows.Forms Component Designer.
            InitializeComponent();

            Listener listener = new Listener(new IPEndPoint(Dns.GetHostEntry(Dns.GetHostName()).AddressList[0], Constants.DefaultPort));
            striveEngine = new Engine(
                new MessageProcessor(new World(listener, Global.WorldId, new History()), listener));
        }
示例#2
0
 public Engine()
 {
     _log.Info("Creating " + Assembly.GetExecutingAssembly().GetName().FullName);
     Global.ReadConfiguration();
     //Global.worldFilename = "DefaultWorld.xml";
     _engineThread = new StoppableThread(UpdateLoop);
     _listener = new Listener(new IPEndPoint(Dns.GetHostEntry(Dns.GetHostName()).AddressList[0], port));
     _log = LogManager.GetCurrentClassLogger();
     ServerStatusModel = new ServerStatusModel {Status = "Created"};
 }
示例#3
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();
        }
 public MessageProcessor(World world, Listener listener)
 {
     World = world;
     Listener = listener;
 }