예제 #1
0
 /// <summary>
 /// 获取在线玩家列表
 /// </summary>
 /// <returns></returns>
 public string getOnLinePlayers()
 {
     try
     {
         return((cgetOnLinePlayers != null) ? StrTool.c_str(cgetOnLinePlayers()) :
                string.Empty);
     } catch (Exception e) { Console.WriteLine(e.StackTrace); }
     return(string.Empty);
 }
예제 #2
0
 /// <summary>
 /// 获取玩家权限与游戏模式<br/>
 /// 注:OP命令等级包含6个有效等级[op-permission-level],权限包含3种有效权限[permissions.json],游戏模式包含5种有效模式[gamemode]
 /// </summary>
 /// <param name="uuid">在线玩家的uuid字符串</param>
 /// <returns>权限与模式的json字符串</returns>
 public string getPlayerPermissionAndGametype(string uuid)
 {
     try
     {
         return((cgetPlayerPermissionAndGametype != null) ? StrTool.c_str(cgetPlayerPermissionAndGametype(uuid)) :
                string.Empty);
     } catch (Exception e) { Console.WriteLine(e.StackTrace); }
     return(string.Empty);
 }
예제 #3
0
 /// <summary>
 /// 获取一个结构
 /// </summary>
 /// <param name="did">地图维度</param>
 /// <param name="jsonposa">坐标JSON字符串</param>
 /// <param name="jsonposb">坐标JSON字符串</param>
 /// <param name="exent">是否导出实体</param>
 /// <param name="exblk">是否导出方块</param>
 /// <returns>结构json字符串</returns>
 public string getStructure(int did, string jsonposa, string jsonposb, bool exent, bool exblk)
 {
     try
     {
         return((cgetStructure != null) ? StrTool.c_str(cgetStructure(did, jsonposa, jsonposb, exent, exblk)) :
                string.Empty);
     }catch (Exception e) { Console.WriteLine(e.StackTrace); }
     return(string.Empty);
 }
예제 #4
0
 protected void loadData(IntPtr s)
 {
     // 此处为转换过程
     mplayername  = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 0));
     mdimension   = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 8));
     mXYZ         = (Vec3)Marshal.PtrToStructure(s + 16, typeof(Vec3));
     mdimensionid = Marshal.ReadInt32(s, 28);
     misstand     = Marshal.ReadByte(s, 32) == 1;
 }
예제 #5
0
 /// <summary>
 /// 获取玩家所有效果列表
 /// </summary>
 /// <param name="uuid">在线玩家的uuid字符串</param>
 /// <returns>效果列表json字符串</returns>
 public string getPlayerEffects(string uuid)
 {
     try
     {
         return((cgetPlayerEffects != null) ? StrTool.c_str(cgetPlayerEffects(uuid)) :
                string.Empty);
     } catch (Exception e) { Console.WriteLine(e.StackTrace); }
     return(string.Empty);
 }
예제 #6
0
 /// <summary>
 /// 获取名字
 /// </summary>
 /// <returns></returns>
 public string getName()
 {
     if (ptr != null && ptr != IntPtr.Zero)
     {
         Std_String s = egetName(ptr);
         return(StrTool.c_str(s));
     }
     return(null);
 }
예제 #7
0
 protected new void loadData(IntPtr s)
 {
     base.loadData(s);
     // 此处为转换过程
     mblockname = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 40));
     mposition  = (BPos3)Marshal.PtrToStructure(s + 48, typeof(BPos3));
     mblockid   = Marshal.ReadInt16(s, 60);
     mplayer    = Marshal.ReadIntPtr(s, 64);
 }
예제 #8
0
 /// <summary>
 /// 查询在线玩家基本信息
 /// </summary>
 /// <param name="uuid">在线玩家的uuid字符串</param>
 /// <returns>玩家基本信息json字符串</returns>
 public string selectPlayer(string uuid)
 {
     try
     {
         return((cselectPlayer != null) ? StrTool.c_str(cselectPlayer(uuid)) :
                string.Empty);
     } catch (Exception e) { Console.WriteLine(e); }
     return(string.Empty);
 }
