Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef MANGOSSERVER_WORLDPACKET_H
#define MANGOSSERVER_WORLDPACKET_H

#include "Platform/Headers/ByteBuffer.h"
#include "OPCodesTpl.h"
#include <boost/serialization/base_object.hpp>

namespace Divide {

class WorldPacket : public ByteBuffer {
   public:
    // just container for later use
    WorldPacket() : WorldPacket(OPCodes::MSG_NOP, 0)
    {
    }

    explicit WorldPacket(OPCodes::ValueType opcode, 
                         size_t res = 200)
        : ByteBuffer(res),
          m_opcode(opcode)
    {
    }

    // copy constructor
    WorldPacket(const WorldPacket& packet)
        : ByteBuffer(packet),
          m_opcode(packet.m_opcode)
    {
    }

    WorldPacket& operator=(const WorldPacket &packet) {
        ByteBuffer::operator=(packet);
        m_opcode = packet.m_opcode;

        return *this;
    }

    void Initialize(U16 opcode, size_t newres = 200) {
        clear();
        _storage.reserve(newres);
        m_opcode = opcode;
    }

    OPCodes::ValueType opcode() const { return m_opcode; }
    void opcode(OPCodes::ValueType opcode) { m_opcode = opcode; }

   private:
    friend class boost::serialization::access;

    template <typename Archive>
    void serialize(Archive& ar, const unsigned int version) {
        ACKNOWLEDGE_UNUSED(version);

        ar & boost::serialization::base_object<ByteBuffer>(*this);
        ar & m_opcode;
    }

   protected:
    OPCodes::ValueType m_opcode;
};

};  // namespace Divide

#endif

Commits for Divide-Framework/trunk/Source Code/Networking/Headers/WorldPacket.h

Diff revisions: vs.
Revision Author Commited Message
750 Diff Diff IonutCava picture IonutCava Thu 07 Jul, 2016 16:02:03 +0000

[IonutCava]
- Static analysis based fixes and improvements

540 Diff Diff IonutCava picture IonutCava Wed 28 Oct, 2015 19:06:28 +0000

[IonutCava]
- Remove the “Platform” folder from the Platform project as the name is redundant. Move files one level up

510 Diff Diff IonutCava picture IonutCava Thu 03 Sep, 2015 16:01:22 +0000

[IonutCava]
- Modify VertexBuffer classes to use interleaved data
— Needs a lot of optimizations. Higher RAM and VRAM usage currently, but faster access

457 IonutCava picture IonutCava Mon 01 Jun, 2015 21:45:52 +0000

[Ionut]
- Windows build fix for previous commit