|
|
virtual | ~actor_testlua ()=default |
| | 析构函数
|
| virtual void | init () |
| | 初始化Lua测试Actor,绑定testlua数据库组件
|
| virtual void | erase_actor_before () |
| | Actor移除前的清理钩子
|
| virtual void | loaddb_finish (pbdb::ENUM_DB atype, enum_dbstat astat) |
| | 数据库加载完成回调
|
| bool | handle (const message< mforward< pbnet::PROBUFF_NET_TESTLUA > > &adata) |
| | 处理Lua网络测试消息转发
|
| template<typename TDerived> |
| void | init_rfun () |
| | 初始化消息分发器。
|
| | actor (const actorparm &aparm) |
| | 构造函数。
|
| actor_stat | activity_stat () final |
| | 获取调度器可见的生命周期状态。
|
| void | set_activity_stat (actor_stat astat) final |
| | 更新调度器可见的生命周期状态。
|
| void | release () final |
| | 停止actor,排空队列中的工作,并持久化DB支持的状态。
|
| bool | list_empty () final |
| | 检查普通队列和优先级队列是否都为空。
|
| bool | pending_empty () final |
| | 检查高优先级队列是否为空
|
| bool | high_empty () final |
| | 检查优先级队列是否为空。
|
| std::optional< int32_t > | hight_value () |
| | 获取当前最高优先级值。
|
| bool | push (handle_pram &apram) final |
| | 将传入任务入队到相应的优先级队列。
|
| bool | actor_handle (i32_threadid athreadid) final |
| | 在指定的工作线程上运行一个调度切片。
|
| template<typename T> |
| bool | ahandle (const std::shared_ptr< T > &aparm) |
| | 处理类型化消息。
|
| bool | ahandle (i32_threadid athreadid, handle_pram &aparm) |
| | 处理消息队列中的消息。
|
| virtual void | broadcast () |
| | 广播消息处理钩子。
|
| bool | handle_broadcast (const message< np_actor_broadcast > &adata) |
| | 合成广播消息的内部入口点。
|
| bool | handle_close (const message< np_actor_close > &) |
| | 合成关闭消息的内部入口点。
|
| template<typename TMESSAGE> |
| bool | handle_script (const message< TMESSAGE > &adata) |
| | 将类型化消息转发到附加的脚本运行时。
|
| | actor_base (const actorparmbase &aparm) |
| | Actor基类构造函数
|
|
nready & | ready () |
|
std::unique_ptr< nmanage_dbclient > & | manage_dbclient () |
|
void | set_db_component (ndb_component *acomponent) |
|
void | db_component_init_data () |
|
void | init_db_component (bool acreate) |
|
void | add_dbclient (ndbclient_base *adbclient, i64_actorid aid) |
|
template<pbdb::ENUM_DB DBTYPE, typename TDBTAB, typename TACTOR> |
| bool | handle_db (const message< np_actordb_load_response< DBTYPE, TDBTAB > > &adata) |
| virtual void | handle_after (handle_pram &) |
|
virtual void | save () |
|
bool | is_single () const |
|
const nguid & | guid () const |
|
i64_actorid | id_guid () const |
|
i32_actordataid | id () const |
|
i16_area | area () const |
|
ENUM_ACTOR | type () const |
|
virtual void | erase_actor () |
| | 从actor_manage中注销并销毁此Actor
|
|
bool | nscript_using () const |
|
bool | nscript_db_loadfinish () const |
|
template<typename T> |
| bool | nscript_data_push (const char *asource, const T &adata, bool aedit) |
|
template<typename T> |
| bool | nscript_data_del (int64_t adataid) |
|
template<typename T> |
| bool | nscript_data_checkout (int64_t adataid, T &adata) |
|
template<typename T> |
| bool | nscript_data_checkout (std::map< int64_t, T > &adata) |
|
template<typename T> |
| bool | nscript_data_checkdel (int64_t adataid) |
|
template<typename T> |
| bool | nscript_data_checkdel (std::vector< int64_t > &adeldata) |
|
template<typename T> |
| bool | nscript_handle (const T &adata) |
|
void | kcp_setindex (i32_serverid aserverid, pbnet::ENUM_KCP aenum, i16_port akcpindex) |
|
std::optional< i16_port > | kcp_index (i32_serverid aserverid, pbnet::ENUM_KCP aenum) |
|
std::optional< i16_port > | kcp_index (int16_t aservertid, int16_t atcount, pbnet::ENUM_KCP aenum) |
|
bool | kcp_connect (i16_port auport, const std::string &aip, i16_port aprot, i64_actorid aactoridserver, std::string &akcpsession) const |
| int64_t | set_timer (const np_timerparm &aparm) |
| | 为当前Actor设置定时器
|
|
bool | isbroadcast () const |
|
void | set_broadcast (bool aisbroadcast) |
|
template<typename T> |
| void | handle_print (const message< T > &adata) const |
|
|
static void | create () |
| | 创建actor_testlua单例实例
|
| static ENUM_ACTOR | actor_type () |
| | 获取Actor类型枚举值
|
| static i64_actorid | actorid () |
| | 生成Lua测试Actor的唯一ActorID
|
|
static void | nregister () |
| | 注册Lua脚本消息处理器
|
| template<typename TDerived> |
| static void | register_timer (Tfun< TDerived, np_timerparm > afun=&TDerived::timer_handle) |
| | 注册定时器回调函数。
|
| template<typename TDerived, typename T> |
| static void | register_actor_s (const std::function< void(TDerived *, const message< T > &)> &afun) |
| | 注册基于std::function的消息处理器。
|
| template<typename TDerived, typename ... ARG> |
| static void | register_actor (ARG... afun) |
| | 注册一个或多个强类型消息处理器。
|
| template<typename TDerived, typename T> |
| static void | register_actornonet (const Tfun< TDerived, T > afun) |
| | 注册本地专用消息处理器(不来自网络协议分发)。
|
| template<typename TDerived, typename ... ARG> |
| static void | register_handle () |
| | 注册TDerived::handle作为消息处理器。
|
| template<typename TDerived, typename ... ARG> |
| static void | register_script_handle () |
| | 注册脚本支持的消息处理器。
|
| template<typename TDerived, typename ... ARG> |
| static void | register_forward_c2g () |
| | 注册客户端到网关的转发处理器。
|
| template<typename TDerived, typename ... ARG> |
| static void | register_forward_g2c () |
| | 注册网关到客户端的转发处理器。
|
| template<typename TDerived, ENUM_ACTOR ACTOR, typename ... ARG> |
| static void | register_secondary_forward_c2g () |
| | 注册中继actor的二级转发辅助器。
|
|
static void | erase_actor (const nguid &aguid) |
|
static std::shared_ptr< pack > | jsonpack (const std::string &apbname, const std::string &ajson, i64_actorid aactorid, i64_actorid arequestactorid, bool ahead=false) |
|
template<typename T> |
| static std::shared_ptr< pack > | net_pack (T &adata, i64_actorid aactorid, i64_actorid arequestactorid, bool ahead=false) |
|
static bool | send_pack (i32_sessionid asession, std::shared_ptr< pack > &apack) |
|
template<typename T> |
| static bool | send (i32_sessionid asession, const T &adata, i64_actorid aactorid, i64_actorid arequestactorid) |
|
template<typename T> |
| static bool | send_server (i32_serverid aserverid, const T &adata, i64_actorid aactorid, i64_actorid arequestactorid) |
|
template<typename T> |
| static bool | send_server (const std::set< i32_serverid > &aserverids, const T &adata, i64_actorid aactorid, i64_actorid arequestactorid) |
|
static bool | send_server (i32_serverid aserverid, std::shared_ptr< pack > &apack) |
|
static bool | kcp_sendpack (i64_actorid aactorid, std::shared_ptr< pack > &adata, i16_port auport=0) |
|
static bool | kcp_sendpack (const std::set< i64_actorid > &aactorids, std::shared_ptr< pack > &adata, i16_port auport=0) |
| template<typename T> |
| static bool | kcp_send (i64_actorid aactorid, const T &adata, i16_port auport=0) |
| | 向单个Actor发送KCP数据(actor_base模板实现)。
|
| template<typename T> |
| static bool | kcp_send (const std::set< i64_actorid > &aactorids, const T &adata, i16_port auport=0) |
| | 向一组Actor广播KCP数据(actor_base模板实现)。
|
|
static i64_actorid | actorclient_guid () |
|
template<typename T> |
| static void | send_client (const std::set< i64_actorid > &aids, const T &adata, ENET_PROTOCOL aprotocol=ENET_TCP) |
|
template<typename T> |
| static void | send_client (i64_actorid aid, const T &adata, ENET_PROTOCOL aprotocol=ENET_TCP) |
|
template<typename T> |
| static void | send_client (const std::vector< i64_actorid > &aids, const T &adata, ENET_PROTOCOL aprotocol=ENET_TCP) |
|
template<typename T> |
| static void | send_client (const T &adata, ENET_PROTOCOL aprotocol=ENET_TCP) |
|
template<typename T> |
| static void | send_clientbyarea (i16_area aarea, const T &adata, ENET_PROTOCOL aprotocol=ENET_TCP) |
| static void | send_actor (const nguid &aguid, const std::shared_ptr< pack > &adata) |
| | 向指定Actor发送消息包
|
|
template<typename T, bool IS_SEND = true> |
| static void | send_actor (ENUM_ACTOR atype, const std::shared_ptr< T > &adata) |
|
template<typename T, bool IS_SEND = true> |
| static void | send_actor (const nguid &aguid, const nguid &arequestguid, const std::shared_ptr< T > &adata) |
|
template<typename T, bool IS_SEND = true> |
| static void | send_actor (const nguid &aguid, const nguid &arequestguid, const std::shared_ptr< T > &adata, const std::function< void()> &afailfun) |
|
template<typename T, bool IS_SEND = true> |
| static void | send_actor (const std::set< i64_actorid > &asetguid, const nguid &arequestguid, const std::shared_ptr< T > &adata) |
| static void | start_broadcast () |
| | 启动全局广播定时器
|
|
template<typename TDerived> |
| static void | first_nregister (ENUM_ACTOR atype) |
| template<typename TACTOR, typename ... ARG> |
| static std::shared_ptr< actor_base > | create (i16_area aarea, i32_actordataid aid, ARG &&... args) |
| | actor工厂方法(编译期类型)
|
|
template<typename ... ARG> |
| static std::map< ENUM_ACTOR, create_fun< ARG... > > & | creators () |
|
template<ENUM_ACTOR EACTOR, typename TACTOR, typename ... ARG> |
| static void | cregister () |
| template<typename ... ARG> |
| static std::shared_ptr< actor_base > | create (ENUM_ACTOR atype, i16_area aarea, i32_actordataid aid, ARG &&... args) |
| | actor工厂方法(运行时类型,查分桶表转调编译期create<TACTOR>)
|
Lua脚本测试Actor.
继承自actor基类,启用Lua脚本引擎用于C++与Lua绑定机制验证。 拥有testlua数据库组件,支持定时器和Lua脚本消息处理。