예제 #9
0
 protected void loadData(IntPtr s)
 {
     // 此处为转换过程
     mplayername = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 0));
     muuid       = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 8));
     mxuid       = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 16));
     mability    = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 24));
     mplayer     = Marshal.ReadIntPtr(s, 32);
 }
예제 #10
0
        public static new ServerCmdOutputEvent getFrom(Events e)
        {
            var soe = createHead(e, EventType.onServerCmdOutput, typeof(ServerCmdOutputEvent)) as ServerCmdOutputEvent;

            if (soe == null)
            {
                return(soe);
            }
            IntPtr s = e.data;              // 此处为转换过程

            soe.moutput = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 0));
            return(soe);
        }
예제 #11
0
        public static new InputCommandEvent getFrom(Events e)
        {
            var le = createHead(e, EventType.onInputCommand, typeof(InputCommandEvent)) as InputCommandEvent;

            if (le == null)
            {
                return(null);
            }
            IntPtr s = e.data;

            le.loadData(s);
            le.mcmd = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 40));
            return(le);
        }
예제 #12
0
 protected void loadData(IntPtr s)
 {
     // 此处为转换过程
     mmobname     = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 0));
     mplayername  = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 8));
     mdimension   = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 16));
     mmobtype     = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 24));
     msrcname     = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 32));
     msrctype     = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 40));
     mXYZ         = (Vec3)Marshal.PtrToStructure(s + 48, typeof(Vec3));
     mdimensionid = Marshal.ReadInt32(s, 60);
     mdmcase      = Marshal.ReadInt32(s, 64);
     misstand     = Marshal.ReadByte(s, 68) == 1;
 }
예제 #13
0
        public static new PlayerLeftEvent getFrom(Events e)
        {
            var le = createHead(e, EventType.onPlayerLeft, typeof(PlayerLeftEvent)) as PlayerLeftEvent;

            if (le == null)
            {
                return(null);
            }
            IntPtr s = e.data;                  // 此处为转换过程

            le.mplayername = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 0));
            le.muuid       = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 8));
            le.mxuid       = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 16));
            le.mability    = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 24));
            return(le);
        }
예제 #14
0
        public static new MobHurtEvent getFrom(Events e)
        {
            var le = createHead(e, EventType.onMobHurt, typeof(MobHurtEvent)) as MobHurtEvent;

            if (le == null)
            {
                return(null);
            }
            IntPtr s = e.data;

            le.loadData(s);
            le.mdmtype  = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 72));
            le.mhealth  = StrTool.itof(Marshal.ReadInt32(s, 80));
            le.mdmcount = Marshal.ReadInt32(s, 84);
            return(le);
        }
예제 #15
0
        public static new ChatEvent getFrom(Events e)
        {
            var le = createHead(e, EventType.onChat, typeof(ChatEvent)) as ChatEvent;

            if (le == null)
            {
                return(null);
            }
            IntPtr s = e.data;              // 此处为转换过程

            le.mplayername = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 0));
            le.mtarget     = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 8));
            le.mmsg        = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 16));
            le.mchatstyle  = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 24));
            return(le);
        }
예제 #16
0
        public static new AttackEvent getFrom(Events e)
        {
            var ate = createHead(e, EventType.onAttack, typeof(AttackEvent)) as AttackEvent;

            if (ate == null)
            {
                return(null);
            }
            IntPtr s = e.data;                  // 此处为转换过程

            ate.loadData(s);
            ate.mactorname = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 40));
            ate.mactortype = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 48));
            ate.mactorpos  = (Vec3)Marshal.PtrToStructure(s + 56, typeof(Vec3));
            return(ate);
        }
예제 #17
0
        public static new FormSelectEvent getFrom(Events e)
        {
            var fse = createHead(e, EventType.onFormSelect, typeof(FormSelectEvent)) as FormSelectEvent;

            if (fse == null)
            {
                return(fse);
            }
            IntPtr s = e.data;                  // 此处为转换过程

            fse.loadData(s);
            fse.muuid     = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 40));
            fse.mselected = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 48));
            fse.mformid   = Marshal.ReadInt32(s, 56);
            return(fse);
        }
