Esempio n. 1
0
        static void sendSomeMessages()
        {
            for (uint i = 0; i < 10000u; i++)
            {
                using (PooledNetworkWriter writer = NetworkWriterPool.GetWriter())
                {
                    // write mask
                    writer.WriteUInt64(1);
                    // behaviour length
                    writer.WriteInt32(1);

                    // behaviour delta

                    //  sync object mask
                    writer.WriteUInt64(0);
                    // sync object delta
                    //      assume no sync objects for this test

                    // sync var mask
                    writer.WriteUInt64(1);
                    // sync var delta
                    //      assume sync var has changed its value to 10
                    writer.WriteInt32(10);


                    // send message
                    NetworkServer.localConnection.Send(new UpdateVarsMessage
                    {
                        netId   = i,
                        payload = writer.ToArraySegment()
                    });
                }
            }
        }