| 22 |
#include "str_process.h" |
#include "str_process.h" |
| 23 |
#include "user_list.h" |
#include "user_list.h" |
| 24 |
#include "user_priv.h" |
#include "user_priv.h" |
| 25 |
|
#include "user_info_display.h" |
| 26 |
#include "user_list_display.h" |
#include "user_list_display.h" |
| 27 |
#include <string.h> |
#include <string.h> |
| 28 |
#include <time.h> |
#include <time.h> |
| 82 |
else if (p_tm->tm_year > 70) |
else if (p_tm->tm_year > 70) |
| 83 |
{ |
{ |
| 84 |
snprintf(str_time_login, sizeof(str_time_login), |
snprintf(str_time_login, sizeof(str_time_login), |
| 85 |
"%d年", p_tm->tm_year - 70); |
"%d年%d天", p_tm->tm_year - 70, p_tm->tm_yday); |
| 86 |
} |
} |
| 87 |
else if (p_tm->tm_yday > 0) |
else if (p_tm->tm_yday > 0) |
| 88 |
{ |
{ |
| 92 |
else if (p_tm->tm_hour > 0) |
else if (p_tm->tm_hour > 0) |
| 93 |
{ |
{ |
| 94 |
snprintf(str_time_login, sizeof(str_time_login), |
snprintf(str_time_login, sizeof(str_time_login), |
| 95 |
"%d时%d分", p_tm->tm_hour, p_tm->tm_min); |
"%d:%.2d", p_tm->tm_hour, p_tm->tm_min); |
| 96 |
} |
} |
| 97 |
else |
else |
| 98 |
{ |
{ |
| 99 |
snprintf(str_time_login, sizeof(str_time_login), |
snprintf(str_time_login, sizeof(str_time_login), |
| 100 |
"%d分%d秒", p_tm->tm_min, p_tm->tm_sec); |
"%d\'%.2d\"", p_tm->tm_min, p_tm->tm_sec); |
| 101 |
} |
} |
| 102 |
|
|
| 103 |
moveto(4 + i, 1); |
moveto(4 + i, 1); |
| 142 |
else if (p_tm->tm_yday > 0) |
else if (p_tm->tm_yday > 0) |
| 143 |
{ |
{ |
| 144 |
snprintf(str_time_login, sizeof(str_time_login), |
snprintf(str_time_login, sizeof(str_time_login), |
| 145 |
"%d天%d时", p_tm->tm_yday, p_tm->tm_hour); |
"%dd%dh", p_tm->tm_yday, p_tm->tm_hour); |
| 146 |
} |
} |
| 147 |
else if (p_tm->tm_hour > 0) |
else if (p_tm->tm_hour > 0) |
| 148 |
{ |
{ |
| 149 |
snprintf(str_time_login, sizeof(str_time_login), |
snprintf(str_time_login, sizeof(str_time_login), |
| 150 |
"%d时%d分", p_tm->tm_hour, p_tm->tm_min); |
"%d:%.2d", p_tm->tm_hour, p_tm->tm_min); |
| 151 |
} |
} |
| 152 |
else |
else |
| 153 |
{ |
{ |
| 154 |
snprintf(str_time_login, sizeof(str_time_login), |
snprintf(str_time_login, sizeof(str_time_login), |
| 155 |
"%d\'%d\"", p_tm->tm_min, p_tm->tm_sec); |
"%d\'%.2d\"", p_tm->tm_min, p_tm->tm_sec); |
| 156 |
} |
} |
| 157 |
|
|
| 158 |
tm_duration = tm_now - p_users[i].last_tm; |
tm_duration = tm_now - p_users[i].last_tm; |
| 446 |
} |
} |
| 447 |
break; |
break; |
| 448 |
case VIEW_USER: |
case VIEW_USER: |
| 449 |
clearscr(); |
user_info_display(online_user ? &(online_users[selected_index].user_info) : &(users[selected_index])); |
|
if (online_user) |
|
|
{ |
|
|
prints("已选中用户 [%s] 会话 %d", online_users[selected_index].user_info.username, online_users[selected_index].id); |
|
|
|
|
|
USER_ONLINE_INFO users[5]; |
|
|
int user_cnt = 5; |
|
|
ret = query_user_online_info_by_uid(online_users[selected_index].user_info.uid, users, &user_cnt, 0); |
|
|
if (ret <= 0) |
|
|
{ |
|
|
log_error("query_user_online_info_by_uid(uid=%d, cnt=%d) error: %d\n", |
|
|
online_users[selected_index].user_info.uid, user_cnt, ret); |
|
|
} |
|
|
else |
|
|
{ |
|
|
for (int i = 0; i < user_cnt; i++) |
|
|
{ |
|
|
moveto(2 + i, 1); |
|
|
prints("会话%d", users[i].id); |
|
|
} |
|
|
} |
|
|
} |
|
|
else |
|
|
{ |
|
|
prints("已选中用户 [%s]", users[selected_index].username); |
|
|
} |
|
|
press_any_key(); |
|
| 450 |
user_list_draw_screen(online_user); |
user_list_draw_screen(online_user); |
| 451 |
break; |
break; |
| 452 |
case SHOW_HELP: |
case SHOW_HELP: |