예제 #18
0
        public static new CommandBlockUpdateEvent getFrom(Events e)
        {
            var le = createHead(e, EventType.onCommandBlockUpdate, typeof(CommandBlockUpdateEvent)) as CommandBlockUpdateEvent;

            if (le == null)
            {
                return(null);
            }
            IntPtr s = e.data;

            le.loadData(s);
            le.mcmd       = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 40));
            le.mactortype = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 48));
            le.mposition  = (BPos3)Marshal.PtrToStructure(s + 56, typeof(BPos3));
            le.misblock   = Marshal.ReadByte(s, 68) == 1;
            return(le);
        }
예제 #19
0
        public static new UseItemEvent getFrom(Events e)
        {
            var ue = createHead(e, EventType.onUseItem, typeof(UseItemEvent)) as UseItemEvent;

            if (ue == null)
            {
                return(null);
            }
            IntPtr s = e.data;                  // 此处为转换过程

            ue.loadData(s);
            ue.mitemname = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 40));
            ue.mposition = (BPos3)Marshal.PtrToStructure(s + 48, typeof(BPos3));
            ue.mitemid   = Marshal.ReadInt16(s, 60);
            ue.mitemaux  = Marshal.ReadInt16(s, 62);
            return(ue);
        }
예제 #20
0
        public static new EquippedArmorEvent getFrom(Events e)
        {
            var qae = createHead(e, EventType.onEquippedArmor, typeof(EquippedArmorEvent)) as EquippedArmorEvent;

            if (qae == null)
            {
                return(null);
            }
            IntPtr s = e.data;              // 此处为转换过程

            qae.loadData(s);
            qae.mitemname  = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 40));
            qae.mitemcount = Marshal.ReadInt32(s, 48);
            qae.mslot      = Marshal.ReadInt32(s, 52);
            qae.mitemaux   = Marshal.ReadInt16(s, 56);
            qae.mitemid    = Marshal.ReadInt16(s, 58);
            qae.mplayer    = Marshal.ReadIntPtr(s, 64);
            return(qae);
        }
예제 #21
0
        public static new BlockCmdEvent getFrom(Events e)
        {
            var le = createHead(e, EventType.onBlockCmd, typeof(BlockCmdEvent)) as BlockCmdEvent;

            if (le == null)
            {
                return(null);
            }
            IntPtr s = e.data;             // 此处为转换过程

            le.mcmd         = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 0));
            le.mname        = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 8));
            le.mdimension   = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 16));
            le.mposition    = (BPos3)Marshal.PtrToStructure(s + 24, typeof(BPos3));
            le.mdimensionid = Marshal.ReadInt32(s, 36);
            le.mtickdelay   = Marshal.ReadInt32(s, 40);
            le.mtype        = Marshal.ReadInt32(s, 44);
            return(le);
        }
예제 #22
0
        public static new LevelExplodeEvent getFrom(Events e)
        {
            var le = createHead(e, EventType.onLevelExplode, typeof(LevelExplodeEvent)) as LevelExplodeEvent;

            if (le == null)
            {
                return(null);
            }
            IntPtr s = e.data;              // 此处为转换过程

            le.mentity       = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 0));
            le.mblockname    = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 8));
            le.mdimension    = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 16));
            le.mposition     = (Vec3)Marshal.PtrToStructure(s + 24, typeof(Vec3));
            le.mentityid     = Marshal.ReadInt32(s, 36);
            le.mdimensionid  = Marshal.ReadInt32(s, 40);
            le.mexplodepower = StrTool.itof(Marshal.ReadInt32(s, 44));
            le.mblockid      = Marshal.ReadInt16(s, 48);
            return(le);
        }
예제 #23
0
        public static new NpcCmdEvent getFrom(Events e)
        {
            var le = createHead(e, EventType.onNpcCmd, typeof(NpcCmdEvent)) as NpcCmdEvent;

            if (le == null)
            {
                return(null);
            }
            IntPtr s = e.data;             // 此处为转换过程

            le.mnpcname     = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 0));
            le.mentity      = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 8));
            le.mdimension   = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 16));
            le.mactions     = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 24));
            le.mposition    = (Vec3)Marshal.PtrToStructure(s + 32, typeof(Vec3));
            le.mactionid    = Marshal.ReadInt32(s, 44);
            le.mentityid    = Marshal.ReadInt32(s, 48);
            le.mdimensionid = Marshal.ReadInt32(s, 52);
            return(le);
        }
