Renames buffer writer to fix any conflicts (#204)

This commit is contained in:
Kamron Batman 2020-08-30 20:28:35 -07:00 committed by GitHub
parent c4e7f47ada
commit 133a1c4b56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 19 deletions

View file

@ -40,14 +40,14 @@ namespace Server.Guilds
List.Add(Serial, this); List.Add(Serial, this);
if (Serial + 1 > m_NextID) if (Serial + 1 > m_NextID)
m_NextID = Serial + 1; m_NextID = Serial + 1;
SaveBuffer = new BufferWriter(true); SaveBuffer = new BufferedFileWriter(true);
} }
protected BaseGuild() protected BaseGuild()
{ {
Serial = m_NextID++; Serial = m_NextID++;
List.Add(Serial, this); List.Add(Serial, this);
SaveBuffer = new BufferWriter(true); SaveBuffer = new BufferedFileWriter(true);
} }
public abstract string Abbreviation { get; set; } public abstract string Abbreviation { get; set; }
@ -56,7 +56,7 @@ namespace Server.Guilds
public abstract bool Disbanded { get; } public abstract bool Disbanded { get; }
public static Dictionary<uint, BaseGuild> List { get; } = new Dictionary<uint, BaseGuild>(); public static Dictionary<uint, BaseGuild> List { get; } = new Dictionary<uint, BaseGuild>();
public BufferWriter SaveBuffer { get; } public BufferedFileWriter SaveBuffer { get; }
[CommandProperty(AccessLevel.Counselor)] [CommandProperty(AccessLevel.Counselor)]
public Serial Serial { get; } public Serial Serial { get; }

View file

@ -253,7 +253,7 @@ namespace Server
TypeRef = World.m_ItemTypes.Count - 1; TypeRef = World.m_ItemTypes.Count - 1;
} }
SaveBuffer = new BufferWriter(true); SaveBuffer = new BufferedFileWriter(true);
} }
public Item(Serial serial) public Item(Serial serial)
@ -269,7 +269,7 @@ namespace Server
TypeRef = World.m_ItemTypes.Count - 1; TypeRef = World.m_ItemTypes.Count - 1;
} }
SaveBuffer = new BufferWriter(true); SaveBuffer = new BufferedFileWriter(true);
} }
public int TempFlags public int TempFlags
@ -794,7 +794,7 @@ namespace Server
AddNameProperties(list); AddNameProperties(list);
} }
public BufferWriter SaveBuffer { get; } public BufferedFileWriter SaveBuffer { get; }
[CommandProperty(AccessLevel.Counselor)] [CommandProperty(AccessLevel.Counselor)]
public Serial Serial { get; } public Serial Serial { get; }

View file

@ -616,7 +616,7 @@ namespace Server
TypeRef = World.m_MobileTypes.Count - 1; TypeRef = World.m_MobileTypes.Count - 1;
} }
SaveBuffer = new BufferWriter(true); SaveBuffer = new BufferedFileWriter(true);
} }
public Mobile() public Mobile()
@ -637,7 +637,7 @@ namespace Server
TypeRef = World.m_MobileTypes.Count - 1; TypeRef = World.m_MobileTypes.Count - 1;
} }
SaveBuffer = new BufferWriter(true); SaveBuffer = new BufferedFileWriter(true);
} }
public static bool DragEffects { get; set; } = true; public static bool DragEffects { get; set; } = true;
@ -2528,7 +2528,7 @@ namespace Server
AddNameProperties(list); AddNameProperties(list);
} }
public BufferWriter SaveBuffer { get; } public BufferedFileWriter SaveBuffer { get; }
[CommandProperty(AccessLevel.Counselor)] [CommandProperty(AccessLevel.Counselor)]
public Serial Serial { get; } public Serial Serial { get; }

View file

@ -2,19 +2,13 @@
* ModernUO * * ModernUO *
* Copyright (C) 2019-2020 - ModernUO Development Team * * Copyright (C) 2019-2020 - ModernUO Development Team *
* Email: hi@modernuo.com * * Email: hi@modernuo.com *
* File: BufferWriter.cs * * File: BufferedFileWriter.cs *
* Created: 2019/12/30 - Updated: 2020/01/18 *
* * * *
* This program is free software: you can redistribute it and/or modify * * This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or * * the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. * * along with this program. If not, see <http://www.gnu.org/licenses/>. *
*************************************************************************/ *************************************************************************/
@ -27,7 +21,7 @@ using Server.Guilds;
namespace Server namespace Server
{ {
public class BufferWriter : IGenericWriter public class BufferedFileWriter : IGenericWriter
{ {
private const int LargeByteBufferSize = 256; private const int LargeByteBufferSize = 256;
@ -41,7 +35,7 @@ namespace Server
private int m_Index; private int m_Index;
private int m_MaxBufferChars; private int m_MaxBufferChars;
public BufferWriter(bool prefixStr) public BufferedFileWriter(bool prefixStr)
{ {
m_PrefixStrings = prefixStr; m_PrefixStrings = prefixStr;
m_Encoding = Utility.UTF8; m_Encoding = Utility.UTF8;

View file

@ -23,7 +23,7 @@ namespace Server
{ {
public interface ISerializable public interface ISerializable
{ {
BufferWriter SaveBuffer { get; } BufferedFileWriter SaveBuffer { get; }
int TypeRef { get; } int TypeRef { get; }
Serial Serial { get; } Serial Serial { get; }
void Serialize(); void Serialize();