Changeset 39 for trunk/src/trinitycore

Show
Ignore:
Timestamp:
11/19/08 13:26:44 (17 years ago)
Author:
yumileroy
Message:

[svn] * Various small changes here and there.
* Implementing MangChat? IRC system.
* Added new config option, MAX_WHO, can be used to set the limit of characters being sent in a /who request from client.

Original author: XTZGZoReX
Date: 2008-10-12 14:03:38-05:00

Location:
trunk/src/trinitycore
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/trinitycore/CliRunnable.cpp

    r2 r39  
    3737#include "PlayerDump.h" 
    3838#include "Player.h" 
     39#include "IRCClient.h" 
    3940 
    4041//CliCommand and CliCommandHolder are defined in World.h to avoid cyclic deps 
     
    314315    sWorld.SendWorldText(LANG_SYSTEMMESSAGE,textUtf8.c_str()); 
    315316    zprintf("Broadcasting to the world: %s\r\n",textUtf8.c_str()); 
     317 
     318    if((sIRC.BOTMASK & 256) != 0) 
     319    { 
     320        std::string ircchan = "#"; 
     321        ircchan += sIRC._irc_chan[sIRC.anchn].c_str(); 
     322        sIRC.Send_IRC_Channel(ircchan, sIRC.MakeMsg("\00304,08\037/!\\\037\017\00304 System Message \00304,08\037/!\\\037\017 %s", "%s", text), true); 
     323    } 
     324 
    316325} 
    317326 
  • trunk/src/trinitycore/Main.cpp

    r2 r39  
    2626#include "Log.h" 
    2727#include "Master.h" 
     28#include "../game/IRCConf.h" 
     29#include "../game/IRCClient.h" 
    2830 
    2931#ifndef _TRINITY_CORE_CONFIG 
     
    7678    ///- Command line parsing to get the configuration file name 
    7779    char const* cfg_file = _TRINITY_CORE_CONFIG; 
     80    char const* mc_cfg_file = _TRINITY_CORE_CONFIG; 
    7881    int c=1; 
    7982    while( c < argc ) 
     
    136139        return 1; 
    137140    } 
    138      
     141 
     142    sIRC.SetCfg(mc_cfg_file); 
    139143    sLog.outString("Using configuration file %s.", cfg_file); 
    140144     
  • trunk/src/trinitycore/Master.cpp

    r34 r39  
    3939#include "ScriptCalls.h" 
    4040#include "Util.h" 
     41#include "IRCClient.h" 
    4142 
    4243#include "sockets/TcpSocket.h" 
     
    227228        return 1; 
    228229 
     230    ///- Load IRC Config (need DB for gm levels, AutoBroadcast uses world timers) 
     231    sIRC.LoadConfig(sIRC.CfgFile); 
     232 
    229233    ///- Initialize the World 
    230234    sWorld.SetInitialWorldSettings(); 
     
    310314    uint32 loopCounter = 0; 
    311315 
     316    // Start up IRC bot 
     317    ZThread::Thread irc(new IRCClient); 
     318    irc.setPriority ((ZThread::Priority )2); 
     319 
     320 
     321 
    312322    ///- Start up freeze catcher thread 
    313323    uint32 freeze_delay = sConfig.GetIntDefault("MaxCoreStuckTime", 0); 
  • trunk/src/trinitycore/trinitycore.conf.dist

    r34 r39  
    389389#                 3 - disabled for both teams 
    390390# 
     391#    MaxWhoListReturns 
     392#        Set the maximum number of players returned in the /who list and interface. 
     393#        Default: 49 (stable) 
     394# 
    391395#    CharactersPerAccount 
    392396#        Limit numbers of characters per account (at all realms). 
     
    513517StrictCharterNames = 0 
    514518StrictPetNames = 0 
     519MaxWhoListReturns = 49 
    515520CharactersCreatingDisabled = 0 
    516521CharactersPerAccount = 50 
     
    11851190PvPToken.ItemCount = 1 
    11861191NoResetTalentsCost = 0 
     1192 
     1193################################################################################################################### 
     1194# IRC SYSTEM CONFIG 
     1195# 
     1196# irc.active 
     1197#     Enable IRC bot/system 
     1198#     Default: 0 - Disable 
     1199#              0 - Enable 
     1200# irc.icc 
     1201#     IRC connect code 
     1202#     Default: 001 - Welcome To Network msg 
     1203#              375 - Beginning Of MOTD 
     1204#              376 - End Of MOTD 
     1205# 
     1206# irc.host 
     1207#     IRC server to connect to 
     1208# 
     1209# irc.port 
     1210#     IRC server port to use 
     1211#     Default: "6667" - Semi-standard IRC port 
     1212# 
     1213# irc.user 
     1214#     The username/ident to use when connecting to the IRC server 
     1215# 
     1216# irc.nick 
     1217#     IRC nickname to be used by the bot 
     1218# 
     1219# irc.pass 
     1220#     The password to be used to identify to NickServ 
     1221# 
     1222# irc.auth 
     1223#     IRC Authentication Method 
     1224#     Default: 0 - Disable 
     1225#              1 - NickServ - Normal Method - PRIVMSG NickServ :IDENTIFY Password 
     1226#              2 - NickServ - Alternate Method To Identify To A Different Nick - PRIVMSG NickServ :IDENTIFY irc.auth.nick Password 
     1227#              3 - QuakeNet - Normal Method - PRIVMSG Q@CServe.quakenet.org :AUTH irc.nick Password 
     1228#              4 - QuakeNet - Alternate Method To Identify To A Different Nick - PRIVMSG Q@CServe.quakenet.org :AUTH irc.auth.nick Password 
     1229# 
     1230# irc.auth.nick 
     1231#     IRC Nickname to use if Auth method 2 or 4 is used 
     1232# 
     1233# irc.ldef 
     1234#     Leave a defined IRC channel on server connect 
     1235#     Default: 0 - Disable 
     1236#              1 - Enable 
     1237# irc.defchan 
     1238#     IRC channel to leave on server connect if irc.ldef is on 
     1239# 
     1240# irc.wct 
     1241#     Time to wait before (re)attemptimg connection to IRC server 
     1242#     Default: 30000 - (30 Seconds) 
     1243# 
     1244# irc.maxattempt 
     1245#     Maximum attempts to try IRC server 
     1246#     Default: 20 
     1247# 
     1248# irc.auto.announce 
     1249#     Time to wait in Minutes to announce random messages from database. 
     1250#     Default: 30 - (30 Minutes) 
     1251# 
     1252# irc.autojoin_kick 
     1253#     Autojoin IRC channel if kicked 
     1254#     Default: 1 - Enable 
     1255#              0 - Disable 
     1256# 
     1257# irc.command_prefix 
     1258#     IRC command prefix 
     1259#     Example: (.)online all 
     1260# 
     1261# irc.joinmsg 
     1262# irc.rstmsg 
     1263# irc.kickmsg 
     1264#     Bot join/restart/kick messages 
     1265# 
     1266# irc.chan_# 
     1267# wow.chan_# 
     1268#     IRC and WOW channels to link. Leave # out of IRC channel. Both channels _ARE_ case sensitive 
     1269#     Example: irc.chan_1 = "Trinity" 
     1270#              irc.chan_2 = "trinity2" 
     1271#              wow.chan_1 = "world" 
     1272#              wow.chan_2 = "LookingForGroup" 
     1273# 
     1274# irc.StatusChannel 
     1275#     Channel Number To Display Status Messages In (AuctionHouse, Levels, Deaths, Etc) 
     1276#     Default: 1 - Channel ID 1 
     1277# 
     1278# irc.AnnounceChannel 
     1279#     Channel Number To Display Announcements In (Announces, Notifies, Event) 
     1280#     Default: 1 - Channel ID 1 
     1281# 
     1282# irc.op_gm_login 
     1283#     Op The GM In All Channels The Bot Is On When They Log In 
     1284#     Default: 0 - Disable 
     1285#              1 - Enable 
     1286# 
     1287# irc.op_gm_level 
     1288#     The Minimum GM Level Required To Have The Bot Op The User 
     1289#     Default: 5 - GM Level 5 
     1290# 
     1291# irc.ajoin (Experimental/Under Development) 
     1292#     Force players to autojoin an in game channel 
     1293#     Atleast one player must be in the channel on server start, and atleast one person online for invite to work 
     1294#     Default: 0 - Disable 
     1295#              1 - Enable 
     1296# irc.ajchan 
     1297#     Channel to join if above is Enabled. 
     1298# 
     1299# irc.online.result 
     1300#     Maximum number of results per line for the online command 
     1301# 
     1302# chat.*** (Defineable Strings) 
     1303#     wow_* - String is displayed in IRC channel 
     1304#     irc_* - String is displayed in WOW channel 
     1305#     Options: $Name, $Level, $Msg, $GM (not all options work in every string) 
     1306# 
     1307# Botmask 
     1308#     This defines what the bot announces, if its 0 everything is disabled 
     1309#     simply add the values of the elements you want to create this mask. 
     1310#     Example: WoW join/leaves are 1 and IRC join/leaves are 2, if you want both of these active then the BotMask is 3. 
     1311#       (1)Display WoW Chan Join/Leaves In IRC 
     1312#       (2)Display IRC Chan Join/Leaves/NickChanges In WoW 
     1313#       (4)Display Unknown Command Message When Trigger Is Used And No Command Exists 
     1314#       (8)Announce Security Level > 0 As GM At Login 
     1315#       (16)Announce GM In GM ON State AS GM At Login 
     1316#       (32)Return Errors To Notice. (If disabled then default is Private Message) 
     1317#       (64)Display WoW Status Messages (Levels/Deaths) 
     1318#       (128)Display Nick Changes From IRC In WOW 
     1319#       (256)Display WoW Announces/Notifies In IRC 
     1320#       (512)Do Not Let Players Use Commands On Higher GM Level Players 
     1321#       (1024)Enable AuctionHouse Announcements 
     1322# 
     1323# irc.gmlog 
     1324#     Minimum GM level to not show login/pass info in IRC logs 
     1325# 
     1326# irc.logfile.prefix 
     1327#     The prefix of the IRC logfile. Directories can be added here. 
     1328#     Example: "IRC/IRC_" outputs IRC_YYYY-MM-DD.log to the IRC subdirectory in your logs dir 
     1329# 
     1330# irc.fun.games (Experimental/Under Development) 
     1331#     Enable IRC games 
     1332#     Default: 0 - Disable 
     1333#              1 - Enable 
     1334# irc.gm# 
     1335#     GM tag to append to (GM onjoin / online command) IRC color codes are acceptable 
     1336# 
     1337################################################################################################################### 
     1338 
     1339irc.active = 0 
     1340irc.icc = 001 
     1341irc.host = "" 
     1342irc.port = "6667" 
     1343irc.user = "TC" 
     1344irc.nick = "TrinityCoreBot" 
     1345irc.pass = "" 
     1346irc.auth = 0 
     1347irc.auth.nick = "TrinityCoreBot" 
     1348irc.ldef = 0 
     1349irc.defchan = "lobby" 
     1350irc.wct = 30000 
     1351irc.maxattempt = 20 
     1352irc.auto.announce = 30 
     1353irc.autojoin_kick = 1 
     1354irc.command_prefix = "." 
     1355irc.joinmsg = "Trinity Core running. Command trigger is $Trigger." 
     1356irc.rstmsg  = "Trinity Core is restarting..." 
     1357irc.kickmsg = "Do not kick me." 
     1358irc.chan_1 = "mangos" 
     1359wow.chan_1 = "world" 
     1360irc.StatusChannel = 1 
     1361irc.AnnounceChannel = 1 
     1362irc.op_gm_login = 0 
     1363irc.op_gm_level = 3 
     1364irc.ajoin = 1 
     1365irc.ajchan = "world" 
     1366irc.online.result = 30 
     1367chat.wow_irc = "<WoW>$Name [$Level]: $Msg" 
     1368chat.irc_wow = "<IRC>$Name: $Msg" 
     1369chat.join_wow = "[$GM] $Name has joined IRC." 
     1370chat.leave_wow = "[$GM] $Name has left IRC." 
     1371Botmask = 1023 
     1372irc.gmlog = 1 
     1373irc.logfile.prefix = "irc_" 
     1374irc.fun.games = 0 
     1375irc.gm1 = "[Moderator]" 
     1376irc.gm2 = "[Game Master]" 
     1377irc.gm3 = "[BugTracker]" 
     1378irc.gm4 = "[DevTeam Admin]" 
     1379irc.gm5 = "[SysOP]"