資源簡介
暫時實現(xiàn)的功能有:
1.群聊
2.私聊
3.登陸驗證
4.注冊
5.所用的在線用戶
6.退出
7.管理員踢出某用戶
8.管理員禁止某用戶聊天
9.管理員提升某用戶為管理員
10.管理員把某用戶降為普通用戶
代碼片段和文件信息
#include?“chat.h“
/*
??Email:gfj19900401@163.com
???client.c
???client????客戶端
?*/
int?socketfd;??//套接字描述符
//菜單提示的數(shù)據(jù)結(jié)構(gòu)???
typedef?struct?{
char?cmd[40]; //format
char?explain[100];//description
int??admin; //authority
}usage;
int?global_admin_flag=NORMAL_USER;???//用戶的權(quán)限標(biāo)記,默認為0
int?globel_is_shutup;??? //用戶是否被禁言的標(biāo)記?默認為0
??
//0為普通用戶具有的執(zhí)行權(quán)限?,1為管理員具有的執(zhí)行權(quán)限?。
?usage?help_menu[]?=?{
{“format“? ????????“\t\tdescription“0}
{“/content“? ??????“\tchat?to?all?clients?online(eg?/abc)“0}
{“:user/content“ ????“\tchat?to?somebody?online(eg?:1001/abc)“0}
{“-online“?????????????“\t\tshow?online?clients“0}
{“-help“???????????????“\t\tshow?help?infomations“0}
{“exit“ ????????????“\t\texit?the?chat?room“0}
{“@kick:user“??????????“\tlet?somebody?down(eg?@kick:1001)“
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????4052??2012-05-18?23:31??on_socket_chat_v1\chat.h
?????文件??????13524??2012-05-18?23:31??on_socket_chat_v1\client
?????文件???????8889??2012-05-18?23:31??on_socket_chat_v1\client.c
?????文件???????9276??2012-05-18?23:31??on_socket_chat_v1\client.o
?????文件????????114??2012-05-18?23:31??on_socket_chat_v1\makefile
?????文件??????18360??2012-05-18?23:31??on_socket_chat_v1\server
?????文件??????18240??2012-05-18?23:31??on_socket_chat_v1\server.c
?????文件??????14872??2012-05-18?23:31??on_socket_chat_v1\server.o
?????文件?????????85??2012-05-18?23:31??on_socket_chat_v1\userinfo
?????目錄??????????0??2012-05-23?10:58??on_socket_chat_v1
-----------?---------??----------?-----??----
????????????????87412????????????????????10
評論
共有 條評論