本文整理汇总了C#中SMP.Player.SendRaw方法的典型用法代码示例。如果您正苦于以下问题:C# Player.SendRaw方法的具体用法?C# Player.SendRaw怎么用?C# Player.SendRaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMP.Player
的用法示例。
在下文中一共展示了Player.SendRaw方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: rain
public void rain(bool on, Player p)
{
if (on)
{
byte[] bytes = new byte[1];
byte thisin = 1;
bytes[0] = thisin;
p.SendRaw(0x46, bytes);
Israining = true;
// p.SendMessage("Weather is: " + Israining.ToString());
return;
}
if(!on)
{
byte[] bytes = new byte[1];
bytes[0] = 2;
p.SendRaw(0x46, bytes);
Israining = false;
return;
// p.SendMessage("Weather is: " + Israining.ToString());
}
//
//{
// Israining = false;
//}
//else
//{
// Israining = true;
//}
}
示例2: SendExperience
/// <summary>
/// Updates the players experience bar
/// </summary>
/// <param name="expbarval">Value of the experience bar (0-19)</param>
/// <param name="level">Ecperience level of player</param>
/// <param name="totalexp">Players total experience</param>
public static void SendExperience(Player p, byte expbarval, byte level, short totalexp)
{
byte[] bytes = new byte[4];
bytes[0] = expbarval;
bytes[1] = level;
util.EndianBitConverter.Big.GetBytes(totalexp).CopyTo(bytes, 2);
p.SendRaw(0x2B, bytes);
}
示例3: SendLightning
//public Weather()
// :base(0, 127, 0, "main", new Random().Next())
//{
//}
public void SendLightning(int x, int y, int z, int EntityId, Player p)
{
byte[] bytes = new byte[17];
util.EndianBitConverter.Big.GetBytes(EntityId).CopyTo(bytes, 0);
util.EndianBitConverter.Big.GetBytes(true).CopyTo(bytes, 4);
util.EndianBitConverter.Big.GetBytes(x).CopyTo(bytes, 5);
util.EndianBitConverter.Big.GetBytes(y).CopyTo(bytes, 9);
util.EndianBitConverter.Big.GetBytes(z).CopyTo(bytes, 13);
p.SendRaw(0x47, bytes);
}
示例4: OpenDispenser
public static bool OpenDispenser(Player a, BCS b)
{
if(!a.level.windows.ContainsKey(b.pos))
{
new Windows(3, b.pos, a.level);
}
Windows window = a.level.windows[b.pos];
short length = (short)window.name.Length;
byte[] bytes = new byte[5 + (length)];
bytes[0] = 1; //CHANGE THIS! (idk what the byte referances, i dont really see a use for it if its just a byte)
bytes[1] = window.type;
util.EndianBitConverter.Big.GetBytes(length).CopyTo(bytes, 2);
UTF8Encoding.UTF8.GetBytes(window.name).CopyTo(bytes, 4);
bytes[4 + (length)] = (byte)window.items.Length; //number of slots
a.SendRaw(0x64, bytes);
return false;
}