示例#1
0
 public void SendNetEvent(int id, FNetHead data)
 {
     if (mMsgCore != null)
     {
         mMsgCore.Send(id, data);
     }
 }
示例#2
0
        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);
        }
示例#3
0
    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
    }
示例#4
0
 public void SendNetEvent(int id, FNetHead data)
 {
     mNetMsg.SendNetEvent(id, data);
 }