Fix pbs and some other stuff.

Took 1 hour 5 minutes
This commit is contained in:
Lukas Brübach 2025-10-04 20:06:57 +02:00
parent 01378b8314
commit 408b732854
84 changed files with 181 additions and 172 deletions

View file

@ -0,0 +1,14 @@
#include "../include/server/get_pb_extension.h"
#include <google/protobuf/descriptor.h>
#include <google/protobuf/message.h>
int getPbExtension(const ::google::protobuf::Message &message)
{
std::vector<const ::google::protobuf::FieldDescriptor *> fieldList;
message.GetReflection()->ListFields(message, &fieldList);
for (unsigned int j = 0; j < fieldList.size(); ++j)
if (fieldList[j]->is_extension())
return fieldList[j]->number();
return -1;
}