コード例 #1
0
ファイル: virtualRoom.cs プロジェクト: habb0/HoloRebirth
 /// <summary>
 /// Adds a virtual wallitem to the item manager and optionally makes it appear in the room.
 /// </summary>
 /// <param name="itemID">The ID of the item to add.</param>
 /// <param name="Item">The item to add.</param>
 /// <param name="Place">Indicates if the item is put in the room now, so updating database and sending appear packet to room.</param>
 internal void addItem(int itemID, int templateID, string wallPosition, string Var, bool Place)
 {
     //Out.WriteLine("addItem: " + itemID + "  " + templateID + "  " + wallPosition + "  " + Var + "  " + Place);
     if (_Items.Contains(itemID) == false)
     {
         wallItem Item = new wallItem(itemID, templateID, wallPosition, Var);
         _Items.Add(itemID, Item);
         if (Place)
         {
             _Room.sendData("AS" + Item.ToString());
             using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
             {
                 dbClient.runQuery("UPDATE furniture SET roomid = '" + _Room.roomID + "',wallpos = '" + wallPosition + "' WHERE id = '" + itemID + "' LIMIT 1");
                 if (templateID == 1002)
                 {
                     if (dbClient.findsResult("SELECT roomid FROM furniture_moodlight WHERE id='" + itemID + "'") == false)
                     { // The moodlight is new ;)
                         dbClient.runQuery("INSERT INTO furniture_moodlight VALUES ('" + itemID + "','" + _Room.roomID + "','1','1,#000000,225','1,#000000,200','1,#000000,175')");
                     }
                     else
                     { // The moodlight is moved to another room
                         dbClient.runQuery("UPDATE furniture_moodlight SET roomid = '" + _Room.roomID + "' WHERE id= '" + itemID + "'");
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
 /// <summary>
 /// Adds a virtual wallitem to the item manager and optionally makes it appear in the room.
 /// </summary>
 /// <param name="itemID">The ID of the item to add.</param>
 /// <param name="Item">The item to add.</param>
 /// <param name="Place">Indicates if the item is put in the room now, so updating database and sending appear packet to room.</param>
 internal void addItem(int itemID, int templateID, string wallPosition, string Var, bool Place)
 {
     if (_Items.Contains(itemID) == false)
     {
         wallItem Item = new wallItem(itemID,templateID,wallPosition,Var);
         _Items.Add(itemID,Item);
         if (Place)
         {
             _Room.sendData("AS" + Item.ToString());
             DB.runQuery("UPDATE furniture SET roomid = '" + _Room.roomID + "',wallpos = '" + wallPosition + "' WHERE id = '" + itemID + "' LIMIT 1");
         }
     }
 }