Ejemplo n.º 1
0
        /// <summary>
        /// 发送消息
        /// </summary>
        public void SendMsg(INetPackage package)
        {
            if (State != ENetworkState.Connected)
            {
                LogSystem.Log(ELogType.Warning, "Network is not connected.");
                return;
            }

            if (_channel != null)
            {
                _channel.SendMsg(package);
            }
        }
Ejemplo n.º 2
0
		/// <summary>
		/// 发送消息
		/// </summary>
		public void SendMsg(ushort msgID, System.Object protoObj)
		{
			if (State != ENetworkState.Connected)
			{
				LogSystem.Log(ELogType.Warning, "Network is not connected.");
				return;
			}

			NetSendPackage package = new NetSendPackage();
			package.Type = msgID;
			package.ProtoObj = protoObj;

			if (_channel != null)
				_channel.SendMsg(package);
		}