本文整理汇总了C#中Client.SendCompressed方法的典型用法代码示例。如果您正苦于以下问题:C# Client.SendCompressed方法的具体用法?C# Client.SendCompressed怎么用?C# Client.SendCompressed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Client
的用法示例。
在下文中一共展示了Client.SendCompressed方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Send
public static void Send(Client cli, NonPlayerCharacterClass knubotTarget, string message)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushByte(0xdf);
packetWriter.PushByte(0xdf);
packetWriter.PushShort(0xa);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(cli.Character.Id);
packetWriter.PushInt(0x5d70532a);
packetWriter.PushIdentity(cli.Character.Type, cli.Character.Id);
packetWriter.PushByte(0);
packetWriter.PushShort(2);
packetWriter.PushIdentity(knubotTarget.Type, knubotTarget.Id);
packetWriter.PushInt(0);
packetWriter.PushInt(message.Length);
packetWriter.PushString(message);
packetWriter.PushInt(0);
byte[] packet = packetWriter.Finish();
cli.SendCompressed(packet);
}
示例2: Send
public static void Send(Client cli, NonPlayerCharacterClass knubotTarget, AOItem[] items)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushByte(0xdf);
packetWriter.PushByte(0xdf);
packetWriter.PushShort(0xa);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(cli.Character.Id);
packetWriter.PushInt(0x7864401d);
packetWriter.PushIdentity(cli.Character.Type, cli.Character.Id);
packetWriter.PushByte(0);
packetWriter.PushShort(2);
packetWriter.PushIdentity(knubotTarget.Type, knubotTarget.Id);
packetWriter.PushInt(items.Length);
foreach (AOItem item in items)
{
packetWriter.PushInt(item.LowID);
packetWriter.PushInt(item.HighID);
packetWriter.PushInt(item.Quality);
packetWriter.PushInt(0x499602d2); // 1234567890 ???????
}
packetWriter.PushInt(0);
byte[] packet = packetWriter.Finish();
cli.SendCompressed(packet);
}
示例3: Send
public static void Send(Client client, string text, int color)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushByte(0xdf);
packetWriter.PushByte(0xdf);
packetWriter.PushShort(0xa);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushInt(0x206b4b73);
packetWriter.PushInt(50000);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushByte(1);
packetWriter.PushInt(0);
packetWriter.PushInt(0x557e26);
packetWriter.PushInt(0x21212122);
packetWriter.PushInt(0x3a212121);
packetWriter.PushShort(0x293c);
packetWriter.PushByte(0x73);
packetWriter.PushByte((byte)text.Length);
packetWriter.PushString(text);
packetWriter.PushInt(0);
byte[] packet = packetWriter.Finish();
client.SendCompressed(packet);
}
示例4: GetDynels
/// <summary>
///
/// </summary>
/// <param name="client"></param>
public static void GetDynels(Client client)
{
foreach (Client clients in client.Server.Clients)
{
PacketWriter packetWriter;
if ((clients.Character.PlayField == client.Character.PlayField)
&& (clients.Character.Id != client.Character.Id))
{
SimpleCharFullUpdate.SendToOne(clients.Character, client);
// Send CharacterInPlay packet
// TODO: Move this out to own file
packetWriter = new PacketWriter();
packetWriter.PushByte(0xDF);
packetWriter.PushByte(0xDF);
packetWriter.PushShort(10);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushInt(0x570C2039);
packetWriter.PushIdentity(50000, clients.Character.Id);
packetWriter.PushByte(0);
byte[] reply2 = packetWriter.Finish();
client.SendCompressed(reply2);
}
}
}
示例5: Send
public static void Send(Client cli, NonPlayerCharacterClass knubotTarget, string[] choices)
{
PacketWriter pw = new PacketWriter();
pw.PushByte(0xdf);
pw.PushByte(0xdf);
pw.PushShort(0xa);
pw.PushShort(1);
pw.PushShort(0);
pw.PushInt(3086);
pw.PushInt(cli.Character.Id);
pw.PushInt(0x55704d31);
pw.PushIdentity(cli.Character.Type, cli.Character.Id);
pw.PushByte(0);
pw.PushShort(2);
pw.PushIdentity(knubotTarget.Type, knubotTarget.Id);
pw.PushInt(choices.Length);
foreach (string choice in choices)
{
pw.PushInt(choice.Length);
pw.PushString(choice);
}
byte[] packet = pw.Finish();
cli.SendCompressed(packet);
}
示例6: Set
/// <summary>
/// Set own stat (no announce)
/// </summary>
/// <param name="client">Affected client</param>
/// <param name="stat">Stat</param>
/// <param name="value">Value</param>
/// <param name="announce">Let others on same playfield know?</param>
public static uint Set(Client client, int stat, uint value, bool announce)
{
PacketWriter packetWriter = new PacketWriter();
uint oldValue = (uint)client.Character.Stats.StatValueByName(stat);
client.Character.Stats.SetStatValueByName(stat, value);
packetWriter.PushBytes(new byte[] { 0xDF, 0xDF, });
packetWriter.PushShort(10);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushInt(0x2B333D6E);
packetWriter.PushIdentity(50000, client.Character.Id);
packetWriter.PushByte(1);
packetWriter.PushInt(1);
packetWriter.PushInt(stat);
packetWriter.PushUInt(value);
byte[] packet = packetWriter.Finish();
client.SendCompressed(packet);
/* announce to playfield? */
if (announce)
{
Announce.Playfield(client.Character.PlayField, packet);
}
return oldValue;
}
示例7: Send
public static bool Send(Client client, int MsgCategory, int MsgNum)
{
var message = new FeedbackMessage
{
Identity = client.Character.Identity,
Unknown = 0x01,
Unknown1 = 0x00000000,
CategoryId = MsgCategory,
MessageId = MsgNum
};
client.SendCompressed(message);
return true;
}
示例8: Send
public static void Send(Client client, VendingMachine vendingMachine)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushByte(0xdf);
packetWriter.PushByte(0xdf);
packetWriter.PushShort(0xa);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushInt(0x7f544905); // 20
packetWriter.PushIdentity(vendingMachine.Type, vendingMachine.Id);
packetWriter.PushByte(0);
packetWriter.PushInt(0xb); // Counter??
packetWriter.PushInt(0);
packetWriter.PushInt(0); // 41
packetWriter.PushCoord(vendingMachine.Coordinates);
packetWriter.PushQuat(vendingMachine.Heading); // 69
packetWriter.PushInt(vendingMachine.PlayField);
packetWriter.PushInt(1000015);
packetWriter.PushInt(0);
packetWriter.PushShort(0x6f);
packetWriter.PushInt(0x2379);
packetWriter.PushInt(0); // 91
packetWriter.PushByte(0x80);
packetWriter.PushByte(2);
packetWriter.PushShort(0x3603);
packetWriter.PushInt(0x17);
packetWriter.PushInt(vendingMachine.TemplateId);
packetWriter.PushInt(0x2bd);
packetWriter.PushInt(0); // 111
packetWriter.PushInt(0x2be);
packetWriter.PushInt(0);
packetWriter.PushInt(0x2bf);
packetWriter.PushInt(0);
packetWriter.PushInt(0x19c); // 131
packetWriter.PushInt(1);
packetWriter.PushInt(0x1f5);
packetWriter.PushInt(2);
packetWriter.PushInt(0x1f4);
packetWriter.PushInt(0);
packetWriter.PushInt(0);
packetWriter.PushInt(2);
packetWriter.PushInt(0x32); // 147
packetWriter.Push3F1Count(0);
packetWriter.PushInt(3); // 155<
byte[] packet = packetWriter.Finish();
client.SendCompressed(packet);
}
示例9: Send
public static void Send(Client client, int category, int instance, object[] args)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushByte(0xDF);
packetWriter.PushByte(0xDF);
packetWriter.PushShort(10);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(0);
packetWriter.PushInt(0x206B4B73);
packetWriter.PushIdentity(50000, client.Character.Id);
packetWriter.PushByte(1);
packetWriter.PushInt(0);
string message = "&~" + Encode85By4(category) + "&:" + Encode85By4(instance);
foreach (object arg in args)
{
if (arg is Int32)
{
message = message + "i" + Encode85By5((Int32)arg);
}
string stringArg = arg as string;
if (stringArg != null)
{
if (stringArg.Length > 255)
{
message = message + "S";
Int16 len = (Int16)stringArg.Length;
message = message + ShortToChar(len) + stringArg;
}
else
{
message = message + "s" + ByteToChar((byte)(stringArg.Length));
}
}
}
Int16 mlen = (Int16)(message.Length);
packetWriter.PushShort(mlen);
packetWriter.PushString(message);
packetWriter.PushInt(1);
byte[] packet = packetWriter.Finish();
client.SendCompressed(packet);
}
示例10: Send
public static void Send(Client client)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushByte(0xdf);
packetWriter.PushByte(0xdf);
packetWriter.PushShort(0xa);
packetWriter.PushShort(1);
packetWriter.PushShort(0); // Length
packetWriter.PushInt(3086);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushInt(0x343c287f);
packetWriter.PushIdentity(50000, client.Character.Id);
packetWriter.PushByte(1);
packetWriter.PushInt(0);
packetWriter.PushInt(0);
packetWriter.PushInt(0);
packetWriter.Push3F1Count(client.Character.Bank.Count);
foreach (AOItem item in client.Character.Bank)
{
packetWriter.PushInt(item.Flags); // misused the flags for position in the bank
short flags = 0;
if (item.isInstanced())
{
flags |= 0xa0;
}
if (item.LowID == item.HighID)
{
flags |= 2;
}
else
{
flags |= 1;
}
// perhaps there are more flags...
packetWriter.PushShort(flags);
packetWriter.PushShort((short)item.MultipleCount);
packetWriter.PushInt(item.Type);
packetWriter.PushInt(item.Instance);
packetWriter.PushInt(item.LowID);
packetWriter.PushInt(item.HighID);
packetWriter.PushInt(item.Quality);
packetWriter.PushInt(0); // didnt encounter any other value
}
byte[] reply = packetWriter.Finish();
client.SendCompressed(reply);
}
示例11: Send
/// <summary>
///
/// </summary>
/// <param name="client"></param>
public static void Send(Client client)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushBytes(new byte[] { 0xDF, 0xDF });
packetWriter.PushShort(10);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushInt(0x5F4B1A39);
packetWriter.PushIdentity(40016, client.Character.PlayField);
packetWriter.PushByte(0);
packetWriter.PushInt(4);
packetWriter.PushCoord(client.Character.Coordinates);
packetWriter.PushByte(97);
packetWriter.PushIdentity(51100, client.Character.PlayField);
packetWriter.PushInt(0);
packetWriter.PushInt(0);
packetWriter.PushIdentity(40016, client.Character.PlayField);
packetWriter.PushInt(0);
packetWriter.PushInt(0);
int vendorcount = VendorHandler.GetNumberofVendorsinPlayfield(client.Character.PlayField);
if (vendorcount > 0)
{
packetWriter.PushInt(51035);
packetWriter.PushInt(1);
packetWriter.PushInt(1);
packetWriter.PushInt(vendorcount);
packetWriter.PushInt(VendorHandler.GetFirstVendor(client.Character.PlayField));
}
// TODO: Use correct World Position for each "outdoors" playfield -Suiv-
// Playfield WorldPos X
packetWriter.PushInt(Playfields.GetPlayfieldX(client.Character.PlayField));
// Playfield WorldPos Z
packetWriter.PushInt(Playfields.GetPlayfieldZ(client.Character.PlayField));
byte[] packet = packetWriter.Finish();
client.SendCompressed(packet);
}
示例12: Send
public static void Send(Client client, Dynel dynel1, Dynel dynel2)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushByte(0xdf);
packetWriter.PushByte(0xdf);
packetWriter.PushShort(0xa);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushInt(0x36284f6e);
packetWriter.PushIdentity(dynel1.Type, dynel1.Id);
packetWriter.PushByte(0);
packetWriter.PushInt(1); // Knubot sends 2 here
packetWriter.PushByte(0); // and 2 here too
packetWriter.PushIdentity(dynel2.Type, dynel2.Id); // knubot 0
packetWriter.PushIdentity(0xc767, 0x39da2458); // temp bag ID?? Knubot 0, needs more testing....
byte[] packet = packetWriter.Finish();
client.SendCompressed(packet);
}
示例13: Send
/// <summary>
/// Sends chat server info to client
/// </summary>
/// <param name="client">Client that gets the info</param>
public static void Send(Client client)
{
/* get chat settings from config */
string chatServerIp = string.Empty;
IPAddress tempIp;
if (IPAddress.TryParse(ConfigReadWrite.Instance.CurrentConfig.ChatIP, out tempIp))
{
chatServerIp = ConfigReadWrite.Instance.CurrentConfig.ChatIP;
}
else
{
IPHostEntry chatHost = Dns.GetHostEntry(ConfigReadWrite.Instance.CurrentConfig.ChatIP);
foreach (IPAddress ip in chatHost.AddressList)
{
if (ip.AddressFamily == AddressFamily.InterNetwork)
{
chatServerIp = ip.ToString();
break;
}
}
}
int chatPort = Convert.ToInt32(ConfigReadWrite.Instance.CurrentConfig.ChatPort);
PacketWriter writer = new PacketWriter();
writer.PushBytes(new byte[] { 0xDF, 0xDF });
writer.PushShort(1);
writer.PushShort(1);
writer.PushShort(0);
writer.PushInt(3086);
writer.PushInt(client.Character.Id);
writer.PushInt(67);
writer.PushInt(1);
writer.PushInt(chatServerIp.Length);
writer.PushBytes(Encoding.ASCII.GetBytes(chatServerIp));
writer.PushInt(chatPort);
writer.PushInt(0);
byte[] packet = writer.Finish();
client.SendCompressed(packet);
}
示例14: Send
public static void Send(Client client, InventoryEntries inventoryEntry)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushByte(0xdf);
packetWriter.PushByte(0xdf);
packetWriter.PushShort(0xa);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushInt(0x052e2f0c);
packetWriter.PushIdentity(client.Character.Type, client.Character.Id);
packetWriter.PushByte(0);
packetWriter.PushInt(inventoryEntry.Item.LowID);
packetWriter.PushInt(inventoryEntry.Item.HighID);
packetWriter.PushInt(inventoryEntry.Item.Quality);
packetWriter.PushInt(inventoryEntry.Item.MultipleCount);
byte[] packet = packetWriter.Finish();
client.SendCompressed(packet);
}
示例15: Send
public static void Send(Client client, NonPlayerCharacterClass knubotTarget)
{
PacketWriter packetWriter = new PacketWriter();
packetWriter.PushByte(0xdf);
packetWriter.PushByte(0xdf);
packetWriter.PushShort(0xa);
packetWriter.PushShort(1);
packetWriter.PushShort(0);
packetWriter.PushInt(3086);
packetWriter.PushInt(client.Character.Id);
packetWriter.PushInt(0x3b132d64);
packetWriter.PushIdentity(client.Character.Type, client.Character.Id);
packetWriter.PushByte(0);
packetWriter.PushShort(2);
packetWriter.PushIdentity(knubotTarget.Type, knubotTarget.Id);
packetWriter.PushInt(1);
packetWriter.PushInt(0);
byte[] packet = packetWriter.Finish();
client.SendCompressed(packet);
}