// Read this object from message-in internal override bool Read(BinaryReader binaryReader, EndPoint senderEndPoint, int gameVersion) { if (base.Read(binaryReader, senderEndPoint, gameVersion) == false) return NetworkError(); MyMwcVector3Sbyte? relativeSectorPosition = MyMwcMessageIn.ReadVector3SbyteEx(binaryReader, senderEndPoint); if (relativeSectorPosition == null) return NetworkError(); RelativeSectorPosition = relativeSectorPosition.Value; MyMwcLog.IfNetVerbose_AddToLog("RelativeSectorPosition: " + RelativeSectorPosition.ToString()); MyMwcVector3Short? voxelMapPositionInVoxelCoords = MyMwcMessageIn.ReadVector3ShortEx(binaryReader, senderEndPoint); if (voxelMapPositionInVoxelCoords == null) return NetworkError(); VoxelMapPositionInVoxelCoords = voxelMapPositionInVoxelCoords.Value; MyMwcLog.IfNetVerbose_AddToLog("VoxelMapPositionInVoxelCoords: " + VoxelMapPositionInVoxelCoords.ToString()); MyMwcVoxelFilesEnum? voxelFile = MyMwcMessageIn.ReadVoxelFileEnumEx(binaryReader, senderEndPoint); if (voxelFile == null) return NetworkError(); VoxelFile = voxelFile.Value; MyMwcLog.IfNetVerbose_AddToLog("VoxelFile: " + VoxelFile.ToString()); MyMwcVoxelMaterialsEnum? voxelMaterial = MyMwcMessageIn.ReadVoxelMaterialsEnumEx(binaryReader, senderEndPoint); if (voxelMaterial == null) return NetworkError(); VoxelMaterial = voxelMaterial.Value; MyMwcLog.IfNetVerbose_AddToLog("VoxelMaterial: " + VoxelMaterial.ToString()); return true; }
public MyMwcObjectBuilder_VoxelMap_Neighbour(MyMwcVector3Sbyte relativeSectorPosition, MyMwcVector3Short voxelMapPositionInVoxelCoords, MyMwcVoxelFilesEnum voxelFile, MyMwcVoxelMaterialsEnum voxelMaterial) : base() { RelativeSectorPosition = relativeSectorPosition; VoxelMapPositionInVoxelCoords = voxelMapPositionInVoxelCoords; VoxelFile = voxelFile; VoxelMaterial = voxelMaterial; }
// Read this object from message-in internal override bool Read(BinaryReader binaryReader, EndPoint senderEndPoint, int gameVersion) { if (base.Read(binaryReader, senderEndPoint, gameVersion) == false) { return(NetworkError()); } MyMwcVector3Sbyte?relativeSectorPosition = MyMwcMessageIn.ReadVector3SbyteEx(binaryReader, senderEndPoint); if (relativeSectorPosition == null) { return(NetworkError()); } RelativeSectorPosition = relativeSectorPosition.Value; MyMwcLog.IfNetVerbose_AddToLog("RelativeSectorPosition: " + RelativeSectorPosition.ToString()); MyMwcVector3Short?voxelMapPositionInVoxelCoords = MyMwcMessageIn.ReadVector3ShortEx(binaryReader, senderEndPoint); if (voxelMapPositionInVoxelCoords == null) { return(NetworkError()); } VoxelMapPositionInVoxelCoords = voxelMapPositionInVoxelCoords.Value; MyMwcLog.IfNetVerbose_AddToLog("VoxelMapPositionInVoxelCoords: " + VoxelMapPositionInVoxelCoords.ToString()); MyMwcVoxelFilesEnum?voxelFile = MyMwcMessageIn.ReadVoxelFileEnumEx(binaryReader, senderEndPoint); if (voxelFile == null) { return(NetworkError()); } VoxelFile = voxelFile.Value; MyMwcLog.IfNetVerbose_AddToLog("VoxelFile: " + VoxelFile.ToString()); MyMwcVoxelMaterialsEnum?voxelMaterial = MyMwcMessageIn.ReadVoxelMaterialsEnumEx(binaryReader, senderEndPoint); if (voxelMaterial == null) { return(NetworkError()); } VoxelMaterial = voxelMaterial.Value; MyMwcLog.IfNetVerbose_AddToLog("VoxelMaterial: " + VoxelMaterial.ToString()); return(true); }
public static void WriteVector3Sbyte(MyMwcVector3Sbyte val, BinaryWriter binaryWriter) { binaryWriter.Write(val.X); binaryWriter.Write(val.Y); binaryWriter.Write(val.Z); }