Welcome to the RaGEZONE - MMORPG development forums.

MUS for UberEmulator

This is a discussion on MUS for UberEmulator within the Habbo Releases forums, part of the Habbo Hotel category; Hello RZ, Some people are still looking for MUS Connection. To update tags etc. Here is the .CS file for ...

LyncusMU
Page 1 of 2 12 LastLast
Results 1 to 15 of 28
  1. #1
    The Omega
    Rank
    Member
    Join Date
    Jul 2009
    Location
    Netherlands
    Posts
    108
    Liked
    35

    MUS for UberEmulator

    Tabo Hotel
    Hello RZ,

    Some people are still looking for MUS Connection.
    To update tags etc.

    Here is the .CS file for UberEmulator >:)

    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Net;
    using System.Net.Sockets;
    
    using Uber.HabboHotel;
    using Uber.Core;
    using Uber.HabboHotel.GameClients;
    using Uber;
    
    namespace MLD_Productions.Net
    {
        class MussTcpConnection
        {
            public static class musSocketServer
            {
                private static Socket socketHandler;
                private static int _Port;
                private static string _musHost;
                /// <summary> 
                /// Initializes the socket listener for MUS connections and starts listening. 
                /// </summary> 
                /// <param name="bindPort">The port where the socket listener should be bound to.</param> 
                /// <remarks></remarks> 
                internal static bool Init(int bindPort, string musHost)
                {
                    _Port = bindPort;
                    _musHost = musHost;
                    socketHandler = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
    
                    
                    try
                    {
                        socketHandler.Bind(new IPEndPoint(IPAddress.Any, bindPort));
                        socketHandler.Listen(25);
                        socketHandler.BeginAccept(new AsyncCallback(connectionRequest), socketHandler);
    
                        
                        Console.WriteLine("-> MUS TCP luistert naar " + musHost + ":" + bindPort);
                        return true;
                    }
    
                    catch
                    {
                        Console.WriteLine("Error while setting up asynchronous socket server for MUS connections on port " + bindPort);
                        Console.WriteLine("Port " + bindPort + " could be invalid or in use already.");
                        return false;
                    }
                }
    
    
                private static void connectionRequest(IAsyncResult iAr)
                {
                    
                    Socket newSocket = ((Socket)iAr.AsyncState).EndAccept(iAr);
                    if (newSocket.RemoteEndPoint.ToString().Split(':')[0] != _musHost)
                    {
                        newSocket.Close();
                        return;
                    }
    
                    musConnection newConnection = new musConnection(newSocket);
                    socketHandler.BeginAccept(new AsyncCallback(connectionRequest), socketHandler);
                }
    
    
                private class musConnection
                {
                    private Socket Connector;
                    private byte[] dataBuffer = new byte[10001];
                    /// <summary>
                    /// Initializes the musConnection and listens for one single packet, processes it and closes the connection. On any error, the connection is closed.
                    /// </summary>
                    /// <param name="Connector">The socket of the musConnection.</param>
                    internal musConnection(Socket Connector)
                    {
                        this.Connector = Connector;
                        Connector.BeginReceive(dataBuffer, 0, dataBuffer.Length, SocketFlags.None, new AsyncCallback(dataArrival), null);
                        
                    }
                    /// <summary>
                    /// Called when a packet is received, the packet will be processed and the connection will be closed (after processing packet) in all cases. No errors will be thrown.
                    /// </summary>
                    /// <param name="iAr"></param>\
                    //
    
    
                    private void dataArrival(IAsyncResult iAr)
                    {
                        try
                        {
                            int bytesReceived = Connector.EndReceive(iAr);
                            string Data = System.Text.Encoding.ASCII.GetString(dataBuffer, 0, bytesReceived);
    
                            string musHeader = Data.Substring(0, 4);
                            string[] musData = Data.Substring(4).Split(Convert.ToChar(2));
    
    
                            #region MUS trigger commands
                            // Unsafe code, but on any error it jumps to the catch block & disconnects the socket
                            switch (musHeader)
                            {
                                case "ALED": // Housekeeping - textmessage [BK] :: "HKTM123This is a test message to user with ID 123" 
                                    {
                                        
                                        uint userID = Convert.ToUInt32(int.Parse(musData[0]));
                                        string Message = musData[1];
                                        GameClient tTargetClient = HangEnvironment.GetGame().GetClientManager().GetClientByHabbo(userID);
    
                                        if (tTargetClient != null)
                                        {
                                            tTargetClient.SendNotif(Message);
                                        }
    
                                        break;
                                    }
    
                                case "UPRA": // Housekeeping - textmessage [BK] :: "HKTM123This is a test message to user with ID 123" 
                                    {
    
                                        uint userID = Convert.ToUInt32(int.Parse(musData[0]));
                                        GameClient tTargetClient = HangEnvironment.GetGame().GetClientManager().GetClientByHabbo(userID);
    
                                        if (tTargetClient != null)
                                        {
    
                                            tTargetClient.GetHabbo().LoadTags(tTargetClient.GetHabbo().HabboDataRow);
                                           
                                        }
    
                                        break;
                                    }
    
                                case "ALEA": // Housekeeping - textmessage [BK] :: "HKTM123This is a test message to user with ID 123" 
                                    {
    
                                        string Message = musData[0];
    
                                        HangEnvironment.SendMassMessage(Message);
    
                                        break;
                                    }
                            }
    
                            #endregion
                        }
    
    
                        catch {  }
                    }
            }
    
    
    
            
    
    
    
            }
                        
    
    
    
    
    
        }
    }

    Config.ini Requires:
    Code:
    ## MUS TCP/IP Configuration
    mus.tcp.status=ON
    mus.tcp.bindip=IP-FROM-WEBSERVER
    mus.tcp.port=30001

    PHP Function SendMUSData
    Code:
    function SendMUSData($data){
    $ip = 'IP FROM EMULATOR';
    $port = '30001';
    
    if(!is_numeric($port)){ return false; }
    
    $sock = socket_create(AF_INET, SOCK_STREAM, getprotobyname('tcp'));
    socket_connect($sock, $ip, $port);
    
            if(!is_resource($sock)){
                    return false;
            } else {
                    socket_send($sock, $data, strlen($data), MSG_DONTROUTE);
                    return true;
            }
    
    	socket_close($sock);
    }
    Example for MUS Usage:
    Code:
    SendMUSData('ALEA' . 'This message is for everyone!');
    At UberEnvironment.cs is an location it says: Uberemulator ready for connections.
    Paste this above it.

    Code:
    if (UberEnvironment.GetConfig().data["mus.tcp.status"].ToString() == "ON")
                    {
                        MLD_Productions.Net.MussTcpConnection.musSocketServer.Init(Convert.ToInt32(UberEnvironment.GetConfig().data["mus.tcp.port"].ToString()), UberEnvironment.GetConfig().data["mus.tcp.bindip"].ToString());
                    }
                    else if (UberEnvironment.GetConfig().data["mus.tcp.status"].ToString() == "OFF")
                    {
                        Console.WriteLine("-> MUS has been disabled.");
                    }
                    else { Console.WriteLine("-> MUS Variable hasnt been found!"); }
    That will send everyone in the hotel online an message. From the websever :)

    This is for an R63 Emulator.
    And yes. This has came from V26 Emulators. but has been made compitable with R63.

    Hope you like.
    If you dont like it, dont bump and get out. ;3

    Regards.
    Mikeuyz
    Last edited by Mister. M; 10-12-11 at 11:52 AM.

  2. HostKey.com: Unmetered Dedicated servers in the Netherlands
  3. #2
    What about no.
    Rank
    Subscriber
    Join Date
    Nov 2009
    Location
    The Nederlands
    Posts
    900
    Liked
    303

    Re: MUS for UberEmulator

    Orginal uber had a class for that

  4. #3
    Now 35% cooler!
    Rank
    Alpha Member
    Join Date
    Oct 2008
    Location
    United Kingdom
    Posts
    2,071
    Liked
    353

    Re: MUS for UberEmulator

    lolwut. The MUS work's in uber && Phoenix. All you need to do if your using uberCMS, is enable MUS in the inc.config.


  5. #4
    The Omega
    Rank
    Member
    Join Date
    Jul 2009
    Location
    Netherlands
    Posts
    108
    Liked
    35

    Re: MUS for UberEmulator

    Is it? oh. Didnt notice. Sorry for this useless thread 'x
    The ubersource i had didnt had Muss. So i recoded it.

  6. #5
    http://hardfuse.yours.tv/
    Rank
    Member +
    Join Date
    Oct 2011
    Location
    RaGEZONE
    Posts
    239
    Liked
    35

    Re: MUS for UberEmulator

    Someone raped this MUS.

  7. #6
    The Omega
    Rank
    Member
    Join Date
    Jul 2009
    Location
    Netherlands
    Posts
    108
    Liked
    35

    Re: MUS for UberEmulator

    Yes, if you put 0.0.0.0 as ip. Then everyone can send Packets trolled so hard for that.

  8. #7
    Retired
    Rank
    Member +
    Join Date
    Mar 2007
    Location
    netherland
    Posts
    674
    Liked
    90

    Re: MUS for UberEmulator

    Quote Originally Posted by Wupz0r View Post
    Someone raped this MUS.
    true, if i look those codes it looks like holograph mus *.*

    uberemulator(the orginal one) mus port works perfect never got problems with it.

  9. #8
    PHP, HTML5, CSS3, JS, C#
    Rank
    Alpha Member
    Join Date
    Jun 2010
    Location
    The Netherlands
    Posts
    1,814
    Liked
    1013

    Re: MUS for UberEmulator

    Be warned, Someone can have much fun on this if you don't protect it!

  10. #9
    The Omega
    Rank
    Member
    Join Date
    Jul 2009
    Location
    Netherlands
    Posts
    108
    Liked
    35

    Re: MUS for UberEmulator

    It doesnt allow you to use 0.0.0.0 enymore.
    Disabled that bullshit. Only allows one IP. Thats for ex: 222.222.222.222 or 127.0.0.1. Dont go fuck arround with this code. Works fine :)

    ~ Peace

  11. #10
    Azure subscription
    Rank
    Subscriber
    Join Date
    Dec 2011
    Location
    єαятн
    Posts
    1,734
    Liked
    263

    Re: MUS for UberEmulator

    Omfg, this was already in UberEmulator..

  12. #11
    returned to Habbo..
    Rank
    Member +
    Join Date
    Jan 2009
    Location
    Alabama - North
    Posts
    1,084
    Liked
    150

    Re: MUS for UberEmulator

    Okay, but my question is what was wrong with the MUS Connection in Uber? By the looks of it, I tested a server and MUS is fine. Maybe you just have to PF your MUS port, but server-wise MUS is fine.

  13. #12
    PHP, HTML5, CSS3, JS, C#
    Rank
    Alpha Member
    Join Date
    Jun 2010
    Location
    The Netherlands
    Posts
    1,814
    Liked
    1013

    Re: MUS for UberEmulator

    Portforward mus? Haha then i have fun xd
    Posted via Mobile Device

  14. #13
    What about no.
    Rank
    Subscriber
    Join Date
    Nov 2009
    Location
    The Nederlands
    Posts
    900
    Liked
    303

    Re: MUS for UberEmulator

    Quote Originally Posted by joopie View Post
    Portforward mus? Haha then i have fun xd
    Posted via Mobile Device
    Uber Mus is protected ;)

  15. #14
    PHP, HTML5, CSS3, JS, C#
    Rank
    Alpha Member
    Join Date
    Jun 2010
    Location
    The Netherlands
    Posts
    1,814
    Liked
    1013
    Quote Originally Posted by Davidaap View Post
    Uber Mus is protected ;)
    You think? The last time i treid it worked fine xd
    Posted via Mobile Device

  16. #15
    returned to Habbo..
    Rank
    Member +
    Join Date
    Jan 2009
    Location
    Alabama - North
    Posts
    1,084
    Liked
    150

    Re: MUS for UberEmulator

    Quote Originally Posted by joopie View Post
    Portforward mus? Haha then i have fun xd
    Posted via Mobile Device
    I said portforward the MUS port, because that could be an issue if it doesn't work on your hotel, etc..?

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •