1
This commit is contained in:
parent
ee6b7fdd7f
commit
3e86b80f1b
@ -18,6 +18,7 @@
|
|||||||
#include "handlermgr.h"
|
#include "handlermgr.h"
|
||||||
#include "perfmonitor.h"
|
#include "perfmonitor.h"
|
||||||
#include "metamgr.h"
|
#include "metamgr.h"
|
||||||
|
#include "textmgr.h"
|
||||||
|
|
||||||
#include "framework/cpp/msgqueue.h"
|
#include "framework/cpp/msgqueue.h"
|
||||||
#include "framework/cpp/tglog.h"
|
#include "framework/cpp/tglog.h"
|
||||||
@ -79,6 +80,7 @@ void App::Init(int argc, char* argv[])
|
|||||||
GCListener::Instance()->Init();
|
GCListener::Instance()->Init();
|
||||||
uuid.SetMachineId(instance_id);
|
uuid.SetMachineId(instance_id);
|
||||||
MetaMgr::Instance()->Init();
|
MetaMgr::Instance()->Init();
|
||||||
|
TextMgr::Instance()->Init();
|
||||||
|
|
||||||
a8::UdpLog::Instance()->Info("rankserver starting instance_id:%d pid:%d", {instance_id, getpid()});
|
a8::UdpLog::Instance()->Info("rankserver starting instance_id:%d pid:%d", {instance_id, getpid()});
|
||||||
}
|
}
|
||||||
@ -88,6 +90,7 @@ void App::UnInit()
|
|||||||
if (terminated) {
|
if (terminated) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
TextMgr::Instance()->UnInit();
|
||||||
GCListener::Instance()->UnInit();
|
GCListener::Instance()->UnInit();
|
||||||
MetaMgr::Instance()->UnInit();
|
MetaMgr::Instance()->UnInit();
|
||||||
JsonDataMgr::Instance()->UnInit();
|
JsonDataMgr::Instance()->UnInit();
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
#include "app.h"
|
#include "app.h"
|
||||||
#include "perfmonitor.h"
|
#include "perfmonitor.h"
|
||||||
#include "GCListener.h"
|
#include "GCListener.h"
|
||||||
|
#include "textmgr.h"
|
||||||
|
|
||||||
static void _GMOpsSelfChecking(f8::JsonHttpRequest* request)
|
static void _GMOpsSelfChecking(f8::JsonHttpRequest* request)
|
||||||
{
|
{
|
||||||
@ -29,6 +30,27 @@ void HandlerMgr::Init()
|
|||||||
RegisterNetMsgHandlers();
|
RegisterNetMsgHandlers();
|
||||||
RegisterGMMsgHandler("Ops@selfChecking", _GMOpsSelfChecking);
|
RegisterGMMsgHandler("Ops@selfChecking", _GMOpsSelfChecking);
|
||||||
RegisterGMMsgHandler("Ops@reload", _GMOpsReload);
|
RegisterGMMsgHandler("Ops@reload", _GMOpsReload);
|
||||||
|
RegisterGMMsgHandler("TextService@dirtyWordCheck",
|
||||||
|
[] (f8::JsonHttpRequest* request)
|
||||||
|
{
|
||||||
|
TextMgr::Instance()->__DirtyWordCheck(request);
|
||||||
|
});
|
||||||
|
RegisterGMMsgHandler("TextService@dirtyWordReplace",
|
||||||
|
[] (f8::JsonHttpRequest* request)
|
||||||
|
{
|
||||||
|
TextMgr::Instance()->__DirtyWordReplace(request);
|
||||||
|
});
|
||||||
|
RegisterGMMsgHandler("TextService@randName",
|
||||||
|
[] (f8::JsonHttpRequest* request)
|
||||||
|
{
|
||||||
|
TextMgr::Instance()->__RandName(request);
|
||||||
|
});
|
||||||
|
RegisterGMMsgHandler("TextService@isValidName",
|
||||||
|
[] (f8::JsonHttpRequest* request)
|
||||||
|
{
|
||||||
|
TextMgr::Instance()->__IsValidName(request);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandlerMgr::UnInit()
|
void HandlerMgr::UnInit()
|
||||||
|
45
server/textserver/textmgr.cc
Normal file
45
server/textserver/textmgr.cc
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
#include "precompile.h"
|
||||||
|
|
||||||
|
#include <a8/udplog.h>
|
||||||
|
#include <a8/timer.h>
|
||||||
|
#include <a8/openssl.h>
|
||||||
|
|
||||||
|
#include "typeconvert.h"
|
||||||
|
#include "app.h"
|
||||||
|
#include "jsondatamgr.h"
|
||||||
|
#include "GCListener.h"
|
||||||
|
#include "metamgr.h"
|
||||||
|
#include "textmgr.h"
|
||||||
|
|
||||||
|
#include "framework/cpp/utils.h"
|
||||||
|
#include "framework/cpp/channel.h"
|
||||||
|
|
||||||
|
void TextMgr::Init()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextMgr::UnInit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextMgr::__DirtyWordCheck(f8::JsonHttpRequest* request)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextMgr::__DirtyWordReplace(f8::JsonHttpRequest* request)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextMgr::__RandName(f8::JsonHttpRequest* request)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextMgr::__IsValidName(f8::JsonHttpRequest* request)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
25
server/textserver/textmgr.h
Normal file
25
server/textserver/textmgr.h
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <a8/timer_attacher.h>
|
||||||
|
|
||||||
|
struct timer_list;
|
||||||
|
class TextMgr : public a8::Singleton<TextMgr>
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
TextMgr() {};
|
||||||
|
friend class a8::Singleton<TextMgr>;
|
||||||
|
|
||||||
|
public:
|
||||||
|
void Init();
|
||||||
|
void UnInit();
|
||||||
|
|
||||||
|
void __DirtyWordCheck(f8::JsonHttpRequest* request);
|
||||||
|
void __DirtyWordReplace(f8::JsonHttpRequest* request);
|
||||||
|
void __RandName(f8::JsonHttpRequest* request);
|
||||||
|
void __IsValidName(f8::JsonHttpRequest* request);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
private:
|
||||||
|
a8::TimerAttacher timer_attacher_;
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user