Skip to content

Commit

Permalink
Weaver: update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vis2k committed Apr 8, 2023
1 parent 88170ed commit 20b7e53
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Assets/Mirror/Editor/Weaver/Processors/CommandProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ public static class CommandProcessor
// generates code like:
public void CmdThrust(float thrusting, int spin)
{
NetworkWriter networkWriter = new NetworkWriter();
networkWriter.Write(thrusting);
networkWriter.WritePackedUInt32((uint)spin);
base.SendCommandInternal(cmdName, networkWriter, channel);
NetworkWriterPooled writer = NetworkWriterPool.Get();
writer.Write(thrusting);
writer.WritePackedUInt32((uint)spin);
base.SendCommandInternal(cmdName, cmdHash, writer, channel);
NetworkWriterPool.Return(writer);
}
public void CallCmdThrust(float thrusting, int spin)
Expand Down Expand Up @@ -54,7 +55,7 @@ public static MethodDefinition ProcessCommandCall(WeaverTypes weaverTypes, Write
worker.Emit(OpCodes.Ldstr, md.FullName);
// pass the function hash so we don't have to compute it at runtime
// otherwise each GetStableHash call requires O(N) complexity.
// noticeable for long function names:
// noticeable for long function names:
// https://github.com/MirrorNetworking/Mirror/issues/3375
worker.Emit(OpCodes.Ldc_I4, md.FullName.GetStableHashCode());
// writer
Expand Down

0 comments on commit 20b7e53

Please sign in to comment.