예제 #1
0
파일: ITcpSession.cs 프로젝트: oathx/Six
	/// <summary>
	/// Receive the specified package.
	/// </summary>
	/// <param name="package">Package.</param>
	private void 			Receive(IPackage package)
	{
		int nCmdID = package.GetCmdID();

#if OPEN_DEBUG_LOG
		Debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Recv net message : " + nCmdID + " Length:" + package.GetLength());
#endif

		if (m_dFactory.ContainsKey(nCmdID))
		{
			DispatchEvent (
				new IEvent (EngineEventType.EVENT_NET, nCmdID, m_dFactory[nCmdID].Create(package))
				);
		}
		else
		{
#if OPEN_DEBUG_LOG
			Debug.LogWarning(">>>> Can't find net message factory : " + nCmdID + " Length:" + package.GetLength());
#endif
		}
	}
예제 #2
0
파일: ITcpSession.cs 프로젝트: oathx/Six
	/// <summary>
	/// Receive the specified package.
	/// </summary>
	/// <param name="package">Package.</param>
	private void 			Receive(IPackage package)
	{
		int nCmdID = package.GetCmdID();

#if OPEN_DEBUG_LOG
		Debug.Log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Recv net message : " + nCmdID + " Length:" + package.GetLength());
#endif
		if (m_dFactory.ContainsKey(nCmdID))
		{
			IEvent evt = new IEvent (EngineEventType.EVENT_NET, nCmdID, m_dFactory[nCmdID].Create(package));
			if (m_dHook.ContainsKey(nCmdID))
			{
				m_dHook[nCmdID](evt);
			}
			else
			{
				DispatchEvent (evt);
			}
		}
		else
		{
#if UNITY_EDITOR
			Debug.LogError(">>>> Can't find net message factory : " + nCmdID + " Length : " + package.GetLength());
#endif
		}
	}