Auto Announcement sPWAdmin [need help]

Page 2 of 2 FirstFirst 12
Results 26 to 46 of 46
  1. #26
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: Auto Announcement sPWAdmin [need help]

    Quote Originally Posted by NaMeLeS View Post
    Just kinda offtopicish, whats the best way to make a loop script in ubuntu? Im making a script that checks what time it is and shutsdown the server if its a certain time and i need it to loop to the if time =...
    Posted via Mobile Device
    Same for any computer language

    while (true) {}, syntax may vary

    From what you said though you are better off using cron as that is what it is there for...

  2. #27
    Viva la Vida NaMeLeS is offline
    MemberRank
    Jul 2011 Join Date
    613Posts

    Re: Auto Announcement sPWAdmin [need help]

    Thanks das, I have written the script/s which displays server shutdown notices and then shuts down the server.

    I shall try cron for getting it to run at a certain time.

    Thanks :)

  3. #28
    Member jh281978 is offline
    MemberRank
    Jan 2011 Join Date
    WashingtonLocation
    85Posts

    Re: Auto Announcement sPWAdmin [need help]

    I am still having issues with this, I guess I am still to much of nob with php, more trial and error to come. Thanks guys.

  4. #29
    Enthusiast Suedevander is offline
    MemberRank
    Apr 2011 Join Date
    36Posts

    Re: Auto Announcement sPWAdmin [need help]

    not understood explains again

  5. #30
    Member jh281978 is offline
    MemberRank
    Jan 2011 Join Date
    WashingtonLocation
    85Posts

    Re: Auto Announcement sPWAdmin [need help]

    Ok here is the deal ( I am about ready to pull out all my hair and teeth lol which would make me a very ugly woman )

    This is my crontab:
    Code:
    # /etc/crontab: system-wide crontab
    # Unlike any other crontab you don't have to run the `crontab'
    # command to install the new version when you edit this file
    # and files in /etc/cron.d. These files also have username fields,
    # that none of the other crontabs do.
    
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    
    # m h dom mon dow user	command
    17 *	* * *	root    cd / && run-parts --report /etc/cron.hourly
    25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
    47 6	* * 7	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
    52 6	1 * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
    00 0	* * *	root	/etc/cron.daily/brokenbridge.sh
    00 1	* * *	root	/etc/cron.daily/dream.sh
    00 2	* * *	root	/etc/cron.daily/sumor.sh
    00 4	* * *	root	/etc/cron.daily/intrepid.sh
    00 6	* * *	root	/etc/cron.daily/misfortune.sh
    00 8	* * *	root	/etc/cron.daily/bamboo.sh
    00 10	* * *	root	/etc/cron.daily/sirrywine.sh
    00 11	* * *	root	/etc/cron.daily/ADC1.sh
    30 11	* * *	root	/etc/cron.daily/ADC2.sh
    00 12	* * *	root	/etc/cron.daily/ADC3.sh
    30 12	* * *	root	/etc/cron.daily/ADC4.sh
    00 13	* * *	root	/etc/cron.daily/ADC5.sh
    00 14	* * *	root	/etc/cron.daily/northbarrier.sh
    00 16	* * *	root	/etc/cron.daily/walled.sh
    00 18	* * *	root	/etc/cron.daily/tusk.sh
    00 20	* * *	root	/etc/cron.daily/arrivals.sh
    00 22	* * *	root	/etc/cron.daily/shatice.sh
    00 23	* * *	root	/etc/cron.daily/1K.sh
    45 0,2,4,6,8,10,12,14,16,18,20,22	* * *	root	/etc/cron.hourly/voteAWE.sh
    45 1,3,5,7,9,11,13,15,17,19,21,23	* * *	root	/etc/cron.hourly/welcome.sh
    #
    This is what my .sh's look like:
    Code:
    #!/bin/sh
    
    wget http://my.test.server.!:8080/PWServer/jetty-7.2.0/webapps/pwAdmin/jsp/1K.jsp
    rm *jsp*
    This is what my .jsp's look like:
    Code:
    <%@page contentType="text/html; charset=GBK"%>
    <%@page import="java.lang.*"%>
    <%@page import="java.util.*"%>
    <%@page import="java.text.*"%>
    <%@page import="org.apache.commons.lang.StringEscapeUtils"%>
    <%@page import="protocol.*"%>
    <%@page import="com.goldhuman.auth.*"%>
    <%@page import="com.goldhuman.util.*"%>
    <%@page import="org.apache.commons.logging.Log"%>
    <%@page import="org.apache.commons.logging.LogFactory"%>
    <%@page import="java.io.*"%>
    <%@page import="java.sql.*"%>
    <%
    	//
    	// Coded by [B]aSH from Vendetta Gaming Network.
    	// 
    String msg = "Thousand Streams is under attack. Can anyone protect it?";
    try {
    	protocol.DeliveryDB.broadcast((byte)9,-1,msg);
    }
    catch (Exception e)
    {
    	out.println("<font color=red>Error Attempting to Broadcast Message!</font>");
    }	
    %>
    <%
    out.println("<font color=green>Successfully Sent Broadcast Message!</font>");
    %>
    And I am running my test server on Debian 6.0, with ronny1982's server setup with MySQL.

    I can't get the auto announcements to run at all. I'm dieing here any suggestions, Please. Thanks guys.

  6. #31
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: Auto Announcement sPWAdmin [need help]

    Quote Originally Posted by jh281978 View Post
    Ok here is the deal ( I am about ready to pull out all my hair and teeth lol which would make me a very ugly woman )

    This is my crontab:
    Code:
    # /etc/crontab: system-wide crontab
    # Unlike any other crontab you don't have to run the `crontab'
    # command to install the new version when you edit this file
    # and files in /etc/cron.d. These files also have username fields,
    # that none of the other crontabs do.
    
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    
    # m h dom mon dow user	command
    17 *	* * *	root    cd / && run-parts --report /etc/cron.hourly
    25 6	* * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
    47 6	* * 7	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
    52 6	1 * *	root	test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
    00 0	* * *	root	/etc/cron.daily/brokenbridge.sh
    00 1	* * *	root	/etc/cron.daily/dream.sh
    00 2	* * *	root	/etc/cron.daily/sumor.sh
    00 4	* * *	root	/etc/cron.daily/intrepid.sh
    00 6	* * *	root	/etc/cron.daily/misfortune.sh
    00 8	* * *	root	/etc/cron.daily/bamboo.sh
    00 10	* * *	root	/etc/cron.daily/sirrywine.sh
    00 11	* * *	root	/etc/cron.daily/ADC1.sh
    30 11	* * *	root	/etc/cron.daily/ADC2.sh
    00 12	* * *	root	/etc/cron.daily/ADC3.sh
    30 12	* * *	root	/etc/cron.daily/ADC4.sh
    00 13	* * *	root	/etc/cron.daily/ADC5.sh
    00 14	* * *	root	/etc/cron.daily/northbarrier.sh
    00 16	* * *	root	/etc/cron.daily/walled.sh
    00 18	* * *	root	/etc/cron.daily/tusk.sh
    00 20	* * *	root	/etc/cron.daily/arrivals.sh
    00 22	* * *	root	/etc/cron.daily/shatice.sh
    00 23	* * *	root	/etc/cron.daily/1K.sh
    45 0,2,4,6,8,10,12,14,16,18,20,22	* * *	root	/etc/cron.hourly/voteAWE.sh
    45 1,3,5,7,9,11,13,15,17,19,21,23	* * *	root	/etc/cron.hourly/welcome.sh
    #
    This is what my .sh's look like:
    Code:
    #!/bin/sh
    
    wget http://my.test.server.!:8080/PWServer/jetty-7.2.0/webapps/pwAdmin/jsp/1K.jsp
    rm *jsp*
    This is what my .jsp's look like:
    Code:
    <%@page contentType="text/html; charset=GBK"%>
    <%@page import="java.lang.*"%>
    <%@page import="java.util.*"%>
    <%@page import="java.text.*"%>
    <%@page import="org.apache.commons.lang.StringEscapeUtils"%>
    <%@page import="protocol.*"%>
    <%@page import="com.goldhuman.auth.*"%>
    <%@page import="com.goldhuman.util.*"%>
    <%@page import="org.apache.commons.logging.Log"%>
    <%@page import="org.apache.commons.logging.LogFactory"%>
    <%@page import="java.io.*"%>
    <%@page import="java.sql.*"%>
    <%
    	//
    	// Coded by [B]aSH from Vendetta Gaming Network.
    	// 
    String msg = "Thousand Streams is under attack. Can anyone protect it?";
    try {
    	protocol.DeliveryDB.broadcast((byte)9,-1,msg);
    }
    catch (Exception e)
    {
    	out.println("<font color=red>Error Attempting to Broadcast Message!</font>");
    }	
    %>
    <%
    out.println("<font color=green>Successfully Sent Broadcast Message!</font>");
    %>
    And I am running my test server on Debian 6.0, with ronny1982's server setup with MySQL.

    I can't get the auto announcements to run at all. I'm dieing here any suggestions, Please. Thanks guys.
    *points back to my method with PHP yet again*

  7. #32
    Member jh281978 is offline
    MemberRank
    Jan 2011 Join Date
    WashingtonLocation
    85Posts

    Re: Auto Announcement sPWAdmin [need help]

    das7002 can you explain were the code goes cause I have no idea were to place it or how to use it, ( nob still ) step by step if possible so I can learn some more. Thanks.

  8. #33
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: Auto Announcement sPWAdmin [need help]

    Quote Originally Posted by jh281978 View Post
    das7002 can you explain were the code goes cause I have no idea were to place it or how to use it, ( nob still ) step by step if possible so I can learn some more. Thanks.
    Anywhere you want, it doesn't matter. Lets say you put it into /autoannounce/announce.php

    Then in your cron you'd simply use

    Code:
    php /autoannounce/announce.php "Message to broadcast"
    No more silly shell scripts and JSP stuff

  9. #34
    Omega 343 is offline
    MemberRank
    Oct 2009 Join Date
    Ancient DGN CTYLocation
    5,514Posts

    Re: Auto Announcement sPWAdmin [need help]

    Problem looks to be in your .SH

    you do NOT want to use actual domain name or IP -- instead ALWAYS use 127.0.0.1 : http://forum.ragezone.com/f452/auto-...ml#post6421603

    ---------- Post added at 07:45 PM ---------- Previous post was at 07:37 PM ----------

    Quote Originally Posted by das7002 View Post
    I'd actually recommend just using php5-cli over that

    This doesn't rely on the JSP server running and you can run it from any server that has PHP-CLI support
    No more silly shell scripts and JSP stuff

    You can think it's silly all you want, but at least JSP is something people are going to already have AND be using anyway (pwAdmin). No real reason to install PHP-CLI just for "announcements"...
    Spoiler:
    +plus+ have fun when people start complaining about it not working since they don't have PHP-CLI installed, and people asking you to help with the installation of it =\

  10. #35
    Member jh281978 is offline
    MemberRank
    Jan 2011 Join Date
    WashingtonLocation
    85Posts

    Re: Auto Announcement sPWAdmin [need help]

    Again no luck, but I did find an article about problems running crons if they are writing to a file in my home folder cause its encrypted, so it wouldn't work unless I was logged in to my test sever pc, this might be an issue for this as well. I'm still getting this error from my system log.
    Code:
    (CRON) error (grandchild #2769 failed with exit status 127)
    I'll find it soon more trial and error.

  11. #36
    SON OF MARFEL hrace009 is offline
    MemberRank
    Apr 2009 Join Date
    Pekanbaru, IndoLocation
    1,035Posts

    Re: Auto Announcement sPWAdmin [need help]

    Quote Originally Posted by jh281978 View Post
    Again no luck, but I did find an article about problems running crons if they are writing to a file in my home folder cause its encrypted, so it wouldn't work unless I was logged in to my test sever pc, this might be an issue for this as well. I'm still getting this error from my system log.
    Code:
    (CRON) error (grandchild #2769 failed with exit status 127)
    I'll find it soon more trial and error.
    use webmin

  12. #37
    Member jh281978 is offline
    MemberRank
    Jan 2011 Join Date
    WashingtonLocation
    85Posts

    Re: Auto Announcement sPWAdmin [need help]

    Quote Originally Posted by hrace009 View Post
    use webmin
    I have this downloaded but haven't used it yet. So I'll try again in the morning. Thanks guys.

  13. #38
    Nerd-IO Romulan is offline
    MemberRank
    Feb 2009 Join Date
    BelgiumLocation
    3,333Posts

    Re: Auto Announcement sPWAdmin [need help]

    Spoiler:
    Quote Originally Posted by das7002 View Post
    I'd actually recommend just using php5-cli over that

    PHP Code:
    <?php

    function broadcast($message){
            
    $sock socket_create(AF_INETSOCK_STREAMSOL_TCP);
            if(
    $sock){
                    if(
    socket_connect($sock127.0.0.129100)){
                            
    socket_set_block($sock);
                            
    $data2 mByte(9) . mByte(0) . mInt(-1) . mInt(0) . mString($message);
                            
    $data mUInt32(79) . mUInt32(strlen($data2)) . $data2;
                            
    socket_send($sock$data81920);
                            
    socket_set_nonblock($sock);
                            
    socket_close($sock);
                            echo 
    "Message Sent Successfully";
                    } else {
                            echo 
    "Message Sending Failed";
                    }
            }
    }

    // pack - http://ru2.php.net/pack
    function mByte($p) { return pack('C'$p 0xFF); }

    function 
    mf($i$j) { return ($i >> $j) & 0xFF; }
    function 
    mBytes($p$from)
    {
            
    $packed '';
            for (
    $i $from$i >= 0$i -= 8)
                    
    $packed .= mByte(mf($p,$i));
            return 
    $packed;
    }

    function 
    mChar($p) { return mByte(mf($p,0)) . mByte(mf($p,8)); }
    function 
    mString($s)
    {
            
    $s=iconv('utf-8','utf-16le',$s);
            
    $ret mUInt32(mb_strlen($s));//mUInt32(count($s) * 2);
            
    $s=array_merge(unpack("n*",$s));
            for (
    $i 0;$i count($s); $i++)
            {
                    
    $ret .= mByte(($s[$i]) >> 8);
                    
    $ret .= mByte($s[$i]);
            }
            return 
    $ret;
    }

    function 
    mShort($p) { return mBytes($p,8); }
    function 
    mInt($p) { return mBytes($p,24); }
    function 
    mLong($p) { return mBytes($p,56); }

    function 
    mUInt32($p) {
            if (
    $p 64)
                    return 
    mByte($p);
            if (
    $p 16384)
                    return 
    mShort($p 0x8000);
            if (
    $p 536870912)
                    return 
    mInt($p 0xC0000000);
            return 
    mInt(-32) . mInt($p);
    }
    function 
    mSInt32($p) {
            if (
    $p >= 0)
                    return 
    mUInt32($p);
            
    $t=-$p;
            if (
    $t 64)
                    return 
    mByte($p 0x40);
            if (
    $t 16384)
                    return 
    mShort($p 0xA000);
            if (
    $t 536870912)
                    return 
    mInt($p 0xD0000000);
            return 
    mInt(-16). mInt($p);
    }

    function 
    mOctets($p) {
            
    $packed mUInt32(count($p));
            for (
    $i 0$i count($p); $i++)
                    
    $packed .= mByte($p[$i]);
            return 
    $packed;
    }

    broadcast($argv[1]);

    ?>
    and use

    php whateveryoucalledit.php "Message to broadcast"

    This doesn't rely on the JSP server running and you can run it from any server that has PHP-CLI support


    Great

  14. #39
    Omega 343 is offline
    MemberRank
    Oct 2009 Join Date
    Ancient DGN CTYLocation
    5,514Posts

    Re: Auto Announcement sPWAdmin [need help]

    Quote Originally Posted by jh281978 View Post
    Again no luck, but I did find an article about problems running crons if they are writing to a file in my home folder cause its encrypted, so it wouldn't work unless I was logged in to my test sever pc, this might be an issue for this as well. I'm still getting this error from my system log.
    Code:
    (CRON) error (grandchild #2769 failed with exit status 127)
    I'll find it soon more trial and error.
    You NEED to be more concerned with NETWORK security (opposed to LOCAL security) [you're not dealing with an ATM here...]

    ;)
    Last edited by 343; 30-07-11 at 12:19 PM.

  15. #40
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: Auto Announcement sPWAdmin [need help]

    Quote Originally Posted by 343 View Post

    You can think it's silly all you want, but at least JSP is something people are going to already have AND be using anyway (pwAdmin). No real reason to install PHP-CLI just for "announcements"...
    Well they probably already have php5-cgi or apache2-mod-php5 so adding php5-cli isn't that much to ask...

    Quote Originally Posted by 343 View Post
    You NEED to be more concerned with NETWORK security (opposed to LOCAL security) [you're not dealing with an ATM here...]

    ;)
    I found that somewhat funny too... if someone has access to the machine it doesn't matter how much security you have they can get in...

  16. #41
    Member jh281978 is offline
    MemberRank
    Jan 2011 Join Date
    WashingtonLocation
    85Posts

    Re: Auto Announcement sPWAdmin [need help]

    New error code after changing the .sh's
    Code:
    (CRON) error (grandchild #3651 failed with exit status 126)
    I found this
    Code:
    126 | Command invoked cannot execute | Permission problem or command is not an executable
    here [ubuntu] CRON issue on 10.10 - error (grandchild... vs syslog - Ubuntu Forums after searching for the error code. I am going to try the webmin now lol. Be back shortly with results.

  17. #42
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: Auto Announcement sPWAdmin [need help]

    Quote Originally Posted by jh281978 View Post
    Code:
    command is not an executable
    Shell scripts need to be executable in order to run... chmod +x shellscriptname.sh

  18. #43
    Member jh281978 is offline
    MemberRank
    Jan 2011 Join Date
    WashingtonLocation
    85Posts

    Re: Auto Announcement sPWAdmin [need help]

    Now I'm getting this error (CRON) error (grandchild #3651 failed with exit status 1), arg....Ok I'll try again shortly need a break, lol.

  19. #44
    Nerd-IO Romulan is offline
    MemberRank
    Feb 2009 Join Date
    BelgiumLocation
    3,333Posts

    Re: Auto Announcement sPWAdmin [need help]

    Quote Originally Posted by das7002 View Post
    I'd actually recommend just using php5-cli over that

    PHP Code:
    <?php

    function broadcast($message){
            
    $sock socket_create(AF_INETSOCK_STREAMSOL_TCP);
            if(
    $sock){
                    if(
    socket_connect($sock127.0.0.129100)){
                            
    socket_set_block($sock);
                            
    $data2 mByte(9) . mByte(0) . mInt(-1) . mInt(0) . mString($message);
                            
    $data mUInt32(79) . mUInt32(strlen($data2)) . $data2;
                            
    socket_send($sock$data81920);
                            
    socket_set_nonblock($sock);
                            
    socket_close($sock);
                            echo 
    "Message Sent Successfully";
                    } else {
                            echo 
    "Message Sending Failed";
                    }
            }
    }

    // pack - http://ru2.php.net/pack
    function mByte($p) { return pack('C'$p 0xFF); }

    function 
    mf($i$j) { return ($i >> $j) & 0xFF; }
    function 
    mBytes($p$from)
    {
            
    $packed '';
            for (
    $i $from$i >= 0$i -= 8)
                    
    $packed .= mByte(mf($p,$i));
            return 
    $packed;
    }

    function 
    mChar($p) { return mByte(mf($p,0)) . mByte(mf($p,8)); }
    function 
    mString($s)
    {
            
    $s=iconv('utf-8','utf-16le',$s);
            
    $ret mUInt32(mb_strlen($s));//mUInt32(count($s) * 2);
            
    $s=array_merge(unpack("n*",$s));
            for (
    $i 0;$i count($s); $i++)
            {
                    
    $ret .= mByte(($s[$i]) >> 8);
                    
    $ret .= mByte($s[$i]);
            }
            return 
    $ret;
    }

    function 
    mShort($p) { return mBytes($p,8); }
    function 
    mInt($p) { return mBytes($p,24); }
    function 
    mLong($p) { return mBytes($p,56); }

    function 
    mUInt32($p) {
            if (
    $p 64)
                    return 
    mByte($p);
            if (
    $p 16384)
                    return 
    mShort($p 0x8000);
            if (
    $p 536870912)
                    return 
    mInt($p 0xC0000000);
            return 
    mInt(-32) . mInt($p);
    }
    function 
    mSInt32($p) {
            if (
    $p >= 0)
                    return 
    mUInt32($p);
            
    $t=-$p;
            if (
    $t 64)
                    return 
    mByte($p 0x40);
            if (
    $t 16384)
                    return 
    mShort($p 0xA000);
            if (
    $t 536870912)
                    return 
    mInt($p 0xD0000000);
            return 
    mInt(-16). mInt($p);
    }

    function 
    mOctets($p) {
            
    $packed mUInt32(count($p));
            for (
    $i 0$i count($p); $i++)
                    
    $packed .= mByte($p[$i]);
            return 
    $packed;
    }

    broadcast($argv[1]);

    ?>
    and use

    php whateveryoucalledit.php "Message to broadcast"

    This doesn't rely on the JSP server running and you can run it from any server that has PHP-CLI support
    Code:
    PHP Parse error: syntax error, unexpected T_DNUMBER in /root/broadcast.php on line 7
    Can you fix that Das?

  20. #45
    Black Magic Development das7002 is offline
    MemberRank
    Apr 2010 Join Date
    EarthLocation
    2,188Posts

    Re: Auto Announcement sPWAdmin [need help]

    Quote Originally Posted by Romulan View Post
    Code:
    PHP Parse error: syntax error, unexpected T_DNUMBER in /root/broadcast.php on line 7
    Can you fix that Das?
    I always disliked how PHP did line numbers for errors (sometimes you get the actual line other times you get the line after it and that causes all kinds of hell with debugging)

    Turns out I forgot that PHP (sometimes) dislikes IP addresses just sitting in plain text (as I just did a quick CLI conversion based on what I had already used in PW-Chat)

    Spoiler:
    PHP Code:
    <?php

    function broadcast($message){
            
    $sock socket_create(AF_INETSOCK_STREAMSOL_TCP);
            if(
    $sock){
                    if(
    socket_connect($sock"127.0.0.1"29100)){
                            
    socket_set_block($sock);
                            
    $data2 mByte(9) . mByte(0) . mInt(-1) . mInt(0) . mString($message);
                            
    $data mUInt32(79) . mUInt32(strlen($data2)) . $data2;
                            
    socket_send($sock$data81920);
                            
    socket_set_nonblock($sock);
                            
    socket_close($sock);
                            echo 
    "Message Sent Successfully";
                    } else {
                            echo 
    "Message Sending Failed";
                    }
            }
    }

    // pack - http://ru2.php.net/pack
    function mByte($p) { return pack('C'$p 0xFF); }

    function 
    mf($i$j) { return ($i >> $j) & 0xFF; }
    function 
    mBytes($p$from)
    {
            
    $packed '';
            for (
    $i $from$i >= 0$i -= 8)
                    
    $packed .= mByte(mf($p,$i));
            return 
    $packed;
    }

    function 
    mChar($p) { return mByte(mf($p,0)) . mByte(mf($p,8)); }
    function 
    mString($s)
    {
            
    $s=iconv('utf-8','utf-16le',$s);
            
    $ret mUInt32(mb_strlen($s));//mUInt32(count($s) * 2);
            
    $s=array_merge(unpack("n*",$s));
            for (
    $i 0;$i count($s); $i++)
            {
                    
    $ret .= mByte(($s[$i]) >> 8);
                    
    $ret .= mByte($s[$i]);
            }
            return 
    $ret;
    }

    function 
    mShort($p) { return mBytes($p,8); }
    function 
    mInt($p) { return mBytes($p,24); }
    function 
    mLong($p) { return mBytes($p,56); }

    function 
    mUInt32($p) {
            if (
    $p 64)
                    return 
    mByte($p);
            if (
    $p 16384)
                    return 
    mShort($p 0x8000);
            if (
    $p 536870912)
                    return 
    mInt($p 0xC0000000);
            return 
    mInt(-32) . mInt($p);
    }
    function 
    mSInt32($p) {
            if (
    $p >= 0)
                    return 
    mUInt32($p);
            
    $t=-$p;
            if (
    $t 64)
                    return 
    mByte($p 0x40);
            if (
    $t 16384)
                    return 
    mShort($p 0xA000);
            if (
    $t 536870912)
                    return 
    mInt($p 0xD0000000);
            return 
    mInt(-16). mInt($p);
    }

    function 
    mOctets($p) {
            
    $packed mUInt32(count($p));
            for (
    $i 0$i count($p); $i++)
                    
    $packed .= mByte($p[$i]);
            return 
    $packed;
    }

    broadcast($argv[1]);

    ?>


    Wrapping 127.0.0.1 in quotes and it should work now.
    Last edited by das7002; 10-08-11 at 09:05 PM.

  21. #46
    Nerd-IO Romulan is offline
    MemberRank
    Feb 2009 Join Date
    BelgiumLocation
    3,333Posts

    Re: Auto Announcement sPWAdmin [need help]

    Thanks you



Page 2 of 2 FirstFirst 12

Advertisement