Hi all,
For the most part I have been able to inherit or extend the functionality of TNet quite well without any upgrade issues each time a new version comes out.
However, I have two areas that are problematic.
1) Custom packets in the Packet enum
I'm implementing a couple custom packets for authentication in my game, and I've upgraded to the latest TNet 3 with the same issues each time. The main problem is that onCustomerPacket delegate requires Packet as part of the parameters, so ultimately to get any custom packets, I have to modify TNPacket.cs and add my own packets at the end of the list.
But when I update TNet and copy over all the files, I have to overwrite TNPacket.cs, which means I lose my changes there.
I noticed that TcpProtocol has two versions of BeginSend() - one that takes Packet and one that takes byte.
I'm wondering if it would be possible to change the onCustomerPacket delegate to use byte instead of Packet, that way I can implement my own custom packet enum separately like this:
public enum CustomPacket : byte
{
UserPacket = (byte)TNet.Packet.UserPacket,
RequestSignin,
ResponseSignin,
}
2) Private vs. Protected members in GameServer
There are several lists / dictionaries inside TNet.GameServer that I want to get access to. In my case, I've inherited GameServer and want to add a readonly count of channels very similar to the playerCount property on GameServer. But mChannelList is private, so I can't do that. Is there a better way to get this data? Or would it be possible to change the scope of mPlayerList, mPlayerDict, mChannelList, and mChannelDict to protected?
Thanks,
Matt