ngl_server 1.0
基于 Actor 模型的 C++ 服务器框架
ngl::encryption_bytexor Class Reference

XOR加密辅助类。 More...

#include <structbytes.h>

Static Public Member Functions

static i32_protocolnum get_registered_protocolnum (const char *aname)
 获取已注册协议的协议号。
static bool check_xor (int aprotocolnum)
 检查指定协议是否需要XOR加密。
template<typename Y>
static bool check_xor ()
 检查指定类型是否需要XOR加密。

Detailed Description

XOR加密辅助类。

提供协议特定的XOR加密检查功能,用于决定是否对数据包进行XOR加密。 某些协议(如GM命令)不需要加密。

Member Function Documentation

◆ check_xor() [1/2]

template<typename Y>
bool ngl::encryption_bytexor::check_xor ( )
inlinestatic

检查指定类型是否需要XOR加密。

Template Parameters
Y协议类型
Returns
true 如果需要加密,false 如果不需要

◆ check_xor() [2/2]

bool ngl::encryption_bytexor::check_xor ( int aprotocolnum)
inlinestatic

检查指定协议是否需要XOR加密。

Parameters
aprotocolnum协议号
Returns
true 如果需要加密,false 如果不需要

GM命令协议不需要加密,其他协议根据配置决定。

◆ get_registered_protocolnum()

i32_protocolnum ngl::encryption_bytexor::get_registered_protocolnum ( const char * aname)
inlinestatic

获取已注册协议的协议号。

Parameters
aname协议名称
Returns
协议号,如果未找到返回-1

The documentation for this class was generated from the following file: