| 828 | } |
| 829 | |
| 830 | void IdoMysqlConnection::InternalDeactivateObject(const DbObject::Ptr& dbobj) |
| 831 | { |
| 832 | AssertOnWorkQueue(); |
| 833 | |
| 834 | if (IsPaused()) |
| 835 | return; |
| 836 | |
| 837 | if (!GetConnected()) |
| 838 | return; |
| 839 | |
| 840 | DbReference dbref = GetObjectID(dbobj); |
| 841 | |
| 842 | if (!dbref.IsValid()) |
| 843 | return; |
| 844 | |
| 845 | std::ostringstream qbuf; |
| 846 | qbuf << "UPDATE " + GetTablePrefix() + "objects SET is_active = 0 WHERE object_id = " << static_cast<long>(dbref); |
| 847 | IncreasePendingQueries(1); |
| 848 | AsyncQuery(qbuf.str()); |
| 849 | |
| 850 | /* Note that we're _NOT_ clearing the db refs via SetReference/SetConfigUpdate/SetStatusUpdate |
| 851 | * because the object is still in the database. */ |
| 852 | |
| 853 | SetObjectActive(dbobj, false); |
| 854 | } |
| 855 | |
| 856 | bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& value, Value *result) |
| 857 | { |