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!

[SERVICE] - Coding Commands

Status
Not open for further replies.
Experienced Elementalist
Joined
Aug 26, 2012
Messages
248
Reaction score
49
DarkPower, I want to almost beg you to help me with something, haha

The empty command only deletes furniture from the items_users table, while it should also delete it from the items table. I found out that this is the only way the traxplayer won't start to bug after you delete some trax CDs and buy some new ones.

The empty command makes use of

PHP:
internal void ClearItems()
{
    using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
    {
        adapter.runFastQuery("DELETE FROM items_users WHERE user_id = " + this.UserId);
    }


    this.mAddedItems.Clear();
    this.mRemovedItems.Clear();
    this.floorItems.Clear();
    this.wallItems.Clear();
    this.discs.Clear();
    this.isUpdated = true;
    this.mClient.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
    this.GetClient().GetMessageHandler().SendResponse();
}

But I really don't know how to get the deleted ids and also delete those from the items table.


Emu? :)
 
Experienced Elementalist
Joined
Aug 26, 2012
Messages
248
Reaction score
49
DarkPower, I want to almost beg you to help me with something, haha

The empty command only deletes furniture from the items_users table, while it should also delete it from the items table. I found out that this is the only way the traxplayer won't start to bug after you delete some trax CDs and buy some new ones.

The empty command makes use of

PHP:
internal void ClearItems()
{
    using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
    {
        adapter.runFastQuery("DELETE FROM items_users WHERE user_id = " + this.UserId);
    }


    this.mAddedItems.Clear();
    this.mRemovedItems.Clear();
    this.floorItems.Clear();
    this.wallItems.Clear();
    this.discs.Clear();
    this.isUpdated = true;
    this.mClient.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
    this.GetClient().GetMessageHandler().SendResponse();
}

But I really don't know how to get the deleted ids and also delete those from the items table.

i could do this as a command but it might lagg, depening on how many items the user has, i can code you somthing in php? for housekeeping which would be more effective
 
Joined
Apr 24, 2007
Messages
644
Reaction score
157
DarkPower, I want to almost beg you to help me with something, haha

The empty command only deletes furniture from the items_users table, while it should also delete it from the items table. I found out that this is the only way the traxplayer won't start to bug after you delete some trax CDs and buy some new ones.

The empty command makes use of

PHP:
internal void ClearItems()
{
    using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
    {
        adapter.runFastQuery("DELETE FROM items_users WHERE user_id = " + this.UserId);
    }


    this.mAddedItems.Clear();
    this.mRemovedItems.Clear();
    this.floorItems.Clear();
    this.wallItems.Clear();
    this.discs.Clear();
    this.isUpdated = true;
    this.mClient.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
    this.GetClient().GetMessageHandler().SendResponse();
}

But I really don't know how to get the deleted ids and also delete those from the items table.

Use JOIN query like:

PHP:
dbClient.runFastQuery("DELETE items, items_extradata, items_users " +
                                             "FROM items_users " +
                                             "INNER JOIN items ON (items.item_id = items_users.item_id) " +
                                             "LEFT JOIN items_extradata ON (items_extradata.item_id = items.item_id) " +
                                             "WHERE items_users.user_id = " + UserId);

Not tested, but that's the idea.
 
Experienced Elementalist
Joined
Aug 26, 2012
Messages
248
Reaction score
49
Use JOIN query like:

PHP:
dbClient.runFastQuery("DELETE items, items_extradata, items_users " +
                                             "FROM items_users " +
                                             "INNER JOIN items ON (items.item_id = items_users.item_id) " +
                                             "LEFT JOIN items_extradata ON (items_extradata.item_id = items.item_id) " +
                                             "WHERE items_users.user_id = " + UserId);

Not tested, but that's the idea.

Brilliant idea! never thought about a join query!
learn something new everyday!
 
Joined
Apr 24, 2013
Messages
1,691
Reaction score
1,150
Use JOIN query like:

PHP:
dbClient.runFastQuery("DELETE items, items_extradata, items_users " +
                                             "FROM items_users " +
                                             "INNER JOIN items ON (items.item_id = items_users.item_id) " +
                                             "LEFT JOIN items_extradata ON (items_extradata.item_id = items.item_id) " +
                                             "WHERE items_users.user_id = " + UserId);

Not tested, but that's the idea.
Oh that's brilliant, thank you! I'll be trying it out.

EDIT:
It works like a charm!
 
Last edited:
LETS REACH 666 POSTS?!!!!
Joined
Apr 24, 2013
Messages
573
Reaction score
53
Use JOIN query like:

PHP:
dbClient.runFastQuery("DELETE items, items_extradata, items_users " +
                                             "FROM items_users " +
                                             "INNER JOIN items ON (items.item_id = items_users.item_id) " +
                                             "LEFT JOIN items_extradata ON (items_extradata.item_id = items.item_id) " +
                                             "WHERE items_users.user_id = " + UserId);

Wow nice this is sure handy :D
 
Last edited:

PR0

