- 主题:我想问一下
怎么获得当前用户的utmp?
--
FROM 159.226.37.*
term
【 在 atppp (Big Mouse) 的大作中提到: 】
: term or www
--
FROM 159.226.37.*
是啊,但是又怎么知道当前的utmpnum
struct user_info *get_utmpent(int utmpnum)
{
if (utmpnum <= 0)
return NULL;
return utmpshm->uinfo + (utmpnum - 1);
}
int get_utmpent_num(struct user_info *uent)
{
if (uent == NULL)
return -1;
return uent - utmpshm->uinfo + 1;
}
【 在 atppp (Big Mouse) 的大作中提到: 】
: 代码变化很大了,不知道你哪个版本的代码了
: 基本上就是从utmpnum算
--
FROM 159.226.37.*
给个提示,比如,哪个地方用到过当前utmp?
像list.c,都是直接读user_record,应该就是ushm吧
【 在 atppp (Big Mouse) 的大作中提到: 】
: 应该有个全局变量什么的,你慢慢找找好了。这部分代码变化很大了,我不知道你的
: 代码里应该怎么找
--
FROM 159.226.37.*
好像真的是
3x
【 在 etnlegend (etn|金字塔·失恋|available) 的大作中提到: 】
: 嗯, 现在的貌似 uinfo ...
--
FROM 159.226.37.*
if (getSession()->utmpent > 0)
clear_utmp(getSession()->utmpent, usernum, getpid());
是不是就是getSession()->utmpent?
【 在 atppp (Big Mouse) 的大作中提到: 】
: 比方 u_exit()
--
FROM 159.226.37.*
get_utmpent(getSession()->utmpent);
这样应该是获得了当前的utmp
【 在 jiangjun2000 (jiangjun) 的大作中提到: 】
: if (getSession()->utmpent > 0)
: clear_utmp(getSession()->utmpent, usernum, getpid());
: 是不是就是getSession()->utmpent?
: ...................
--
FROM 159.226.37.*
user_info 中的chatid,在聊天之外没什么用处吧,我拿来做一个临时的变量可以吧?
或者如果要在user_info中添加一个字符串,需要关bbsd吧?
还需要对数据结构进行转换么
【 在 jiangjun2000 (jiangjun) 的大作中提到: 】
: get_utmpent(getSession()->utmpent);
: 这样应该是获得了当前的utmp
--
FROM 159.226.37.*
我不是怕fill别处有用么,呵呵
既然没有,那就用它了
【 在 atppp (Big Mouse) 的大作中提到: 】
: 里面有个没用的fill字段
--
FROM 159.226.37.*
看名字...
chatid估计是聊天是用来判定对方id的嘛
【 在 atppp (Big Mouse) 的大作中提到: 】
: 那你怎么确定charid没用呢,同样的方法用在这个字段上不是一样么
--
FROM 159.226.37.*