Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Plus Emulator Revision RB3.0 [Community Project]

Status
Not open for further replies.
Junior Spellweaver
Joined
Jul 19, 2013
Messages
171
Reaction score
115
Re: RELEASE63-201405071257-197450526 - PlusR2

Okay everyone here are the fixes for creating rooms and entering rooms.
I am from KekoMundo, however I will not post these fixes there because those people are just stupid.

Create Room:

Replace the CreateRoom() void with this one:
Code:
internal void CreateRoom()
        {
// New structure fixed by Finn

            string Name = this.Request.PopFixedString();
            string Description = this.Request.PopFixedString();
            string RoomModel = this.Request.PopFixedString();
            int Category = this.Request.PopWiredInt32();
            int MaxVisitors = this.Request.PopWiredInt32();
            int TradeState = this.Request.PopWiredInt32();


            RoomData Data = SilverwaveEnvironment.GetGame().GetRoomManager().CreateRoom(this.Session, Name, Description, RoomModel, Category, MaxVisitors);
            if (Data != null)
            {
                this.Response.Init(Outgoing.OnCreateRoomInfo);
                this.Response.AppendInt32(Data.Id);
                this.Response.AppendString(Data.Name);
                this.SendResponse();
            }
        }

Now find internal RoomData CreateRoom(
and replace the whole function with:
* ow, I believe the code below was fucked up by the forum. The "@" parameters were replaced by mentions
Code:
internal RoomData CreateRoom(GameClient Session, string Name, string Desc, string Model, int Category, int MaxVisitors)
        {
        // New structure fixed by Finn
        
            if (!this.roomModels.ContainsKey(Model))
            {
                Session.SendNotif("Room Model was not found.");
                return null;
            }
            if (Name.Length < 3)
            {
                Session.SendNotif("The Room name is too short...");
                return null;
            }


            uint RoomId = 0;
            using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("INSERT INTO rooms (roomtype,caption,description,owner,model_name,category,users_max) VALUES ('private', @[I][B][URL="http://forum.ragezone.com/members/482331.html"]Caption[/URL][/B][/I] , @[I][B][URL="http://forum.ragezone.com/members/275999.html"]des[/URL][/B][/I]c , @[I][B][URL="http://forum.ragezone.com/members/411303.html"]username[/URL][/B][/I] , @[I][B][URL="http://forum.ragezone.com/members/1333478952.html"]model[/URL][/B][/I] , @[I][B][URL="http://forum.ragezone.com/members/1333417018.html"]cat[/URL][/B][/I] , @usmax)");
                dbClient.addParameter("caption", Name);
                dbClient.addParameter("desc", Desc);
                dbClient.addParameter("username", Session.GetHabbo().Username);
                dbClient.addParameter("model", Model);
                dbClient.addParameter("cat", Category);
                dbClient.addParameter("usmax", MaxVisitors);
                RoomId = (uint)dbClient.insertQuery();
            }
            RoomData Data = this.GenerateRoomData(RoomId);
            Session.GetHabbo().UsersRooms.Add(Data);
            return Data;
        }

Now, how to fix room entering?
Search for:
Code:
[B]ServerMessage Message = new ServerMessage(Outgoing.HeightMap);
Message.AppendBoolean(false);[/B]

And below that you put:
Code:
[B]Message.AppendInt32(-1);[/B] // Walls height, new structure fixed by Finn

done :D
I would like some rep++

MAKE SURE
Outgoing.SerializeWallItems IS 395
and not that crappy 0xFFF
 
Last edited:
Master Summoner
Joined
Dec 1, 2013
Messages
547
Reaction score
694
Re: RELEASE63-201405071257-197450526 - PlusR2

MrPudding updating the thread thanks for this mate ;)
 
Initiate Mage
Joined
Jan 3, 2014
Messages
37
Reaction score
4
Re: RELEASE63-201405071257-197450526 - PlusR2

