Re: [server regulator]CloudyServ 0.982-X3 Public Release [message #484732 is a reply to message #340914] |
Sat, 30 November 2013 18:13 ![Go to previous message Go to previous message](/theme/Renegade_Forums/images/up.png) ![Go to next message Go to previous message](/theme/Renegade_Forums/images/down.png) |
![](http://renegadeforums.com/images/avatars/Viseroid.jpg) |
Gen_Blacky
Messages: 3250 Registered: September 2006
Karma:
|
General (3 Stars) |
|
|
I tried this without any noticeable problems. Probably should do it another way with the binvar and endline 0x0
Toggle Spoiler
alias TCPLogConnect {
sockopen TCPLog 127.0.0.1 7025
echo -s Status $Sock(TCPLog).status
}
alias TCPLogDisconnect {
sockclose TCPLog
}
on *:sockopen:TCPLog*:{
echo -s Connection
if ($sockerr) {
echo -s Unable to connect $Sock(TCPLOG).wsmsg
}
}
on *:sockread:TCPLog*:{
if ($sockerr) {
return
}
sockread -n &TCPLogRead
if ($sockbr == 0) {
return
}
var %Offset = 0
var %Len = $bvar(&TCPLogRead,0)
if (%Len < 8) {
return
}
if ($bvar(&TCPLogRead,1) == 0) {
%Offset = 1
}
var %ID = $bvar(&TCPLogRead,$calc(%Offset + 1),3).text
var %Message = $bvar(&TCPLogRead,$calc(%Offset + 15),%Len).text
if ( %Message ) {
if (%ID == 000) {
echo -s %ID %Message
}
else if (%ID == 001) {
echo -s %ID %Message
}
else if (%ID == 002) {
echo -s %ID %Message
}
}
}
![http://s18.postimage.org/jc6qbn4k9/bricks3.png](http://s18.postimage.org/jc6qbn4k9/bricks3.png)
[Updated on: Sat, 30 November 2013 18:19] Report message to a moderator
|
|
|