public static List <ClientEffectStartData> DeSerializeEffectsToStartFromStream(Component context, ref IBitStream stream) { sbyte num1 = 0; stream.Serialize(ref num1); var clientEffectStartDataList = new List <ClientEffectStartData>(num1); for (var index1 = 0; index1 < (int)num1; ++index1) { uint num2 = 0; stream.Serialize(ref num2); sbyte num3 = 0; stream.Serialize(ref num3); var sequenceStartDataList = new List <ServerClientUtils.SequenceStartData>(num3); for (var index2 = 0; index2 < (int)num3; ++index2) { var sequenceStartData = ServerClientUtils.SequenceStartData.SequenceStartData_DeserializeFromStream(ref stream); sequenceStartDataList.Add(sequenceStartData); } sbyte invalidActorIndex1 = (sbyte)ActorData.s_invalidActorIndex; stream.Serialize(ref invalidActorIndex1); ActorData actorByActorIndex1 = context.GameFlowData.FindActorByActorIndex(invalidActorIndex1); sbyte invalidActorIndex2 = (sbyte)ActorData.s_invalidActorIndex; stream.Serialize(ref invalidActorIndex2); ActorData actorByActorIndex2 = context.GameFlowData.FindActorByActorIndex(invalidActorIndex2); var statuses = new List <StatusType>(); var statusesOnTurnStart = new List <StatusType>(); if (invalidActorIndex2 != ActorData.s_invalidActorIndex) { sbyte num4 = 0; stream.Serialize(ref num4); for (var index2 = 0; index2 < (int)num4; ++index2) { byte num5 = 0; stream.Serialize(ref num5); statuses.Add((StatusType)num5); } } if (invalidActorIndex2 != ActorData.s_invalidActorIndex) { sbyte num4 = 0; stream.Serialize(ref num4); for (var index2 = 0; index2 < (int)num4; ++index2) { byte num5 = 0; stream.Serialize(ref num5); statusesOnTurnStart.Add((StatusType)num5); } } bool out0 = false; bool out1 = false; bool out2 = false; bool out3 = false; bool out4 = false; byte bitField = 0; stream.Serialize(ref bitField); ServerClientUtils.GetBoolsFromBitfield(bitField, out out0, out out1, out out2, out out3, out out4); short num6 = 0; if (out3) { stream.Serialize(ref num6); } short num7 = 0; if (out4) { stream.Serialize(ref num7); } var clientEffectStartData = new ClientEffectStartData((int)num2, sequenceStartDataList, actorByActorIndex2, actorByActorIndex1, statuses, statusesOnTurnStart, num6, num7, out0, out1, out2); clientEffectStartDataList.Add(clientEffectStartData); } return(clientEffectStartDataList); }
public static BoardSquarePathInfo DeSerializePath(Component context, NetworkReader reader) { var boardSquarePathInfo1 = new BoardSquarePathInfo(); var boardSquarePathInfo2 = boardSquarePathInfo1; BoardSquarePathInfo boardSquarePathInfo3 = null; float num1 = 0.0f; sbyte num2 = 0; sbyte num3 = 0; float num4 = 0.0f; float num5 = 0.0f; float num6 = 0.0f; bool out0_1 = false; bool out1_1 = false; bool flag; if (flag = reader.ReadBoolean()) { num4 = reader.ReadSingle(); num5 = reader.ReadSingle(); num6 = reader.ReadSingle(); } bool out2 = !flag; bool out3 = false; bool out4 = false; bool out5 = false; bool out0_2 = false; bool out1_2 = false; while (!out2) { byte num7 = reader.ReadByte(); byte num8 = reader.ReadByte(); sbyte num9 = reader.ReadSByte(); int num10; switch (num9) { case 0: case 3: num10 = 1; break; default: num10 = num9 == (sbyte)1 ? 1 : 0; break; } if (num10 == 0) { num2 = reader.ReadSByte(); num3 = reader.ReadSByte(); } var bitField1 = reader.ReadByte(); var bitField2 = reader.ReadByte(); var out6 = false; var out7 = false; ServerClientUtils.GetBoolsFromBitfield(bitField1, out out0_1, out out1_1, out out2, out out3, out out4, out out5, out out6, out out7); ServerClientUtils.GetBoolsFromBitfield(bitField2, out out0_2, out out1_2); var num11 = num4; var num12 = num5; if (out6) { num11 = reader.ReadSingle(); } if (out7) { num12 = reader.ReadSingle(); } var boardSquare = context.Board.method_10(num7, num8); if (boardSquare == null) { Log.Print(LogType.Error, "Failed to find square from index [" + num7 + ", " + num8 + "] during serialization of path"); } boardSquarePathInfo2.square = boardSquare; boardSquarePathInfo2.moveCost = num1; boardSquarePathInfo2.heuristicCost = 0.0f; boardSquarePathInfo2.connectionType = (BoardSquarePathInfo.ConnectionType)num9; boardSquarePathInfo2.chargeCycleType = (BoardSquarePathInfo.ChargeCycleType)num2; boardSquarePathInfo2.chargeEndType = (BoardSquarePathInfo.ChargeEndType)num3; boardSquarePathInfo2.segmentMovementSpeed = num11; boardSquarePathInfo2.segmentMovementDuration = num12; boardSquarePathInfo2.m_reverse = out0_1; boardSquarePathInfo2.m_unskippable = out1_1; boardSquarePathInfo2.m_visibleToEnemies = out3; boardSquarePathInfo2.m_updateLastKnownPos = out4; boardSquarePathInfo2.m_moverDiesHere = out5; boardSquarePathInfo2.m_moverClashesHere = out0_2; boardSquarePathInfo2.m_moverBumpedFromClash = out1_2; boardSquarePathInfo2.prev = boardSquarePathInfo3; if (boardSquarePathInfo3 != null) { boardSquarePathInfo3.next = boardSquarePathInfo2; } if (!out2) { boardSquarePathInfo3 = boardSquarePathInfo2; boardSquarePathInfo2 = new BoardSquarePathInfo(); } } boardSquarePathInfo1.moveCost = num6; boardSquarePathInfo1.CalcAndSetMoveCostToEnd(context); return(boardSquarePathInfo1); }
public ClientActorHitResults(Component context, ref IBitStream stream) { byte bitField1 = 0; stream.Serialize(ref bitField1); ServerClientUtils.GetBoolsFromBitfield(bitField1, out m_hasDamage, out m_hasHealing, out m_hasTechPointGain, out m_hasTechPointLoss, out m_hasTechPointGainOnCaster, out m_hasKnockback, out m_targetInCoverWrtDamage, out m_canBeReactedTo); byte bitField2 = 0; stream.Serialize(ref bitField2); ServerClientUtils.GetBoolsFromBitfield(bitField2, out m_damageBoosted, out m_damageReduced, out m_updateCasterLastKnownPos, out m_updateTargetLastKnownPos, out m_updateEffectHolderLastKnownPos, out m_updateOtherLastKnownPos, out m_isPartOfHealOverTime, out m_triggerCasterVisOnHitVisualOnly); short num1 = 0; short num2 = 0; short num3 = 0; short num4 = 0; short num5 = 0; if (m_hasDamage) { stream.Serialize(ref num1); m_finalDamage = num1; } if (m_hasHealing) { stream.Serialize(ref num2); m_finalHealing = num2; } if (m_hasTechPointGain) { stream.Serialize(ref num3); m_finalTechPointsGain = num3; } if (m_hasTechPointLoss) { stream.Serialize(ref num4); m_finalTechPointsLoss = num4; } if (m_hasTechPointGainOnCaster) { stream.Serialize(ref num5); m_finalTechPointGainOnCaster = num5; } if (m_hasKnockback) { short invalidActorIndex = (short)ActorData.s_invalidActorIndex; stream.Serialize(ref invalidActorIndex); m_knockbackSourceActor = (int)invalidActorIndex == ActorData.s_invalidActorIndex ? null : context.GameFlowData.FindActorByActorIndex(invalidActorIndex); } if ((!m_hasDamage || !m_targetInCoverWrtDamage ? (m_hasKnockback ? 1 : 0) : 1) != 0) { float num6 = 0.0f; float num7 = 0.0f; stream.Serialize(ref num6); stream.Serialize(ref num7); m_damageHitOrigin.X = num6; m_damageHitOrigin.Y = 0.0f; m_damageHitOrigin.Z = num7; } if (m_updateEffectHolderLastKnownPos) { short invalidActorIndex = (short)ActorData.s_invalidActorIndex; stream.Serialize(ref invalidActorIndex); m_effectHolderActor = (int)invalidActorIndex == ActorData.s_invalidActorIndex ? null : context.GameFlowData.FindActorByActorIndex(invalidActorIndex); } if (m_updateOtherLastKnownPos) { byte num6 = 0; stream.Serialize(ref num6); m_otherActorsToUpdateVisibility = new List <ActorData>(num6); for (int index = 0; index < (int)num6; ++index) { short invalidActorIndex = (short)ActorData.s_invalidActorIndex; stream.Serialize(ref invalidActorIndex); if (invalidActorIndex != ActorData.s_invalidActorIndex) { ActorData actorByActorIndex = context.GameFlowData.FindActorByActorIndex(invalidActorIndex); if (actorByActorIndex != null) { m_otherActorsToUpdateVisibility.Add(actorByActorIndex); } } } } bool out0_1 = false; bool out1_1 = false; bool out2_1 = false; bool out2_2 = false; bool out3_1 = false; bool out4 = false; bool out5 = false; bool out6 = false; bool out7 = false; bool out0_2 = false; bool out1_2 = false; bool out3_2 = false; byte bitField3 = 0; byte bitField4 = 0; stream.Serialize(ref bitField3); stream.Serialize(ref bitField4); ServerClientUtils.GetBoolsFromBitfield(bitField3, out out0_1, out out1_1, out out2_2, out out3_1, out out4, out out5, out out6, out out7); ServerClientUtils.GetBoolsFromBitfield(bitField4, out out0_2, out out1_2, out out2_1, out out3_2); m_effectsToStart = !out0_1 ? new List <ClientEffectStartData>() : AbilityResultsUtils.DeSerializeEffectsToStartFromStream(context, ref stream); m_effectsToRemove = !out1_1 ? new List <int>() : AbilityResultsUtils.DeSerializeEffectsForRemovalFromStream(ref stream); m_barriersToAdd = !out2_1 ? new List <ClientBarrierStartData>() : AbilityResultsUtils.DeSerializeBarriersToStartFromStream(context, ref stream); m_barriersToRemove = !out2_2 ? new List <int>() : AbilityResultsUtils.DeSerializeBarriersForRemovalFromStream(ref stream); m_sequencesToEnd = !out3_1 ? new List <ServerClientUtils.SequenceEndData>() : AbilityResultsUtils.DeSerializeSequenceEndDataListFromStream(ref stream); m_reactions = !out4 ? new List <ClientReactionResults>() : AbilityResultsUtils.DeSerializeClientReactionResultsFromStream(context, ref stream); m_powerupsToRemove = !out5 ? new List <int>() : AbilityResultsUtils.DeSerializePowerupsToRemoveFromStream(ref stream); m_powerupsToSteal = !out6 ? new List <ClientPowerupStealData>() : AbilityResultsUtils.DeSerializePowerupsToStealFromStream(context, ref stream); m_directPowerupHits = !out7 ? new List <ClientMovementResults>() : AbilityResultsUtils.DeSerializeClientMovementResultsListFromStream(context, ref stream); m_gameModeEvents = !out0_2 ? new List <ClientGameModeEvent>() : AbilityResultsUtils.DeSerializeClientGameModeEventListFromStream(context, ref stream); m_overconIds = !out3_2 ? new List <int>() : AbilityResultsUtils.DeSerializeClientOverconListFromStream(ref stream); m_isCharacterSpecificAbility = out1_2; IsMovementHit = false; ExecutedHit = false; }