private void OnDisconnected(DisType dis, string msg)
{
//关掉客户端链接
Close();
int protocal = dis == DisType.Exception ? Protocal.Exception : Protocal.Disconnect;
ByteBuffer buffer = new ByteBuffer();
buffer.WriteShort((ushort)protocal);
NetworkManager.AddEvent(protocal, buffer);
Debug.LogError("Connection was closed by the server:>" + msg + " Distype:>" + dis);
}