Orginal uber had a class for that
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 ...

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
Example for MUS Usage: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); }
At UberEnvironment.cs is an location it says: Uberemulator ready for connections.Code:SendMUSData('ALEA' . 'This message is for everyone!');
Paste this above it.
That will send everyone in the hotel online an message. From the websever :)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!"); }
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.
Orginal uber had a class for that
lolwut. The MUS work's in uber && Phoenix. All you need to do if your using uberCMS, is enable MUS in the inc.config.
![]()
Is it? oh. Didnt notice. Sorry for this useless thread 'x
The ubersource i had didnt had Muss. So i recoded it.
Someone raped this MUS.
Yes, if you put 0.0.0.0 as ip. Then everyone can send Packets trolled so hard for that.
Be warned, Someone can have much fun on this if you don't protect it!
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
Omfg, this was already in 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.
Portforward mus? Haha then i have fun xd
Posted via Mobile Device