Skip to content

Commit

Permalink
Modified OracleHack library for CLS compliance
Browse files Browse the repository at this point in the history
  • Loading branch information
kabili207 committed Dec 7, 2014
1 parent a87cf08 commit 8155057
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ public enum Memory : byte
}

[Flags]
public enum Rings : ulong
public enum Rings : long
{
None = 0,
All = UInt64.MaxValue,
All = unchecked((long)UInt64.MaxValue),
[RingInfo("Friendship Ring", "Symbol of a meeting")]
FriendshipRing = 0x1L,
[RingInfo("Power Ring L-1", "Sword damage ▲\nDamage taken ▲")]
Expand Down Expand Up @@ -209,6 +209,6 @@ public enum Rings : ulong
[RingInfo("Whimsical Ring", "Sword damage ▼ Sometimes deadly")]
WhimsicalRing = 0x4000000000000000L,
[RingInfo("Protection Ring", "Damage taken is always one Heart")]
ProtectionRing = 0x8000000000000000L
ProtectionRing = unchecked((long)0x8000000000000000L)
}
}
8 changes: 4 additions & 4 deletions GameInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class GameInfo : INotifyPropertyChanged
// JSON.Net has problems serializing the rings if it's an enum,
// so we have to put the attribute here instead
[JsonProperty("Rings")]
ulong _rings = 0L;
long _rings = 0L;

[NonSerialized]
byte _currXor = 0;
Expand Down Expand Up @@ -172,7 +172,7 @@ public Rings Rings
get { return (Rings)_rings; }
set
{
_rings = (ulong)value;
_rings = (long)value;
OnPropertyChanged("Rings");
}
}
Expand Down Expand Up @@ -344,7 +344,7 @@ public void LoadRings(byte[] secret, bool appendRings)
if (_gameId != gameId)
throw new InvalidSecretException("The specified secret is not for this Game ID");

ulong rings = Convert.ToUInt64(
long rings = unchecked((long)Convert.ToUInt64(
decodedSecret.ReversedSubstring(36, 8) +
decodedSecret.ReversedSubstring(76, 8) +
decodedSecret.ReversedSubstring(28, 8) +
Expand All @@ -353,7 +353,7 @@ public void LoadRings(byte[] secret, bool appendRings)
decodedSecret.ReversedSubstring(68, 8) +
decodedSecret.ReversedSubstring(20, 8) +
decodedSecret.ReversedSubstring(52, 8)
, 2);
, 2));
if (appendRings)
rings |= _rings;
_rings = rings;
Expand Down
2 changes: 2 additions & 0 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

[assembly: CLSCompliant(true)]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.
Expand Down

0 comments on commit 8155057

Please sign in to comment.