• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[SwiftEmu] Fix's for NewCrypto! [UPDATED 01/08]

Status
Not open for further replies.
Banned
Banned
Joined
May 6, 2009
Messages
531
Reaction score
165
Well people... I've fixed two new things in Swift Emulator:

Mannequin
HabboWheel

I'll improve the Mannequin... For now remains fix when the save Mannequin Save the Name of Mannequin too !
More Later or tomorrow i post the Mannequin Fix :)

Want see the Mannequin working? Acess:
 
Experienced Elementalist
Joined
Dec 25, 2011
Messages
278
Reaction score
57
I think i have find 2 bug.

1. When you use actions/signs, and then goes afk it does use it automatic and make other players that have used actions/signs in the room use it without click it.
2. Room settings to walk trough users does not save.

Or maybe that's just me.

IAM NOT ASKING FOR HELP!
 
Newbie Spellweaver
Joined
Sep 18, 2011
Messages
52
Reaction score
2
It would be nice if every update made to the emulator you've put up for download as open source, and some codes did not work on mine.

Sorry my english, I'm Brazilian.
 
Banned
Banned
Joined
May 6, 2009
Messages
531
Reaction score
165
It would be nice if every update made to the emulator you've put up for download as open source, and some codes did not work on mine.

Sorry my english, I'm Brazilian.

what codes don't work with you ?
 
Newbie Spellweaver
Joined
May 20, 2013
Messages
30
Reaction score
1
It would be nice if every update made to the emulator you've put up for download as open source, and some codes did not work on mine.

Sorry my english, I'm Brazilian.
Download this emulator with all fixes
 
Experienced Elementalist
Joined
Oct 5, 2010
Messages
260
Reaction score
109
Redeem voucher fix:

go to HabboEvents/Incoming.cs and search by:
Code:
Incoming.RedeemVoucher = 2265;

and replace by:
Code:
Incoming.RedeemVoucher = 1520;

Now, go to HabboHotel/Catalogs/VoucherHandler.cs and search by:
Code:
internal static void TryRedeemVoucher(GameClient Session, string Code)

and replace all void by:
Code:
        internal static void TryRedeemVoucher(GameClient Session, string Code)
        {
            if (!IsValidCode(Code))
            {
                Session.SendNotif("Code voucher doesn't exist!");
            }
            else
            {
                int voucherValue = GetVoucherValue(Code);
                TryDeleteVoucher(Code);
                Habbo habbo = Session.GetHabbo();
                habbo.Credits += voucherValue;
                Session.GetHabbo().UpdateCreditsBalance();
                Session.SendMessage(new ServerMessage(212));
            }
        }

Ready!!!

Please Rafa update your Main Thread!
 
Joined
Apr 24, 2007
Messages
644
Reaction score
157
Well people... I've fixed two new things in Swift Emulator:

Mannequin
HabboWheel

I'll improve the Mannequin... For now remains fix when the save Mannequin Save the Name of Mannequin too !
More Later or tomorrow i post the Mannequin Fix :)

Want see the Mannequin working? Acess:

Do you have any plans for the CPU ? He's still high compared to the original Butterfly.
 
Skilled Illusionist
Joined
Apr 27, 2008
Messages
330
Reaction score
370
Two fixes for new crypto:

#1 Login error handling


Find from GameClient.cs:

Code:
   switch (errorCode)
                {
                    case 1:
                        this.SendNotifWithScroll(LanguageLocale.GetValue("login.invalidsso"));
                        return false;

                    case 2:
                        this.SendNotifWithScroll(LanguageLocale.GetValue("login.loggedin"));
                        return false;
                }

Replace to:

Code:
switch (errorCode)
                {
                    case 1:
                        this.SendMessage(DisconnectWithReason(2));
                        return false;

                    case 2:
                       
                        this.SendMessage(DisconnectWithReason(2));

                        return false;
                }

Add before trylogin() (Packet header id same in all revisions)

Code:
 internal ServerMessage DisconnectWithReason(int RID)
        {
            ServerMessage DisWithR = new ServerMessage(4000);
            DisWithR.AppendInt32(RID);
            return DisWithR;
        }

When you try login you don't receive notify who contains "Invalid SSO-ticket" etc. Now you get disconnect. :)

