mirror of
https://github.com/mangosfour/server.git
synced 2025-12-20 16:37:04 +00:00
Rebase resync
This commit is contained in:
parent
a0797532e8
commit
1997c1e903
3106 changed files with 11118 additions and 627576 deletions
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/**
|
||||
* This code is part of MaNGOS. Contributor & Copyright details are in AUTHORS/THANKS.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "Common.h"
|
||||
#include "ByteBuffer.h"
|
||||
#include "Opcodes.h"
|
||||
|
||||
// Note: m_opcode and size stored in platfom dependent format
|
||||
// ignore endianess until send, and converted at receive
|
||||
|
|
@ -28,26 +29,27 @@ class WorldPacket : public ByteBuffer
|
|||
{
|
||||
public:
|
||||
// just container for later use
|
||||
WorldPacket() : ByteBuffer(0), m_opcode(0)
|
||||
WorldPacket() : ByteBuffer(0), m_opcode(MSG_NULL_ACTION)
|
||||
{
|
||||
}
|
||||
explicit WorldPacket(uint16 opcode, size_t res = 200) : ByteBuffer(res), m_opcode(opcode) { }
|
||||
explicit WorldPacket(Opcodes opcode, size_t res = 200) : ByteBuffer(res), m_opcode(opcode) { }
|
||||
// copy constructor
|
||||
WorldPacket(const WorldPacket& packet) : ByteBuffer(packet), m_opcode(packet.m_opcode)
|
||||
{
|
||||
}
|
||||
|
||||
void Initialize(uint16 opcode, size_t newres = 200)
|
||||
void Initialize(Opcodes opcode, size_t newres = 200)
|
||||
{
|
||||
clear();
|
||||
_storage.reserve(newres);
|
||||
m_opcode = opcode;
|
||||
}
|
||||
|
||||
uint16 GetOpcode() const { return m_opcode; }
|
||||
void SetOpcode(uint16 opcode) { m_opcode = opcode; }
|
||||
Opcodes GetOpcode() const { return m_opcode; }
|
||||
void SetOpcode(Opcodes opcode) { m_opcode = opcode; }
|
||||
inline const char* GetOpcodeName() const { return LookupOpcodeName(m_opcode); }
|
||||
|
||||
protected:
|
||||
uint16 m_opcode;
|
||||
Opcodes m_opcode;
|
||||
};
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue