Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3938441
MediaWiki.tcl
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
MediaWiki.tcl
View Options
#
# MediaWiki RC
#
#
# Configuration
#
set
MediaWikiRC
(
source
)
127.0
.0.1
set
MediaWikiRC
(
port
)
8675
set
MediaWikiRC
(
channel
)
#
wolfplex
set
MediaWikiRC
(
color
)
0
# This code implements "A simple UDP server"
# sample from http://tcludp.sourceforge.net/
package
require udp
#Handles UDP event from $sock
proc
mediawiki_rc_udp_event_handler
{
sock
}
{
global
MediaWikiRC
set
pkt
[
read
$sock
]
set
peer
[
fconfigure
$sock
-
peer
]
#Check if peer is source IP to avoid flood
if
{[
string
range
$peer
0
[
string
length
$MediaWikiRC
(
source
)]
-
1
]
==
$MediaWikiRC
(
source
)}
{
if
$MediaWikiRC
(
color
)
{
puthelp
"PRIVMSG $MediaWikiRC(channel) :$pkt"
}
{
puthelp
"PRIVMSG $MediaWikiRC(channel) :[stripcodes abcgru $pkt]"
}
}
{
putdebug
"$peer: [string length $pkt] {$pkt}"
}
return
}
#Listens UDP on $port
proc
mediawiki_rc_udp_listen
{
port
}
{
set
srv
[
udp_open
$port
]
fconfigure
$srv
-
buffering none
-
translation binary
fileevent
$srv
readable
[
list
::
mediawiki_rc_udp_event_handler
$srv
]
#putdebug "Listening on udp port: [fconfigure $srv -myport]"
return
$srv
}
mediawiki_rc_udp_listen
$MediaWikiRC
(
port
)
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 26, 02:09 (18 h, 47 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2314152
Default Alt Text
MediaWiki.tcl (1 KB)
Attached To
Mode
rVIPERSERV ViperServ scripts [legacy Mercurial repo]
Attached
Detach File
Event Timeline
Log In to Comment