/// <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); }
/// <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); }
/// <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); }
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; }
/// <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); }
/// <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); }
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); }
/// <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); }
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); }
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); }
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); }
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; }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
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); }
/// <summary> /// 获取玩家所有效果列表 /// </summary> /// <param name="uuid">在线玩家的uuid字符串</param> /// <returns>效果列表json字符串</returns> public string getPlayerEffects(string uuid) { return((cgetPlayerEffects != null) ? StrTool.readUTF8str(cgetPlayerEffects(uuid)) : string.Empty); }
/// <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); }
/// <summary> /// 查询在线玩家基本信息 /// </summary> /// <param name="uuid">在线玩家的uuid字符串</param> /// <returns>玩家基本信息json字符串</returns> public string selectPlayer(string uuid) { return((cselectPlayer != null) ? StrTool.readUTF8str(cselectPlayer(uuid)) : string.Empty); }
/// <summary> /// 获取物品原始标识字符 /// </summary> /// <param name="id">物品id</param> /// <returns>物品原始标识字符</returns> public string getItemRawname(int id) { return((cgetItemRawname != null) ? StrTool.c_str(cgetItemRawname(id)) : "unknow"); }
/// <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); }
/// <summary> /// 导出地图所有离线玩家数据<br/> /// 注:调用时机在地图初始化完成之后生效 /// </summary> /// <returns></returns> public string exportPlayersData() { return((cexportPlayersData != null) ? StrTool.c_str(cexportPlayersData()) : string.Empty); }