public RemoteConnection(IConnection underlyingConnection, IHeliosConnectionHandler handler) : base(underlyingConnection) { _msgDecoder = new MsgDecoder(); _msgEncoder = new MsgEncoder(); _protobufDecoder = new ProtobufDecoder(TCP.Wrapper.DefaultInstance); _handler = handler; }
void Awake() { ExtensionRegistry registry = ExtensionRegistry.CreateInstance(); registry.Add(ProtobufMsgEnterGame.MsgEnterGame); registry.Add(ProtobufMsgLogin.MsgLogin); registry.Add(MsgBuyItem.msgBuyItem); _decoder = new ProtobufDecoder(ServerMessage.DefaultInstance, registry); }