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