mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-15 06:52:15 -07:00
Fix pbs and some other stuff.
Took 1 hour 5 minutes
This commit is contained in:
parent
01378b8314
commit
408b732854
84 changed files with 181 additions and 172 deletions
14
libs/server/src/get_pb_extension.cpp
Normal file
14
libs/server/src/get_pb_extension.cpp
Normal 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue