跳到主要内容

social_server

简介

以pkg形式发布的社交服务器

项目以pkg形式接入参考这个链接里的说明

https://leiting.feishu.cn/wiki/wikcnuOy4bOGDTCoiKHgKfYWzD5

公共服务器的各类文档说明

https://leiting.feishu.cn/wiki/wikcnSLMgc00KOJTGIwjPtee7gf

组件接口

common.gs

社交服主模块的入口文件

提供主模块的初始化和关闭接口

函数原型函数作用
string get_native_path()获取本地扩展的路径
string get_native_boot_file()获取本地扩展的启动文件
void boot()主模块的启动接口
void shutdown()主模块的关闭接口

AccountD.gs

账号模块

函数原型函数作用
object assure_connection()获取和账号数据库的客户端连接对象
map read_account(string account)获取账号基础资料
bool create_account(string account, map dbase)创建账号基础资料
bool update_account_field(string account, string field, mixed value)更新账号基础资料字段
bool destroy_account(string account)删除账号基础资料

AuthD.gs

账号认证模块

函数原型函数作用
map auth(string account, map args = )账号认证
bool internal_auth(string token)内部连接认证(只需要验证令牌值)
bool set_auth_agent(string name, map agent_info)设置服务器使用的认证代理
map find_auth_agent(string name)查找服务器的认证代理

ChatD.gs

聊天模块

函数原型函数作用
object assure_connection(string server_id, string chat_type = nil)获取指定服务器名称和聊天类型的聊天数据库的客户端连接对象
object assure_connection_world_chat(string server_id)获取指定服务器名称的世界频道类型的聊天数据库客户端连接对象
object assure_connection_private_chat(string server_id)获取指定服务器名称的私聊类型的聊天数据库客户端连接对象
object assure_connection_chatroom_chat(string server_id)获取指定服务器名称的聊天室类型的聊天数据库客户端连接对象
object assure_connection_user_chat(string server_id)获取指定服务器名称的用户留言类型的聊天数据库客户端连接对象
object assure_connection_dimension_chat(string server_id)获取指定服务器名称的跨服聊天类型的聊天数据库客户端连接对象
string get_world_chatroom_id(string server_id)获取指定服务器的世界频道房间id
string get_user_chatroom_id(string user_rid)获取指定用户的用户留言的房间id
string get_chatroom_id(string chatroom)获取聊天室房间id
string get_user_private_chatroom_id(string user_rid1, string user_rid2)获取两个用户之间的私聊频道的房间id
int get_last_recv_message_id(object user, string room_id)获取社交服用户在指定聊天房间里最近拖取的聊天消息的id(记录在社交服用户的临时数据中)
void set_last_recv_message_id(object user, string room_id, int message_id)记录社交服用户在指定聊天房间里最近拖取的聊天消息的id(记录在社交服用户的临时数据中)
bool check_send_frequency(object user, string chat_type)检查指定类型的聊天消息发送频率是否满足发送限制
void update_send_time(object user, string chat_type, int t)更新指定类型的聊天消息的最近发送时间
int get_send_waiting_time(object user, string chat_type)获取指定类型的聊天消息可发送的等待时长
bool ban_chat(string account, map info)禁言指定账号
bool ban_fake_chat(string account, map info)伪禁言指定账号
bool ban_global(map info)全服禁言
map pull_banned_accounts(object user, int count = 10)分段拖取禁言账号(从上次获取的位置开始)
map check_chat_ban_info(string account)检查指定账号是否存在禁言信息
int get_chat_ban_waiting_time(map info)获取禁言剩余时长
bool check_no_disturb(string account)检查指定账号是否处于勿扰状态中
map check_chat_fake_ban_info(string account)检查指定账号是否存在伪禁言信息
int get_chat_fake_ban_waiting_time(map info)获取伪禁言剩余时长
map check_chat_ban_global(object user)检查是否处存在全服禁言信息
map pull_private_chat_list(object user, string target, int count = 10)分段拖取用户和指定目标账号的私聊消息列表

ChatMonitorD.gs

聊天监控功能模块

函数原型函数作用
void set_report_url_and_key(string url, string key = nil)设置聊天监控的上报地址和key
void post_send_message(object user, string channel, map report_info)上报聊天消息
void report(LtRequestStandAlonePatrol req)提交独立巡服请求

DelayD.gs

提供延迟执行操作的功能模块

