[Help] Mus Commands

JayC

Always Learning
Aug 8, 2013
5,504
1,401
Hey Guys,

So this is the first time I am trying to setup MUS Commands on Plus EMU. I have enabled Sockets on IIS and restarted IIS several times.

This is my function:
PHP:
<?php
    function Mus($header, $data = '')
    {
        $musData = $header . chr(1) . $data;
       
        $sock = @socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
        @socket_connect($sock, "VPS IP", "MUS PORT");
        @socket_send($sock, $musData, strlen($musData), MSG_DONTROUTE);   
        @socket_close($sock);
    }       
        ?>
I have my VPS IP and Mus Port correct. The emulator is configured to the mus port, but when I try to call to this function my page turns white?
 
Bump :( Still having this issue and still working to get it.
 
FIXED:

Here is the way to send it:

Code:
<?php
    function Mus()
    {
        $port = 30001;
        $ip = "127.0.0.1";
        $musData = 'goto' . chr(1) . '1:111';

    $sock = @socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));   
    @socket_connect($sock, $ip, intval($port));
      @socket_send($sock, $musData, strlen($musData), MSG_DONTROUTE);       
      @socket_close($sock);
    }       
    Mus();
        ?>

You will have to add parameters and send the parameters. This was just me playing around til it worked
 

Synapse

PogChamp
Mar 3, 2012
164
59
what do you use this for?
This can be used to communicate with the emulator through the CMS. I.e. Send a hotel alert from housekeeping, Give every user online a badge, duckets, or credits, ban someone without having to use :update bans.

Edit:

Jay would you mind showing me an example snippet with a parameter, not quite sure how that's setup. Thanks
 

JayC

Always Learning
Aug 8, 2013
5,504
1,401
Well when I did this on localhost it worked 100% , but now that I am on public the stupid shit isn't working (YES I CHANGED THE IP -> VPS IP). GRrr
 

Zodiak

recovering crack addict
Nov 18, 2011
451
413
Well when I did this on localhost it worked 100% , but now that I am on public the stupid shit isn't working (YES I CHANGED THE IP -> VPS IP). GRrr
If you're now using a server, is the servers firewall configured to allow connections from you or other people on the specified port?
 

JayC

Always Learning
Aug 8, 2013
5,504
1,401
If you're now using a server, is the servers firewall configured to allow connections from you or other people on the specified port?
MUS comes from the localhost though right? Omg if its my firewall imma freak the fuck out. 1 min
 
--Opened that port and still throws a white screen.
 

Zodiak

recovering crack addict
Nov 18, 2011
451
413
I'll c+p you my mus function once I've finished backing up all of my files, give me a few
 
Completely forgot about this.
PHP:
function sendMUS($command, $data = '') {
            $MUSdata = $command . chr(1) . $data;
            $socket = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
            socket_connect($socket, '127.0.0.1', '30001');
            socket_send($socket, $MUSdata, strlen($MUSdata), MSG_DONTROUTE);     
            socket_close($socket);
        }

Usage
PHP:
sendMUS('joincorp', $user->id . ':' . $corp->id);

PHP:
sendMUS('musCommand', 'param1');

sendMUS('musCommand', 'param1:param2');

sendMUS('musCommand', 'param1:param2:param3');

sendMUS('musCommand', 'param1:param2:param3:param4');
 

JayC

Always Learning
Aug 8, 2013
5,504
1,401
I'll c+p you my mus function once I've finished backing up all of my files, give me a few
 
Completely forgot about this.
PHP:
function sendMUS($command, $data = '') {
            $MUSdata = $command . chr(1) . $data;
            $socket = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
            socket_connect($socket, '127.0.0.1', '30001');
            socket_send($socket, $MUSdata, strlen($MUSdata), MSG_DONTROUTE);    
            socket_close($socket);
        }

Usage
PHP:
sendMUS('joincorp', $user->id . ':' . $corp->id);

PHP:
sendMUS('musCommand', 'param1');

sendMUS('musCommand', 'param1:param2');

sendMUS('musCommand', 'param1:param2:param3');

sendMUS('musCommand', 'param1:param2:param3:param4');
You my hero. I'll try this in 2 minutes <3<3
 

Users who are viewing this thread

Top