Fixed DB2 loading and world login!!!!!

This commit is contained in:
hondacrx
2018-12-14 18:43:35 -05:00
parent 8e20114e10
commit f414068883
44 changed files with 779 additions and 852 deletions
+6 -13
View File
@@ -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;
}
}
+23 -1
View File
@@ -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
+1 -1
View File
@@ -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 =
+1 -1
View File
@@ -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>
-57
View File
@@ -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)