예제 #1
0
        void LoadGenWorldOrigin()
        {
            var lg = ServerLandGenerator.Instance;

            lg.ClearQueue();
            lg.ImmediateMode = true;
            var dim = (WorldOptions.ChunkLoadRadius - 1) * 2;

            ChunkHelper.Spiral(dim, dim, GenOrLoad);
            ChunkHelper.Spiral(dim, dim, (x, y) => { _keepaliveChunks.Add(new Int3(x, 0, y)); });
            DebugOutput.LogFormat("Initial world generation. Chunks total: {0}, to generate: {1}", dim * dim, lg.QueueCount);
            lg.TryStartGeneration();
            lg.ImmediateMode = false;
        }
예제 #2
0
        void OnPlayerJoin(OnClientConnected e)
        {
            DebugOutput.LogFormat("Player {0} joined. Starting to send world info.", e.State.UserName);

            var state = new PlayerChunkLoadState()
            {
                Client       = e.State,
                PlayerInited = false
            };

            _playerStates.Add(e.State, state);

            CreateInitialSendQueue(state);
            var wsc = ServerWorldStateController.Instance;             //TODO: Move to world state controller

            wsc.SendToClient(e.State);
        }