public void SendNetEvent(int id, FNetHead data) { if (mMsgCore != null) { mMsgCore.Send(id, data); } }
public static UnityWebRequest CreateHttpMsg(string url, FNetHead head) { UnityWebRequest www = new UnityWebRequest(url, UnityWebRequest.kHttpVerbPOST); byte[] postBytes = System.Text.Encoding.UTF8.GetBytes(JsonUtility.ToJson(head)); www.uploadHandler = new UploadHandlerRaw(postBytes); www.downloadHandler = new DownloadHandlerBuffer(); www.SetRequestHeader("Content-Type", "application/json"); //www.timeout = 30; return(www); }
public static void SentMsg(string key, FNetHead json) { #if UNITY_EDITOR if (FEngine.instance.UDPOPEN) { FoxUdp fu = new FoxUdp(); fu.key = key; fu.json = StringSerialize.Serialize(json); Send(fu); } #endif }
public void SendNetEvent(int id, FNetHead data) { mNetMsg.SendNetEvent(id, data); }