BF2MC-Matchmaker
webserver/request/clan.cpp
1 #include <unistd.h>
2 #include <iostream>
3 #include <iomanip>
4 #include <fstream>
5 #include <regex>
6 #include <thread>
7 
8 #include <settings.h>
9 #include <logger.h>
10 #include <server.h>
11 #include <gpcm/client.h>
12 #include <globals.h>
13 #include <database.h>
14 #include <util.h>
15 #include <atomizes.hpp>
16 #include <service/file_system.h>
17 
18 #include <webserver/client.h>
19 
20 void Webserver::Client::requestClanInfo(const atomizes::HTTPMessage& http_request, const std::string& url_base,
21  const Util::Url::Variables& url_variables)
22 {
23  Battlefield::Clan clan;
24  Battlefield::Player player;
25  atomizes::HTTPMessage http_response = this->_defaultResponseHeader();
26  std::string response = "\r\n";
27 
28  // Get player
29  auto it = url_variables.find("profileid");
30  if (it != url_variables.end())
31  {
32  player.SetProfileId(it->second);
33 
34  // Get Clan id
35  g_database->queryClanByProfileId(clan, player);
36  }
37 
38  it = url_variables.find("name");
39  if(it != url_variables.end() && Util::isAscii(it->second))
40  {
41  clan.SetName(it->second);
42  clan.SetTag(it->second);
43 
44  g_database->queryClanByNameOrTag(clan);
45  }
46 
47  it = url_variables.find("clanid");
48  if(it != url_variables.end())
49  {
50  clan.SetClanId(it->second);
51 
52  g_database->queryClanByClanId(clan);
53  }
54 
55  // Get clan ranks information from database
56  g_database->queryClanRanksByClanId(clan);
57 
58  if(clan.GetClanId() != -1)
59  {
60  response = "OK\r\n";
61  response += "clanID," + std::to_string(clan.GetClanId()) + "\r\n";
62  response += "name," + clan.GetName() + "\r\n";
63  response += "tag," + clan.GetTag() + "\r\n";
64  response += "homepage," + clan.GetHomepage() + "\r\n";
65  response += "info," + clan.GetInfo() + "\r\n";
66  response += "region," + std::to_string(clan.GetRegion()) + "\r\n";
67  response += "lastreportdate,69_1337_69\r\n";
68 
69  response += "rating," + std::to_string(clan.GetScore()) + "\r\n";
70  response += "wins," + std::to_string(clan.GetWins()) + "\r\n";
71  response += "losses," + std::to_string(clan.GetLosses()) + "\r\n";
72  response += "draws," + std::to_string(clan.GetDraws()) + "\r\n";
73 
74  response += "membercount," + std::to_string(clan.GetRanks().size()) + "\r\n";
75  }
76 
77  http_response.SetStatusCode(200);
78  http_response.SetMessageBody(response);
79 
80  this->Send(http_response);
81 
82  this->_LogTransaction("<--", "HTTP/1.1 200 OK");
83 }
84 
85 void Webserver::Client::requestClanMembers(const atomizes::HTTPMessage& http_request, const std::string& url_base,
86  const Util::Url::Variables& url_variables)
87 {
88  Battlefield::Clan clan;
89 
90  // Get player
91  auto it = url_variables.find("clanid");
92  if (it != url_variables.end())
93  {
94  clan.SetClanId(it->second);
95  }
96 
97  // Get clan information
98  g_database->queryClanRanksByClanId(clan);
99 
100  // Create response
101  std::string response = "\r\n";
102  if(clan.GetClanId() != -1)
103  {
104  response = "OK\r\n";
105 
106  for (const auto& pair : clan.GetRanks())
107  {
108  response += "\r\n" + std::to_string(pair.first) + "," + std::to_string(static_cast<uint8_t>(pair.second));
109  }
110  }
111 
112  // Create http response
113  atomizes::HTTPMessage http_response = this->_defaultResponseHeader();
114  http_response.SetStatusCode(200);
115  http_response.SetMessageBody(response);
116 
117  this->Send(http_response);
118 
119  this->_LogTransaction("<--", "HTTP/1.1 200 OK");
120 }
121 
122 void Webserver::Client::requestLeaderboard(const atomizes::HTTPMessage& http_request, const std::string& url_base,
123  const Util::Url::Variables& url_variables)
124 {
125  atomizes::HTTPMessage http_response = this->_defaultResponseHeader();
126  std::string response = "\r\n";
127 
128  Battlefield::RankClans rank_clans;
129 
130  auto it = url_variables.find("clanid");
131  if (it != url_variables.end())
132  {
133  Battlefield::Clan clan;
134 
135  clan.SetClanId(it->second);
136 
137  g_database->queryLeaderboardClanByClanId(rank_clans, clan);
138  }
139  else
140  {
141  uint32_t offset = 0;
142  uint32_t limit = 7;
143 
144  it = url_variables.find("startrank");
145  auto it2 = url_variables.find("endrank");
146 
147  if (it != url_variables.end() && it2 != url_variables.end())
148  {
149  try
150  {
151  offset = std::stoul(it->second) - 1;
152  }
153  catch(...) {};
154  }
155 
156  g_database->queryLeaderboardClan(rank_clans, limit, offset);
157  }
158 
159  if(rank_clans.size() > 0)
160  {
161  response = "OK\r\n";
162  for (const auto& pair : rank_clans)
163  {
164  response += std::to_string(pair.second.GetClanId()) + ",";
165  response += std::to_string(pair.first) + ",";
166  response += pair.second.GetTag() + ",";
167  response += pair.second.GetName() + ",";
168  response += std::to_string(pair.second.GetScore()) + ",";
169  response += std::to_string(pair.second.GetWins()) + ",";
170  response += std::to_string(pair.second.GetLosses()) + ",";
171  response += std::to_string(pair.second.GetDraws()) + "\n";
172  }
173  }
174 
175  http_response.SetStatusCode(200);
176  http_response.SetMessageBody(response);
177 
178  this->Send(http_response);
179 
180  this->_LogTransaction("<--", "HTTP/1.1 200 OK");
181 }
182 
183 void Webserver::Client::requestCreateClan(const atomizes::HTTPMessage& http_request, const std::string& url_base,
184  const Util::Url::Variables& url_variables)
185 {
186  atomizes::HTTPMessage http_response = this->_defaultResponseHeader();
187  Battlefield::Clan clan;
188  Battlefield::Player player;
189 
190  // Get clan and player information based of the authtoken
191  this->_GetSessionPlayerAndClan(url_variables, clan, player);
192 
193  // If player can be found and player is not in clan
194  if(player.GetProfileId() != -1 && clan.GetClanId() == -1)
195  {
196  Battlefield::Clan new_clan;
197 
198  // Copy url variables into clan
199  if(this->_updateClanInformation(new_clan, url_variables))
200  {
201  // get clan by name or tag
202  g_database->queryClanByNameOrTag(new_clan);
203 
204  // Check Clan name is not in use
205  if(new_clan.GetClanId() == -1)
206  {
207  // Insert clan in database
208  g_database->insertClan(new_clan);
209 
210  // Make player leader of clan
211  g_database->insertClanRank(new_clan, player, Battlefield::Clan::Ranks::Leader);
212 
213  http_response.SetMessageBody("OK"); // Clan succesfull created!
214  }
215  else
216  {
217  http_response.SetMessageBody("NAMEINUSE"); // Clan name already used
218  }
219  }
220  else
221  {
222  http_response.SetMessageBody("ERROR");
223  }
224  }
225  else
226  {
227  http_response.SetMessageBody("CANTJOIN");
228  }
229 
230  http_response.SetStatusCode(200);
231  //http_response.SetMessageBody("BANNEDWORD"); // Clan name has bad word
232 
233  this->Send(http_response);
234 
235  this->_LogTransaction("<--", "HTTP/1.1 200 OK");
236 }
237 
238 void Webserver::Client::requestUpdateClan(const atomizes::HTTPMessage &http_request, const std::string& url_base,
239  const Util::Url::Variables &url_variables)
240 {
241  atomizes::HTTPMessage http_response = this->_defaultResponseHeader();
242  Battlefield::Clan clan;
243  Battlefield::Player player;
244 
245  // Get clan and player information based of the authtoken
246  this->_GetSessionPlayerAndClan(url_variables, clan, player);
247 
248  // If player can be found and player is in clan
249  if(player.GetProfileId() != -1 && clan.GetClanId() != -1)
250  {
251  // Get clan information
252  g_database->queryClanByClanId(clan);
253 
254  // Get all ranks in clan
255  g_database->queryClanRanksByClanId(clan);
256 
257  Battlefield::Clan::Ranks rank = clan.GetRank(player.GetProfileId());
258 
259  // If rank is clan leader
261  {
262  // Copy url variables into clan
263  if(this->_updateClanInformation(clan, url_variables, true))
264  {
265  Battlefield::Clan check_clan;
266 
267  check_clan.SetTag(clan.GetTag());
268 
269  g_database->queryClanByNameOrTag(check_clan);
270 
271  if(check_clan.GetClanId() == -1 || // New clan tag is not been used yet
272  check_clan.GetClanId() == clan.GetClanId() // Or clan tag is owned by its own
273  )
274  {
275  // Insert clan in database
276  g_database->updateClan(clan);
277 
278  http_response.SetMessageBody("OK");
279  }
280  else
281  {
282  http_response.SetMessageBody("ERROR");
283  }
284  }
285  else
286  {
287  http_response.SetMessageBody("ERROR");
288  }
289  }
290  else
291  {
292  http_response.SetMessageBody("NOTLEADER");
293  }
294  }
295  else
296  {
297  http_response.SetMessageBody("INVALIDCLAN");
298  }
299 
300  http_response.SetStatusCode(200);
301 
302  this->Send(http_response);
303 
304  this->_LogTransaction("<--", "HTTP/1.1 200 OK");
305 }
306 
307 void Webserver::Client::requestDisband(const atomizes::HTTPMessage& http_request, const std::string& url_base,
308  const Util::Url::Variables& url_variables)
309 {
310  atomizes::HTTPMessage http_response = this->_defaultResponseHeader();
311  Battlefield::Clan clan;
312  Battlefield::Player player;
313 
314  // Get clan and player information based of the authtoken
315  this->_GetSessionPlayerAndClan(url_variables, clan, player);
316 
317  // If player can be found and player is in a clan
318  if(player.GetProfileId() != -1 && clan.GetClanId() != -1)
319  {
320  // Get all ranks in clan
321  g_database->queryClanRanksByClanId(clan);
322 
323  Battlefield::Clan::Ranks rank = clan.GetRank(player.GetProfileId());
324 
325  // If rank is clan leader
327  {
328  // Remove all clan ranks
329  g_database->removeClanRanksByClanId(clan);
330 
331  // remove clan
332  g_database->disableClan(clan);
333 
334  http_response.SetMessageBody("OK");
335  }
336  else
337  {
338  http_response.SetMessageBody("NOTLEADER");
339  }
340  }
341  else
342  {
343  http_response.SetMessageBody("INVALIDCLAN");
344  }
345 
346  http_response.SetStatusCode(200);
347 
348  //http_response.SetMessageBody("OK");
349  //http_response.SetMessageBody("NOTLEADER");
350  //http_response.SetMessageBody("INVALIDCLAN");
351  //http_response.SetMessageBody("ERROR");
352 
353  this->Send(http_response);
354 
355  this->_LogTransaction("<--", "HTTP/1.1 200 OK");
356 }
357 
358 void Webserver::Client::requestChangeRank(const atomizes::HTTPMessage& http_request, const std::string& url_base,
359  const Util::Url::Variables& url_variables)
360 {
361  atomizes::HTTPMessage http_response = this->_defaultResponseHeader();
362  Battlefield::Clan clan;
363  Battlefield::Player player;
364 
365  // Get clan and player information based of the authtoken
366  this->_GetSessionPlayerAndClan(url_variables, clan, player);
367 
368  // If player can be found and player is in a clan
369  if(player.GetProfileId() != -1 && clan.GetClanId() != -1)
370  {
371  Battlefield::Player target_player;
372  Battlefield::Clan target_clan;
373 
374  // Get target player
375  auto it = url_variables.find("profileid");
376  if (it != url_variables.end())
377  {
378  target_player.SetProfileId(it->second);
379  }
380 
381  // Get target player information
382  g_database->queryClanByProfileId(target_clan, target_player);
383 
384  // Get new rank
386 
387  // Convert url variable rank
388  auto it2 = url_variables.find("rank");
389  if (it2 != url_variables.end())
390  {
391  new_rank = clan.convertRank(it2->second);
392  }
393 
394  // Check target player
395  if(
396  target_player.GetProfileId() != -1 && // Valid target player profileid must be supplied
397  target_clan.GetClanId() != -1 && // target player must be in a clan
398  clan.GetClanId() == target_clan.GetClanId() && // player and target player must be in the same clan
400  )
401  {
402  // Get all ranks in clan
403  g_database->queryClanRanksByClanId(clan);
404 
405  // Get clan ranks
406  Battlefield::Clan::Ranks rank = clan.GetRank(player.GetProfileId());
407  Battlefield::Clan::Ranks target_rank = clan.GetRank(target_player.GetProfileId());
408 
409  // Check rank is higher
411  {
412  if(new_rank == Battlefield::Clan::Ranks::Leader)
413  {
414  // Demote rank
415  g_database->updateClanRank(clan, player, Battlefield::Clan::Ranks::Co_Leader);
416  }
417 
418  // give target player new rank
419  g_database->updateClanRank(clan, target_player, new_rank);
420 
421  // Send to the invited player a Clan update call
423  player.GetProfileId(),
424  target_player.GetProfileId(),
425  "1",
426  "BFMCC-UPDATE "
427  );
428 
429  http_response.SetMessageBody("OK");
430  }
431  else
432  {
433  http_response.SetMessageBody("NOTLEADER");
434  }
435  }
436  else
437  {
438  http_response.SetMessageBody("ERROR");
439  }
440  }
441  else
442  {
443  http_response.SetMessageBody("INVALIDCLAN");
444  }
445 
446  http_response.SetStatusCode(200);
447 
448  //http_response.SetMessageBody("OK");
449  //http_response.SetMessageBody("NOTMEMBER");
450  //http_response.SetMessageBody("NOTLEADER");
451  //http_response.SetMessageBody("INVALIDCLAN");
452  //http_response.SetMessageBody("ERROR");
453 
454  this->Send(http_response);
455 
456  this->_LogTransaction("<--", "HTTP/1.1 200 OK");
457 }
458 
459 void Webserver::Client::requestAddMember(const atomizes::HTTPMessage& http_request, const std::string& url_base,
460  const Util::Url::Variables& url_variables)
461 {
462  atomizes::HTTPMessage http_response = this->_defaultResponseHeader();
463  Battlefield::Clan clan;
464  Battlefield::Player player;
465 
466  // Get clan and player information based of the authtoken
467  this->_GetSessionPlayerAndClan(url_variables, clan, player);
468 
469  // If player can be found and player is in a clan
470  if(player.GetProfileId() != -1 || clan.GetClanId() != -1)
471  {
472  // Get all ranks in clan
473  g_database->queryClanRanksByClanId(clan);
474 
475  Battlefield::Clan::Ranks rank = clan.GetRank(player.GetProfileId());
476 
477  // If the player rank is not Co-Leader or higher
479  {
480  Battlefield::Player target_player;
481  Battlefield::Clan target_clan;
482 
483  auto it = url_variables.find("profileid");
484  if (it != url_variables.end())
485  {
486  target_player.SetProfileId(it->second);
487  }
488 
489  if(target_player.GetProfileId() != -1)
490  {
491  // Get target clan
492  g_database->queryClanByProfileId(target_clan, target_player);
493 
494  // Check if target player is already in a clan
495  if(target_clan.GetClanId() != -1)
496  {
497  // Remove target player from old clan
498  g_database->removeClanRank(target_clan, target_player);
499  }
500 
501  // Add target player to clan
502  g_database->insertClanRank(clan, target_player, Battlefield::Clan::Ranks::Member);
503 
504  // Send to the accepted clan member a clan update call
506  player.GetProfileId(),
507  target_player.GetProfileId(),
508  "1",
509  "BFMCC-UPDATE "
510  );
511 
512  http_response.SetMessageBody("OK");
513  }
514  else
515  {
516  http_response.SetMessageBody("ERROR");
517  }
518  }
519  else
520  {
521  http_response.SetMessageBody("NOTLEADER");
522  }
523  }
524  else
525  {
526  http_response.SetMessageBody("INVALIDCLAN");
527  }
528 
529  http_response.SetStatusCode(200);
530 
531  this->Send(http_response);
532 
533  this->_LogTransaction("<--", "HTTP/1.1 200 OK");
534 }
535 
536 void Webserver::Client::requestDeleteMember(const atomizes::HTTPMessage& http_request, const std::string& url_base,
537  const Util::Url::Variables& url_variables)
538 {
539  atomizes::HTTPMessage http_response = this->_defaultResponseHeader();
540  Battlefield::Clan clan;
541  Battlefield::Player player;
542 
543  // Get clan and player information based of the authtoken
544  this->_GetSessionPlayerAndClan(url_variables, clan, player);
545 
546  // If player cant be found or player is not in clan
547  if(player.GetProfileId() != -1 && clan.GetClanId() != -1)
548  {
549  Battlefield::Player target_player;
550  Battlefield::Clan target_clan;
551 
552  // Get target player
553  auto it = url_variables.find("profileid");
554  if (it != url_variables.end())
555  {
556  target_player.SetProfileId(it->second);
557  }
558 
559  // Get target player information
560  g_database->queryClanByProfileId(target_clan, target_player);
561 
562  // Check target player
563  if(
564  target_player.GetProfileId() != -1 && // Valid target player profileid must be supplied
565  target_clan.GetClanId() != -1 && // target player must be in a clan
566  clan.GetClanId() == target_clan.GetClanId() // player and target player must be in the same clan
567  )
568  {
569  // Get all ranks in clan
570  g_database->queryClanRanksByClanId(clan);
571 
572  // Get clan ranks
573  Battlefield::Clan::Ranks rank = clan.GetRank(player.GetProfileId());
574  Battlefield::Clan::Ranks target_rank = clan.GetRank(target_player.GetProfileId());
575 
576  // Check rank is higher or it tries to remove itself as a none leader. Leader can only disband clan.
577  if(
578  rank < target_rank ||
579  (
580  player.GetProfileId() == target_player.GetProfileId() &&
582  )
583  )
584  {
585  // Remove player from clan
586  g_database->removeClanRank(clan, target_player);
587 
588  if(player.GetProfileId() != target_player.GetProfileId())
589  {
590  // Send to the invited player a Clan update call
592  player.GetProfileId(),
593  target_player.GetProfileId(),
594  "1",
595  "BFMCC-UPDATE "
596  );
597 
598  // Send resignation letter
600  player.GetProfileId(),
601  target_player.GetProfileId(),
602  "1",
603  "You have been removed from the clan."
604  );
605  }
606 
607  http_response.SetMessageBody("OK");
608  }
609  else
610  {
611  http_response.SetMessageBody("NOTLEADER");
612  }
613  }
614  else
615  {
616  http_response.SetMessageBody("ERROR");
617  }
618  }
619  else
620  {
621  http_response.SetMessageBody("INVALIDCLAN");
622  }
623 
624  http_response.SetStatusCode(200);
625  //http_response.SetMessageBody("NOTMEMBER");
626  //http_response.SetMessageBody("NOTLEADER");
627  //http_response.SetMessageBody("LEADER");
628  //http_response.SetMessageBody("INVALIDCLAN");
629  //http_response.SetMessageBody("ERROR");
630 
631  this->Send(http_response);
632 
633  this->_LogTransaction("<--", "HTTP/1.1 200 OK");
634 }
635 
636 void Webserver::Client::requestClanMessage(const atomizes::HTTPMessage& http_request, const std::string& url_base,
637  const Util::Url::Variables& url_variables)
638 {
639  atomizes::HTTPMessage http_response = this->_defaultResponseHeader();
640  Battlefield::Clan clan;
641  Battlefield::Player player;
642 
643  // Get clan and player information based of the authtoken
644  this->_GetSessionPlayerAndClan(url_variables, clan, player);
645 
646  // If player can be found and player is in a clan
647  if(player.GetProfileId() != -1 || clan.GetClanId() != -1)
648  {
649  auto it = url_variables.find("message");
650  if (it != url_variables.end() && Util::isAscii(it->second))
651  {
652  std::string message = it->second;
653 
654  // Get all ranks in clan
655  g_database->queryClanRanksByClanId(clan);
656 
657  std::map<int, Battlefield::Clan::Ranks> ranks = clan.GetRanks();
658  int player_profileid = player.GetProfileId();
659 
660  for(const auto& rank : ranks)
661  {
662  if(player_profileid != rank.first)
663  {
664  GPCM::Client::SendBuddyMessage(player_profileid, rank.first, "1", "Clan message: " + message);
665  }
666  }
667 
668  http_response.SetMessageBody("OK");
669  }
670  else
671  {
672  http_response.SetMessageBody("ERROR");
673  }
674  }
675  else
676  {
677  http_response.SetMessageBody("INVALIDCLAN");
678  }
679 
680  http_response.SetStatusCode(200);
681  //http_response.SetMessageBody("INVALIDCLAN");
682  //http_response.SetMessageBody("ERROR");
683 
684  this->Send(http_response);
685 
686  this->_LogTransaction("<--", "HTTP/1.1 200 OK");
687 }
688 
Represents a clan in the Battlefield game.
Definition: clan.h:54
static Ranks convertRank(const std::string &rank)
Converts a string representation of a rank to its corresponding enum value.
Ranks
Represents the ranks within a clan.
Definition: clan.h:77
Represents a player with extended statistics.
Definition: player.h:38
bool removeClanRank(const Battlefield::Clan &clan, const Battlefield::Player &player)
Removes the rank of a player within a clan from the database.
Definition: clan_rank.cpp:181
bool updateClan(const Battlefield::Clan &clan)
Updates a clan in the database.
bool updateClanRank(const Battlefield::Clan &clan, const Battlefield::Player &player, Battlefield::Clan::Ranks rank)
Updates the rank of a player within a clan in the database.
Definition: clan_rank.cpp:128
bool queryClanByClanId(Battlefield::Clan &clan)
Queries a clan by its clan ID.
bool queryClanByNameOrTag(Battlefield::Clan &clan)
Queries a clan by its name or tag.
bool removeClanRanksByClanId(const Battlefield::Clan &clan)
Removes all ranks associated with a clan from the database.
Definition: clan_rank.cpp:228
bool queryClanRanksByClanId(Battlefield::Clan &clan)
Queries the ranks of a clan by its clan ID.
Definition: clan_rank.cpp:10
bool queryLeaderboardClan(Battlefield::RankClans &rank_clans, uint32_t limit=10, uint32_t offset=0)
Queries clan leaderboard.
bool insertClanRank(const Battlefield::Clan &clan, const Battlefield::Player &player, Battlefield::Clan::Ranks rank)
Inserts a rank for a player within a clan into the database.
Definition: clan_rank.cpp:79
bool queryClanByProfileId(Battlefield::Clan &clan, const Battlefield::Player &player)
Queries a clan by a player's profile ID.
bool insertClan(Battlefield::Clan &clan)
Inserts a clan into the database.
bool disableClan(const Battlefield::Clan &clan)
Disable a clan from the database.
bool queryLeaderboardClanByClanId(Battlefield::RankClans &rank_clans, const Battlefield::Clan &clan)
Queries clan leaderboard by clan ID with the clan in the middle.
static void SendBuddyMessage(int profileid, int target_profileid, const std::string &bm, const std::string &message)
Sends a buddy message from one profile ID to another.
void requestLeaderboard(const atomizes::HTTPMessage &http_request, const std::string &url_base, const Util::Url::Variables &url_variables)
Handle a request to get the leaderboard.
atomizes::HTTPMessage _defaultResponseHeader(bool isPlainText=true) const
Generate the default HTTP response header.
void requestClanInfo(const atomizes::HTTPMessage &http_request, const std::string &url_base, const Util::Url::Variables &url_variables)
Handle a request to get clan information.
void requestAddMember(const atomizes::HTTPMessage &http_request, const std::string &url_base, const Util::Url::Variables &url_variables)
Handle a request to add a member to a clan.
void requestChangeRank(const atomizes::HTTPMessage &http_request, const std::string &url_base, const Util::Url::Variables &url_variables)
Handle a request to change a member's rank in a clan.
void requestClanMembers(const atomizes::HTTPMessage &http_request, const std::string &url_base, const Util::Url::Variables &url_variables)
Handle a request to get clan members.
void requestUpdateClan(const atomizes::HTTPMessage &http_request, const std::string &url_base, const Util::Url::Variables &url_variables)
Handle a request to update a clan.
void requestClanMessage(const atomizes::HTTPMessage &http_request, const std::string &url_base, const Util::Url::Variables &url_variables)
Handle a request for clan messages.
void Send(const atomizes::HTTPMessage &http_response) const
Send an HTTP response.
void requestDeleteMember(const atomizes::HTTPMessage &http_request, const std::string &url_base, const Util::Url::Variables &url_variables)
Handle a request to delete a member from a clan.
void _LogTransaction(const std::string &direction, const std::string &response) const
Log a transaction.
void requestCreateClan(const atomizes::HTTPMessage &http_request, const std::string &url_base, const Util::Url::Variables &url_variables)
Handle a request to create a new clan.
void requestDisband(const atomizes::HTTPMessage &http_request, const std::string &url_base, const Util::Url::Variables &url_variables)
Handle a request to disband a clan.