Skip to content

Instantly share code, notes, and snippets.

@LordJZ
LordJZ / gist:1128507
Created August 5, 2011 20:57
4.2 move flags
[Flags]
public enum MovementFlags : uint
{
None = 0x00000000,
Forward = 0x00000001,
Backward = 0x00000002,
StrafeLeft = 0x00000004,
StrafeRight = 0x00000008,
TurnLeft = 0x00000010,
TurnRight = 0x00000020,
@LordJZ
LordJZ / gist:1128920
Created August 6, 2011 02:19
IRC command RFC parser
using (var reader = new StreamReader("rfc.txt"))
using (var writer = new StreamWriter("rfc.parsed"))
{
string pad = " ";
string line;
var builder = new StringBuilder(10240);
string cmd = string.Empty;
while ((line = reader.ReadLine()) != null)
{
if (line.Length > 0 && line[0] != ' ')
@LordJZ
LordJZ / gist:1130416
Created August 7, 2011 14:32
Unix time conversion methods
static readonly DateTime s_unixEpochReference = new DateTime(1970, 1, 1, 0, 0, 0, 0);
/// <summary>
/// Represents the beginning of the Unix Epoch in local time.
/// </summary>
public static readonly DateTime UnixEpoch = (0L).AsUnixTime();
/// <summary>
/// Converts the number of seconds passed since UTC Unix Epoch to local time.
/// </summary>
@LordJZ
LordJZ / gist:1193348
Created September 4, 2011 19:05
SMSG_PHASE_SHIFT_CHANGE 4.2.0
using System;
using System.Text;
namespace Kamilla.WorldOfWarcraft.Latest.OpcodeDatas
{
public sealed class SetPhaseShift : PackedData
{
public readonly byte[][] Data = new byte[4][];
public WowGuid Guid;
public uint Unk;
@LordJZ
LordJZ / gist:1249185
Created September 28, 2011 20:35
opcode analogues
static Dictionary<string, string> s_opcodeAnalogues = new Dictionary<string, string>
{
{ "MSG_MOVE_SET_RAW_POSITION_ACK", "CMSG_MOVE_CHARM_PORT_CHEAT" },
{ "OBSOLETE_DROP_ITEM", "CMSG_UNCLAIM_LICENSE" },
{ "SMSG_INSPECT", "SMSG_INSPECT_RESULTS_UPDATE" },
{ "SMSG_EQUIPMENT_SET_SAVED", "SMSG_EQUIPMENT_SET_ID" },
{ "CMSG_EQUIPMENT_SET_DELETE", "CMSG_DELETEEQUIPMENT_SET" },
{ "CMSG_INSTANCE_LOCK_WARNING_RESPONSE", "CMSG_INSTANCE_LOCK_RESPONSE" },
{ "CMSG_UNUSED2", "CMSG_DEBUG_PASSIVE_AURA" },
{ "SMSG_INSTANCE_LOCK_WARNING_QUERY", "SMSG_PENDING_RAID_LOCK" },
@LordJZ
LordJZ / 1.cs
Created October 24, 2011 22:03
using System;
using System.Collections;
using System.Linq;
namespace Kamilla.WorldOfWarcraft.Latest.OpcodeDatas
{
public abstract class PackedData : OpcodeData
{
protected virtual bool IsMaskSequenceSwapped { get { return true; } }
protected abstract int[] MaskSequence { get; }
@LordJZ
LordJZ / lazyopcodedata.cs
Created November 10, 2011 19:54
SMSG_MONSTER_MOVE
using System;
namespace Kamilla.WorldOfWarcraft.Latest.OpcodeDatas
{
public abstract class LazyOpcodeData : OpcodeData
{
protected Action[] m_readers;
protected StreamHandler Reader;
private byte m_readLevel = 0;
@LordJZ
LordJZ / StreamHandler.cs
Created November 14, 2011 18:40
StreamHandler + StructHelper + Time classes
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using Microsoft.Xna.Framework;
namespace Kamilla
{
@LordJZ
LordJZ / gist:1435671
Created December 5, 2011 22:25
SMSG_CHAR_ENUM as of 4.3, reversed in 26 minutes
using System;
using Kamilla.WorldOfWarcraft.Latest.OpcodeDatas;
using Microsoft.Xna.Framework;
namespace Kamilla.WorldOfWarcraft.Latest.Parsers.Lobby
{
[WowPacketParser(WowOpcodes.SMSG_ENUM_CHARACTERS_RESULT)]
internal sealed class CharEnumParser : WowPacketParser
{
protected unsafe override void Parse()
@LordJZ
LordJZ / gist:1460486
Created December 11, 2011 13:01
Area triggers created
Created Objects: 9
________________________________________
(DynamicObject, Counter: 198306) Type: DynamicObject
Movement: Flags: None
Position: {X:3856,047 Y:929,2022 Z:55,88532}
OBJECT_FIELD_GUID = (DynamicObject, Counter: 198306)
OBJECT_FIELD_TYPE = 65 0
OBJECT_FIELD_ENTRY = 43265
OBJECT_FIELD_SCALE_X = 1.0000