structure chatlog mt:
Code:
public function _-3z7(_arg1:String, _arg2:int, _arg3:int, _arg4:Array, _arg5:Dictionary):void        {
            var k:ChatRecordData;
            var k:_-39d;
            var k:Boolean;
            var k:int;
            var k:int;
            var k:_-39d;
            if (this._disposed)
            {
                return;
            };
            if ((((_arg2 == WindowTracker._-33U)) && (!((_arg3 == this._-63p._-4Un)))))
            {
                return;
            };
            if (_arg2 == WindowTracker._-3Kf)
            {
            };
            for each (k in _arg4)
            {
                for each (k in k.chatlog)
                {
                    k = true;
                    k = -1;
                    k = 0;
                    while (k < this._-1V6.length)
                    {
                        k = this._-1V6[k];
                        if (k._-4wf == k._-4wf)
                        {
                            k = false;
                            break;
                        };
                        if ((((k == -1)) && ((k._-1cA < k._-1cA))))
                        {
                            break;
                        };
                        k++;
                    };
                    if (k)
                    {
                        if (k == -1)
                        {
                            this._-1V6.push(k);
                        } else
                        {
                            this._-1V6.splice(k, 0, k);
                        };
                    };
                };
            };
            this._-4SH();
        }
 
Junior Spellweaver
Joined
Jul 19, 2013
Messages
171
Reaction score
115
Re: New Structure - PlusR2 [Updated]

Okay guys here is the fix for chatlogs, since everyone is lazy .. ;)

Find: internal static ServerMessage SerializeRoomChatlog

Replace the whole function with:

Code:
            internal static ServerMessage SerializeRoomChatlog(uint roomID)
        {
            // NEW CHATLOGS [March 2014] Coded by Finn
            // Please don't remove credits, this took me some time to do... :(
            // Credits to Itachi for the structure's "context" enigma :D


            ServerMessage Message = new ServerMessage();
                       RoomData Room = SilverwaveEnvironment.GetGame().GetRoomManager().GenerateRoomData(roomID);
            if (Room == null)
            {
                throw new NullReferenceException("No room found.");
            }


            Message.Init(Outgoing.RoomChatlog);
            Message.AppendByte(1);
            Message.AppendShort(2);
            Message.AppendString("roomName");
            Message.AppendByte(2);
            Message.AppendString(Room.Name);
            Message.AppendString("roomId");
            Message.AppendByte(1);
            Message.AppendInt32(Room.Id);


            Message.AppendShort(Room.RoomChat.Count);
            Room.RoomChat.Reverse();
            foreach (Chatlog Log in Room.RoomChat)
            {
                Habbo Habbo = SilverwaveEnvironment.getHabboForId(Log.UserId);
                DateTime Date = SilverwaveEnvironment.UnixToDateTime(Log.Timestamp);
                if (Habbo == null)
                {
                    Message.AppendInt32((DateTime.Now - Date).Seconds);
                    Message.AppendInt32(Log.UserId);
                    Message.AppendString("*User not found*");
                    Message.AppendString(Log.Message);
                    Message.AppendBoolean(true);
                }
                else
                {
                    Message.AppendInt32((DateTime.Now - Date).Seconds);
                    Message.AppendInt32(Habbo.Id);
                    Message.AppendString(Habbo.Username);
                    Message.AppendString(Log.Message);
                    Message.AppendBoolean(false); // Text is bold
                }
            }
            Room.RoomChat.Reverse();
            return Message;
        }

EDIT:
Ow, I forgot!!!!!!!
Add to ServerMessage.cs :

Code:
            public void AppendByte(int i)
        {
            this.AppendBytes(new byte[] { (byte)i }, false);
        }

Screen:

e6W7GR5 - Plus Emulator Revision RB3.0 [Community Project] - RaGEZONE Forums


don't forgot to give Rep++ ;D
 

Attachments

You must be registered for see attachments list
Last edited:
Joined
Jan 17, 2014
Messages
53
Reaction score
12
Re: New Structure - PlusR2 [Updated]

Hey guys, When I walk into a room the game crashes and then immediately drops the server
 
Initiate Mage
Joined
Jul 21, 2012
Messages
95
Reaction score
4
Re: New Structure - PlusR2 [Updated]