#2 Commands fix

If you have many inputs on one command, e.g. wheresmypet,wheresmypets,whereismypets. Command shows many times in Commands-list.

Find in ChatCommandRegister.cs:

Code:
 if ((command.commandID != 400) && command.UserGotAuthorization(client))
                {

Add after:

Code:
if (builder.ToString().Contains(command.description))
                    {
                        continue;
                    }
 
Newbie Spellweaver
Joined
Jul 27, 2013
Messages
18
Reaction score
0
Great horse bugg:
When I put the dyes and restart the room took back from dyes, fix this.
 
Newbie Spellweaver
Joined
Jul 21, 2012
Messages
95
Reaction score
4
Two fixes for new crypto:

#1 Login error handling


Find from GameClient.cs:

Code:
   switch (errorCode)
                {
                    case 1:
                        this.SendNotifWithScroll(LanguageLocale.GetValue("login.invalidsso"));
                        return false;

                    case 2:
                        this.SendNotifWithScroll(LanguageLocale.GetValue("login.loggedin"));
                        return false;
                }

Replace to:

Code:
switch (errorCode)
                {
                    case 1:
                        this.SendMessage(DisconnectWithReason(2));
                        return false;

                    case 2:
                       
                        this.SendMessage(DisconnectWithReason(2));

                        return false;
                }

Add before trylogin() (Packet header id same in all revisions)

Code:
 internal ServerMessage DisconnectWithReason(int RID)
        {
            ServerMessage DisWithR = new ServerMessage(4000);
            DisWithR.AppendInt32(RID);
            return DisWithR;
        }

When you try login you don't receive notify who contains "Invalid SSO-ticket" etc. Now you get disconnect. :)

#2 Commands fix

If you have many inputs on one command, e.g. wheresmypet,wheresmypets,whereismypets. Command shows many times in Commands-list.

Find in ChatCommandRegister.cs:

Code:
 if ((command.commandID != 400) && command.UserGotAuthorization(client))
                {

Add after:

Code:
if (builder.ToString().Contains(command.description))
                    {
                        continue;
                    }

fix game center pleaseee uff
 
Junior Spellweaver
Joined
Jan 31, 2009
Messages
162
Reaction score
44
Sure, Friends..

To fix Gift with my "edition":

TUTORIAL, OPEN SPOILER:
In: Catalog.cs Click in "EDIT" -> Go to... and digit: 1144, press Ok.
Search for: if (IsGift)
And, replace all if by:
PHP:
if (IsGift)
                                {
                                    int showSender = 1;
                                    if (isAnonymous == false)
                                        showSender = 0;
                                    GameClient clientByUserID = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUserID(userID);
                                    string purchaseuser;
                                    uint num7 = 0;
                                    if (showSender == 0)
                                    {
                                        purchaseuser = "";
                                    }
                                    else
                                    {
                                        purchaseuser = " - " + Session.GetHabbo().Username + ".";
                                    }
                                    Item giftCase = ButterflyEnvironment.GetGame().GetItemManager().GetItemSprite(giftSprite);
                                    UserItem item3 = ButterflyEnvironment.getHabboForId(userID).GetInventoryComponent().AddNewItem(0, giftCase.ItemId, " " + giftMessage + "" + purchaseuser + "", true, false, 0, Session.GetHabbo().Username, clientByUserID.GetHabbo().Id, 0);
                                    ButterflyEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_GiftGiver", 1);
                                    ButterflyEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(clientByUserID, "ACH_GiftReceiver", 1);
                                    using (adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                                    {
                                        adapter.setQuery("INSERT INTO user_gifts (gift_id,page_id,item_id,extradata,target_name,message,ribbon,color,gift_sprite,show_sender,rare_id,inventory_id) VALUES " +
                                            "(" + item3.Id + "," + PageId + "," + num8 + ",@extradata, @name, @message," + giftRibbon + "," + giftColor + "," + giftSprite + "," + showSender + "," + limitedSelled + ",@inventory_id)");
                                        adapter.addParameter("name", giftReceiverName);
                                        adapter.addParameter("message", giftMessage);
                                        adapter.addParameter("extradata", ExtraData);
                                        adapter.addParameter("inventory_id", item3.Id);
                                        adapter.runQuery();
                                    }

                                    if (clientByUserID != null)
                                    {
                                        clientByUserID.SendNotif(LanguageLocale.GetValue("catalog.gift.received") + Session.GetHabbo().Username);
                                        clientByUserID.GetHabbo().GetInventoryComponent().SendFloorInventoryUpdate();
                                        clientByUserID.GetMessageHandler().GetResponse().Init(Outgoing.SendPurchaseAlert);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(1);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(1);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(1);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(item3.Id);
                                        clientByUserID.GetMessageHandler().SendResponse();
                                        InventoryComponent inventoryComponent = clientByUserID.GetHabbo().GetInventoryComponent();
                                        if (inventoryComponent != null)
                                        {
                                            inventoryComponent.RunDBUpdate();
                                        }
                                    }
                                    Session.SendNotif(LanguageLocale.GetValue("catalog.gift.sent"));
                                }

Now, in: GameClientMessageHandler.cs,
Search by: internal void OpenPresent()
And, replace all void to:
PHP:
        internal void OpenPresent()
        {
            Room room = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(this.Session.GetHabbo().CurrentRoomId);
            if ((room != null) && room.CheckRights(this.Session, true))
            {
                uint pId = this.Request.PopWiredUInt();
                RoomItem item = room.GetRoomItemHandler().GetItem(pId);
                if (item != null)
                {
                    IQueryAdapter adapter;
                    item.MagicRemove = true;
                    ServerMessage message = new ServerMessage(Outgoing.UpdateItemOnRoom);
                    item.Serialize(message, room.OwnerId);
                    room.SendMessage(message);
                    DataRow row = null;
                    using (adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                    {
                        adapter.setQuery("SELECT * FROM user_gifts WHERE gift_id = " + item.Id);
                        row = adapter.getRow();

                    }
                    if (row == null)
                    {
                        room.GetRoomItemHandler().RemoveFurniture(this.Session, item.Id);
                    }
                    else
                    {
                        Item item2 = ButterflyEnvironment.GetGame().GetItemManager().GetItem(Convert.ToUInt32(row["item_id"]));
                        if (item2 == null)
                        {
                            room.GetRoomItemHandler().RemoveFurniture(this.Session, item.Id);
                        }
                        else if (item2.Type.ToString().ToLower().Equals("s") && (item2.InteractionType != InteractionType.teleport))
                        {
                            room.GetRoomItemHandler().RemoveFurniture(this.Session, item.Id);

                            using (adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                            {
                                adapter.runFastQuery(string.Concat(new object[] { "UPDATE items SET base_id = '", row["item_id"], "' WHERE item_id = ", item.Id }));

                                adapter.setQuery(string.Concat(new object[] { "UPDATE items_extradata SET data = '" + row["extradata"] + "' WHERE item_id = " + item.Id }));
                                adapter.addParameter("extradata", row["extradata"]);
                                adapter.runQuery();

                                adapter.runFastQuery("DELETE FROM user_gifts WHERE gift_id = " + item.Id);
                            }

                            string s = item.GetBaseItem().Type.ToString().ToLower();
                            string extraData = row["extradata"].ToString();
                            item.BaseItem = Convert.ToUInt32(row["item_id"]);
                            item.refreshItem();
                            item.ExtraData = extraData;
                            if (!room.GetRoomItemHandler().SetFloorItem(this.Session, item, item.GetX, item.GetY, item.Rot, true, false, true))
                            {
                                this.Session.SendNotif("Failed to create your gift!");
                            }
                            else
                            {
                                this.Response.Init(Outgoing.OpenGift);
                                this.Response.AppendString(item2.Type.ToString());
                                this.Response.AppendInt32(item2.SpriteId);
                                this.Response.AppendString(item2.Name);
                                this.Response.AppendInt32(item.Id);
                                this.Response.AppendString(s);
                                this.Response.AppendBoolean(true);
                                this.Response.AppendString(extraData);
                                this.SendResponse();
                            }
                        }
                        else
                        {
                            room.GetRoomItemHandler().RemoveFurniture(this.Session, item.Id);
                            using (adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                            {
                                adapter.runFastQuery("DELETE FROM user_gifts WHERE gift_id = " + item.Id);
                            }
                            this.Session.GetMessageHandler().GetResponse().Init(Outgoing.SendPurchaseAlert);
                            this.Session.GetMessageHandler().GetResponse().AppendInt32(1);
                            int i = 2;
                            if (item2.Type.ToString().ToLower().Equals("s"))
                            {
                                if (item2.InteractionType == InteractionType.pet)
                                {
                                    i = 3;
                                }
                                else
                                {
                                    i = 1;
                                }
                            }
                            this.Session.GetMessageHandler().GetResponse().AppendInt32(i);
                            List<UserItem> list = ButterflyEnvironment.GetGame().GetCatalog().DeliverItems(this.Session, item2, (int)row["amount"], (string)row["extradata"], 0, 0);
                            this.Session.GetMessageHandler().GetResponse().AppendInt32(list.Count);
                            foreach (UserItem item3 in list)
                            {
                                this.Session.GetMessageHandler().GetResponse().AppendInt32(item3.Id);
                            }
                            this.Session.GetMessageHandler().SendResponse();
                            this.Session.GetHabbo().GetInventoryComponent().UpdateItems(true);
                            //this.Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
                            //this.Session.GetMessageHandler().SendResponse();
                        }
                    }
                }
            }
            this.Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
            this.Session.GetMessageHandler().SendResponse();
        }
To enable the gift purchase, edit this:
In Incoming.cs,
Search by: Incoming.PurchaseGift = 0x0901
Replace by: Incoming.PurchaseGift = 0x0900

Sorry my english, i'm brazilian..
|
|
V
For the present don't bug stay in inventory and when placing it on the ground, do this:
In: GameClientMessageHandler.cs, Search by: internal void PlaceItem()
And, replace all void PlaceItem, by:
PHP:
internal void PlaceItem()
        {
            Room pRoom = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(this.Session.GetHabbo().CurrentRoomId);
            
            if ((pRoom != null) && (pRoom.CheckRights(this.Session)))
            {
                string str = this.Request.PopFixedString();
                string[] strArray = str.Split(new char[] { ' ' });
                uint id = uint.Parse(strArray[0].Replace("-", ""));
                UserItem item = this.Session.GetHabbo().GetInventoryComponent().GetItem(id);
                if (item != null)
                {
                    RoomItem item2;
                    if (item.GetBaseItem().InteractionType == InteractionType.dimmer)
                    {
                        MoodlightData moodlightData = pRoom.MoodlightData;
                        if ((moodlightData != null) && (pRoom.GetRoomItemHandler().GetItem(moodlightData.ItemId) != null))
                        {
                            this.Session.SendNotif(LanguageLocale.GetValue("user.maxmoodlightsreached"));
                        }
                    }

                    if (strArray[1].StartsWith(":"))
                    {
                        try
                        {
                            WallCoordinate wallCoord = new WallCoordinate(":" + str.Split(new char[] { ':' })[1]);
                            item2 = new RoomItem(item.Id, pRoom.RoomId, item.BaseItem, item.ExtraData, wallCoord, pRoom, item.Group_data, item.RareId, item.placedBy);
                            if (pRoom.GetRoomItemHandler().SetWallItem(this.Session, item2))
                            {
                                this.Session.GetHabbo().GetInventoryComponent().RemoveItem(id, true);
                            }
                        }
                        catch
                        {
                        }
                    }
                    else
                    {
                        try
                        {
                            int x = int.Parse(strArray[1]);
                            int y = int.Parse(strArray[2]);
                            int rot = int.Parse(strArray[3]);
                            if (this.Session.GetHabbo().forceRot > -1)
                            {
                                rot = this.Session.GetHabbo().forceRot;
                            }
                            item2 = new RoomItem(item.Id, pRoom.RoomId, item.BaseItem, item.ExtraData, x, y, 0.0, rot, pRoom, item.Group_data, item.RareId, item.placedBy);
                            if (pRoom.GetRoomItemHandler().SetFloorItem(this.Session, item2, x, y, rot, true, false, true))
                            {
                                this.Session.GetHabbo().GetInventoryComponent().RemoveItem(id, true);
                            }
                            if (WiredUtillity.TypeIsWired(item.GetBaseItem().InteractionType))
                            {
                                WiredSaver.HandleDefaultSave(item.Id, pRoom);
                            }
                        }
                        catch (Exception ex)
                        {
                            Logging.LogCriticalException(ex.ToString());
                        }
                    }
                }
            }
            this.Session.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
            this.Session.GetMessageHandler().SendResponse();
        }

Done!
If you don't have table user_gifts, add
USE MY USER_GIFTS TABLE:
PHP:
CREATE TABLE IF NOT EXISTS `user_gifts` ( 
  `gift_id` int(10) NOT NULL AUTO_INCREMENT, 
  `page_id` int(10) unsigned NOT NULL DEFAULT '5', 
  `item_id` mediumint(10) NOT NULL, 
  `extradata` varchar(50) NOT NULL DEFAULT '', 
  `amount` int(11) NOT NULL DEFAULT '1', 
  `target_name` varchar(50) NOT NULL, 
  `by_userid` int(50) NOT NULL, 
  `message` varchar(115) NOT NULL DEFAULT '', 
  `ribbon` tinyint(1) NOT NULL DEFAULT '0', 
  `color` tinyint(1) NOT NULL DEFAULT '0', 
  `gift_sprite` int(10) NOT NULL, 
  `show_sender` tinyint(4) NOT NULL DEFAULT '1', 
  `rare_id` int(10) NOT NULL DEFAULT '0', 
  `inventory_id` int(10) NOT NULL DEFAULT '0', 
  PRIMARY KEY (`gift_id`) 
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=300000 ;

Uffs, By Marlon Colhado? ♥
I noticed an error in my code and fixed it ..
to tidy up the falls, below:
In: Catalog.cs Click in "EDIT" -> Go to... and digit: 1144, press Ok.
Search for: if (IsGift)
And, replace all if by:
PHP:
                                if (IsGift)
                                {
                                    int showSender = 1;
                                    if (isAnonymous == false)
                                        showSender = 0;
                                    GameClient clientByUserID = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUserID(userID);
                                    string purchaseuser;
                                    string BuyerUsername = Session.GetHabbo().Username;
                                    uint useridtosend = Convert.ToUInt32(clientByUserID.GetHabbo().Id);
                                    uint num7 = 0;
                                    if (showSender == 0)
                                    {
                                        purchaseuser = "";
                                    }
                                    else
                                    {
                                        purchaseuser = " - " + BuyerUsername + ".";
                                    }
                                    Item giftCase = ButterflyEnvironment.GetGame().GetItemManager().GetItemSprite(giftSprite);
                                    ButterflyEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_GiftGiver", 1);
                                    ButterflyEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(clientByUserID, "ACH_GiftReceiver", 1);

                                    UserItem item3 = ButterflyEnvironment.getHabboForId(userID).GetInventoryComponent().AddNewItem(0, giftCase.ItemId, " " + giftMessage + "" + purchaseuser + "", true, false, 0, "", useridtosend, 0);
                                    
                                    using (adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                                    {
                                        adapter.setQuery("INSERT INTO user_gifts (gift_id,page_id,item_id,extradata,target_name,message,ribbon,color,gift_sprite,show_sender,rare_id,inventory_id) VALUES " +
                                            "(" + item3.Id + "," + PageId + "," + num8 + ",@extradata, @name, @message," + giftRibbon + "," + giftColor + "," + giftSprite + "," + showSender + "," + limitedSelled + ",@inventory_id)");
                                        adapter.addParameter("name", giftReceiverName);
                                        adapter.addParameter("message", giftMessage);
                                        adapter.addParameter("extradata", ExtraData);
                                        adapter.addParameter("inventory_id", item3.Id);
                                        adapter.runQuery();
                                    }

                                    if (clientByUserID != null)
                                    {
                                        clientByUserID.SendNotif(LanguageLocale.GetValue("catalog.gift.received") + Session.GetHabbo().Username);
                                        clientByUserID.GetHabbo().GetInventoryComponent().SendFloorInventoryUpdate();
                                        clientByUserID.GetMessageHandler().GetResponse().Init(Outgoing.SendPurchaseAlert);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(1);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(1);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(1);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(item3.Id);
                                        clientByUserID.GetMessageHandler().SendResponse();

                                        clientByUserID.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
                                        clientByUserID.GetMessageHandler().SendResponse();

                                        /*InventoryComponent inventoryComponent = clientByUserID.GetHabbo().GetInventoryComponent();
                                        if (inventoryComponent != null)
                                        {
                                            inventoryComponent.RunDBUpdate();
                                        }*/
                                    }
                                    Session.SendNotif(LanguageLocale.GetValue("catalog.gift.sent"));
                                }

Simple, now will not fall over when buying gifts..
Like? :D
 
Junior Spellweaver
Joined
Mar 11, 2010
Messages
132
Reaction score
2
I noticed an error in my code and fixed it ..
to tidy up the falls, below:
In: Catalog.cs Click in "EDIT" -> Go to... and digit: 1144, press Ok.
Search for: if (IsGift)
And, replace all if by:
PHP:
                                if (IsGift)
                                {
                                    int showSender = 1;
                                    if (isAnonymous == false)
                                        showSender = 0;
                                    GameClient clientByUserID = ButterflyEnvironment.GetGame().GetClientManager().GetClientByUserID(userID);
                                    string purchaseuser;
                                    string BuyerUsername = Session.GetHabbo().Username;
                                    uint useridtosend = Convert.ToUInt32(clientByUserID.GetHabbo().Id);
                                    uint num7 = 0;
                                    if (showSender == 0)
                                    {
                                        purchaseuser = "";
                                    }
                                    else
                                    {
                                        purchaseuser = " - " + BuyerUsername + ".";
                                    }
                                    Item giftCase = ButterflyEnvironment.GetGame().GetItemManager().GetItemSprite(giftSprite);
                                    ButterflyEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(Session, "ACH_GiftGiver", 1);
                                    ButterflyEnvironment.GetGame().GetAchievementManager().ProgressUserAchievement(clientByUserID, "ACH_GiftReceiver", 1);

                                    UserItem item3 = ButterflyEnvironment.getHabboForId(userID).GetInventoryComponent().AddNewItem(0, giftCase.ItemId, " " + giftMessage + "" + purchaseuser + "", true, false, 0, "", useridtosend, 0);
                                    
                                    using (adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                                    {
                                        adapter.setQuery("INSERT INTO user_gifts (gift_id,page_id,item_id,extradata,target_name,message,ribbon,color,gift_sprite,show_sender,rare_id,inventory_id) VALUES " +
                                            "(" + item3.Id + "," + PageId + "," + num8 + ",@extradata, @name, @message," + giftRibbon + "," + giftColor + "," + giftSprite + "," + showSender + "," + limitedSelled + ",@inventory_id)");
                                        adapter.addParameter("name", giftReceiverName);
                                        adapter.addParameter("message", giftMessage);
                                        adapter.addParameter("extradata", ExtraData);
                                        adapter.addParameter("inventory_id", item3.Id);
                                        adapter.runQuery();
                                    }

                                    if (clientByUserID != null)
                                    {
                                        clientByUserID.SendNotif(LanguageLocale.GetValue("catalog.gift.received") + Session.GetHabbo().Username);
                                        clientByUserID.GetHabbo().GetInventoryComponent().SendFloorInventoryUpdate();
                                        clientByUserID.GetMessageHandler().GetResponse().Init(Outgoing.SendPurchaseAlert);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(1);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(1);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(1);
                                        clientByUserID.GetMessageHandler().GetResponse().AppendInt32(item3.Id);
                                        clientByUserID.GetMessageHandler().SendResponse();

                                        clientByUserID.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
                                        clientByUserID.GetMessageHandler().SendResponse();

                                        /*InventoryComponent inventoryComponent = clientByUserID.GetHabbo().GetInventoryComponent();
                                        if (inventoryComponent != null)
                                        {
                                            inventoryComponent.RunDBUpdate();
                                        }*/
                                    }
                                    Session.SendNotif(LanguageLocale.GetValue("catalog.gift.sent"));
                                }

Simple, now will not fall over when buying gifts..
Like? :D

works perfect, but if I send a gift to yourself, I have disconnection
 
Status
Not open for further replies.
Back
Top