Skip to content
Closed

test #10

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
3774 commits
Select commit Hold shift + click to select a range
5be55b4
Update ChatHandler.cpp
biglad Jun 15, 2025
9df3972
Update ChatHandler.cpp
biglad Jun 15, 2025
81a4f01
Update ChatHandler.cpp
biglad Jun 15, 2025
fddb38d
Update ChatHandler.cpp
biglad Jun 15, 2025
802b28d
123
biglad Jun 16, 2025
1a7cf98
Update cs_misc.cpp
biglad Jun 16, 2025
0c1ec0e
Update cs_misc.cpp
biglad Jun 16, 2025
0ede6a1
Update cs_misc.cpp
biglad Jun 16, 2025
801f646
Update cs_misc.cpp
biglad Jun 16, 2025
faaa8f1
Update cs_misc.cpp
biglad Jun 16, 2025
6a0f7df
Update cs_misc.cpp
biglad Jun 16, 2025
b82e455
Update cs_misc.cpp
biglad Jun 16, 2025
5102ebb
Update cs_misc.cpp
biglad Jun 16, 2025
583dc2c
Update cs_misc.cpp
biglad Jun 16, 2025
4b1370b
Update cs_misc.cpp
biglad Jun 16, 2025
d5eb0a8
Update cs_misc.cpp
biglad Jun 16, 2025
2e25f4d
Update cs_misc.cpp
biglad Jun 16, 2025
8afe308
Update cs_misc.cpp
biglad Jun 16, 2025
f5ed8bf
Update cs_misc.cpp
biglad Jun 16, 2025
4b12566
Update cs_misc.cpp
biglad Jun 16, 2025
03e78e3
Update cs_misc.cpp
biglad Jun 16, 2025
3dda465
Update cs_misc.cpp
biglad Jun 16, 2025
4c42b6c
Update cs_misc.cpp
biglad Jun 16, 2025
70568a6
Update cs_misc.cpp
biglad Jun 16, 2025
b3cc638
Update cs_misc.cpp
biglad Jun 16, 2025
17d334a
Update cs_misc.cpp
biglad Jun 16, 2025
6a04677
Update cs_misc.cpp
biglad Jun 16, 2025
9913589
Update cs_misc.cpp
biglad Jun 16, 2025
3821f64
Update cs_misc.cpp
biglad Jun 16, 2025
7500cb4
Update cs_misc.cpp
biglad Jun 16, 2025
b97c901
Update cs_misc.cpp
biglad Jun 16, 2025
4a75aa4
Update cs_misc.cpp
biglad Jun 16, 2025
48cba2a
Update cs_misc.cpp
biglad Jun 16, 2025
f10345a
Update cs_misc.cpp
biglad Jun 16, 2025
63455a2
Update cs_misc.cpp
biglad Jun 16, 2025
9a575e8
Update cs_misc.cpp
biglad Jun 16, 2025
b5d8313
Update cs_misc.cpp
biglad Jun 16, 2025
603c24f
Update cs_misc.cpp
biglad Jun 16, 2025
36cb4ed
Update cs_misc.cpp
biglad Jun 16, 2025
e3429f8
Update cs_misc.cpp
biglad Jun 16, 2025
89aad26
Update cs_misc.cpp
biglad Jun 16, 2025
e8cc852
Update cs_misc.cpp
biglad Jun 16, 2025
1a4e7db
Update cs_misc.cpp
biglad Jun 16, 2025
8f897b5
Update cs_misc.cpp
biglad Jun 16, 2025
9f17a55
Update cs_misc.cpp
biglad Jun 16, 2025
fa0f0b2
Update cs_misc.cpp
biglad Jun 16, 2025
fe128d9
Update cs_misc.cpp
biglad Jun 16, 2025
4582308
Update cs_misc.cpp
biglad Jun 16, 2025
0407f2f
Update cs_misc.cpp
biglad Jun 16, 2025
5844175
Update cs_misc.cpp
biglad Jun 16, 2025
667ac0a
Update cs_misc.cpp
biglad Jun 16, 2025
d17da1f
Update cs_misc.cpp
biglad Jun 16, 2025
bb360f8
Update cs_misc.cpp
biglad Jun 16, 2025
fd975bf
Update cs_misc.cpp
biglad Jun 16, 2025
abf3448
Update MailHandler.cpp
biglad Jun 16, 2025
98fa5af
Update TradeHandler.cpp
biglad Jun 16, 2025
aa7d48b
Update TradeHandler.cpp
biglad Jun 16, 2025
8f9e870
Update MailHandler.cpp
biglad Jun 16, 2025
2dea993
Update bot_ai.cpp
biglad Jun 16, 2025
8017a06
Update bot_ai.cpp
biglad Jun 16, 2025
864dba3
Update bot_ai.cpp
biglad Jun 16, 2025
ee98c6d
Update bot_ai.cpp
biglad Jun 16, 2025
6fbde98
Update bot_ai.cpp
biglad Jun 16, 2025
e8388b5
Update bot_ai.cpp
biglad Jun 16, 2025
6af46f1
Update bot_ai.cpp
biglad Jun 16, 2025
1ea50b1
Update bot_ai.cpp
biglad Jun 16, 2025
5c519fe
Update bot_ai.cpp
biglad Jun 16, 2025
894d11c
Update bot_ai.cpp
biglad Jun 16, 2025
8b0795d
Update botdatamgr.cpp
biglad Jun 16, 2025
4ae2c79
Update botdatamgr.cpp
biglad Jun 16, 2025
a4e4b61
Update botdatamgr.cpp
biglad Jun 16, 2025
c4b0178
Update botdatamgr.cpp
biglad Jun 16, 2025
50e7b3d
Update botdatamgr.cpp
biglad Jun 16, 2025
2e6e467
Update botdatamgr.cpp
biglad Jun 16, 2025
aaaa8f4
Update botdatamgr.cpp
biglad Jun 16, 2025
7c69ee2
Update Player.cpp
biglad Jun 16, 2025
f51bb75
Update Player.cpp
biglad Jun 16, 2025
1518f18
Update npc_proff_master.cpp
biglad Jun 16, 2025
b42b340
Update Player.cpp
biglad Jun 16, 2025
4a15c24
Update Player.cpp
biglad Jun 16, 2025
b2a02c0
Update Player.cpp
biglad Jun 16, 2025
7a1ca2c
Update Player.cpp
biglad Jun 16, 2025
07f41a1
Update Player.cpp
biglad Jun 16, 2025
7b06712
Update Player.cpp
biglad Jun 16, 2025
3d0a72d
Update Player.cpp
biglad Jun 16, 2025
69d167c
123
biglad Jun 17, 2025
211dcba
Update Player.cpp
biglad Jun 17, 2025
c16ef32
Update Player.cpp
biglad Jun 17, 2025
68daf91
Update Player.cpp
biglad Jun 17, 2025
7b5277a
Update Player.cpp
biglad Jun 17, 2025
7fb246d
Update Player.cpp
biglad Jun 17, 2025
0642f8a
Update Player.cpp
biglad Jun 17, 2025
75289ff
Update World.cpp
biglad Jun 17, 2025
473644e
Update World.h
biglad Jun 17, 2025
44add62
Update Player.cpp
biglad Jun 17, 2025
6800902
Update Player.cpp
biglad Jun 17, 2025
3fa9625
Update Player.cpp
biglad Jun 17, 2025
7bf241e
Update Player.cpp
biglad Jun 17, 2025
2b4c3cf
Update Player.cpp
biglad Jun 17, 2025
74dd92e
Update Player.cpp
biglad Jun 17, 2025
fe467b1
Update Player.cpp
biglad Jun 17, 2025
d8f6deb
Update Player.cpp
biglad Jun 17, 2025
70a748f
Update Player.cpp
biglad Jun 17, 2025
ab88769
Update Player.cpp
biglad Jun 17, 2025
b8c3284
Update Player.cpp
biglad Jun 17, 2025
99023bc
Update Player.cpp
biglad Jun 17, 2025
1651a01
Update Player.cpp
biglad Jun 17, 2025
71c5035
Update Player.cpp
biglad Jun 17, 2025
c3fd244
Update Player.cpp
biglad Jun 17, 2025
0eff8a1
Update Player.cpp
biglad Jun 17, 2025
f2b2ee6
Update Player.cpp
biglad Jun 17, 2025
dc2efb7
Update Player.cpp
biglad Jun 17, 2025
0c0fae4
Update Player.cpp
biglad Jun 17, 2025
aaa5cb0
Update Player.cpp
biglad Jun 17, 2025
05f847f
Update Player.cpp
biglad Jun 17, 2025
1e75989
Update Player.cpp
biglad Jun 17, 2025
3efafda
Update Player.cpp
biglad Jun 17, 2025
2d7f322
123
biglad Jun 17, 2025
1491b37
Update Player.h
biglad Jun 17, 2025
2c4640c
Update Player.h
biglad Jun 17, 2025
c2d07e1
Update Player.cpp
biglad Jun 17, 2025
5074806
Update Player.cpp
biglad Jun 17, 2025
2d39d9f
Update Player.cpp
biglad Jun 17, 2025
379c4a8
Update Player.cpp
biglad Jun 17, 2025
ee2b6d4
Update Player.cpp
biglad Jun 17, 2025
8606435
Update npc_proff_master.cpp
biglad Jun 17, 2025
5edb717
Update npc_proff_master.cpp
biglad Jun 17, 2025
533144b
Update npc_proff_master.cpp
biglad Jun 17, 2025
85b30f9
Update npc_proff_master.cpp
biglad Jun 17, 2025
02bb7d6
Update npc_proff_master.cpp
biglad Jun 17, 2025
7f56b3d
Update npc_proff_master.cpp
biglad Jun 17, 2025
85f7e8a
Update npc_voters_zone.cpp
biglad Jun 17, 2025
e7f6d52
Update npc_voters_zone.cpp
biglad Jun 17, 2025
e21df4e
Update npc_voters_zone.cpp
biglad Jun 17, 2025
66b8d6c
Update npc_megaboss_starter.cpp
biglad Jun 20, 2025
0ad4223
Update server_hooks.cpp
biglad Jun 21, 2025
c397eb6
Update server_hooks.cpp
biglad Jun 21, 2025
61c64c8
Update server_hooks.cpp
biglad Jun 21, 2025
913df5b
Update mga_boss_one.cpp
biglad Jun 22, 2025
fa895ba
Update mga_boss_one.cpp
biglad Jun 22, 2025
52b9ad0
Update mga_boss_one.cpp
biglad Jun 22, 2025
199dada
Update mga_boss_one.cpp
biglad Jun 22, 2025
c2e181b
Update mga_boss_one.cpp
biglad Jun 22, 2025
948a6c6
Update mga_boss_one.cpp
biglad Jun 22, 2025
764b591
Update mga_boss_one.cpp
biglad Jun 22, 2025
01c56f2
Update mga_boss_one.cpp
biglad Jun 22, 2025
26fa507
Update mga_boss_one.cpp
biglad Jun 22, 2025
7bc7451
Update mga_boss_one.cpp
biglad Jun 22, 2025
fd1763f
Update mga_boss_one.cpp
biglad Jun 22, 2025
ab62590
Update mga_boss_one.cpp
biglad Jun 22, 2025
67a0fc3
Update mga_boss_one.cpp
biglad Jun 22, 2025
929949b
Update mga_boss_one.cpp
biglad Jun 22, 2025
10e0bbf
Update mga_boss_one.cpp
biglad Jun 22, 2025
90f8eaa
Update mga_boss_one.cpp
biglad Jun 22, 2025
4d4b7af
Update mga_boss_one.cpp
biglad Jun 22, 2025
f0ab5b9
Update mga_boss_one.cpp
biglad Jun 22, 2025
d0e9bfc
Update mga_boss_one.cpp
biglad Jun 22, 2025
eb2efd9
Update mga_boss_one.cpp
biglad Jun 22, 2025
2a37c44
Update mga_boss_one.cpp
biglad Jun 22, 2025
40e7b15
Update mga_boss_one.cpp
biglad Jun 22, 2025
0b53221
Update mga_boss_one.cpp
biglad Jun 22, 2025
d70e5fa
Update mga_boss_one.cpp
biglad Jun 22, 2025
69d30e0
Update mga_boss_one.cpp
biglad Jun 22, 2025
a10977e
Update mga_boss_one.cpp
biglad Jun 22, 2025
4fb6029
Update mga_boss_one.cpp
biglad Jun 22, 2025
ffaa665
Update mga_boss_one.cpp
biglad Jun 22, 2025
3725279
Update mga_boss_one.cpp
biglad Jun 22, 2025
f76eed8
Update mga_boss_one.cpp
biglad Jun 22, 2025
d9fc51d
Update mga_boss_one.cpp
biglad Jun 22, 2025
2e91df8
Update mga_boss_one.cpp
biglad Jun 22, 2025
f1cf536
Update mga_boss_one.cpp
biglad Jun 22, 2025
f3e63e1
Update mga_boss_one.cpp
biglad Jun 22, 2025
23519ba
Update mga_boss_one.cpp
biglad Jun 22, 2025
bcfe65e
Update mga_boss_one.cpp
biglad Jun 22, 2025
04f31f2
Update mga_boss_one.cpp
biglad Jun 22, 2025
b01e27a
Update mga_boss_one.cpp
biglad Jun 22, 2025
fa34895
Update mga_boss_one.cpp
biglad Jun 22, 2025
d556f1d
Update mga_boss_one.cpp
biglad Jun 22, 2025
e962c18
Update mga_boss_one.cpp
biglad Jun 22, 2025
15086f5
Update mga_boss_one.cpp
biglad Jun 22, 2025
df34332
Update npc_megaboss_starter.cpp
biglad Jun 22, 2025
758a756
Update mga_boss_one.cpp
biglad Jun 22, 2025
9851fcf
Update mga_boss_one.cpp
biglad Jun 23, 2025
e0e2f0a
Update mga_boss_one.cpp
biglad Jun 23, 2025
a1d2a77
Update mga_boss_one.cpp
biglad Jun 23, 2025
8ee66ab
Update mga_boss_one.cpp
biglad Jun 23, 2025
8c1f7ae
Update player_hooks.cpp
biglad Jun 23, 2025
16f37f7
Update player_hooks.cpp
biglad Jun 23, 2025
92d6979
Update player_hooks.cpp
biglad Jun 23, 2025
a5cd2cf
Update mga_boss_one.cpp
biglad Jun 23, 2025
f853dd8
123
biglad Jun 23, 2025
a43f6bf
Update player_hooks.cpp
biglad Jun 23, 2025
c966115
Update CharacterHandler.cpp
biglad Jun 23, 2025
0448659
Update CharacterHandler.cpp
biglad Jun 23, 2025
5251857
Update CharacterHandler.cpp
biglad Jun 23, 2025
282cd59
Update CharacterHandler.cpp
biglad Jun 23, 2025
416e533
Update CharacterHandler.cpp
biglad Jun 23, 2025
bea0a5e
Update mga_boss_one.cpp
biglad Jun 23, 2025
1f40a78
Update mga_boss_one.cpp
biglad Jun 23, 2025
b7d23b5
123
biglad Jun 24, 2025
8925187
Update AchievementMgr.cpp
biglad Jun 24, 2025
02ff8a8
Update mga_boss_one.cpp
biglad Jun 29, 2025
292fb46
Update mga_boss_one.cpp
biglad Jun 29, 2025
bd7bffb
Create Trinity_Jukebox.sql
biglad Jun 29, 2025
9b52d85
Create world2.zip
biglad Jun 29, 2025
3c06b11
123
biglad Jun 30, 2025
0387ac8
Update instance_stormwind_vault.cpp
biglad Jun 30, 2025
97edf9c
Merge branch 'trickerer:npcbots_3.3.5' into npcbots_3.3.5
biglad Jul 5, 2025
7e47603
Update player_hooks.cpp
biglad Jul 10, 2025
4b9afbb
Update player_hooks.cpp
biglad Jul 10, 2025
3c21a26
Update player_hooks.cpp
biglad Jul 10, 2025
68f7142
Update Player.cpp
biglad Jul 17, 2025
c21ae74
Update Player.cpp
biglad Jul 17, 2025
51ca9b0
321
biglad Jul 18, 2025
17d5adc
Update AchievementMgr.cpp
biglad Jul 18, 2025
39413fe
Update player_hooks.cpp
biglad Jul 18, 2025
08f52a6
Update player_hooks.cpp
biglad Jul 18, 2025
a0edbd7
Update CharacterHandler.cpp
biglad Jul 18, 2025
2a7a9e9
Update CharacterHandler.cpp
biglad Jul 18, 2025
78265ea
Update CharacterHandler.cpp
biglad Jul 18, 2025
30a764a
Update DiscordWebhookMgr.cpp
biglad Jul 19, 2025
16e9fa2
321
biglad Jul 19, 2025
bd5c90e
123
biglad Jul 19, 2025
e5024b3
Update server_hooks.cpp
biglad Jul 19, 2025
9ccf345
Update player_hooks.cpp
biglad Jul 19, 2025
ef191e3
Update DiscordWebhookMgr.cpp
biglad Jul 19, 2025
a491462
Update player_hooks.cpp
biglad Jul 19, 2025
3c7fa51
123
biglad Jul 19, 2025
5aa2ce0
XP flask
biglad Jul 20, 2025
7fd9f5c
Update xp_boost_spell.cpp
biglad Jul 20, 2025
f7877af
Update npc_voters_zone.cpp
biglad Jul 20, 2025
b7f4e74
Update npc_voters_zone.cpp
biglad Jul 21, 2025
93f8811
Update npc_voters_zone.cpp
biglad Jul 21, 2025
1ebb43a
who list
biglad Jul 22, 2025
19c3ee9
Update npc_token_exchange.cpp
biglad Jul 22, 2025
6a46442
Update npc_vote_teleport.cpp
biglad Jul 22, 2025
3745a0d
Update npc_token_exchange.cpp
biglad Jul 22, 2025
168c936
123
biglad Jul 22, 2025
cdc5f06
Update botcommands.cpp
biglad Aug 1, 2025
26eb04f
Update botcommands.cpp
biglad Aug 1, 2025
ec3d1ea
Merge branch 'trickerer:npcbots_3.3.5' into npcbots_3.3.5
biglad Aug 12, 2025
321c6ba
Update Player.cpp
biglad Aug 18, 2025
65b3e3a
Update server_hooks.cpp
biglad Aug 18, 2025
ea89be1
Update server_hooks.cpp
biglad Aug 18, 2025
f509397
Update SpellAuraEffects.cpp
biglad Aug 21, 2025
235891a
Merge branch 'trickerer:npcbots_3.3.5' into npcbots_3.3.5
biglad Aug 24, 2025
baba076
123
biglad Aug 31, 2025
28edd98
Merge branch 'trickerer:npcbots_3.3.5' into npcbots_3.3.5
biglad Aug 31, 2025
3f6ea2d
123
biglad Sep 8, 2025
be50440
321
biglad Sep 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
113 changes: 113 additions & 0 deletions ArkChat/IRCClient.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
* Copyright (C) 2005 - 2012 MaNGOS <http://www.getmangos.com/>
*
* Copyright (C) 2008 - 2012 Trinity <http://www.trinitycore.org/>
*
* Copyright (C) 2010 - 2012 ProjectSkyfire <http://www.projectskyfire.org/>
*
* Copyright (C) 2011 - 2012 ArkCORE <http://www.arkania.net/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "gamePCH.h"
#include "IRCClient.h"
#include "../game/World/World.h"
#include "../Globals/ObjectMgr.h"
#include "../game/Maps/MapManager.h"

