本文整理汇总了C#中Aura.Shared.Network.Packet.PutString方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.PutString方法的具体用法?C# Packet.PutString怎么用?C# Packet.PutString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.Shared.Network.Packet
的用法示例。
在下文中一共展示了Packet.PutString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EnterDynamicRegion
/// <summary>
/// Sends EnterDynamicRegion to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="warpFromRegionId"></param>
/// <param name="warpToRegion"></param>
public static void EnterDynamicRegion(Creature creature, int warpFromRegionId, Region warpToRegion, int x, int y)
{
var warpTo = warpToRegion as DynamicRegion;
if (warpTo == null)
throw new ArgumentException("EnterDynamicRegion requires a dynamic region.");
var pos = creature.GetPosition();
var packet = new Packet(Op.EnterDynamicRegion, MabiId.Broadcast);
packet.PutLong(creature.EntityId);
packet.PutInt(warpFromRegionId); // creature's current region or 0?
packet.PutInt(warpToRegion.Id);
packet.PutString(warpToRegion.Name); // dynamic region name
packet.PutUInt(0x80000000); // bitmask? (|1 = time difference?)
packet.PutInt(warpTo.BaseId);
packet.PutString(warpTo.BaseName);
packet.PutInt(200); // 100|200 (100 changes the lighting?)
packet.PutByte(0); // 1 = next is empty?
packet.PutString("data/world/{0}/{1}", warpTo.BaseName, warpTo.Variation);
packet.PutByte(0);
//if (^ true)
//{
// pp.PutByte(1);
// pp.PutInt(3100); // some region id?
//}
packet.PutInt(x); // target x pos
packet.PutInt(y); // target y pos
creature.Client.Send(packet);
}
示例2: Weather
/// <summary>
/// Sends Weather.
/// </summary>
private static void Weather(Action<Packet> sender, IWeatherProvider provider)
{
var packet = new Packet(Op.Weather, MabiId.Broadcast);
packet.PutByte(0);
packet.PutInt(provider.RegionId);
if (provider is IWeatherProviderTable)
{
var table = (IWeatherProviderTable)provider;
packet.PutByte(0);
packet.PutInt(table.GroupId);
packet.PutByte(2);
packet.PutByte(1);
packet.PutString("table");
packet.PutString(table.Name);
packet.PutLong(0);
packet.PutByte(0);
}
else if (provider is IWeatherProviderConstant)
{
var constant = (IWeatherProviderConstant)provider;
// Packet structure is guessed, even though it works,
// based on constant_smooth.
packet.PutByte(2);
packet.PutByte(0);
packet.PutByte(1);
packet.PutString("constant");
packet.PutFloat(constant.Weather);
packet.PutLong(0);
packet.PutByte(0);
}
else if (provider is IWeatherProviderConstantSmooth)
{
var constantSmooth = (IWeatherProviderConstantSmooth)provider;
packet.PutByte(2);
packet.PutByte(0);
packet.PutByte(1);
packet.PutString("constant_smooth");
packet.PutFloat(constantSmooth.Weather);
packet.PutLong(DateTime.Now); // Start
packet.PutLong(DateTime.MinValue); // End
packet.PutFloat(constantSmooth.WeatherBefore);
packet.PutFloat(constantSmooth.WeatherBefore);
packet.PutLong(constantSmooth.TransitionTime);
packet.PutByte(false); // bool? Is table appended? byte? Appended type?
packet.PutLong(DateTime.MinValue); // End
packet.PutInt(2);
// Append a table packet here to go back to that after end
packet.PutByte(0);
}
sender(packet);
}
示例3: GuildInfoNoGuild
/// <summary>
/// Sends GuildInfoNoGuild to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="guild"></param>
public static void GuildInfoNoGuild(Creature creature, Guild guild)
{
var packet = new Packet(Op.GuildInfoNoGuild, creature.EntityId);
packet.PutLong(guild.Id);
packet.PutString(guild.Name);
packet.PutString(guild.LeaderName);
packet.PutInt(guild.MemberCount);
packet.PutString(guild.IntroMessage);
creature.Client.Send(packet);
}
示例4: AddPropExtension
/// <summary>
/// Broadcasts new prop extension.
/// </summary>
/// <param name="prop"></param>
/// <param name="ext"></param>
public static void AddPropExtension(Prop prop, PropExtension ext)
{
var packet = new Packet(Op.AddPropExtension, prop.EntityId);
packet.PutInt((int)ext.SignalType);
packet.PutInt((int)ext.EventType);
packet.PutString(ext.Name);
packet.PutByte(ext.Mode);
packet.PutString(ext.Value.ToString());
prop.Region.Broadcast(packet);
}
示例5: BankAddItem
/// <summary>
/// Sends BankAddItem to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="item"></param>
/// <param name="bankId"></param>
/// <param name="tabName"></param>
public static void BankAddItem(Creature creature, Item item, string bankId, string tabName)
{
var packet = new Packet(Op.BankAddItem, creature.EntityId);
packet.PutString(tabName);
packet.PutString(bankId);
packet.PutLong(0);
packet.PutLong(0);
packet.AddItemInfo(item, ItemPacketType.Private);
creature.Client.Send(packet);
}
示例6: GuildInfoApplied
/// <summary>
/// Sends GuildInfoApplied to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="guild"></param>
public static void GuildInfoApplied(Creature creature, Guild guild)
{
// The fields of this packet were guessed, something might be missing.
var packet = new Packet(Op.GuildInfoApplied, creature.EntityId);
packet.PutLong(guild.Id);
packet.PutString(guild.Server);
packet.PutLong(creature.EntityId);
packet.PutString(guild.Name);
creature.Client.Send(packet);
}
示例7: System_Broadcast
public static void System_Broadcast(string from, string format, params object[] args)
{
var packet = new Packet(Op.Chat, MabiId.Broadcast);
packet.PutByte(0);
packet.PutString("<{0}>", from);
packet.PutString(format, args);
packet.PutByte(true);
packet.PutUInt(0xFFFF8080);
packet.PutInt(0);
packet.PutByte(0);
ChannelServer.Instance.World.Broadcast(packet);
}
示例8: SystemMessage
/// <summary>
/// Sends system message (special Chat) to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="from"></param>
/// <param name="format"></param>
/// <param name="args"></param>
private static void SystemMessage(Creature creature, string from, string format, params object[] args)
{
var packet = new Packet(Op.Chat, creature.EntityId);
packet.PutByte(0);
packet.PutString(from);
packet.PutString(format, args);
packet.PutByte(true);
packet.PutUInt(0xFFFF8080);
packet.PutInt(0);
packet.PutByte(0);
creature.Client.Send(packet);
}
示例9: GmcpNpcListR
/// <summary>
/// Sends GmcpNpcListR to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="success"></param>
public static void GmcpNpcListR(Creature creature, ICollection<Creature> npcs)
{
var packet = new Packet(Op.GmcpNpcListR, creature.EntityId);
packet.PutInt(npcs.Count);
foreach (var npc in npcs)
{
packet.PutInt(npc.Race); // RaceId
packet.PutString(npc.Name); // Name
packet.PutString(npc.Name); // Local Name
packet.PutString(npc.RegionId.ToString()); // Location
}
creature.Client.Send(packet);
}
示例10: Internal_Broadcast
/// <summary>
/// Sends Internal.Broadcast to login server.
/// </summary>
public static void Internal_Broadcast(string message)
{
var packet = new Packet(Op.Internal.BroadcastNotice, 0);
packet.PutString(message);
ChannelServer.Instance.LoginServer.Send(packet);
}
示例11: GmcpNpcListR
/// <summary>
/// Sends GmcpNpcListR to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="npcs"></param>
public static void GmcpNpcListR(Creature creature, ICollection<Creature> npcs)
{
var packet = new Packet(Op.GmcpNpcListR, creature.EntityId);
packet.PutInt(npcs.Count);
foreach (var npc in npcs)
{
var pos = npc.GetPosition();
packet.PutInt(npc.RegionId);
packet.PutString(npc.Name); // Name
packet.PutString(npc.Name); // Local Name
packet.PutString("{0} @ {1}/{2}", npc.RegionId, pos.X, pos.Y); // Location
}
creature.Client.Send(packet);
}
示例12: Internal_ServerIdentify
/// <summary>
/// Sends Internal.ServerIdentify to login server.
/// </summary>
public static void Internal_ServerIdentify()
{
var packet = new Packet(Op.Internal.ServerIdentify, 0);
packet.PutString(Password.Hash(ChannelServer.Instance.Conf.Internal.Password));
ChannelServer.Instance.LoginServer.Send(packet);
}
示例13: Internal_ChannelStatus
/// <summary>
/// Sends Internal.ChannelStatus to login server.
/// </summary>
public static void Internal_ChannelStatus()
{
var cur = 0;// ChannelServer.Instance.World.GetCharactersCount();
var max = ChannelServer.Instance.Conf.Channel.MaxUsers;
var packet = new Packet(Op.Internal.ChannelStatus, 0);
packet.PutString(ChannelServer.Instance.Conf.Channel.ChannelServer);
packet.PutString(ChannelServer.Instance.Conf.Channel.ChannelName);
packet.PutString(ChannelServer.Instance.Conf.Channel.ChannelHost);
packet.PutInt(ChannelServer.Instance.Conf.Channel.ChannelPort);
packet.PutInt(cur);
packet.PutInt(max);
packet.PutInt((int)ChannelState.Normal);
ChannelServer.Instance.LoginServer.Send(packet);
}
示例14: AcquireItemInfo
/// <summary>
/// Sends AcquireInfo to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="itemId"></param>
/// <param name="amount"></param>
public static void AcquireItemInfo(Creature creature, int itemId, int amount)
{
var packet = new Packet(Op.AcquireInfo, creature.EntityId);
packet.PutString("<xml type='item' classid='{0}' value='{1}'/>", itemId, amount);
packet.PutInt(3000);
creature.Client.Send(packet);
}
示例15: Chat
/// <summary>
/// Sends Chat in range of creature.
/// </summary>
/// <param name="creature">Source, in terms of name and position</param>
/// <param name="format"></param>
/// <param name="args"></param>
public static void Chat(Creature creature, string format, params object[] args)
{
var packet = new Packet(Op.Chat, creature.EntityId);
packet.PutByte(0); // speech (0) vs thought (1) bubble
packet.PutString(creature.Name);
packet.PutString(format, args);
// The following part is not required for normal chat
packet.PutByte(0); // 1 hides chat bubble and enables --v
packet.PutUInt(0); // custom color (supports alpha transparency, FF is 100% opaque)
packet.PutInt(0);
packet.PutByte(0);
creature.Region.Broadcast(packet, creature);
}