1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-07-08 01:47:11 +02:00

Switch to identifier based events in IRC session to be consistent with the main plugin events.

This commit is contained in:
Sandu Liviu Catalin
2016-05-24 21:36:02 +03:00
parent 850a742071
commit da5e83151c
5 changed files with 196 additions and 353 deletions

View File

@ -269,6 +269,16 @@ public:
m_Data = data;
}
/* --------------------------------------------------------------------------------------------
* Retrieve an event supported by this session.
*/
Function & GetEvent(Int32 evid);
/* --------------------------------------------------------------------------------------------
* Bind to an event supported by this session.
*/
void BindEvent(Int32 evid, Object & env, Function & func);
/* --------------------------------------------------------------------------------------------
* Retrieve the server address.
*/
@ -1054,21 +1064,6 @@ public:
return m_OnConnect;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnConnect(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnConnect.ReleaseGently();
}
else
{
m_OnConnect = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1077,21 +1072,6 @@ public:
return m_OnNick;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnNick(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnNick.ReleaseGently();
}
else
{
m_OnNick = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1100,21 +1080,6 @@ public:
return m_OnQuit;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnQuit(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnQuit.ReleaseGently();
}
else
{
m_OnQuit = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1123,21 +1088,6 @@ public:
return m_OnJoin;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnJoin(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnJoin.ReleaseGently();
}
else
{
m_OnJoin = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1146,21 +1096,6 @@ public:
return m_OnPart;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnPart(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnPart.ReleaseGently();
}
else
{
m_OnPart = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1169,21 +1104,6 @@ public:
return m_OnMode;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnMode(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnMode.ReleaseGently();
}
else
{
m_OnMode = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1192,21 +1112,6 @@ public:
return m_OnUmode;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnUmode(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnUmode.ReleaseGently();
}
else
{
m_OnUmode = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1215,21 +1120,6 @@ public:
return m_OnTopic;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnTopic(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnTopic.ReleaseGently();
}
else
{
m_OnTopic = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1238,21 +1128,6 @@ public:
return m_OnKick;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnKick(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnKick.ReleaseGently();
}
else
{
m_OnKick = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1261,21 +1136,6 @@ public:
return m_OnChannel;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnChannel(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnChannel.ReleaseGently();
}
else
{
m_OnChannel = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1284,21 +1144,6 @@ public:
return m_OnPrivMsg;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnPrivMsg(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnPrivMsg.ReleaseGently();
}
else
{
m_OnPrivMsg = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1307,21 +1152,6 @@ public:
return m_OnNotice;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnNotice(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnNotice.ReleaseGently();
}
else
{
m_OnNotice = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1330,21 +1160,6 @@ public:
return m_OnChannelNotice;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnChannelNotice(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnChannelNotice.ReleaseGently();
}
else
{
m_OnChannelNotice = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1353,21 +1168,6 @@ public:
return m_OnInvite;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnInvite(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnInvite.ReleaseGently();
}
else
{
m_OnInvite = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1376,21 +1176,6 @@ public:
return m_OnCtcpReq;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnCtcpReq(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnCtcpReq.ReleaseGently();
}
else
{
m_OnCtcpReq = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1399,21 +1184,6 @@ public:
return m_OnCtcpRep;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnCtcpRep(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnCtcpRep.ReleaseGently();
}
else
{
m_OnCtcpRep = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1422,21 +1192,6 @@ public:
return m_OnCtcpAction;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnCtcpAction(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnCtcpAction.ReleaseGently();
}
else
{
m_OnCtcpAction = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1445,21 +1200,6 @@ public:
return m_OnUnknown;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnUnknown(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnUnknown.ReleaseGently();
}
else
{
m_OnUnknown = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1468,21 +1208,6 @@ public:
return m_OnNumeric;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnNumeric(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnNumeric.ReleaseGently();
}
else
{
m_OnNumeric = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1491,21 +1216,6 @@ public:
return m_OnDccChatReq;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnDccChatReq(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnDccChatReq.ReleaseGently();
}
else
{
m_OnDccChatReq = Function(env.GetVM(), env, func.GetFunc());
}
}
/* --------------------------------------------------------------------------------------------
* ...
*/
@ -1513,21 +1223,6 @@ public:
{
return m_OnDccSendReq;
}
/* --------------------------------------------------------------------------------------------
* ...
*/
void BindOnDccSendReq(Object & env, Function & func)
{
if (func.IsNull())
{
m_OnDccSendReq.ReleaseGently();
}
else
{
m_OnDccSendReq = Function(env.GetVM(), env, func.GetFunc());
}
}
};
} // Namespace:: SqMod