/// <summary> /// 丢失链接 /// </summary> void OnDisconnected(RazDisType dis, string msg) { Close(); //关掉客户端链接 int protocal = dis == RazDisType.Exception ? LuaProtocal.Exception : LuaProtocal.Disconnect; RazByteBuffer buffer = new RazByteBuffer(); buffer.WriteShort((ushort)protocal); RazNetworkManager.AddEvent(protocal, buffer); Debug.LogError("Connection was closed by the server:>" + msg + " Distype:>" + dis); }