本文整理汇总了C#中Aura.Shared.Network.Packet.PutInt方法的典型用法代码示例。如果您正苦于以下问题:C# Packet.PutInt方法的具体用法?C# Packet.PutInt怎么用?C# Packet.PutInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aura.Shared.Network.Packet
的用法示例。
在下文中一共展示了Packet.PutInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BlacksmithingMiniGame
/// <summary>
/// Sends BlacksmithingMiniGame to creature's client, which starts
/// the Blacksmithing mini-game.
/// </summary>
/// <remarks>
/// The position of the dots is relative to the upper left of the
/// field. They land exactly on those spots after "wavering" for a
/// moment. This wavering is randomized on the client side and
/// doesn't affect anything.
///
/// The time bar is always the same, but the time it takes to fill
/// up changes based on the "time displacement". The lower the value,
/// the longer it takes to fill up. Using values that are too high
/// or too low mess up the calculations and cause confusing results.
/// The official range seems to be between ~0.81 and ~0.98.
/// </remarks>
/// <param name="creature"></param>
/// <param name="prop"></param>
/// <param name="item"></param>
/// <param name="dots"></param>
/// <param name="deviation"></param>
public static void BlacksmithingMiniGame(Creature creature, Prop prop, Item item, List<BlacksmithDot> dots, int deviation)
{
if (dots == null || dots.Count != 5)
throw new ArgumentException("5 dots required.");
var packet = new Packet(Op.BlacksmithingMiniGame, creature.EntityId);
// Untested if this is actually the deviation/cursor size,
// but Tailoring does something very similar. Just like with
// Tailoring, wrong values cause failed games.
packet.PutShort((short)deviation);
foreach (var dot in dots)
{
packet.PutShort((short)dot.X);
packet.PutShort((short)dot.Y);
packet.PutFloat(dot.TimeDisplacement);
packet.PutShort((short)dot.Deviation);
}
packet.PutLong(prop.EntityId);
packet.PutInt(0);
packet.PutLong(item.EntityId);
packet.PutInt(0);
creature.Client.Send(packet);
}
示例2: 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);
}
示例3: 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);
}
示例4: ChannelLoginUnkR
/// <summary>
/// Sends ChannelLoginUnkR to creature's client.
/// </summary>
/// <param name="creature"></param>
public static void ChannelLoginUnkR(Creature creature)
{
var packet = new Packet(Op.ChannelLoginUnkR, creature.EntityId);
packet.PutByte(1); // success?
packet.PutInt(0);
packet.PutInt(0);
creature.Client.Send(packet);
}
示例5: Move
/// <summary>
/// Broadcasts Running|Walking in range of creature.
/// </summary>
public static void Move(Creature creature, Position from, Position to, bool walking)
{
var packet = new Packet(!walking ? Op.Running : Op.Walking, creature.EntityId);
packet.PutInt(from.X);
packet.PutInt(from.Y);
packet.PutInt(to.X);
packet.PutInt(to.Y);
creature.Region.Broadcast(packet, creature);
}
示例6: LoginR_Msg
/// <summary>
/// Sends message as response to login (LoginR).
/// </summary>
/// <param name="client"></param>
/// <param name="format"></param>
/// <param name="args"></param>
public static void LoginR_Msg(LoginClient client, string format, params object[] args)
{
var packet = new Packet(Op.LoginR, MabiId.Login);
packet.PutByte((byte)LoginResult.Message);
packet.PutInt((int)LoginResultMessage.Custom);
packet.PutInt(1);
packet.PutString(format, args);
client.Send(packet);
}
示例7: VehicleInfo
/// <summary>
/// Sends empty VehicleInfo in range of vehicle.
/// </summary>
/// <param name="vehicle"></param>
public static void VehicleInfo(Creature vehicle)
{
var packet = new Packet(Op.VehicleInfo, vehicle.EntityId);
packet.PutInt(0);
packet.PutInt(1);
packet.PutLong(vehicle.EntityId);
packet.PutInt(32);
packet.PutByte(0);
vehicle.Region.Broadcast(packet, vehicle);
}
示例8: DyePaletteReqR
/// <summary>
/// Sends DyePaletteReqR to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="var1"></param>
/// <param name="var2"></param>
/// <param name="var3"></param>
/// <param name="var4"></param>
public static void DyePaletteReqR(Creature creature, int var1, int var2, int var3, int var4)
{
var packet = new Packet(Op.DyePaletteReqR, creature.EntityId);
packet.PutByte(true);
packet.PutInt(var1); // PutInt(62);
packet.PutInt(var2); // PutInt(123);
packet.PutInt(var3); // PutInt(6);
packet.PutInt(var4); // PutInt(238);
creature.Client.Send(packet);
}
示例9: 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);
}
示例10: SpecialLogin
/// <summary>
/// Sends SpecialLogin to creature's client.
/// </summary>
/// <remarks>
/// One of those packets with a success parameter,
/// that don't actually support failing.
/// Sends character to a special, client-side-instanced region,
/// where he is to meet the given NPC. EnterRegion isn't needed
/// for this.
/// </remarks>
/// <param name="creature"></param>
/// <param name="regionId"></param>
/// <param name="x"></param>
/// <param name="y"></param>
/// <param name="npcEntityId"></param>
public static void SpecialLogin(Creature creature, int regionId, int x, int y, long npcEntityId)
{
var packet = new Packet(Op.SpecialLogin, MabiId.Channel);
packet.PutByte(true);
packet.PutInt(regionId);
packet.PutInt(x);
packet.PutInt(y);
packet.PutLong(npcEntityId);
packet.AddCreatureInfo(creature, CreaturePacketType.Private);
creature.Client.Send(packet);
}
示例11: EnterRegion
/// <summary>
/// Sends EnterRegion to creature's client.
/// </summary>
/// <param name="creature"></param>
public static void EnterRegion(Creature creature, int regionId, int x, int y)
{
var pos = creature.GetPosition();
var packet = new Packet(Op.EnterRegion, MabiId.Channel);
packet.PutLong(creature.EntityId);
packet.PutByte(true); // success?
packet.PutInt(regionId);
packet.PutInt(x);
packet.PutInt(y);
creature.Client.Send(packet);
}
示例12: 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);
}
示例13: PersonalShopSetUpR
/// <summary>
/// Sends positive PersonalShopSetUpR to creature's client.
/// </summary>
/// <param name="creature"></param>
/// <param name="shopProp"></param>
public static void PersonalShopSetUpR(Creature creature, Prop shopProp)
{
var location = shopProp.GetLocation();
var packet = new Packet(Op.PersonalShopSetUpR, creature.EntityId);
packet.PutByte(true);
packet.PutLong(shopProp.EntityId);
packet.PutByte(1); // no location if 0?
packet.PutInt(location.RegionId);
packet.PutInt(location.X);
packet.PutInt(location.Y);
creature.Client.Send(packet);
}
示例14: 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);
}
示例15: AcceptGiftR
/// <summary>
/// Sends AcceptGiftR to client.
/// </summary>
/// <param name="client"></param>
/// <param name="gift">Negative response if null</param>
public static void AcceptGiftR(LoginClient client, Gift gift)
{
var packet = new Packet(Op.AcceptGiftR, MabiId.Login);
packet.PutByte(gift != null);
if (gift != null)
{
packet.PutByte(gift.IsCharacter);
packet.PutInt(0); // ?
packet.PutInt(0); // ?
packet.PutInt(gift.Type);
// ?
}
client.Send(packet);
}