كود بلغة HTML:
case 440://AddPersonToBlackList
{
var targetname = System.Text.UnicodeEncoding.UTF8.GetString(packet, 43, packet[42]).Replace("/0", "");
foreach (var person in Kernel.GamePool.Values)
{
if (person.Entity.Name == targetname)
{
if (!client.Entity.BlackList.Contains(targetname))
{
client.Entity.BlackList.Add(targetname);
gData.Unknown2 = 1;
gData.dwParam = 1;
gData.UID = client.Entity.UID;
gData.TimeStamp = Time32.Now;
gData.ID = 440;
gData.DailyQuestWordLenght = packet[42];
gData.DailyQuestWord = targetname;
gData.Send(client);
}
}
}
break;
}
case 441://RemovePersonFromBlackList
{
var targetname = System.Text.UnicodeEncoding.UTF8.GetString(packet, 43, packet[42]).Replace("/0", "");
if (client.Entity.BlackList.Contains(targetname))
{
client.Entity.BlackList.Remove(targetname);
gData.Unknown2 = 1;
gData.dwParam = 1;
gData.UID = client.Entity.UID;
gData.TimeStamp = Time32.Now;
gData.ID = 441;
gData.DailyQuestWordLenght = packet[42];
gData.DailyQuestWord = targetname;
gData.Send(client);
}
break;
}
بس كده طب افرض جالك ايرور في DailyQuestWordLenght
كود:
public byte DailyQuestWordLenght//For Poker
{
get { return Buffer[42]; }
set { Buffer[42] = value; }
}
public string DailyQuestWord//For Poker
{
get { return System.Text.UnicodeEncoding.UTF8.GetString(Buffer, 43, DailyQuestWordLenght); }
set { Writer.Write(value, 43, Buffer); }
}