函数原型函数作用
void delay_invoke(float seconds, function fn)延迟指定时长执行函数

EtcdClientD.gs

etcd server监听模块,仅在[etcd_server]设置时起效

函数原型函数作用
bool is_etcd_server_enabled()是否已启用etcd服务器
object new_client_and_watch_prefix(string name, string prefix, function event_put_callback, function event_delete_callback, mixed succeed_callback)新建一个etcd客户端对象并监听前缀
object find_client(string name)查找etcd客户端对象
void close_client(string name)关闭etcd客户端对象
int accquire_lease_id(string name, mixed lease_seconds = nil)申请租约ID
bool set(string name, string key, mixed value, int lease_id = 0)设置键值

FriendD.gs

好友功能模块

函数原型函数作用
object assure_connection(string server_id)获取指定服务器名称的好友数据库的客户端连接对象
void set_list_friend_ids(object user, array friend_ids)记录已经获取的好友id列表
void delete_list_friend_ids(object user, array friend_ids)删除已经获取的好友id列表
array get_list_friend_ids(object user)获取已经获取的好友id列表
void set_list_blacklist(object user, array blacklist)记录已经获取的黑名单id列表
void delete_list_blacklist(object user, array blacklist)删除已经获取的黑名单id列表
array get_list_blacklist(object user)获取已经获取的黑名单id列表
void set_list_reqs(object user, array reqs)记录已经获取的好友请求列表
void delete_list_reqs(object user, array reqs)删除已经获取的好友请求列表
array get_list_reqs(object user)获取已经获取的好友请求列表

InternalD.gs

社交服之间互联功能模块

etcd server模式下:

社交服之间不互连,仅通过etcd server进行消息同步

不需要获取其它社交服务器的列表

只支持广播: 通过内部连接给特定的某个社交服发送消息是没有意义的

社交服务器列表的获取:

  1. 来自notify_server的推送

  2. 定时更新

函数原型函数作用
void set_servers(map servers)增量设置社交服务器信息列表
void sync_and_invoke_local(string op, ...)本地执行操作并且同步操作给其他社交服务器
void sync(string op, ...)同步操作给其他社交服务器
void assure_clients(array ids)确保和其它社交服务器的连接(连接不存在则创建)
void close_clients(array ids)关闭到其它社交服务器的连接
void create_clients(array ids)创建到其它社交服务器的连接

MailD.gs

邮件功能模块

函数原型函数作用
object assure_connection(string server_id)获取指定的服务器名称的邮件数据库的客户端连接
string get_sys_mailbox_id(string server_id)获取指定的服务器名称的系统邮箱id
string get_sys_sender()获取系统邮件的发送者
map pull_mail_list(object user, int count = 10)拖取邮件列表(从上一次的位置继续拖取)

MomentD.gs

朋友圈功能模块

函数原型函数作用
object assure_connection(string server_id)获取指定服务器名称的朋友圈数据库的客户端连接
int get_last_recv_moment_id(object user, string target)获取最近一次记录的目标账号的朋友圈id
void set_last_recv_moment_id(object user, string target, int moment_id)记录最近一次的目标账号的朋友圈id
int get_last_recv_moment_comment_id(object user, int moment_id)获取最近一次记录的朋友圈评论id
void set_last_recv_moment_comment_id(object user, int moment_id, int cmoment_id)记录最近一次的朋友圈评论id
map pull_moment_list(object user, string target, int count = 10)拖取指定目标账号的朋友圈列表(从上一次拖取的位置继续拖取)
bool upload_photo_buff(object user, int photo_id, buffer photo_part_buff, map para = )上传照片
map fetch_photo_buff(object user, int photo_id, map para = )获取图片二进制内容

NotifyClientD.gs

作为客户端对接通知服务器的功能模块

函数原型函数作用
bool is_self_notify_enabled()是否启动本机消息推送
map get_all_servers()获取通知服务器的所有用户列表
void notify(string server_id, mixed name_or_names, map args = )向指定服务器id和指定的账户列表发送通知消息
void push(string event, map info = )向通知服务器发送推送消息

SwordD.gs

敏感词功能模块

一共有四种方式可以屏蔽敏感词,同时只有一种方式起效

方式一:接入最新的雷霆内容安全平台(基于pkt.leiting.sword)

方式二:接入老的雷霆内容安全平台(基于pkt.lt_sword)

方式三:接入敏感词服务器(基于pkg.sword_client)

