当前位置: 首页>>代码示例>>C#>>正文


C# Player.SendRaw方法代码示例

本文整理汇总了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;
            //}
        }
开发者ID:Jack13123,项目名称:ForgeCraft,代码行数:33,代码来源:Weather.cs

示例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);
 }
开发者ID:eszanto8,项目名称:ForgeCraft,代码行数:14,代码来源:Experience.cs

示例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);
 }
开发者ID:Jack13123,项目名称:ForgeCraft,代码行数:14,代码来源:Weather.cs

示例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;
        }
开发者ID:ProLoks,项目名称:ForgeCraft,代码行数:20,代码来源:BlockChangeSystem.cs


注:本文中的SMP.Player.SendRaw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。