예제 #24
0
        public static new SetSlotEvent getFrom(Events e)
        {
            var le = createHead(e, EventType.onSetSlot, typeof(SetSlotEvent)) as SetSlotEvent;

            if (le == null)
            {
                return(null);
            }
            IntPtr s = e.data;                  // 此处为转换过程

            le.loadData(s);
            le.mitemname  = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 40));
            le.mblockname = StrTool.readUTF8str((IntPtr)Marshal.ReadInt64(s, 48));
            le.mposition  = (BPos3)Marshal.PtrToStructure(s + 56, typeof(BPos3));
            le.mitemcount = Marshal.ReadInt32(s, 68);
            le.mslot      = Marshal.ReadInt32(s, 72);
            le.mitemaux   = Marshal.ReadInt16(s, 76);
            le.mblockid   = Marshal.ReadInt16(s, 78);
            le.mitemid    = Marshal.ReadInt16(s, 80);
            return(le);
        }
예제 #25
0
 /// <summary>
 /// 获取玩家所有效果列表
 /// </summary>
 /// <param name="uuid">在线玩家的uuid字符串</param>
 /// <returns>效果列表json字符串</returns>
 public string getPlayerEffects(string uuid)
 {
     return((cgetPlayerEffects != null) ? StrTool.readUTF8str(cgetPlayerEffects(uuid)) :
            string.Empty);
 }
예제 #26
0
 /// <summary>
 /// 获取玩家权限与游戏模式<br/>
 /// 注:OP命令等级包含6个有效等级[op-permission-level],权限包含3种有效权限[permissions.json],游戏模式包含5种有效模式[gamemode]
 /// </summary>
 /// <param name="uuid">在线玩家的uuid字符串</param>
 /// <returns>权限与模式的json字符串</returns>
 public string getPlayerPermissionAndGametype(string uuid)
 {
     return((cgetPlayerPermissionAndGametype != null) ? StrTool.readUTF8str(cgetPlayerPermissionAndGametype(uuid)) :
            string.Empty);
 }
예제 #27
0
 /// <summary>
 /// 查询在线玩家基本信息
 /// </summary>
 /// <param name="uuid">在线玩家的uuid字符串</param>
 /// <returns>玩家基本信息json字符串</returns>
 public string selectPlayer(string uuid)
 {
     return((cselectPlayer != null) ? StrTool.readUTF8str(cselectPlayer(uuid)) :
            string.Empty);
 }
예제 #28
0
 /// <summary>
 /// 获取物品原始标识字符
 /// </summary>
 /// <param name="id">物品id</param>
 /// <returns>物品原始标识字符</returns>
 public string getItemRawname(int id)
 {
     return((cgetItemRawname != null) ?  StrTool.c_str(cgetItemRawname(id)) :
            "unknow");
 }
예제 #29
0
 /// <summary>
 /// 获取一个指定位置处区块的颜色数据<br/>
 /// 注:如区块未处于活动状态,可能返回无效颜色数据
 /// </summary>
 /// <param name="x"></param>
 /// <param name="y"></param>
 /// <param name="z"></param>
 /// <param name="did">待读取的维度</param>
 /// <returns>区块位置及颜色数据内容</returns>
 public string getMapColors(int x, int y, int z, int did)
 {
     return((cgetMapColors != null) ? StrTool.c_str(cgetMapColors(x, y, z, did)) :
            string.Empty);
 }
예제 #30
0
 /// <summary>
 /// 导出地图所有离线玩家数据<br/>
 /// 注:调用时机在地图初始化完成之后生效
 /// </summary>
 /// <returns></returns>
 public string exportPlayersData()
 {
     return((cexportPlayersData != null) ? StrTool.c_str(cexportPlayersData()) :
            string.Empty);
 }