Okay guys here is the fix for chatlogs, since everyone is lazy .. ;)

Find: internal static ServerMessage SerializeRoomChatlog

Replace the whole function with:

Code:
            internal static ServerMessage SerializeRoomChatlog(uint roomID)
        {
            // NEW CHATLOGS [March 2014] Coded by Finn
            // Please don't remove credits, this took me some time to do... :(
            // Credits to Itachi for the structure's "context" enigma :D


            ServerMessage Message = new ServerMessage();
                       RoomData Room = SilverwaveEnvironment.GetGame().GetRoomManager().GenerateRoomData(roomID);
            if (Room == null)
            {
                throw new NullReferenceException("No room found.");
            }


            Message.Init(Outgoing.RoomChatlog);
            Message.AppendByte(1);
            Message.AppendShort(2);
            Message.AppendString("roomName");
            Message.AppendByte(2);
            Message.AppendString(Room.Name);
            Message.AppendString("roomId");
            Message.AppendByte(1);
            Message.AppendInt32(Room.Id);


            Message.AppendShort(Room.RoomChat.Count);
            Room.RoomChat.Reverse();
            foreach (Chatlog Log in Room.RoomChat)
            {
                Habbo Habbo = SilverwaveEnvironment.getHabboForId(Log.UserId);
                DateTime Date = SilverwaveEnvironment.UnixToDateTime(Log.Timestamp);
                if (Habbo == null)
                {
                    Message.AppendInt32((DateTime.Now - Date).Seconds);
                    Message.AppendInt32(Log.UserId);
                    Message.AppendString("*User not found*");
                    Message.AppendString(Log.Message);
                    Message.AppendBoolean(true);
                }
                else
                {
                    Message.AppendInt32((DateTime.Now - Date).Seconds);
                    Message.AppendInt32(Habbo.Id);
                    Message.AppendString(Habbo.Username);
                    Message.AppendString(Log.Message);
                    Message.AppendBoolean(false); // Text is bold
                }
            }
            Room.RoomChat.Reverse();
            return Message;
        }

EDIT:
Ow, I forgot!!!!!!!
Add to ServerMessage.cs :

Code:
            public void AppendByte(int i)
        {
            this.AppendBytes(new byte[] { (byte)i }, false);
        }

Screen:

e6W7GR5 - Plus Emulator Revision RB3.0 [Community Project] - RaGEZONE Forums


don't forgot to give Rep++ ;D

fix habbo club pls? and bubble color chat not change color
 

Attachments

You must be registered for see attachments list
Experienced Elementalist
Joined
Nov 16, 2009
Messages
204
Reaction score
12
Re: New Structure - PlusR2 [Updated]

fix habbo club pls? and bubble color chat not change color

It's best if we just give him time. Some people doesn't like to keep getting messages about to post fixes.
 
Initiate Mage
Joined
Jul 21, 2012
Messages
95
Reaction score
4
Re: New Structure - PlusR2 [Updated]

It's best if we just give him time. Some people doesn't like to keep getting messages about to post fixes.

..... important fix for change look
 
Experienced Elementalist
Joined
Dec 17, 2012
Messages
288
Reaction score
27
Re: New Structure - PlusR2 [Updated]

Bugs:
Enter room when purche group
group items page
My profil dc
 
Skilled Illusionist
Joined
Dec 20, 2013
Messages
365
Reaction score
64
Re: New Structure - PlusR2 [Updated]

Bug!
 
Skilled Illusionist
Joined
Aug 16, 2007
Messages
343
Reaction score
263
Re: New Structure - PlusR2 [Updated]

Complete reversed chatlog, might be usefull

Code:
List rooms
int userId = readint
string userName = readstring
int roomsNumber = readint


rooms = new list(roomsNumber)


