I know, I know. My last project didn't go too well because it was really rubbish, I guess me and Nullable both agree on that. So yeah, I decided to take this project into development again for those who actually followed the development of the previous project.
I'm writing a new source this time, using different methods and actually have gained more information about certain things. Some examples;
Mapping system:
--------------------------------------------------------------------------
Packet serialize/deserialize method:
I will be using a custom winsock wrapper for the sockets. If you have not heard about the previous project, the project will be running on patch 4267.
I'm writing a new source this time, using different methods and actually have gained more information about certain things. Some examples;
Mapping system:
Code:
private Dictionary<uint, IMap> mapCollection;
[B]IMap interface:[/B]
public interface IMap
{
DMap DMap { get; set; }
ushort pHandle { get; set; }
ushort pMesh { get; set; }
bool TryGetValue(uint ID, out IScreenObject obj);
void Attach(IScreenObject obj);
void Detach(IScreenObject obj);
bool Contains(IScreenObject obj);
void CallObjects(IScreenObject callingObj);
}
------------------------------------------------------------------------
Usage:
IMap Map = null;
if (Kernel.MapTable.TryGetValue(client.Hero.MapID, out Map))
{
//You can call objects by doing Map.CallObjects(client.Hero);
//Or use the DMap Map.DMap.Valid(<X>, <Y>);
}
Packet serialize/deserialize method:
Code:
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
struct MessagePacket
{
public PacketHeader Header;//0
public UInt32 Msg_Color;//4
public UInt32 Msg_Type;//8
public UInt32 Msg_ID;//12
public Byte String_Count;//16
public Byte String_From_Length;//17
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public String String_From;//18
public Byte String_To_Length;//19 + pos
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public String String_To;//20 + pos
public Byte Blank;//21 + pos
public Byte String_Message_Length;//22 + pos
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
public String String_Message;//23 + pos
}
--------------------------------------------------------------------------
Usage of the packetfiller:
Filler.FillPacket<MessagePacket>(Packet); - Filler.FillPacket<MessagePacket>(Packet, <OFFSET>);
Or;
Filler.FillPacket<UInt32>(<VALUE>); or Filler.FillPacket<UInt32>(<VALUE>, <OFFSET>);