public override void Read(byte[] array) { McVarint.TryParse(ref array, out EntityID); Location = new Position(); Location.Read(ref array); McUnsignedByte.TryParse(ref array, out DestroyStage); }
public override void Read(byte[] array) { McVarint.TryParse(ref array, out Count); McVarint.TryParse(ref array, out Value); McStatistic.TryParse(ref array, Count, out Statistics); Statistics = new Statistic[Count]; }
public bool IsFlat; //* public override void Read(byte[] array) { McInt.TryParse(ref array, out EntityId); McBoolean.TryParse(ref array, out IsHardcore); if (McUnsignedByte.TryParse(ref array, out var gamemode)) { Gamemode = (Gamemodes)gamemode; } if (McByte.TryParse(ref array, out var previousGamemode)) { PreviousGamemode = (Gamemodes)previousGamemode; } McVarint.TryParse(ref array, out WorldCount); McStringArray.TryParse(WorldCount, ref array, out WorldNames); McNbtCompoundTag.TryParse(ref array, out DimensionCodec); McNbtCompoundTag.TryParse(ref array, out Dimension); McString.TryParse(ref array, out WorldName); McLong.TryParse(ref array, out HashedSeed); McVarint.TryParse(ref array, out MaxPlayers); McVarint.TryParse(ref array, out ViewDistance); McBoolean.TryParse(ref array, out ReducedDebugInfo); McBoolean.TryParse(ref array, out EnableRespawnScreen); McBoolean.TryParse(ref array, out IsDebug); McBoolean.TryParse(ref array, out IsFlat); }
public byte[] VerifyToken; //Byte Array public override void Read(byte[] array) { McVarint.TryParse(ref array, out SharedSecretLength); McByteArray.TryParse(ref array, out SharedSecret); McVarint.TryParse(ref array, out VerifyTokenLength); McByteArray.TryParse(ref array, out VerifyToken); }
public override void Read(byte[] array) { McVarint.TryParse(ref array, out EntityID); McUnsignedByte.TryParse(ref array, out Yaw); McUnsignedByte.TryParse(ref array, out Pitch); McBoolean.TryParse(ref array, out OnGround); }
public override void Read(byte[] array) { Location = new Position(); Location.Read(ref array); McVarint.TryParse(ref array, out Block); McVarint.TryParse(ref array, out Status); McBoolean.TryParse(ref array, out Successful); }
public int BlockType; //Varint public override void Read(byte[] array) { Location = new Position(); Location.Read(ref array); McUnsignedByte.TryParse(ref array, out ActionID); McUnsignedByte.TryParse(ref array, out ActionParam); McVarint.TryParse(ref array, out BlockType); }
public override void Read(byte[] array) { McVarint.TryParse(ref array, out EntityID); McShort.TryParse(ref array, out DeltaX); McShort.TryParse(ref array, out DeltaY); McShort.TryParse(ref array, out DeltaZ); McBoolean.TryParse(ref array, out OnGround); }
public byte[] VerifyToken; // Byte Array public override void Read(byte[] array) { McString.TryParse(ref array, out ServerID); McVarint.TryParse(ref array, out PublicKeyLength); McByteArray.TryParse(ref array, out PublicKey); McVarint.TryParse(ref array, out VerifyTokenLength); McByteArray.TryParse(ref array, out VerifyToken); }
public override void Read(byte[] array) { McVarint.TryParse(ref array, out EntityId); McDouble.TryParse(ref array, out X); McDouble.TryParse(ref array, out Y); McDouble.TryParse(ref array, out Z); McShort.TryParse(ref array, out Count); }
public int JumpBoost; //Varint public override void Read(byte[] array) { _ = McVarint.TryParse(ref array, out EntityID); if (McVarint.TryParse(ref array, out var actionID)) { ActionID = (EntityActionType)actionID; } _ = McVarint.TryParse(ref array, out JumpBoost); }
public int[] EntityIDs; //Array of VarInt public override void Read(byte[] array) { McVarint.TryParse(ref array, out Count); EntityIDs = new int[Count]; for (int i = 0; i < Count; i++) { McVarint.TryParse(ref array, out EntityIDs[i]); } }
public byte[] Data; //Optional Byte Array public override void Read(byte[] array) { McVarint.TryParse(ref array, out MessageID); McBoolean.TryParse(ref array, out Successful); if (Successful) { McByteArray.TryParse(ref array, out Data); } }
public byte Direction; //Byte Enum public override void Read(byte[] array) { McVarint.TryParse(ref array, out EntityID); McUUID.TryParse(ref array, out EntityUUID); McVarint.TryParse(ref array, out Motive); Location = new Position(); Location.Read(ref array); McUnsignedByte.TryParse(ref array, out Direction); }
public int TeleportID; // Varint public override void Read(byte[] array) { McDouble.TryParse(ref array, out X); McDouble.TryParse(ref array, out Y); McDouble.TryParse(ref array, out Z); McFloat.TryParse(ref array, out Yaw); McFloat.TryParse(ref array, out Pitch); McUnsignedByte.TryParse(ref array, out Flags); McVarint.TryParse(ref array, out TeleportID); }
public byte Pitch; //Angle public override void Read(byte[] array) { McVarint.TryParse(ref array, out EntityID); McUUID.TryParse(ref array, out PlayerUUID); McDouble.TryParse(ref array, out X); McDouble.TryParse(ref array, out Y); McDouble.TryParse(ref array, out Z); McUnsignedByte.TryParse(ref array, out Yaw); McUnsignedByte.TryParse(ref array, out Pitch); }
public void Parse(ref byte[] array) { McBoolean.TryParse(ref array, out Present); if (Present) { McVarint.TryParse(ref array, out ItemId); McUnsignedByte.TryParse(ref array, out ItemCount); McNbtCompoundTag.TryParse(ref array, out NBT); } }
public override void Read(byte[] array) { McUnsignedByte.TryParse(ref array, out WindowID); McShort.TryParse(ref array, out Slot); McUnsignedByte.TryParse(ref array, out Button); McShort.TryParse(ref array, out ActionNumber); McVarint.TryParse(ref array, out Mode); Slot slot = new Slot(); slot.Parse(ref array); }
public override void Read(byte[] array) { McVarint.TryParse(ref array, out ProtocolVersion); McString.TryParse(ref array, out Address); McUnsignedShort.TryParse(ref array, out Port); McVarint.TryParse(ref array, out int loginState); LoginState = (LoginStates)loginState; }
public override void Read(byte[] array) { McVarint.TryParse(ref array, out EntityID); McInt.TryParse(ref array, out NumberOfProperties); Property = new EntityProperty[NumberOfProperties]; for (int i = 0; i < NumberOfProperties; i++) { Property[i] = new EntityProperty(); Property[i].Read(ref array); } }
public override void Read(byte[] array) { McVarint.TryParse(ref array, out Action); McVarint.TryParse(ref array, out NumberOfPlayers); Players = new Player[NumberOfPlayers]; for (int i = 0; i < NumberOfPlayers; i++) { Players[i] = new Player(); Players[i].Read(ref array, Action); } }
public ModifierData[] Modifiers; //Array of Modifier Data public void Read(ref byte[] array) { McString.TryParse(ref array, out Key); McDouble.TryParse(ref array, out Value); McVarint.TryParse(ref array, out NumberOfModifiers); Modifiers = new ModifierData[NumberOfModifiers]; for (int i = 0; i < NumberOfModifiers; i++) { Modifiers[i] = new ModifierData(); Modifiers[i].Read(ref array); } }
public override void Read(byte[] array) { McInt.TryParse(ref array, out ChunkX); McInt.TryParse(ref array, out ChunkZ); McVarint.TryParse(ref array, out RecordCount); Records = new Record[RecordCount]; for (int i = 0; i < RecordCount; i++) { Records[i] = new Record(); Records[i].Read(ref array); } }
public override void Read(byte[] array) { if (McVarint.TryParse(ref array, out var hand)) { Hand = (HandType)hand; } Location = new Position(); Location.Read(ref array); _ = McVarint.TryParse(ref array, out Face); _ = McFloat.TryParse(ref array, out CursorPositionX); _ = McFloat.TryParse(ref array, out CursorPositionY); _ = McFloat.TryParse(ref array, out CursorPositionZ); _ = McBoolean.TryParse(ref array, out InsideBlock); }
public override void Read(byte[] array) { McVarint.TryParse(ref array, out EntityID); McUUID.TryParse(ref array, out EntityUUID); McVarint.TryParse(ref array, out Type); McDouble.TryParse(ref array, out X); McDouble.TryParse(ref array, out Y); McDouble.TryParse(ref array, out Z); McUnsignedByte.TryParse(ref array, out Yaw); McUnsignedByte.TryParse(ref array, out Pitch); McUnsignedByte.TryParse(ref array, out HeadPitch); McShort.TryParse(ref array, out VelocityX); McShort.TryParse(ref array, out VelocityY); McShort.TryParse(ref array, out VelocityZ); }
public int Hand; // Optional Varint Enum public override void Read(byte[] array) { McVarint.TryParse(ref array, out EntityID); McVarint.TryParse(ref array, out var type); Type = (InteractEntityType)type; if (Type == InteractEntityType.InteractAt) { McFloat.TryParse(ref array, out TargetX); McFloat.TryParse(ref array, out TargetY); McFloat.TryParse(ref array, out TargetZ); } if (Type != InteractEntityType.Attack) { McVarint.TryParse(ref array, out Hand); } }
public Chat DisplayName; //Optional Chat public void Read(ref byte[] array, int action) { McUUID.TryParse(ref array, out UUID); if (action == 0) { McString.TryParse(ref array, out Name); McVarint.TryParse(ref array, out NumberOfProperties); Propertys = new Property[NumberOfProperties]; for (int i = 0; i < NumberOfProperties; i++) { Propertys[i] = new Property(); Propertys[i].Read(ref array); } McVarint.TryParse(ref array, out int GamemodeId); Gamemode = (Gamemods)GamemodeId; McVarint.TryParse(ref array, out Ping); McBoolean.TryParse(ref array, out HasDisplayName); if (HasDisplayName == true) { McChat.TryParse(ref array, out DisplayName); } } if (action == 1) { McVarint.TryParse(ref array, out int GamemodeId); Gamemode = (Gamemods)GamemodeId; } if (action == 2) { McVarint.TryParse(ref array, out Ping); } if (action == 3) { McBoolean.TryParse(ref array, out HasDisplayName); if (HasDisplayName == true) { McChat.TryParse(ref array, out DisplayName); } } }
public override void Read(byte[] array) { Location = new Position(); Location.Read(ref array); McVarint.TryParse(ref array, out Action); McVarint.TryParse(ref array, out Mode); McString.TryParse(ref array, out Name); McByte.TryParse(ref array, out OffsetX); McByte.TryParse(ref array, out OffsetY); McByte.TryParse(ref array, out OffsetZ); McUnsignedByte.TryParse(ref array, out SizeX); McUnsignedByte.TryParse(ref array, out SizeY); McUnsignedByte.TryParse(ref array, out SizeZ); McVarint.TryParse(ref array, out Mirror); McVarint.TryParse(ref array, out Rotation); McString.TryParse(ref array, out Metadata); McFloat.TryParse(ref array, out Integrity); McVarlong.TryParse(ref array, out Seed); McUnsignedByte.TryParse(ref array, out Flags); }
public override void Invoke(McConnectionContext ctx) { queue.AddRange(ctx.Data); while (queue.Count > 0) { ctx.Data = queue.ToArray(); bool parsed = McVarint.TryParse(ctx.Data, out lengthLength, out length); if (!parsed) { Debug.WriteLine("Packet is too small, read next packet"); break; } if (length + lengthLength > queue.Count) { break; } ctx.Data = ctx.Data[lengthLength..(length + lengthLength)];
// Array size 2 Recipe IDs Number of elements in the following array, only present if mode is 0 (init) public override void Read(byte[] array) { if (McVarint.TryParse(ref array, out var action)) { Action = (UnlockRecipesActions)action; } McBoolean.TryParse(ref array, out CraftingRecipeBookOpen); McBoolean.TryParse(ref array, out CraftingRecipeBookFilterActive); McBoolean.TryParse(ref array, out SmeltingRecipeBookOpen); McBoolean.TryParse(ref array, out SmeltingRecipeBookFilterActive); McBoolean.TryParse(ref array, out BlastFuranceRecipeBookOpen); McBoolean.TryParse(ref array, out BlastFuranceRecipeBookFilterActive); McBoolean.TryParse(ref array, out SmokerRecipeBookOpen); McBoolean.TryParse(ref array, out SmokerRecipeBookFilterActive); McVarint.TryParse(ref array, out ArraySize1); McStringArray.TryParse(ArraySize1, ref array, out RecipeIDs1); if (Action == 0) { McVarint.TryParse(ref array, out ArraySize2); McStringArray.TryParse(ArraySize2, ref array, out RecipeIDs2); } }