You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
68 lines
2.5 KiB
68 lines
2.5 KiB
using System.Collections.Generic; |
|
|
|
/// <summary> |
|
/// 聊天频道类 |
|
/// 公聊-私聊-建议 |
|
/// 公聊频道-1 (进入等待房间时加入频道、点击其他按钮时离开频道) |
|
/// 公聊频道-2 (点击频道按钮时加入频道、点击其他按钮时离开频道) |
|
/// 公聊频道-3 (点击频道按钮时加入频道、点击其他按钮时离开频道) |
|
/// 公聊频道-4 (点击频道按钮时加入频道、点击其他按钮时离开频道) |
|
/// 公聊频道-5 (点击频道按钮时加入频道、点击其他按钮时离开频道) |
|
/// 公聊频道-6 (点击频道按钮时加入频道、点击其他按钮时离开频道) |
|
/// 公聊频道-7 (点击频道按钮时加入频道、点击其他按钮时离开频道) |
|
/// 公聊频道-8 (点击频道按钮时加入频道、点击其他按钮时离开频道) |
|
/// 私聊频道 (发送消息者userID+接收消息者userID 为联合主键作为频道ID) |
|
/// 建议频道1001-总队 (组织机构为总队的<参谋><指挥员>都存在时申请创建频道,同时加入) |
|
/// 建议频道1002-支队 (组织机构为支队的<参谋><指挥员>都存在时申请创建频道,同时加入) |
|
/// 建议频道1003-大队 (组织机构为大队的<参谋><指挥员>都存在时申请创建频道,同时加入) |
|
/// </summary> |
|
public class ChatChannel |
|
{ |
|
/// <summary> |
|
/// 聊天频道ID |
|
/// </summary> |
|
public long ID; |
|
/// <summary> |
|
/// 房间ID |
|
/// </summary> |
|
public long RoomID; |
|
/// <summary> |
|
/// 加入频道的用户ID |
|
/// </summary> |
|
public long EnterUserId; |
|
/// <summary> |
|
/// 聊天用户信息 |
|
/// </summary> |
|
public List<UserData> Users = new List<UserData>(); |
|
/// <summary> |
|
/// 根据ID获取用户名 |
|
/// </summary> |
|
/// <param name="id"></param> |
|
/// <returns></returns> |
|
public string GetUserNameByID(long id) |
|
{ |
|
string name = ""; |
|
foreach (var item in Users) |
|
{ |
|
if (item.UserInfo.Id == id) |
|
{ |
|
name = item.UserInfo.RealName; |
|
} |
|
} |
|
return name; |
|
} |
|
/// <summary> |
|
/// 根据用户ID移除用户信息 |
|
/// </summary> |
|
/// <param name="id"></param> |
|
public void RemoveUserByUserID(long id) |
|
{ |
|
for (int i = 0; i < Users.Count; i++) |
|
{ |
|
if (Users[i].UserInfo.Id == id) |
|
{ |
|
Users.Remove(Users[i]); |
|
} |
|
} |
|
} |
|
}
|
|
|