Skip to content

Commit

Permalink
Released version 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
0blu committed Mar 24, 2019
1 parent 2570d13 commit b64aa67
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
6 changes: 3 additions & 3 deletions PhotonPackageParser.Example/ExampleParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ namespace PhotonPackageParser.Example
{
public class ExampleParser : PhotonParser
{
protected override void OnEvent(byte Code, Dictionary<byte, object> Parameters)
protected override void OnEvent(byte code, Dictionary<byte, object> parameters)
{
Console.WriteLine("OnEvent");
}

protected override void OnRequest(byte OperationCode, Dictionary<byte, object> Parameters)
protected override void OnRequest(byte operationCode, Dictionary<byte, object> parameters)
{
Console.WriteLine("OnRequest");
}

protected override void OnResponse(byte OperationCode, short ReturnCode, string DebugMessage, Dictionary<byte, object> Parameters)
protected override void OnResponse(byte operationCode, short returnCode, string debugMessage, Dictionary<byte, object> parameters)
{
Console.WriteLine("OnResponse");
}
Expand Down
17 changes: 6 additions & 11 deletions PhotonPackageParser/PhotonParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ public abstract class PhotonParser
private const int CommandHeaderLength = 12;
private const int PhotonHeaderLength = 12;

private readonly Dictionary<int, SegmentedPackage> pendingSegments;

public PhotonParser()
{
pendingSegments = new Dictionary<int, SegmentedPackage>();
}
private readonly Dictionary<int, SegmentedPackage> pendingSegments = new Dictionary<int, SegmentedPackage>();

public void ReceivePacket(byte[] payload)
{
Expand Down Expand Up @@ -59,11 +54,11 @@ public void ReceivePacket(byte[] payload)
}
}

protected abstract void OnRequest(byte OperationCode, Dictionary<byte, object> Parameters);
protected abstract void OnRequest(byte operationCode, Dictionary<byte, object> parameters);

protected abstract void OnResponse(byte OperationCode, short ReturnCode, string DebugMessage, Dictionary<byte, object> Parameters);
protected abstract void OnResponse(byte operationCode, short returnCode, string debugMessage, Dictionary<byte, object> parameters);

protected abstract void OnEvent(byte Code, Dictionary<byte, object> Parameters);
protected abstract void OnEvent(byte code, Dictionary<byte, object> parameters);

private void HandleCommand(byte[] source, ref int offset)
{
Expand Down Expand Up @@ -157,7 +152,7 @@ private void HandleSendFragment(byte[] source, ref int offset, ref int commandLe
commandLength -= 4;

int fragmentLength = commandLength;
HandleSegementedPayload(startSequenceNumber, totalLength, fragmentLength, fragmentOffset, source, ref offset);
HandleSegmentedPayload(startSequenceNumber, totalLength, fragmentLength, fragmentOffset, source, ref offset);
}

private void HandleFinishedSegmentedPackage(byte[] totalPayload)
Expand All @@ -167,7 +162,7 @@ private void HandleFinishedSegmentedPackage(byte[] totalPayload)
HandleSendReliable(totalPayload, ref offset, ref commandLength);
}

private void HandleSegementedPayload(int startSequenceNumber, int totalLength, int fragmentLength, int fragmentOffset, byte[] source, ref int offset)
private void HandleSegmentedPayload(int startSequenceNumber, int totalLength, int fragmentLength, int fragmentOffset, byte[] source, ref int offset)
{
SegmentedPackage segmentedPackage = GetSegmentedPackage(startSequenceNumber, totalLength);

Expand Down
4 changes: 2 additions & 2 deletions PhotonPackageParser/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.0.0.0")]
[assembly: AssemblyFileVersion("3.0.0.0")]
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0")]

0 comments on commit b64aa67

Please sign in to comment.