ByteBuffer.ReadLong C# (CSharp) Method

ReadLong() public method

public ReadLong ( ) : long
return long
    public long ReadLong()
    {
        return (long)mBinaryReader.ReadInt64();
    }

Usage Example

Example #1
0
        private static void Packet_UpdateUserData(byte[] data)
        {
            ByteBuffer buffer = new ByteBuffer();

            buffer.WriteBytes(data);

            //skip read pakcet id
            buffer.ReadLong();

            long connectionId = buffer.ReadLong();

            long UserId = buffer.ReadLong();

            string Nickname = buffer.ReadStringUnicode();

            double money = buffer.ReadDouble();

            // if avatar string is empty then skip. Otherwise read
            string avatarPath = "";

            if (buffer.Length() > 0)
            {
                int strLen = buffer.ReadInteger(false);
                if (strLen > 0)
                {
                    avatarPath = buffer.ReadString();
                }
            }

            //Invoke callback on observers
            FoolObservable.OnUpdateUserData(connectionId, UserId, Nickname, money, avatarPath);
        }
All Usage Examples Of ByteBuffer::ReadLong