Exemplo n.º 1
0
        public WorldPersistence(ServerProtoBufSerializer protoBufSerializer, ServerJsonSerializer jsonSerializer, ServerConfig config)
        {
            this.protoBufSerializer = protoBufSerializer;
            this.config             = config;

            saveDataSerializer = config.SerializerModeEnum == ServerSerializerMode.PROTOBUF ? (IServerSerializer)protoBufSerializer : jsonSerializer;
            fileEnding         = config.SerializerModeEnum == ServerSerializerMode.PROTOBUF ? ".nitrox" : ".json";
        }
Exemplo n.º 2
0
        public WorldPersistence(ServerProtoBufSerializer protoBufSerializer, ServerJsonSerializer jsonSerializer, ServerConfig config, RandomStartGenerator randomStart)
        {
            this.protoBufSerializer = protoBufSerializer;
            this.randomStart        = randomStart;
            this.config             = config;

            Serializer = config.SerializerMode == ServerSerializerMode.PROTOBUF ? protoBufSerializer : jsonSerializer;
        }
Exemplo n.º 3
0
        public WorldPersistence(ServerProtoBufSerializer protoBufSerializer, ServerJsonSerializer jsonSerializer, ServerConfig config, RandomStartGenerator randomStart)
        {
            this.protoBufSerializer = protoBufSerializer;
            this.config             = config;
            this.randomStart        = randomStart;

            SaveDataSerializer = config.SerializerMode == ServerSerializerMode.PROTOBUF ? (IServerSerializer)protoBufSerializer : jsonSerializer;
            fileEnding         = SaveDataSerializer.GetFileEnding();
        }
Exemplo n.º 4
0
 internal void UpdateSerializer(IServerSerializer serializer)
 {
     SaveDataSerializer = serializer;
     fileEnding         = serializer.GetFileEnding();
 }
Exemplo n.º 5
0
 internal void UpdateSerializer(ServerSerializerMode mode)
 {
     Serializer = (mode == ServerSerializerMode.PROTOBUF) ? protoBufSerializer : jsonSerializer;
 }
Exemplo n.º 6
0
 internal void UpdateSerializer(IServerSerializer serverSerializer)
 {
     Validate.NotNull(serverSerializer, "Serializer cannot be null");
     Serializer = serverSerializer;
 }
Exemplo n.º 7
0
 internal void UpdateSerializer(IServerSerializer serializer)
 {
     this.Serializer = serializer;
 }