示例#1
0
    public World(
        IGameInstance gameInstance,
        Streaming sharedStreaming,
        WorldChunkComponent chunkComponent,
        Transform sceneGroup,
        GameObject defaultActorPrefab,
        GetObjectPoolRootDelegate getStaticPoolRoot,
        GetObjectPoolRootDelegate getTransientPoolRoot,
        SerializableObjectFactory objectFactory,
        INetDriver netDriver,
        NetMsgFactory netMsgFactory
        )
    {
        this.gameInstance      = gameInstance;
        _sceneGroup            = sceneGroup;
        _netDriver             = netDriver;
        _rpcReferenceCollector = new RPCObjectReferenceCollector(this);
        _objectFactory         = objectFactory;
        _netMsgFactory         = netMsgFactory;
        _getStaticPoolRoot     = getStaticPoolRoot;
        _getTransientPoolRoot  = getTransientPoolRoot;
        _defaultActorPrefab    = defaultActorPrefab;

        CacheNetworkDispatchMethods();

        _netArchiveBytes = new byte[MAX_RELIABLE_MESSAGE_SIZE];
        _netArchive      = new NetMsgArchive(_netArchiveBytes);
        _nextNetID       = 0;

        _worldStreaming       = sharedStreaming ?? new Streaming(chunkComponent, CreateGenVoxelsJob, MMapChunkData, WriteChunkData);
        _sharedWorldStreaming = sharedStreaming != null;
    }
 public ServerWorld(
     IGameInstance gameInstance,
     WorldChunkComponent chunkComponent,
     Transform sceneGroup,
     string serverName,
     string serverMessage,
     System.Reflection.Assembly[] assemblies,
     INetDriver driver
     ) : base(gameInstance, null, chunkComponent, sceneGroup, GameManager.instance.staticData.defaultActorPrefab, () => GameManager.instance.staticObjectPoolRoot, () => GameManager.instance.transientObjectPoolRoot, serverName, serverMessage, assemblies, driver)
 {
 }
示例#3
0
 public ClientWorld(
     IGameInstance gameInstance,
     Streaming sharedStreaming,
     WorldChunkComponent chunkComponent,
     Transform sceneGroup,
     GameObject defaultActorPrefab,
     GetObjectPoolRootDelegate getStaticPoolRoot,
     GetObjectPoolRootDelegate getTransientPoolRoot,
     System.Reflection.Assembly[] assemblies,
     INetDriver driver
     ) : base(gameInstance, sharedStreaming, chunkComponent, sceneGroup, defaultActorPrefab, getStaticPoolRoot, getTransientPoolRoot, new ClientSerializableObjectFactory(assemblies), driver, new ClientNetMsgFactory(assemblies))
 {
 }
        public ClientWorld(
            IGameInstance gameInstance,
            Streaming sharedStreaming,
            WorldChunkComponent chunkComponent,
            Transform sceneGroup,
            System.Reflection.Assembly[] assemblies,
            INetDriver driver
            ) : base(gameInstance, sharedStreaming, chunkComponent, sceneGroup, GameManager.instance.staticData.defaultActorPrefab, () => GameManager.instance.staticObjectPoolRoot, () => GameManager.instance.transientObjectPoolRoot, assemblies, driver)
        {
#if UNITY_EDITOR
#if DEV_STREAMING
            worldStreaming.shaderQualityLevel = Streaming.EShaderQualityLevel.LOW;
#else
            worldStreaming.shaderQualityLevel = Streaming.debugHQShaderLevel;
#endif
#endif
        }
 public ServerWorld(
     IGameInstance gameInstance,
     Streaming sharedStreaming,
     WorldChunkComponent chunkComponent,
     Transform sceneGroup,
     GameObject defaultActorPrefab,
     GetObjectPoolRootDelegate getStaticPoolRoot,
     GetObjectPoolRootDelegate getTransientPoolRoot,
     string serverName,
     string serverMessage,
     System.Reflection.Assembly[] assemblies,
     INetDriver driver
     ) : base(gameInstance, sharedStreaming, chunkComponent, sceneGroup, defaultActorPrefab, getStaticPoolRoot, getTransientPoolRoot, new ServerSerializableObjectFactory(assemblies), driver, new ServerNetMsgFactory(assemblies))
 {
     this.serverName    = serverName;
     this.serverMessage = serverMessage;
     _clientConnections = new ReadOnlyCollection <ActorReplicationChannel>(connectionList);
 }