コード例 #1
0
	public void WriteToServer(JgC2S_Msgs messageType, TBase message, Action<TBase> callback)
	{
		if (transport.IsBound() == false) return;

		int messageIndex = (int)messageType;
		messageCallbacks[messageIndex] = callback;

		SendMessageToServer(messageType, message);
	}
コード例 #2
0
	public void SendMessageToServer(JgC2S_Msgs messageType, TBase message)
	{
		if (transport.IsBound() == false) return;

		Debug.Log(string.Format("C({0}): ->S ({1}) - {2} \n", dbgUserName, messageType, message));

		int length = JThrift.Serialize((byte)messageType, message, ref writeBuffer);

		transport.Write(writeBuffer, length);
	}