#include "../../../../dep/acelite/ace/Singleton.h"
//INSTANTIATE_SINGLETON_1( IRCClient );

#ifdef WIN32
#define Delay(x) Sleep(x)
#else
#define Delay(x) sleep(x / 1000)
#endif
// IRCClient Constructor
IRCClient::IRCClient()
{
for(int i = 0;i > 5;i++)
sIRC.Script_Lock[i] = false;
}
// IRCClient Destructor
IRCClient::~IRCClient(){}

// ZThread Entry This function is called when the thread is created in Master.cpp (trinitycore)
void IRCClient::run()
{
sIRC.iLog.WriteLog(" %s : ****** ArkCORE With ArkChat Has Been Started ******", sIRC.iLog.GetLogDateTimeStr().c_str());

// before we begin we wait a few
// mangos is still starting up.
ACE_Based::Thread::Sleep(500);
sLog->outString("\n%s\n%s\n%s\n%s",
"***************************************",
"** ArkChat Threaded IRC Client **",
"** With Enhanced GM Control. **",
"***************************************");
sLog->outString("****** ArkChat: %s ********", sIRC._Mver.c_str());
int cCount = 1;
// Clean Up MySQL Tables
sLog->outString("*** ArkChat: Cleaning Up Inchan Table*");
WorldDatabase.PExecute("DELETE FROM `IRC_Inchan`");
sIRC._Max_Script_Inst = 0;
// Create a loop to keep the thread running untill active is set to false
while(sIRC.Active && !World::IsStopped())
{
// Initialize socket library
if(this->InitSock())
{
// Connect To The IRC Server
sLog->outString("*** ArkChat: Connecting to %s Try # %d ******", sIRC._Host.c_str(), cCount);
if(this->Connect(sIRC._Host.c_str(), sIRC._Port))
{
// On connection success reset the connection counter
cCount = 0;
sLog->outString("*** ArkChat: Connected And Logging In*");
// Login to the IRC server
if(this->Login(sIRC._Nick, sIRC._User, sIRC._Pass))
{
sLog->outString("*** ArkChat: Logged In And Running!! *");
// While we are connected to the irc server keep listening for data on the socket
while(sIRC.Connected && !World::IsStopped()){ sIRC.SockRecv(); }
}
sLog->outString("*** ArkChat: Connection To IRC Server Lost! ***");
}
// When an error occures or connection lost cleanup
Disconnect();
// Increase the connection counter
cCount++;
// if MAX_CONNECT_ATTEMPT is reached stop trying
if(sIRC._MCA != 0 && cCount == sIRC._MCA)
sIRC.Active = false;
// If we need to reattempt a connection wait WAIT_CONNECT_TIME milli seconds before we try again
if(sIRC.Active)
ACE_Based::Thread::Sleep(sIRC._wct);
}
else
{
// Socket could not initialize cancel
sIRC.Active = false;
sLog->outError("** ArkChat: Could not initialize socket");
}
}
while(!World::IsStopped()){};
}

