Skip to content

Instantly share code, notes, and snippets.

View DDuarte's full-sized avatar
😴
Dormant

Duarte Duarte DDuarte

😴
Dormant
View GitHub Profile
@DDuarte
DDuarte / gist:1506469
Created December 21, 2011 15:42
CMSG_MESSAGECHAT_ADDON_X
void WorldSession::HandleAddonMessagechatOpcode(WorldPacket& recvData)
{
Player* sender = GetPlayer();
ChatMsg type;
switch (recvData.GetOpcode())
{
case CMSG_MESSAGECHAT_ADDON_BATTLEGROUND:
type = CHAT_MSG_BATTLEGROUND;
break;
@DDuarte
DDuarte / 2fe9bf66ea756e23cbdeeb25efde34779fecf542.patch
Created February 24, 2012 16:37
Trinity - Silinoron - calendar branch
From 2fe9bf66ea756e23cbdeeb25efde34779fecf542 Mon Sep 17 00:00:00 2001
From: Silinoron <silinoron@trinity>
Date: Wed, 27 Jul 2011 14:14:41 -0700
Subject: [PATCH] re-add calendar work on top of current master. DO NOT USE
THIS BRANCH.
---
src/server/game/Calendar/Calendar.cpp | 2 +
src/server/game/Calendar/Calendar.h | 55 ++++-
src/server/game/Calendar/CalendarMgr.cpp | 80 +++++
@DDuarte
DDuarte / gist:2378319
Created April 13, 2012 16:53
BG teleport plr (exploit)
// Find if the player left our start zone; if so, teleport it back
// TODO: This could be a little "expensive", we might want to only run this every X seconds (using diff)
float dist = GetStartMaxDist();
if (dist > 0.0f)
{
float x[2], y[2], z[2], o[2];
GetTeamStartLoc(TEAM_ALLIANCE, x[TEAM_ALLIANCE], y[TEAM_ALLIANCE], z[TEAM_ALLIANCE], o[TEAM_ALLIANCE]);
GetTeamStartLoc(TEAM_HORDE, x[TEAM_HORDE], y[TEAM_HORDE], z[TEAM_HORDE], o[TEAM_HORDE]);
uint32 mapId = GetMapId();
@DDuarte
DDuarte / gist:2624878
Created May 6, 2012 22:49
ConcurrentMultiDictionary - C#
// By Nayd
public class ConcurrentMultiDictionary<TKey, TValue> : ConcurrentDictionary<TKey, List<TValue>>
{
public bool TryAdd(TKey key, TValue value)
{
List<TValue> container;
if (!TryGetValue(key, out container))
{
container = new List<TValue>();
From 402f59dd04b6f77c39edd2ada84a474697caba37 Mon Sep 17 00:00:00 2001
From: Nay <[email protected]>
Date: Thu, 10 May 2012 16:17:32 +0100
Subject: [PATCH] Remove BinaryReader from Packet and implement our own ReadX
---
WowPacketParser/Misc/Packet.cs | 49 ++++++++++++------
WowPacketParser/Misc/PacketReads.cs | 95 +++++++++++++++++++++++++++++++++++
WowPacketParser/Parsing/Handler.cs | 2 +-
3 files changed, 130 insertions(+), 16 deletions(-)
@DDuarte
DDuarte / gist:2874747
Created June 5, 2012 12:44
Sublime Text 2 + SublimeREPL + CINT

Data/Packages/SublimeREPL/config/C++/Default.sublime-commands:

[
    {
        "caption": "SublimeREPL: C++",
        "command": "run_existing_window_command", "args":
        {
            "id": "repl_cpp",
            "file": "config/C++/Main.sublime-menu"
@DDuarte
DDuarte / gist:2875650
Created June 5, 2012 15:24
Dynamic systems - Maxima
load("basic")$
load("nchrpl")$
fpprintprec: 4$
IsImag(x) := if (imagpart(x) # 0) then true else false$
IsTrueImag(x) := if (IsImag(x) and realpart(x) = 0) then true else false$
IsDoubleEigen(x) := if (length(x[1]) = 1) then true else false$ /* x é uma lista retornada por eigenvalues */
SistAnalyse(f, vars) := block(
@DDuarte
DDuarte / gist:2875705
Created June 5, 2012 15:32
Sublime Text 2 + SublimeREPL + Maxima

Data/Packages/SublimeREPL/config/Maxima/Default.sublime-commands:

[
    {
        "caption": "SublimeREPL: Maxima",
        "command": "run_existing_window_command", "args":
        {
            "id": "repl_maxima",
            "file": "config/Maxima/Main.sublime-menu"
@DDuarte
DDuarte / gist:2962622
Created June 20, 2012 22:29
tc_commands_conversion_fixed
From cf7fe11890aae3bec163eba3dbea666f16d57ea0 Mon Sep 17 00:00:00 2001
From: Xees <[email protected]>
Date: Wed, 20 Jun 2012 23:28:16 +0100
Subject: [PATCH] Scripts/Commands: Convert character and server commands to
commandscript
Closes #6856
---
src/server/game/Chat/Chat.cpp | 79 --
src/server/game/Chat/Chat.h | 59 +--
@DDuarte
DDuarte / debugsendopcode.patch
Created August 3, 2012 17:55
Core/WorldSession: Bypass assigned handler restriction if .debug send opcode command is used
From c4432a8592c7b9b5589a742985d061e7b2e4082c Mon Sep 17 00:00:00 2001
From: Nay <[email protected]>
Date: Fri, 3 Aug 2012 18:54:37 +0100
Subject: [PATCH] Core/WorldSession: Bypass assigned handler restriction if
.debug send opcode command is used
---
src/server/game/Server/WorldSession.cpp | 11 +++++++----
src/server/game/Server/WorldSession.h | 2 +-
src/server/scripts/Commands/cs_debug.cpp | 2 +-