方式四:接入本地敏感词功能模块(基于pkg.ssword)

可以通过配置[screen_all_sword]配置关闭全部敏感词功能

函数原型函数作用
array filter_content(map msg)内容过滤
void set_game_code_and_key(string game_code, string key)设置雷霆内容安全平台游戏码和签名密钥
map patrol_init(map msg)生成一个巡服上报消息实例
void patrol_set_field(map m, string key, mixed val)设置巡服上报键值
void patrol(map m, function func)执行巡服上报

SyncOpD.gs

响应通知服务器的同步操作通知的功能模块

函数原型函数作用
void invoke(string op, ...)执行一个同步操作

SystemD.gs

系统功能模块

处理系统启动、关闭

函数原型函数作用
bool is_shut()判断系统是否处于关闭状态
bool is_booting()判断系统是否处于启动中状态
bool is_shutting()判断系统是否处于关机中状态
bool is_running()判断系统是否处于正常运行状态
void boot(function func)执行系统启动
void on_post_boot(function func)执行系统启动后处理
void shutdown(function func = nil)执行系统关机
void on_post_shutdown(function func)执行系统关闭后处理

UserD.gs

用户对象管理模块

函数原型函数作用
void add_user(object u)添加用户
void remove_user(object u)移除用户
void walk_all_users(function func)遍历所有用户对象
void walk_server_users(string server_id, function func)遍历指定服务器的所有用户对象
void walk_name_users(mixed name_or_names, function func)遍历指定名字的所有用户对象
void walk_server_name_users(string server_id, mixed name_or_names, function func)遍历指定服务器和名字的所有用户对象
void debug_on(bool on = true)调试接口 - 打开/关闭调试
void dump()调试接口 - 输出所有用户对象

UserEventD.gs

玩家事件模块

函数原型函数作用
void listen_event(string user_event, function func)监听玩家事件

account_op.gs

账号操作功能模块

账号数据分成两部分,一部分是基础资料(静态数据),轻易不更新

另一部分是账号动态资料(动态数据,也需要序列化),可能经常更新

这样做的目的是基础资料的缓存不必频繁更新

函数原型函数作用
bool create_account(object conn, string account, map data)创建账号基础资料(静态数据)
bool update_account_field(object conn, string account, string field, mixed value)更新账号基础资料的某个字段
map read_account(object conn, string account)读取账号基础资料
bool set_account_profile_field(object conn, string account, string field, mixed value)设置账号动态资料的某个字段
mixed get_account_profile_field(object conn, string account, string field)获取账号动态资料的某个字段值
bool set_account_profile_field_dict(object conn, string account, map field_dict)批量设置账号资料的字段值
map get_entire_account_profile(object conn, string account)获取账号的完整动态资料
bool destroy_account(object conn, string account)删除账号
map get_ban_chat(object conn, string account)获取账号的被禁言数据(在账号动态资料里记录)
bool set_ban_chat(object conn, string account, map info)禁言账号(在账号动态资料里记录)
map get_ban_fake_chat(object conn, string account)获取账号的伪禁言数据(在账号动态资料里记录)
bool set_fake_chat(object conn, string account, map info)伪禁言账号(在账号动态资料里记录)
object assure_account_cache(string account, object conn)获取一个账号对应的缓存对象(如果缓存对象不存在则创建)
bool set_ban_global(object conn, map info)全服禁言
map get_ban_global(object conn)获取全服禁言信息
object assure_account_profile_cache(string account, object conn)获取一个账号动态资料对应的缓存对象(如果缓存对象不存在则创建)
object assure_global_settings_cache(object conn)获取一个全局设置对应的缓存对象(如果缓存对象不存在则创建)

arg_protocol.gs

客户端命令接口参数协议模块

只有在配置表中配置了参数协议时起效

函数原型函数作用
mixed get_cmd_arg_protocol_config(string cmd)获取指令的参数协议配置
void set_cmd_arg_protocol(string cmd, CmdArgProtocol protocol)设置指令的参数协议
mixed get_cmd_arg_protocol(string cmd)获取网络指令的参数协议
bool match_cmd_arg_protocol(string cmd, ...)检查网络指令的参数是否匹配
CmdArgProtocol new_cmd_arg_protocol(mixed value)创建一个CmdArgProtocol实例
void dump(string cmd = nil)调试接口 - 输出指令的参数协议

