62 rs.header.push_back(
"certificateID" );
63 rs.header.push_back(
"grantDate" );
64 rs.header.push_back(
"visibilityFlags" );
66 for (
auto cur : crt) {
70 fieldData->
AddItemInt( cur.second.visibilityFlags );
71 rs.lines->AddItem( fieldData );
82 codelog(SERVICE__ERROR,
"Failed to load cache, generating empty contents.");
89 PyResult CertificateMgrService::Handle_GetAllShipCertificateRecommendations(
PyCallArgs &call) {
95 codelog(SERVICE__ERROR,
"Failed to load cache, generating empty contents.");
108 codelog(SERVICE__ERROR,
"Failed to load cache, generating empty contents.");
116 Call_SingleIntegerArg arg;
117 if (!arg.Decode(&call.
tuple)) {
118 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
127 Call_TwoIntegerArgs arg;
128 if (!arg.Decode(&call.
tuple)) {
129 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
138 Call_SingleIntList arg;
139 if (!arg.Decode(&call.
tuple)) {
140 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
146 std::vector<int32>::iterator itr = arg.ints.begin();
147 for (; itr != arg.ints.end(); ++itr) {
155 Call_BatchCertificateUpdate
args;
156 if (!args.Decode(&call.
tuple)) {
157 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
162 std::map<uint32, uint32>::iterator itr = args.update.begin();
163 for (; itr != args.update.end(); ++itr)
170 Call_SingleIntegerArg arg;
171 if (!arg.Decode(&call.
tuple)) {
172 _log(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
177 sItemFactory.GetCharacter(arg.arg)->GetCertificates(crt);
181 rs.header.push_back(
"grantDate");
182 rs.header.push_back(
"certificateID");
183 rs.header.push_back(
"visibilityFlags");
185 for (
auto cur : crt) {
188 fieldData->
AddItemInt( cur.second.certificateID );
189 fieldData->
AddItemInt( cur.second.visibilityFlags );
190 rs.lines->AddItem( fieldData );
Dispatcher *const m_dispatch
PyRep * GetAllShipCertificateRecommendations()
#define _log(type, fmt,...)
PyCallable_Make_InnerDispatcher(CertificateMgrService) CertificateMgrService
PyRep * GetCertificateClasses()
void GetCertificates(CertMap &crt)
Dispatcher *const m_dispatch
void UpdateCertificate(uint32 certificateID, bool pub)
CharacterRef GetChar() const
const char * GetName() const
std::map< uint16, CharCerts > CertMap
#define codelog(type, fmt,...)
PyServiceMgr *const m_manager
void AddItemInt(int32 intval)
PyRep * GetCertificateCategories()
#define PyCallable_REG_CALL(c, m)
void GiveCache(const PyRep *objectID, PyRep **contents)
void GrantCertificate(uint32 certificateID)
ObjCacheService * cache_service
void AddItemLong(int64 intval)
PyObject * MakeObjectCachedMethodCallResult(const PyRep *objectID, const char *versionCheck="run")
bool IsCacheLoaded(const PyRep *objectID) const