commonly commit
This commit is contained in:
+3
-2
@@ -3,6 +3,7 @@ using System.Text;
|
|||||||
using System.Net.Sockets;
|
using System.Net.Sockets;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
namespace Interact
|
namespace Interact
|
||||||
@@ -78,8 +79,8 @@ namespace Interact
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!StormClient.tcpClient.Connected)
|
|
||||||
return false;
|
workingDictionary.Clear(); //清空临时记录
|
||||||
if (sendLoopThread != null)
|
if (sendLoopThread != null)
|
||||||
sendLoopThread.Abort();
|
sendLoopThread.Abort();
|
||||||
if (readLoopThread != null)
|
if (readLoopThread != null)
|
||||||
|
|||||||
+19
-3
@@ -41,11 +41,17 @@ namespace Interact
|
|||||||
HandlePanic(GetResultHead(jsonObj));
|
HandlePanic(GetResultHead(jsonObj));
|
||||||
break;
|
break;
|
||||||
case Operations.TransMessage:
|
case Operations.TransMessage:
|
||||||
|
break;
|
||||||
case Operations.SendMessage:
|
case Operations.SendMessage:
|
||||||
|
break;
|
||||||
case Operations.Logout:
|
case Operations.Logout:
|
||||||
|
break;
|
||||||
case Operations.Offline:
|
case Operations.Offline:
|
||||||
|
break;
|
||||||
case Operations.UpdateUserInfo:
|
case Operations.UpdateUserInfo:
|
||||||
|
break;
|
||||||
|
case Operations.GetUsers:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -80,13 +86,12 @@ namespace Interact
|
|||||||
OnLoginDone?.Invoke(resultHead, null);
|
OnLoginDone?.Invoke(resultHead, null);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JObject dataObj = (JObject)JsonConvert.DeserializeObject(Encoding.UTF8.GetString(data));
|
|
||||||
User user = new User
|
User user = new User
|
||||||
{
|
{
|
||||||
Name = head[AttrNames.User].ToString(),
|
Name = head[AttrNames.User].ToString(),
|
||||||
NickName = head[AttrNames.NickName].ToString(),
|
NickName = head[AttrNames.NickName].ToString(),
|
||||||
Motto = head[AttrNames.Motto].ToString(),
|
Motto = head[AttrNames.Motto].ToString(),
|
||||||
Group = (UserGroup)Enum.Parse(typeof(UserGroup), dataObj[AttrNames.UGroup].ToString()),
|
Group = (UserGroup)Enum.Parse(typeof(UserGroup), head[AttrNames.UGroup].ToString()),
|
||||||
Photo = User.DefaultPhoto
|
Photo = User.DefaultPhoto
|
||||||
};
|
};
|
||||||
if (int.Parse(head[AttrNames.Photo].ToString()) > 0)
|
if (int.Parse(head[AttrNames.Photo].ToString()) > 0)
|
||||||
@@ -96,6 +101,17 @@ namespace Interact
|
|||||||
} //用户头像数据
|
} //用户头像数据
|
||||||
OnLoginDone?.Invoke(resultHead, user);
|
OnLoginDone?.Invoke(resultHead, user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//处理获取用户列表的不连续返回包。当所有包接收完毕后返回给客户
|
||||||
|
private static void HandleGetUsersPack(JObject head, byte[] data)
|
||||||
|
{
|
||||||
|
if (head[AttrNames.Error].ToString() != string.Empty)
|
||||||
|
{
|
||||||
|
OnGetUserListDone?.Invoke(GetResultHead(head), null);
|
||||||
|
return;
|
||||||
|
} //获取失败
|
||||||
|
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user