auth_op.gs

验证操作的功能模块

函数原型函数作用
bool set_auth_agent(object conn, string name, map info)设置服务器对应的账号验证代理
map find_auth_agent(object conn, string name)获取指定服务器名称对应的账号验证代理
object assure_auth_agent_cache(string name, object conn)获取服务器对应的账号验证代理缓存对象

caches.gs

对象缓存池

为了减少数据库访问频率,将一些经常访问的数据缓存起来

本模块是这些缓存对象的管理器,提供对象的创建和销毁接口

函数原型函数作用
object get_cache(string type, string key)获取缓存对象
object create_cache(string type, string key, ...)创建缓存对象
void close_cache(string type, string key)关闭缓存对象
void close_caches_by_type(string type)关闭指定类型的所有缓存对象
void close_all_caches()关闭所有缓存对象
void dump()调试接口 - 输出所有的缓存对象调试信息

chatroom.gs

聊天室相关操作

函数原型函数作用
array get_chatrooms(object conn, string who)获取聊天室列表
bool drop_chatroom(object conn, string room_id)删除指定的聊天室
bool add_member(object conn, string room_id, string target, map target_info)聊天室添加成员
bool update_member_info(object conn, string room_id, string target, map target_info)聊天室更新成员信息
bool remove_member(object conn, string room_id, string target)聊天室移除成员
map get_member(object conn, string room_id, string target)获取聊天室成员信息
array get_members(object conn, string room_id)获取聊天室所有成员列表
map get_full_members(object conn, string room_id)获取聊天室所有成员完整信息列表
array send_message(object conn, string chat_type, string room_id, map msg = )发送指定类型的消息到指定聊天室
map erase_messages_by_id(object conn, string chat_type, string room_id, array ids, string sender)删除指定聊天室的指定消息
array get_messages(object conn, string chat_type, string room_id, int start_id = 0, int count = -1)获取指定聊天室的指定类型的消息
array get_recent_messages(object conn, string chat_type, string room_id, int start_id = 0, int count = -1, int register_time = 0)获取指定聊天室的指定类型的最近的消息
array get_received_messages(object conn, string chat_type, string receiver, int start_id = 0, int count = -1, int register_time = 0)获取指定账号在指定聊天室的指定类型的最近的消息
array get_private_chat_messages_by_id(object conn, string room_id, array ids)获取指定的私聊消息列表
object assure_cache(string room_id, object conn)获取一个聊天室对应的缓存对象(如果没有则创建一个)

chat_op.gs

聊天操作功能模块

函数原型函数作用
array recv_private_chat_recent_messages(object conn, string who, string room_id, int start_id, int count = -1)接收最近的私聊消息
array recv_private_chat_received_messages(object conn, string who, int start_id, int count = -1)接收最近的私聊消息(不限定发送者)
array recv_world_chat_recent_messages(object conn, string who, string room_id, int start_id, int count = -1, int register_time = 0)接收最近的世界频道聊天消息
array recv_chatroom_chat_recent_messages(object conn, string who, string room_id, int start_id, int count = -1)接收最近的聊天室聊天消息
array recv_user_chat_recent_messages(object conn, string who, string room_id, int start_id, int count = -1)接收最近的留言消息
array send_private_chat_message(object conn, string room_id, map msg = )发送私聊消息
array send_world_chat_message(object conn, string room_id, map msg = )发送世界频道消息
array send_chatroom_chat_message(object conn, string room_id, map msg = )发送聊天室聊天消息
array send_user_chat_message(object conn, string room_id, map msg = )发送留言消息
array get_private_chat_targets(object conn, string who)获取私聊对象列表

config.gs

社交服配置模块

社交服的配置可以通过启动参数中添加/D CONFIG 来指定配置文件;如果未指定配置文件,则默认使用/etc/config.json

函数原型函数作用
void init(string config_file)读取配置文件初始化
mixed get(string path)获取配置值
string system_id()获取系统id
string ip()获取本机ip
int port()获取本机端口

friend_op.gs

好友操作功能模块