Legendary Battlemage
Joined
Mar 3, 2007
Messages
690
Reaction score
85
All rights works fine for me *ankka emu*
Freeze all ill have a look at
Randomly cant walk on spots never seen that bug
ill look in to :setmax
i havent got a gift fix so i cant help there
the dice thing is easy to fix

#Threading Main Loops.
#Esta opcion separa del MainGameLoop cada tarea a ejecutar en un proceso distinto.
SeparatedTasksInMainLoops.enabled=true


#Threading GameClientManager Loops.
#Esta opcion separa del GameClientManager.OnCycle las tareas de forma lógica para aumentar rendimiento.
SeparatedTasksInGameClientManager.enabled=true and make sure the cycle count is on 6 in the db

dont touch any wired mate sorry

working on custom models atm


Damn.. should have specified. Would you be able to make the :allrights command compatible for PlusEMU please? :)
 
Experienced Elementalist
Joined
Nov 16, 2009
Messages
204
Reaction score
12
can someone code :emptypets and :emptybots? I use PlusEMU r2. The :emptypets in the emulator doesn't work..
 
LETS REACH 666 POSTS?!!!!
Joined
Apr 24, 2013
Messages
573
Reaction score
53
@

Do you tink you could code an :emptybots and :emptypets

Atm i got an empypets but it doesnt work really good cuz im a noob xD


Atm i got this:
internal void emptypets()
{
this.Session.GetHabbo().GetInventoryComponent().ClearPets();
this.Session.SendNotif("Pets cleaned);
}

internal void ClearPets()
{
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.runFastQuery("DELETE FROM user_pets WHERE user_id = " + UserId + " AND room_id = 0;");
}
this.mAddedItems.Clear();
this.mRemovedItems.Clear();
this.floorItems.Clear();
this.wallItems.Clear();
this.discs.Clear();
this.InventoryPets.Clear();
this.isUpdated = true;
this.mClient.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
this.GetClient().GetMessageHandler().SendResponse();
}

it works but i need to reload, could u make it so it update's

Thx :D!!!!
 
Last edited:
Joined
Apr 24, 2007
Messages
644
Reaction score
157
@DarkPower

Do you tink you could code an :emptybots and :emptypets

Atm i got an empypets but it doesnt work really good cuz im a noob xD


Atm i got this:
internal void emptypets()
{
this.Session.GetHabbo().GetInventoryComponent().ClearPets();
this.Session.SendNotif("Pets cleaned);
}

internal void ClearPets()
{
using (IQueryAdapter adapter = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
{
adapter.runFastQuery("DELETE FROM user_pets WHERE user_id = " + UserId + " AND room_id = 0;");
}
this.mAddedItems.Clear();
this.mRemovedItems.Clear();
this.floorItems.Clear();
this.wallItems.Clear();
this.discs.Clear();
this.InventoryPets.Clear();
this.isUpdated = true;
this.mClient.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
this.GetClient().GetMessageHandler().SendResponse();
}

it works but i need to reload, could u make it so it update's

Thx :D!!!!

Try this ?

Code:
internal void emptypets()
        {
               Session.GetHabbo().GetInventoryComponent().ClearPets();
   [B]Session.SendMessage(Session.GetHabbo().GetInventoryComponent().SerializePetInventory());[/B]
               Session.SendNotif("Pets cleaned");
        }
 
LETS REACH 666 POSTS?!!!!
Joined
Apr 24, 2013
Messages
573
Reaction score
53
Try this ?

Code:
internal void emptypets()
        {
               Session.GetHabbo().GetInventoryComponent().ClearPets();
   [B]Session.SendMessage(Session.GetHabbo().GetInventoryComponent().SerializePetInventory());[/B]
               Session.SendNotif("Pets cleaned");
        }

Thx :D

should i keep this?

this.mAddedItems.Clear();
this.mRemovedItems.Clear();
this.floorItems.Clear();
this.wallItems.Clear();
this.discs.Clear();
this.InventoryPets.Clear();
this.isUpdated = true;
this.mClient.GetMessageHandler().GetResponse().Init(Outgoing.UpdateInventary);
this.GetClient().GetMessageHandler().SendResponse();

Elso what should i use for bots?

EDIT:
nvm :p

this.Session.SendMessage(Session.GetHabbo().GetInventoryComponent().SerializeBotInventory();

EDIT 2:
totally works now thx :)!


EDIT3 :

do you may know how to make a command like

:reloadroomlist

(reloads the rooms of a user)
 
Last edited:
Junior Spellweaver
Joined
Oct 29, 2013
Messages
124
Reaction score
9
Please a transform for Swift/BcStorm ( Sorry i'm french x) ).
 
Experienced Elementalist
Joined
Aug 26, 2012
Messages
248
Reaction score
49
Please a transform for Swift/BcStorm ( Sorry i'm french x) ).

i tried to do this a failed terrible <3 i would love this also. and harun9 and what emu if it phoenix no
 
Status
Not open for further replies.
Back
Top