public KcpPeerBase(PeerContext pc) : base(pc) { this.pc = pc; //kcp create放在这里比较合适 if (kcp == null) { throw new NullReferenceException("kcp codec lost"); } realsend = new k.d_output(udp_output); pc.EncoderData->output = Marshal.GetFunctionPointerForDelegate(realsend); }
protected override void BuildCodecsBeforePlayerCreated(PeerContext x) { DebugLog($"kcp {nameof(BuildCodecsBeforePlayerCreated)}"); x.Codec = new Codec.KcpCodecEx(x); }
public KcpPeerEx(PeerContext pc) : base(pc) { }