Well I'm still not sure what to do.
My source isn't exactly like CoEmu I guess...
It uses a really weird why of doing it.
The only place that I see 0x3f9 is here:
Code:
public unsafe class BigUpdatePacket
{
private byte[] Buffer;
private struct internalUpdate
{
public ushort Size;
public ushort Type;
public uint UID;
public uint UpdateCount;
}
const int SizeOf_Data = 12;
[StructLayout(LayoutKind.Explicit, Size = SizeOf_Data)]
public struct Data
{
[FieldOffset(0)]
public UpdateID ID;
[FieldOffset(4)]
public uint Value;
[FieldOffset(8)]
public uint Footer;
[FieldOffset(4)]
public ulong qwValue;
public static Data Create(UpdateID _ID, ulong _Value)
{
Data retn = new Data();
retn.ID = _ID;
retn.qwValue = _Value;
return retn;
}
public static Data Create(UpdateID _ID, uint _Value)
{
Data retn = new Data();
retn.ID = _ID;
retn.Value = _Value;
return retn;
}
public static Data Create(UpdateID _ID, int _Value)
{
Data retn = new Data();
retn.ID = _ID;
retn.Value = (uint)_Value;
return retn;
}
public static Data Create(UpdateID _ID, ushort _Value)
{
Data retn = new Data();
retn.ID = _ID;
retn.Value = _Value;
return retn;
}
public static Data Create(UpdateID _ID, byte _Value)
{
Data retn = new Data();
retn.ID = _ID;
retn.Value = _Value;
return retn;
}
}
public BigUpdatePacket(uint TotalUpdates)
{
Buffer = new byte[12 + (TotalUpdates * SizeOf_Data) + 8];
fixed (byte* _iUpdate = Buffer)
{
internalUpdate* iUpdate = (internalUpdate*)_iUpdate;
iUpdate->Size = (ushort)(Buffer.Length - 8);
iUpdate->Type = 0x3f9;
iUpdate->UpdateCount = TotalUpdates;
}
COPacket o = new COPacket(Buffer);
o.WriteTQServer();
Buffer = o.Packet;
}
public uint UID
{
get
{
fixed (byte* iUpdate = Buffer)
return ((internalUpdate*)iUpdate)->UID;
}
set
{
fixed (byte* iUpdate = Buffer)
((internalUpdate*)iUpdate)->UID = value;
}
}
public static implicit operator byte[](BigUpdatePacket big)
{
return big.Buffer;
}
public void Append(int UpdateNumber, UpdateID ID, ulong Value)
{
fixed (byte* iUpdate = Buffer)
{
*((BigUpdatePacket.Data*)(iUpdate + 12 + (UpdateNumber * SizeOf_Data))) =
BigUpdatePacket.Data.Create(ID, Value);
}
}
public void Append(int UpdateNumber, UpdateID ID, uint Value)
{
fixed (byte* iUpdate = Buffer)
{
*((BigUpdatePacket.Data*)(iUpdate + 12 + (UpdateNumber * SizeOf_Data))) =
BigUpdatePacket.Data.Create(ID, Value);
}
}
public void Append(int UpdateNumber, UpdateID ID, ushort Value)
{
fixed (byte* iUpdate = Buffer)
{
*((BigUpdatePacket.Data*)(iUpdate + 12 + (UpdateNumber * SizeOf_Data))) =
BigUpdatePacket.Data.Create(ID, Value);
}
}
public void Append(int UpdateNumber, UpdateID ID, int Value)
{
fixed (byte* iUpdate = Buffer)
{
*((BigUpdatePacket.Data*)(iUpdate + 12 + (UpdateNumber * SizeOf_Data))) =
BigUpdatePacket.Data.Create(ID, Value);
}
}
public void Append(int UpdateNumber, UpdateID ID, byte Value)
{
fixed (byte* iUpdate = Buffer)
{
*((BigUpdatePacket.Data*)(iUpdate + 12 + (UpdateNumber * SizeOf_Data))) =
BigUpdatePacket.Data.Create(ID, Value);
}
}
}
and the Status packet sends information to it seen at the bottom of this code:
Code:
public static byte[] Status(ClientSocket CSocket, int Switch, int Value, Struct.StatusTypes Type)
{
Handler.BigUpdatePacket p = new Handler.BigUpdatePacket(1);
p.UID = (uint)CSocket.Client.ID;
if (Type == Struct.StatusTypes.StatusEffect)
{
ulong Status = 0;
if (CSocket.Client.PkPoints >= 100)
Status += 0x8000;
else if (CSocket.Client.PkPoints >= 30 && CSocket.Client.PkPoints < 100)
Status += 0x4000;
if (CSocket.Client.Flashing)
Status += 0x1;
if (CSocket.Client.Stigged)
Status += 0x200;
if (CSocket.Client.Dead)
Status += 0x400;
if (CSocket.Client.Dead)
Status += 0x20;
if (CSocket.Client.Accuracy || CSocket.Client.Dodged)
Status += 0x80;
if (CSocket.Client.TeamLeader)
Status += 0x40;
if (CSocket.Client.Stigged)
Status += 0x0;
if (CSocket.Client.Invisible)
Status += 0x400000;
if (CSocket.Client.Shield)
Status += 0x100;
if (CSocket.Client.Poisoned)
Status += 0x2;
if (CSocket.Client.SuperMan)
Status += 0x40000;
if (CSocket.Client.Cyclone)
Status += 0x800000;
if (CSocket.Client.XPSkillList)
Status += 0x10;
if (CSocket.Client.Flying)
Status += 0x8000000;
if (CSocket.Client.CastingPray)
Status += 0x40000000;
if (CSocket.Client.Praying)
Status += 0x80000000;
if (CSocket.Client.Reflect)
Status += 0x20000;
int id = CSocket.Client.ID;
if (CSocket.Client.TopHalo == 1)
{
Struct.TopHalos.Trojan = id;
Status += 0x8000000000;
}
else if (CSocket.Client.TopHalo == 2)
{
Struct.TopHalos.Warrior = id;
Status += 0x4000000000;
}
else if (CSocket.Client.TopHalo == 3)
{
Struct.TopHalos.Archer = id;
Status += 0x10000000000;
}
else if (CSocket.Client.TopHalo == 4)
{
Struct.TopHalos.Ninja = id;
Status += 0x80000000000;
}
else if (CSocket.Client.TopHalo == 5)
{
Struct.TopHalos.Water = id;
Status += 0x20000000000;
}
else if (CSocket.Client.TopHalo == 6)
{
Struct.TopHalos.Fire = id;
Status += 0x40000000000;
}
else if (CSocket.Client.TopHalo == 7)
{
Struct.TopHalos.PkWeek = id;
Status += 0x2000000000;
}
else if (CSocket.Client.TopHalo == 8)
{
Struct.TopHalos.PkMonth = id;
Status += 0x1000000000;
}
else if (CSocket.Client.TopHalo == 9)
{
Struct.TopHalos.GuildLeader = id;
Status += 0x400000000;
}
else if (CSocket.Client.TopHalo == 10)
{
Status += 0x800000000;
}
if (CSocket.Client.Vortex)
Status += 0x400000000000;
if (CSocket.Client.FatalStrike)
Status += 0x800000000000;
p.Append(0, (Handlers.Handler.UpdateID)Type, Status);
}
else
p.Append(0, (Handlers.Handler.UpdateID)Type, Value);
return p;
}
and when you login, it uses the following codes:
Code:
CSocket.AccountName = World.AuthenticatedLogins[Keys].Account;
Program.WriteLine("[WorldServer] Authenticated Login.");
ConnectionRequest User = World.AuthenticatedLogins[Keys];
User.Expire(false);
CSocket.Client = Database.GetCharacter(User.Account);
if (CSocket.Client == null)
{
CSocket.Send(CoPacket.Chat(0, "SYSTEM", "ALLUSERS", "NEW_ROLE", Struct.ChatType.LoginInformation));
return;
}
Calculation.Vitals(CSocket, true);
if (CSocket.Client.First)
{
CSocket.Client.CurrentMP = CSocket.Client.MaxMP;
CSocket.Client.CurrentHP = CSocket.Client.MaxHP;
}
if (World.ClientPool.ContainsKey(CSocket.Client.ID))
{
ClientSocket C = World.ClientPool[CSocket.Client.ID];
C.Send(CoPacket.Chat(0, "SYSTEM", C.Client.Name, " Your character has logged in from another location, you're being booted.", Struct.ChatType.Talk));
C.Disconnect();
}
try
{
Monitor.Enter(World.ClientPool);
World.ClientPool.Add(CSocket.Client.ID, CSocket);
}
catch (Exception Exc)
{
Program.WriteLine(Exc);
}
finally
{
Monitor.Exit(World.ClientPool);
}
CSocket.Send(CoPacket.Chat(0, "SYSTEM", "ALLUSERS", "ANSWER_OK", Struct.ChatType.LoginInformation));
if (CSocket.Client.GuildID != 0)
{
Handlers.Guilds.SendCharGuild(CSocket);
//Handlers.Guilds.SendGuildScreen(CSocket);
}
if (CSocket.Client.CurrentHP < 1)
{
Struct.ReviveLocations r = World.ReviveLocations[(int)CSocket.Client.Loc.Map];
Handler.Teleport((int)CSocket.Client.Loc.Map, CSocket.Client.Loc.X, CSocket.Client.Loc.Y, 0, CSocket);
CSocket.Client.Dead = false;
CSocket.Client.CurrentHP = 1;
CSocket.Send(CoPacket.Status(CSocket, 2, CSocket.Client.CurrentHP, Struct.StatusTypes.Hp));
}
Database.CheckForSashes(CSocket);
CSocket.Send(CoPacket.Status(CSocket, 512, CSocket.Client.HeavenBlessing, Struct.StatusTypes.BlessTime));
CSocket.Send(CoPacket.CharacterInfo(CSocket));
CSocket.Send(CoPacket.Status(CSocket, 2, CSocket.Client.NobleDonate, Struct.StatusTypes.NobilityDonation));
CSocket.Send(CoPacket.Nobility(CSocket.Client.ID));
CSocket.Send(CoPacket.Status(CSocket, 2, CSocket.Client.VipLevel, Struct.StatusTypes.VIPLevel));
I know what you guys are talking about, I just can't recognize any entity status packet in the source =\ I'm so used to the 5165 source... and I just want to learn more about this source I'm working on. If someone wants to help me over team viewer or something, that'd be awesome.