int roomsCounter =0;
while(roomsCounter < roomsNumber)
{
    //Chat Record Data
    //Notice that each ChatRecordData has it's own context and chatlog
    //For every room that the user has been you will have a ChatRecordData
    //Appending a post from a group forum is a possibility (they have website forums)
    
    new hashtable context // must be hashtable;
    new List<Chatlogs> chatlogs
    
    byte chatDataType = readbyte  //0-4
    // type 0 = nothing
    // type 1 = roomChatlog
    // type 2 = IM Session  : Internal mods chat ?
    // type 3 = Forum Thread
    // type 4 = Forum Message  : Website forum or group forum ?
    // Notice that both in-game chat messages and forum messages will look the same client-side speaking
    // There is a in-game tool in which the mod can delete a forum post or thread
    // A mod cannot delete a room chatlog in oposite to forum messages
    
   short contextNumber = readshort
   short contextCounter = 0;
   
   while(contextCounter < contextNumber)
   {
        string contextKey = readstring
        // keys: {roomName,groupId,threadId,messageId,roomId}
        int contextDataType = (int)readbyte
        switch(contextDataType)
        {
            case 0:
                context[contextKey] = readbool
                break
            case 1:
                context[contextKey] = readint
                break
            case 2:
                context[contextKey] = readstring
                break
            deafult:
                Unknown data type    
        }
        k++;
   }
   
   //finally, you append the chatlog list
   //Each context data is associed to only one chatlog list
    
    int chatlogsNumber = (int)readshort  // 0-65535
    int chatlogsCounter = 0;
    while(chatlogsCounter < chatlogsNumber)
    {
        //notice that you are appending the chat for everyone in the room/thread
        //if the userId is the same as the reported user that you are browing, the chat color should change
        int timestamp = readint
        int userId  = readint  //0 if 'bot/pet'
        string userName = readstring
        string message = readstring
        bool colorBool = readbool //defines a color for something. Must test
        
        k++
    }
    roomsCounter++
}
 
Custom Title Activated
Member
Joined
Jun 5, 2010
Messages
1,582
Reaction score
160
Re: New Structure - PlusR2 [Updated]

Complete reversed chatlog, might be usefull

Code:
List rooms
int userId = readint
string userName = readstring
int roomsNumber = readint


rooms = new list(roomsNumber)


int roomsCounter =0;
while(roomsCounter < roomsNumber)
{
    //Chat Record Data
    //Notice that each ChatRecordData has it's own context and chatlog
    //For every room that the user has been you will have a ChatRecordData
    //Appending a post from a group forum is a possibility (they have website forums)
    
    new hashtable context // must be hashtable;
    new List<Chatlogs> chatlogs
    
    byte chatDataType = readbyte  //0-4
    // type 0 = nothing
    // type 1 = roomChatlog
    // type 2 = IM Session  : Internal mods chat ?
    // type 3 = Forum Thread
    // type 4 = Forum Message  : Website forum or group forum ?
    // Notice that both in-game chat messages and forum messages will look the same client-side speaking
    // There is a in-game tool in which the mod can delete a forum post or thread
    // A mod cannot delete a room chatlog in oposite to forum messages
    
   short contextNumber = readshort
   short contextCounter = 0;
   
   while(contextCounter < contextNumber)
   {
        string contextKey = readstring
        // keys: {roomName,groupId,threadId,messageId,roomId}
        int contextDataType = (int)readbyte
        switch(contextDataType)
        {
            case 0:
                context[contextKey] = readbool
                break
            case 1:
                context[contextKey] = readint
                break
            case 2:
                context[contextKey] = readstring
                break
            deafult:
                Unknown data type    
        }
        k++;
   }
   
   //finally, you append the chatlog list
   //Each context data is associed to only one chatlog list
    
    int chatlogsNumber = (int)readshort  // 0-65535
    int chatlogsCounter = 0;
    while(chatlogsCounter < chatlogsNumber)
    {
        //notice that you are appending the chat for everyone in the room/thread
        //if the userId is the same as the reported user that you are browing, the chat color should change
        int timestamp = readint
        int userId  = readint  //0 if 'bot/pet'
        string userName = readstring
        string message = readstring
        bool colorBool = readbool //defines a color for something. Must test
        
        k++
    }
    roomsCounter++
}

Where do i have to add this?
 
Status
Not open for further replies.
Back
Top