Fixed DB2 loading and world login!!!!!
This commit is contained in:
@@ -21,6 +21,8 @@ namespace System.Collections.Generic
|
||||
{
|
||||
public class Array<T> : List<T>
|
||||
{
|
||||
int _limit;
|
||||
|
||||
public Array(int size) : base(size)
|
||||
{
|
||||
_limit = size;
|
||||
@@ -31,8 +33,9 @@ namespace System.Collections.Generic
|
||||
_limit = args.Length;
|
||||
}
|
||||
|
||||
public Array(int size, T defaultFillValue) : this(size)
|
||||
public Array(int size, T defaultFillValue) : base(size)
|
||||
{
|
||||
_limit = size;
|
||||
Fill(defaultFillValue);
|
||||
}
|
||||
|
||||
@@ -42,14 +45,6 @@ namespace System.Collections.Generic
|
||||
Add(value);
|
||||
}
|
||||
|
||||
public new void Add(T value)
|
||||
{
|
||||
if (base.Count >= _limit)
|
||||
throw new InternalBufferOverflowException("Attempted to read more array elements from packet " + base.Count + 1 + " than allowed " + _limit);
|
||||
|
||||
base.Add(value);
|
||||
}
|
||||
|
||||
public new T this[int index]
|
||||
{
|
||||
get
|
||||
@@ -61,8 +56,8 @@ namespace System.Collections.Generic
|
||||
if (index >= Count)
|
||||
{
|
||||
if (Count >= _limit)
|
||||
throw new InternalBufferOverflowException("Attempted to read more array elements from packet " + base.Count + 1 + " than allowed " + _limit);
|
||||
base.Insert(index, value);
|
||||
throw new InternalBufferOverflowException("Attempted to read more array elements from packet " + Count + 1 + " than allowed " + _limit);
|
||||
Insert(index, value);
|
||||
}
|
||||
else
|
||||
base[index] = value;
|
||||
@@ -75,7 +70,5 @@ namespace System.Collections.Generic
|
||||
{
|
||||
return array.ToArray();
|
||||
}
|
||||
|
||||
int _limit;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,10 +13,32 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
*/
|
||||
using System;
|
||||
|
||||
namespace Framework.Constants
|
||||
{
|
||||
public enum DB2ColumnCompression : uint
|
||||
{
|
||||
None,
|
||||
Immediate,
|
||||
Common,
|
||||
Pallet,
|
||||
PalletArray,
|
||||
SignedImmediate
|
||||
}
|
||||
|
||||
[Flags]
|
||||
public enum HeaderFlags : short
|
||||
{
|
||||
None = 0x0,
|
||||
OffsetMap = 0x1,
|
||||
SecondIndex = 0x2,
|
||||
IndexMap = 0x4,
|
||||
Unknown = 0x8,
|
||||
Compressed = 0x10,
|
||||
}
|
||||
|
||||
public enum AbilityLearnType : byte
|
||||
{
|
||||
OnSkillValue = 1, // Spell state will update depending on skill value
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Framework.Constants
|
||||
|
||||
public const int MaxItemSubclassTotal = 21;
|
||||
|
||||
public const int MaxItemSetItems = 10;
|
||||
public const int MaxItemSetItems = 17;
|
||||
public const int MaxItemSetSpells = 8;
|
||||
|
||||
public static uint[] ItemQualityColors =
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
|
||||
<PackageReference Include="MySqlConnector" Version="0.46.2" />
|
||||
<PackageReference Include="MySqlConnector" Version="0.48.2" />
|
||||
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -305,44 +305,6 @@ namespace Framework.IO
|
||||
WriteBytes(buffer.GetData());
|
||||
}
|
||||
|
||||
public void Replace<T>(int pos, T value)
|
||||
{
|
||||
int retpos = (int)writeStream.BaseStream.Position;
|
||||
|
||||
writeStream.Seek(pos, SeekOrigin.Begin);
|
||||
switch (typeof(T).Name)
|
||||
{
|
||||
case "Byte":
|
||||
WriteUInt8(Convert.ToByte(value));
|
||||
break;
|
||||
case "SByte":
|
||||
WriteInt8(Convert.ToSByte(value));
|
||||
break;
|
||||
case "Float":
|
||||
WriteFloat(Convert.ToSingle(value));
|
||||
break;
|
||||
case "Int16":
|
||||
WriteInt16(Convert.ToInt16(value));
|
||||
break;
|
||||
case "UInt16":
|
||||
WriteUInt16(Convert.ToUInt16(value));
|
||||
break;
|
||||
case "Int32":
|
||||
WriteInt32(Convert.ToInt32(value));
|
||||
break;
|
||||
case "UInt32":
|
||||
WriteUInt32(Convert.ToUInt32(value));
|
||||
break;
|
||||
case "Int64":
|
||||
WriteInt64(Convert.ToInt64(value));
|
||||
break;
|
||||
case "UInt64":
|
||||
WriteUInt64(Convert.ToUInt64(value));
|
||||
break;
|
||||
}
|
||||
writeStream.Seek(retpos, SeekOrigin.Begin);
|
||||
}
|
||||
|
||||
public void WriteVector3(Vector3 pos)
|
||||
{
|
||||
WriteFloat(pos.X);
|
||||
@@ -401,25 +363,6 @@ namespace Framework.IO
|
||||
}
|
||||
#endregion
|
||||
|
||||
public int GetPosition()
|
||||
{
|
||||
long pos = 0;
|
||||
if (writeStream != null)
|
||||
pos = writeStream.BaseStream.Position;
|
||||
else if (readStream != null)
|
||||
pos = readStream.BaseStream.Position;
|
||||
|
||||
return (int)pos;
|
||||
}
|
||||
|
||||
public void SetPosition(long pos)
|
||||
{
|
||||
if (writeStream != null)
|
||||
writeStream.BaseStream.Position = pos;
|
||||
else if (readStream != null)
|
||||
readStream.BaseStream.Position = pos;
|
||||
}
|
||||
|
||||
public void FlushBits()
|
||||
{
|
||||
if (BitPosition == 8)
|
||||
|
||||
Reference in New Issue
Block a user