函数原型函数作用
bool add_into_friends(object conn, string who, string friend_id, map friend_info)加入好友列表
bool remove_from_friends(object conn, string who, string friend_id)移出好友列表
map get_make_friend_req(object conn, string who, string friend_id)获取来自指定账号的交友请求
bool add_into_blacklist(object conn, string who, string friend_id, map friend_info)加入黑名单
bool remove_from_blacklist(object conn, string who, string friend_id)移出黑名单
map get_blacklists(object conn, string who)获取黑名单列表
map get_blacklist_info(object conn, string who, string friend_id)获取黑名单信息
bool req_make_friend(object conn, string who, map who_info, string target)发出好友请求
array req_make_friend_mixed(object conn, string who, map who_info, string target)发出好友请求,返回值带失败原因
bool ack_make_friend(object conn, string ack_type, string who, map who_info, string target)应答好友请求
bool add_friend_each_other(object conn, string who1, map who1_info, string who2, map who2_info)互加好友
bool remove_friend_each_other(object conn, string who1, string who2)互删好友
map get_diff_blacklist(object conn, string who, array listed_blacklist = [])获取黑名单列表变更值
map get_diff_friends(object conn, string who, array listed_friends = [])获取好友名单列表变更值
map get_diff_friend_reqs(object conn, string who, array listed_reqs = [])获取好友请求列表的变更值
map get_friends(object conn, string who)获取好友列表
map get_friend_info(object conn, string who, string friend_id)获取好友信息

InternalClient.gs

社交服之间的内部连接会话对象

函数原型函数作用
bool ping()测试连接状态

internal_client.gs

提供社交服之间的内部连接的功能模块

函数原型函数作用
object create_client(map para)创建一个内部客户端会话对象

mailbox.gs

邮箱相关操作

函数原型函数作用
bool send_mail(object conn, string mail_type, string box_id, map msg = , int register_time = 0, string channel = nil)发送邮件
bool send_mail_with_pin_code(object conn, string mail_type, string box_id, map msg = , int register_time = 0, string pin_code = "", string channel = nil)发送带有安全码的邮件
map get_mail(object conn, string mail_type, string box_id, int id)获取邮件信息
array get_mails(object conn, string mail_type, string box_id, int start_id = 0, int count = -1)获取邮件信息列表
array get_mails_by_id(object conn, string mail_type, string box_id, array ids)通过一组邮件id获取邮件信息列表
array get_mails_by_pin_code(object conn, string mail_type, string box_id, array pin_codes)通过一组安全码获取邮件信息列表
array get_recent_mails(object conn, string mail_type, string box_id, int start_id = 0, int count = -1)获取最近的邮件信息列表

mail_op.gs

邮件操作功能模块

函数原型函数作用
void recv_recent_sys_mail(object conn, string who, string box_id, int count = -1, int register_time = 0, string channel = nil)接收最近的系统邮件,将系统邮件收取到个人邮箱中
map batch_delete_mail(object conn, string who, array ids)批量标记邮件为已删除
bool delete_mail(object conn, string who, int id)将邮件标记为已删除
map batch_read_mail(object conn, string who, array ids)批量标记邮件为已读
bool read_mail(object conn, string who, int id)将邮件标记为已读
map batch_take_attachment(object conn, string who, array ids)批量标记邮件为附件已读取
bool take_attachment(object conn, string who, int id)将邮件标记为附件已领取
map erase_mails_by_id(object conn, string mail_type, string who, array ids)删除指定的邮件
map erase_mails_by_field(object conn, string mail_type, string who, array fields)删除符合指定条件的邮件
bool drop_user_mails_by_ref_id(object conn, array ref_mail_ids)根据引用的系统邮件id删除所有玩家邮件

moment_op.gs

提供朋友圈操作的功能模块

函数原型函数作用
array new_moment(object conn, string sender, map moment_msg)发朋友圈
array modify_moment(object conn, int moment_id, map moment_msg)修改朋友圈
array comment_moment(object conn, int moment_id, string comment_sender, map comment_msg)评论朋友圈
map erase_moments_by_id(object conn, array moment_ids)删朋友圈
map erase_moment_comments_by_id(object conn, int moment_id, array comment_ids)删评论
array modify_moment_comment(object conn, int moment_id, int comment_id, map comment_msg)修改评论
array recv_recent_moments(object conn, string target, int start_id, int count = -1)获取最近的朋友圈
array recv_recent_moment_comments(object conn, int moment_id, int start_id, int count = -1)获取最近的评论
map get_moment_info(object conn, int moment_id)获取朋友圈信息
map get_comment_info(object conn, int moment_id, int comment_id)获取评论信息
array new_moment_photo(object conn, string sender, map photo_msg)请求上传图片
bool upload_moment_photo(object conn, int photo_id, buffer photo_buff)上传图片
array exist_moment_photo(object conn, string sender, int photo_id)判断图片是否存在
map get_moment_photo_info(object conn, int photo_id)获取图片信息