std::string IRCClient::GetChatLine(int nItem)
{
return sIRC.ILINES[nItem];
}
253 changes: 253 additions & 0 deletions ArkChat/IRCClient.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
/*
* Copyright (C) 2005 - 2012 MaNGOS <http://www.getmangos.com/>
*
* Copyright (C) 2008 - 2012 Trinity <http://www.trinitycore.org/>
*
* Copyright (C) 2010 - 2012 ProjectSkyfire <http://www.projectskyfire.org/>
*
* Copyright (C) 2011 - 2012 ArkCORE <http://www.arkania.net/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#ifndef _IRC_CLIENT_H
#define _IRC_CLIENT_H

#include "../../../../dep/acelite/ace/Singleton.h"
#include "../Entities/Player/Player.h"
#include "IRCLog.h"
#include "IRCCmd.h"

using namespace std;
// The maximum ammount of channels used, must be >= config option
#define MAX_CONF_CHANNELS 10
#define MAX_CHAT_LINES 10
// time we need to wait before we try another connecton attempt
// Default is 30 seconds
#define MAX_SCRIPT_INST 10
// CLINES is used for the default chatlines
// By using the GetChatLine function its easier and faster
// to receieve the line you need.
enum CLINES
{
IRC_WOW = 0,
WOW_IRC = 1,
JOIN_WOW = 2,
JOIN_IRC = 3,
LEAVE_WOW = 4,
LEAVE_IRC = 5,
CHANGE_NICK = 6
};
// CACTION is used by the Handle_WoW_Channel function
// this function is called in channel.h when a player
// joins or leave a channel inside the client.
enum CACTION
{
CHANNEL_JOIN,
CHANNEL_LEAVE,
};

enum script_Names
{
MCS_Players_Online = 0,
};

// IRCClient main class
class IRCClient : public ACE_Based::Runnable
{
public:
// IRCClient Constructor
IRCClient();
// IRCClient Destructor
~IRCClient();
// ZThread Entry
void run();
public:
// AH Function
void AHFunc(uint64 itmid, std::string itmnme, std::string plname, uint32 faction);
//bool BeenToGMI(float posx, float posy, std::string player, std::string from);
// IRCClient active
bool Active;
// Connected to IRC
bool Connected;
// Socket indentifier
int SOCKET;
fd_set sfdset;
// Send data to IRC, in addition the endline is added \n
bool SendIRC(std::string data);
// This function is called in ChatHandler.cpp and processes the chat from game to IRC
void Send_WoW_IRC(Player *plr, std::string Channel, std::string Msg);
// Sends a message to all players on the specified channel
void Send_WoW_Channel(const char *channel, std::string chat);
// Send a system message to all players
void Send_WoW_System(std::string Message);
// Send a message to the specified IRC channel
void Send_IRC_Channel(std::string sChannel, std::string sMsg, bool NoPrefix = false, std::string nType = "PRIVMSG");
// Sends a message to all IRC Channels
void Send_IRC_Channels(std::string sMsg);
std::string MakeMsg(std::string msg, std::string var, std::string val)
{
std::size_t start = msg.find(var);
if (start != std::string::npos)
msg.replace(start, var.length(), val);
return msg;
}
void Send_WoW_Player(string sPlayer, string sMsg);
void Send_WoW_Player(Player *plr, string sMsg);

// This function is called in Channel.cpp and processes Join/leave messages
void Handle_WoW_Channel(std::string Channel, Player *plr, int nAction);
void ResetIRC();
public:
void AutoJoinChannel(Player *plr);

public:
bool Script_Lock[5];
bool _AmiOp;

public:
string _Mver;
// IRC Server host
string _Host;
// IRC Server Port
int _Port;
// IRC Username
string _User;
// IRC Password
string _Pass;
// IRC Nickname
string _Nick;
//Password for in-game channel
std::string _irc_pass[MAX_CONF_CHANNELS];
// Authentication type
int _Auth;
string _Auth_Nick;
// IRC Connect code
string _ICC;
// IRC Default channel
string _defchan;
// IRC Leave Default channel
int _ldefc;
// Wait Connect Time
int _wct;
// BotMask Options
int Botmask;
// Status Channel
int Status;
// Announce Channel
int anchn;
int autoanc;
// IRC Channel count
int _chan_count;
// IRC Channel list
// Array to store our IRC channels
// each element will corrospond
// with _wow_chan array below.
std::string _irc_chan[MAX_CONF_CHANNELS];
// Game Channel list
std::string _wow_chan[MAX_CONF_CHANNELS];
// AutoJoin Options
int ajoin;
string ajchan;
// Online Command Max Results
int onlrslt;
// Channel OnJoin/Restart/Kick Messages
string JoinMsg;
string RstMsg;
string kikmsg;
// Misc Options
string ojGM1;
string ojGM2;
string ojGM3;
string ojGM4;
string ojGM5;
string logfile;
string logchan;
string logchanpw;
int logmask;
int games;
int gmlog;
// IRC Commands Security Level
int CACCT;
int CBAN;
int CCHAN;
int CCHAR;
int CFUN;
int CHELP;
int CINCHAN;
int CINFO;
int CITEM;
int CJAIL;
int CKICK;
int _KILL;
int CLEVEL;
int CLOOKUP;
int CMONEY;
int CMUTE;
int CONLINE;
int CPM;
int CRECONNECT;
int CRELOAD;
int CREVIVE;
int CSAVEALL;
int CSERVERCMD;
int CSHUTDOWN;
int CSPELL;
int CSYSMSG;
int CTELE;
int CTOP;
int CWHO;
// BotMask
int BOTMASK;
// Max connect attempt
int _MCA;
// Auto rejoin when kicked from irc
int _autojoinkick;
// IRC Command prefix
string _cmd_prefx;
int _op_gm;
int _op_gm_lev;
// Array that contains our chatlines from the conf file
// To increase this value change the MAX_CHAT_LINE define above
// Make sure the number of elements must match your items
// (remeber this starts at 0 so 0..9 is 10 items)
// and that you load the line in the LoadConfig function.
string ILINES[MAX_CHAT_LINES];
string GetChatLine(int nItem);

int _Max_Script_Inst;
// MAX_SCRIPT_INST

IRCLog iLog;

private:
// Returns default chatline based on enum CLINES
// Initialize socket library
bool InitSock();
// Connect to IRC Server
bool Connect(const char *cHost, int nPort);
// Login to IRC Server
bool Login(std::string sNick, std::string sUser, std::string sPass);
// Send raw data to IRC
bool SendData(const char *data);
// Disconnect from IRC and cleanup socket
void Disconnect();
// Processes the data receieved from IRC
void Handle_IRC(std::string sData);
// Receieves data from the socket.
void SockRecv();
};
#endif
#define sIRC (*ACE_Singleton<IRCClient, ACE_Null_Mutex>::instance())
Loading