搜索
查看: 5878|回复: 14

[AMXX 带源码] 在服务器里直接用ICQ联系OP

[复制链接]
发表于 2009-5-27 18:04:07 | 显示全部楼层 |阅读模式 来自 中国–广东–深圳–宝安区
本帖最后由 eason39 于 2009-5-27 18:06 编辑

在服务器里直接用ICQ联系OP 大概意思可能是这样。
This plugin with module allow you to add ICQ/AIM ability to your server.
Features:
Players can send ICQ message to admin(s) thru say command.
Admins can display message in server chat by sending ICQ message, or execute commands on server console (adminicq_allowexec should be set to 1).
You can use ICQBot module to write your own ICQ message processing plugin.
Also works with AIM (use screen names instead of UINs).
This plugin was written with FFAC plugin in mind (https://forums.alliedmods.net/showthread.php?t=55900), so default trigger to send message on ICQ is !admin, but you can change it to what ever you want.

Module was written under AMXX 1.8.0 SDK, but I use it on server with AMXX 1.8.1. Tested on Windows and Linux HLDM dedicated servers.

For ICQ protocol implementation I used AOL AIM Custom Client SDK version 1.6.8 (http://dev.aol.com/aim/sdk). This was most fast way to get ICQ functionality. But if someone will point me to good OpenSource ICQ library I will try to switch to it.

How to setup:
Files from acclib folder place in Windows\system32 folder or near hlds.exe (the just simple should be in app folder or in folders that are in PATH system variable). On Lunix systems place near hlds_run or where server could load it. This is necessary and sufficient part of AOL SDK libraries.
icqbot_amxx.dll (icqbot_amxx_i386.so for Linux) should be placed in amxmodx\modules folder.
adminicq.amxx should be placed in amxmodx\plugins folder.
Add icqbot string at the end of modules.ini.
Add adminicq.amxx string at the end of plugins.ini.
You should have registered ICQ account for use on server. You can prepare account for use (with some other ICQ client): enable option "All users can add me to their contact list without authorization" or add desired admins to contact list and ask them for authorization (when this is not obligatory, this will allow admins to watch the server is running and help server to bypass admin's ICQ client antispam protection if any).
Under Linux you must have libnspr4 and libnss3 packages installed.
Also under Linux you should: create symbolic links to nss and nspr libs near hlsd_run. You can use those commands to do this (tested on debian, on it you should have libnspr4-0d and nss3-0d packages installed):
ln -s /usr/lib/libnspr4.so.0d libnspr4.so
ln -s /usr/lib/libnss3.so.0d libnss3.so
ln -s /usr/lib/xulrunner/libnssckbi.so libnssckbi.so
ln -s /usr/lib/libplc4.so.0d libplc4.so
ln -s /usr/lib/libplds4.so.0d libplds4.so
ln -s /usr/lib/libsmime3.so.0d libsmime3.so
ln -s /usr/lib/libsoftokn3.so.0d libsoftokn3.so
ln -s /usr/lib/libssl3.so.0d libssl3.so

Also this library is used, but link to it is not needed (doesn't know why), anyway you can create it too:
ln -s /usr/lib/xulrunner/libfreebl3.so libfreebl3.so
You should set in server.cfg:
icqbot_uin "ICQ_account_number_for_server"
icqbot_pass "ICQ_account_password"
adminicq_admins "admin_ICQ_number;another_admin_ICQ_numbe r"
// for example
// icqbot_uin "123456789"
// icqbot_pass "fd2$terf"
// adminicq_admins "123456;987654"

Also you can set in server.cfg:
adminicq_trigger "!admin" // 31 char max. Default is "!admin". If empty (""), players can't send administrative alert. Notification is also will not be displayed.
adminicq_showinfo 1 // show notification that players can send ICQ message to admin. Default is 1.
adminicq_flood_time 600 // time range (in seconds) in which player can send 4 messages to admin (flood protection). Default is 600.
adminicq_allowexec 0 // If 1 allow execution of commands received thru ICQ, otherwise if 0 just say text to all users. Default is 0.


There are some limitations on messages length:
message received by module is truncated to 1023 chars before calling forward function in plugin.
when you are in say mode (adminicq_allowexec 0) you can say no more than 63 chars. I.e. all after this is lost. Also only first row in message is displayed (Upto 63 chars or carriage return).
when you are in admin mode (adminicq_allowexec 1) only one command allowed in one message (others are skipped). Command will be truncated to 63 chars.
To prevent futher questions why this plugin is needed when there is one already (FFAC ICQ bot). Let's I describe the conceptions:

1. FFAC ICQ bot:
User type "!admin message".
Plugin catch say event. Then it check for "!admin" string if it is, plugin prepare next info: admin ICQ, message, and send this info by UDP packet to predefined master server.
Master server is running special program that waits such UDP packets and, when receives, it send an ICQ message to specified admin ICQ.

2. AdminICQ plugin:
Special module on HL server starts ICQ client using icqbot_uin and icqbot_pass "CVARs" information (they are not really CVARs, but this is not important).
User type "!admin message".
Plugin catch say event. Then it check for "!admin" string if it is, plugin call for module running ICQ client send message to specified admin ICQ.
ICQ Client running in separate thread on HL server send message.


Next to do:
User messages processing: subscribing on in game events, such as notification about your friend is come to play on server, your faivorite map is started and so on.
Change log for plugin:
1.7
[!]Fixed: if no rcon password specified it will be set to random value on execution time of the command.
1.6
[!]Fixed: character escaping is now correct in message sended to admin on trigger.
1.5
[!]Changed: CVAR changed from adminicq_sendto to adminicq_admins!
[+]Added: now commands in execute mode (adminicq_allowexec 1) are executed thru rcon and output of command is sent back to admin. If execution thru rcon is unsuccessfull command is executed directly in console and admin receive no output.
[!]Fixed: added trimming of uins before comparing in admins check.
1.4
[!]Fixed: message in say mode (adminicq_allowexec 0) is now truncated to 63 chars. In previous version if message exceeded 514 chars server can't say it.
1.3
[!]Fixed: if adminicq_trigger is empty ("") players can't send administrative alerts, but notification about AdminICQ is displayed to them. Now notification will not be displayed if adminicq_trigger is empty ("").
1.2
[+]Added: server can receive messages via ICQ client and execute them on server console as commands if adminicq_allowexec set to 1 or just display message to all players if adminicq_allowexec set to 0 (default behaviour).
[+]Added: new CVAR adminicq_allowexec. Default 0. If 0 first string from message will be displayed to all players in chat area (simply say command at server console), otherwise (if 1) execute each row of message as command at server console.
1.1
[!]Fixed: ICQ client goes offline on map change.

Change log for module:
1.5
[!]Fixed: if ICQ goes offline somehow it will try to reconnect.
1.4
[!]New: Linux version released.
[!]Changed: jgtktlk.dll and sipXtapi.dll are removed from acclib.zip (now Windows acclib.zip) because they are unneeded.
[!]Changed: icqbot.amxx and icqbot.sma are removed because functionality of this plugin now moved into module.
[!]Changed: incoming message truncation lenght reduced to 1023.
1.2
[+]Added: server can receive messages via ICQ client.
1.1
[!]Fixed: ICQ client goes offline on map change.

You need to download acclib.zip and ICQBot.zip apropriate to your system type and AdminICQ.zip. SMA files was not included on the page because they reference INC file, so they all reside in archives. You should redownload only AdminICQ and ICQBot.zip archives on version changes, acclib.zip will not change unless specified.
传上源码  希望有会写程序的能改成联系QQ(实时举报作弊或者举报捣乱者)
点击下载
发表于 2009-5-27 21:41:14 | 显示全部楼层 来自 中国–辽宁–沈阳
这个不错啊
回复

使用道具 举报

 楼主| 发表于 2009-5-28 10:05:47 | 显示全部楼层 来自 中国–广东–深圳
以前很早就有人发过了  一直没人去理过 希望现在会有人在开发出来  很早以前DCOO就已经有这个功能了
回复

使用道具 举报

发表于 2009-5-31 02:38:31 | 显示全部楼层 来自 中国–上海–上海–闵行区
这个不怎么实用.............国外用的比较多
回复

使用道具 举报

 楼主| 发表于 2009-5-31 04:05:39 | 显示全部楼层 来自 中国–广东–深圳
这个不怎么实用.............国外用的比较多
hackroad 发表于 2009-5-31 02:38

不是不适用只是没人肯改成以QQ方式来通知OP或QQ群
回复

使用道具 举报

发表于 2009-10-8 17:30:44 | 显示全部楼层 来自 中国–广东–深圳
以前很早就有人发过了  一直没人去理过 希望现在会有人在开发出来  很早以前DCOO就已经有这个功能了
回复

使用道具 举报

发表于 2009-10-8 17:37:07 | 显示全部楼层 来自 中国–四川–宜宾
这个事情需要高手来做,如果做成的话,那是非常实用的!
回复

使用道具 举报

发表于 2009-10-16 20:46:41 | 显示全部楼层 来自 中国–浙江–杭州–余杭区
其实这个 很有创意。
我有个思路。
在服务器目录中创建一个。motd1 文件。 用网页代码编写。把OP QQ 写进去 。

在写个插件游戏里 调用motd1 网页文件

感觉这个 没使用价值 。在 娱乐服务器里用用可以 。
回复

使用道具 举报

发表于 2009-11-11 14:57:47 | 显示全部楼层 来自 中国–广东–汕头
什么时候有QQ?
回复

使用道具 举报

发表于 2009-11-12 11:04:32 | 显示全部楼层 来自 中国–广东–河源
现实意义一在
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表