gauthd
 
Loading...
Searching...
No Matches
D:/pwsrc2.0/docs/gauthd/addcash_re.hpp
Go to the documentation of this file.
1
8
9 #ifndef __GNET_ADDCASH_RE_HPP
10 #define __GNET_ADDCASH_RE_HPP
11
12 #include "rpcdefs.h"
13 #include "callid.hxx"
14 #include "state.hxx"
15
16 namespace GNET
17 {
18
26 class AddCash_Re : public GNET::Protocol
27 {
28 // Включаем автоматически сгенерированные поля (userid, retcode, zoneid, sn и др.)
29 #include "addcash_re"
30
31 private:
37 void SendFailCash()
38 {
39 printf("AddCash_Re::SendFailCash: userid = %d \n", userid);
41 int idx = db->GetCashUser(userid);
42 db->DelCashUser(idx);
43 }
44
45 public:
54 void Process(Manager *manager, Manager::Session::ID sid)
55 {
56 if(retcode != 0) {
57 SendFailCash();
58 return;
59 }
60
62 int idx = db->GetCashUser(userid);
63 int cash = db->GetCashCash(idx);
64 int point = db->GetCashPoint(idx);
65 char * creatime = db->GetCashCreaTime(idx);
66
67 db->AddCashLog(userid, zoneid, sn, db->GetAid(), point, cash, 1, creatime);
68 db->DelUseCashNow(1, userid, sn);
69 db->DelCashUser(idx);
70 }
71 };
72
73 };
74
75 #endif
Основной класс для работы с MySQL базой данных
void DelCashUser(int idx)
bool DelUseCashNow(int status, int uid, int sn)
Удаление записи из usecashnow.
bool AddCashLog(int uid, int zoneid, int sn, int aid, int point, int cash, int status, char *creatime)
Добавление записи в лог операций с наличностью
char GetAid()
Получить ID приложения
int GetCashPoint(int idx)
static GMysqlClient * GetInstance()
Получить экземпляр класса (Singleton)
int GetCashCash(int idx)
int GetCashUser(int userid)
char * GetCashCreaTime(int idx)
Класс протокола для обработки ответов на операции пополнения игровой валюты.
void Process(Manager *manager, Manager::Session::ID sid)
Основной метод обработки протокола.
Основное пространство имен для сетевых компонентов системы.