Closed LouYu2015 closed 6 years ago
Also, removing all of the testing-related DLL/XML files would probably be best, since we probably can't actually host them with the license on this repository.
If we do remove those files, what does someone need to do after cloning the repository to make everything work again?
I found that VS can automatically restore packages
folder if I delete UnitTest\bin
. Maybe the reason why it failed previously is that VS won't rebuild packages
folder if UnitTest\bin
exists. Now we can safely remove the files in it. However, I may need to copy codes to another branch so that those files won't show up in the history (they will remain in this branch's history even if I delete them).
I successfully removed the history of packages
folder by using filter-branch
. Now we can keep this branch.
Revision is pushed to the branch: https://github.com/huskyroboticsteam/Scarlet/pull/1/commits/9503196e409e439ed8c9d4d80e31fb9289b00551
I also just went through and made a lot of style-related changes (no functional changes should have been made). The big two things that I saw were omitting this.
. We like to use this.
for all field accessors/assignments to make it clear that it's a field, and hopefully reduce the number of times we accidentally type the wrong variable.
The other thing was just various spacing changes. Bringing blocks into single lines, and reducing the amount of wasted space in comments. With these changes, I reduced the linecount by almost 100 lines, while (in my opinion) making things more readable.
Have a look at the kinds of changes that I made, so that you can keep them in mind for future changes.
@Baldstrom We should probably better define our style guidelines for things like this, to help others understand what we expect. Right now, our documentation is a bit lacking in that department, and we will need to make it more clear if we have more people contributing.
Unit test passed after merging. However, there is a minor issue: there are two entries of .vs
in .gitignore
now.
Summary:
PacketBuffer.cs
Client
andServer
Communications
inCommunications/PacketBuffer.cs
:PacketBuffer
QueueBuffer
PriorityBuffer
BandwidthControlBuffer
GenericController
Communications.Packet
inCommunication/Packet.cs
:GetLength
Communications.Client
inCommunications/Client.cs
:DefaultPriority
SendQueue
fromQueue<Packet>
toPacketBuffer
ReceiveQueue
fromQueue<Packet>
toQueueBuffer
Start
has new optional parameterUsePriorityQueue
Send
has new optional parameterPriority
Send
will returnfalse
if the packet is not added to queueSendPackets
won't clone packet because packet is already cloned before adding to buffer.Communications.Server
inCommunications/Server.cs
:PriorityQueueEnabled
DefaultPriority
SendQueues
fromDictionary<string, Queue<Packet>>
toDictionary<string, PacketBuffer>
ReceiveQueue
fromQueue<Packet>
toQueueBuffer
Start
has new optional parameterUsePriorityQueue
Send
has new optional parameterPriority
CreateBufferIfClientIsNew
Communications
inCommunications/Constants.cs
:PacketPriority