Beispiel #1
0
        public static IMessageLite sendImmediate(IBuilderLite build)
        {
            var bundle = new Bundle();
            var data   = build.WeakBuild();

            bundle.newMessage(data.GetType());
            var fid = bundle.writePB(data);

            bundle.sendImm(KBEngine.KBEngineApp.app.networkInterface(), fid);
            return(data);
        }
Beispiel #2
0
        public static byte[] GetPacket(IBuilderLite build)
        {
            var bundle = new Bundle();
            var data   = build.WeakBuild();

            Log.Net("GetPacket: " + data);
            bundle.newMessage(data.GetType());
            var fid = bundle.writePB(data);

            return(bundle.stream.getbuffer());
        }
Beispiel #3
0
        public static Packet GetPacketFid(IBuilderLite build)
        {
            var p = new Packet();

            var bundle = new Bundle();
            var data   = build.WeakBuild();

            Log.Net("GetPacket: " + data);
            bundle.newMessage(data.GetType());
            var fid  = bundle.writePB(data);
            var buff = bundle.stream.getbuffer();

            p.flowId = fid;
            p.data   = buff;
            return(p);
        }
Beispiel #4
0
        public static IEnumerator sendSimple(UnityEngine.MonoBehaviour mo, IBuilderLite build, PacketHolder par)
        {
            var bundle = new Bundle();
            var data   = build.WeakBuild();

            Log.Net("send Simple " + bundle + " " + data);

            /*
             * After Build  builder Clear
             */

            bundle.newMessage(data.GetType());
            var fid = bundle.writePB(data);

            //Log.Net ("Perhaps network not ok");
            yield return(mo.StartCoroutine(bundle.sendCoroutine(KBEngine.KBEngineApp.app.networkInterface(), fid, par)));
        }