public static INetworkServerBuilder UseZeroFormatter(this INetworkServerBuilder serverBuilder) { var serviceCollection = serverBuilder.GetServiceCollection(); serviceCollection.AddSingleton <IPacketSerialiser, ZeroFormatterPacketSerialiser>(); return(serverBuilder); }
public static INetworkServerBuilder UseProtobufNet(this INetworkServerBuilder serverBuilder) { var serviceCollection = serverBuilder.GetServiceCollection(); serviceCollection.AddSingleton <IPacketSerialiser, ProtoBufNetSerialiser>(); return(serverBuilder); }