mongo.gs

提供mongo数据库操作功能模块

注意,本对象包含了pkg.mongo_scripts

函数原型函数作用
void start()启动mongo数据库服务
object find_client(string name, string server_id = nil)根据数据库名称和服务器id找到mongo客户端连接对象
array get_mongo_dbs_by_name(string name)通过数据库名称获取所有相关的数据库名称列表
bool contains_db(string name, string server_id)判断指定数据库名称和服务器id对应的数据库配置是否存在

netd.gs

社交服的网络功能模块

函数原型函数作用
void start_server(string name, int port, map para = , bool using_websocket = false)启动网络服务
void stop_server(string name)停止网络服务
void dump()调试接口 - 输出消息处理器统计信息
void add_into_scan_list(object ob)加入会话防呆扫描队列

Session.gs

会话对象

函数原型函数作用
bool is_session()是不是一个会话对象
void set_running_cmd(bool running_cmd = true)设置本会话对象是否正在执行指令标记
bool is_running_cmd()是不是正在执行指令
void set_port_recv_size(int recv_size)设置会话所属连接的接收缓冲区大小
bool auto_close()尝试自动关闭(满足pkg.session_scanner管理提供的接口)
void close_in_seconds(int seconds)指定时长时间后自动关闭
object unbind_connection()解除绑定当前网络连接对象
void bind_connection(object conn)绑定网络连接对象
bool transfer_connection(object to)将当前网络连接对象传递给目标会话对象
bool is_connected()判断当前网络连接对象是否已连接
void send(string cmd, ...)发送网络消息
void send_ping()发送ping消息
string desc()获取描述信息
void dump()调试接口 - 输出当前会话统计信息

sword.gs

社交服敏感词功能模块

解释一下,sword是sensitive word的缩写

内置了4种敏感词功能模块,分别对应pkg.leiting.sword/pkg.lt_sword/pkg.sword_client/pkg.ssword

函数原型函数作用
void startup(string name, mixed m)启动指定名称的敏感词功能模块
bool is_manual_patrol_enabled()手动巡服上报是否激活
array filter_content(map msg)敏感词过滤

InternalUser.gs

内部用户对象

函数原型函数作用
string get_id()获取内部用户ID(一般是社交服系统ID)
void post_auth_success()执行内部验证成功以后的处理

User.gs

已验证的用户对象

函数原型函数作用
bool is_user()声明我是一个User对象
string Session.desc()获取描述信息
int get_privilege()获取权限值
string get_server_id()获取所属游戏服务器id
string get_name()获取名字(社交服账号)
int get_register_time()获取注册时间
string get_channel()获取所属渠道
bool Session.auto_close()尝试自动关闭
mixed get_account_profile_field(string field)获取用户账号动态资料的字段值
bool set_account_profile_field(string field, mixed value)设置账号动态资料的字段值
bool set_account_profile_field_dict(map field_dict)设置账号动态资料的一组字段值
map get_entire_account_profile()获取账号动态资料的完整数据
map get_location()获取用户的定位信息
void send_notify(map args)发送社交服通知消息(cmd_social_notify)
void receive_notify(map args)处理社交服通知消息
bool check_and_record_cmd_frequency(string cmd)检查并记录指令执行频率
bool is_out_of_life()判断是否超出了生存周期
void post_auth_success()执行验证成功以后的处理

preimport.gs

预定义文件

函数原型函数作用
void set_embedded_mode(bool flag_embedded)设置嵌入模式
bool is_embedded_mode()是不是嵌入模式

social_server.gs

函数原型函数作用
void setup(string config_file)嵌入模式下启动社交服

枚举

Privileges

用户权限

枚举成员描述
Normal3
Admin7
Root15

SessionProperties

会话属性

成员变量

变量名类型初始值须初始化描述
countint0可选已处理消息数量
total_costfloat0可选已花费处理消息总耗时
min_costfloat0可选已处理消息的最小耗时
max_costfloat0可选已处理消息的最大耗时
running_cmdboolfalse可选当前是不是在执行指令
anonymous_sessionboolfalse可选是否为匿名会话
auto_close_timeint0可选自动关闭时间

成员方法

函数原型函数作用