本文整理汇总了C#中GoldTree.HabboHotel.Items.RoomItem.UpdateState方法的典型用法代码示例。如果您正苦于以下问题:C# RoomItem.UpdateState方法的具体用法?C# RoomItem.UpdateState怎么用?C# RoomItem.UpdateState使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GoldTree.HabboHotel.Items.RoomItem
的用法示例。
在下文中一共展示了RoomItem.UpdateState方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnRemove
public override void OnRemove(GameClient Session, RoomItem Item)
{
RoomMusicController roomMusicController = GoldTree.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId).GetRoomMusicController();
roomMusicController.Stop();
roomMusicController.UnLinkRoomOutputItem();
Item.UpdateState(true, true);
}
示例2: Action
public void Action(RoomItem Item, Task Task, string ExtraData)
{
if (ExtraData == "1")
{
Task.Wait(7000);
Item.FireWorkCount--;
using (DatabaseClient dbClient = GoldTree.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("itemid", Item.uint_0);
dbClient.ExecuteQuery("UPDATE items SET fw_count = fw_count - 1 WHERE id = @itemid LIMIT 1");
}
}
if (Item.FireWorkCount == 0)
{
ExtraData = "0";
}
Item.ExtraData = ExtraData;
Item.UpdateState(true, true);
Task.Wait();
Task.Dispose();
}
示例3: OnTrigger
public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
{
if (RoomItem_0.ExtraData != "-1")
{
RoomItem_0.ExtraData = "-1";
RoomItem_0.UpdateState(false, true);
RoomItem_0.ReqUpdate(3);
}
}
示例4: OnTrigger
public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_1, bool bool_0)
{
if (bool_0)
{
if (this.Modes == 0)
{
RoomItem_0.UpdateState(false, true);
}
int num = 0;
int num2 = 0;
if (RoomItem_0.ExtraData.Length > 0)
{
num = int.Parse(RoomItem_0.ExtraData);
}
if (num <= 0)
{
num2 = 1;
}
else
{
if (num >= this.Modes)
{
num2 = 0;
}
else
{
num2 = num + 1;
}
}
if (num2 == 0)
{
if (RoomItem_0.method_8().method_97(RoomItem_0.Int32_0, RoomItem_0.Int32_1))
{
return;
}
Dictionary<int, AffectedTile> dictionary = RoomItem_0.method_8().method_94(RoomItem_0.GetBaseItem().Length, RoomItem_0.GetBaseItem().Width, RoomItem_0.Int32_0, RoomItem_0.Int32_1, RoomItem_0.int_3);
if (dictionary == null)
{
dictionary = new Dictionary<int, AffectedTile>();
}
foreach (AffectedTile current in dictionary.Values)
{
if (RoomItem_0.method_8().method_97(current.Int32_0, current.Int32_1))
{
return;
}
}
}
RoomItem_0.ExtraData = num2.ToString();
RoomItem_0.method_4();
RoomItem_0.method_8().method_22();
}
}
示例5: OnPlace
public override void OnPlace(GameClient Session, RoomItem Item)
{
DataRow dataRow2;
using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
{
dataRow2 = @class.ReadDataRow("SELECT fw_count FROM items WHERE id = '" + Item.uint_0 + "'");
}
if (dataRow2 != null)
{
Item.FireWorkCount = (int)dataRow2["fw_count"];
}
if (Item.FireWorkCount > 0)
{
Item.ExtraData = "1";
Item.UpdateState(true, true);
}
else if (Item.FireWorkCount <= 0)
{
Item.ExtraData = "0";
Item.UpdateState(true, true);
}
}
示例6: OnTrigger
public override void OnTrigger(GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
{
RoomUser @class = null;
if (Session != null)
{
@class = RoomItem_0.method_8().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (@class == null)
{
return;
}
}
if (Session == null || RoomItem_0.method_8().method_99(RoomItem_0.Int32_0, RoomItem_0.Int32_1, @class.int_3, @class.int_4))
{
if (RoomItem_0.ExtraData != "-1")
{
if (int_0 == -1)
{
RoomItem_0.ExtraData = "0";
RoomItem_0.method_4();
}
else
{
RoomItem_0.uint_3 = @class.uint_0;
RoomItem_0.ExtraData = "-1";
RoomItem_0.UpdateState(false, true);
RoomItem_0.ReqUpdate(4);
}
}
}
else
{
if (Session != null && @class != null && @class.bool_0)
{
try
{
@class.method_4(RoomItem_0.GStruct1_1);
}
catch
{
}
}
}
}
示例7: BreakIceBlock
public bool BreakIceBlock(RoomItem Item, RoomItem Item2)
{
if (Item.method_8().frzTimer == true)
{
Item2.ExtraData = "11200";
Item2.UpdateState(false, true);
int rand = GoldTreeEnvironment.GetRandomNumber(1, 11);
foreach (RoomItem Item3 in Item.method_8().GetFreeze().freezeBlocks.Values)
{
if (Item2.Int32_0 == Item3.Int32_0 && Item2.Int32_1 == Item3.Int32_1)
{
if (string.IsNullOrEmpty(Item3.ExtraData))
{
Item3.method_8().GetFreeze().SetRandomPowerUp(Item3);
return true;
}
}
}
}
return false;
}
示例8: OnRemove
public override void OnRemove(GameClient Session, RoomItem Item)
{
Item.ExtraData = "0";
Item.UpdateState(true, true);
}
示例9: OnTrigger
public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
RoomUser User = Item.method_8().GetRoomUserByHabbo((uint)Session.GetHabbo().Id);
if (User == null)
{
return;
}
if (Request == 0 && Item.FireWorkCount > 0 && Item.ExtraData == "1")
{
Item.ExtraData = "2";
Item.UpdateState(false, true);
if (Item.FireWorkCount > 0)
{
Task T = null;
T = new Task(delegate() { Action(Item, T, "1"); });
T.Start();
}
else
{
Task T = null;
T = new Task(delegate() { Action(Item, T, "0"); });
T.Start();
}
}
else if (Request == 1)
{
ServerMessage PixelMessage = new ServerMessage(629);
PixelMessage.AppendUInt(Item.uint_0);
PixelMessage.AppendInt32(Item.FireWorkCount);
PixelMessage.AppendBoolean(false);
PixelMessage.AppendInt32(Pixels); // pixels :D
PixelMessage.AppendBoolean(false);
PixelMessage.AppendInt32(Fireworks); // 10 fireworks :D
Session.SendMessage(PixelMessage);
}
else if (Request == 2 && Session.GetHabbo().ActivityPoints >= 20)
{
Item.FireWorkCount += Fireworks;
Session.GetHabbo().FireworkPixelLoadedCount += Pixels;
Session.GetHabbo().ActivityPoints -= 20;
Session.GetHabbo().method_15(true);
using (DatabaseClient dbClient = GoldTree.GetDatabase().GetClient())
{
dbClient.AddParamWithValue("itemid", Item.uint_0);
dbClient.AddParamWithValue("sessionid", Session.GetHabbo().Id);
dbClient.ExecuteQuery("UPDATE items SET fw_count = fw_count + '" + Fireworks + "' WHERE id = @itemid LIMIT 1");
dbClient.ExecuteQuery("UPDATE user_stats SET fireworks = fireworks + '" + Pixels + "' WHERE id = @sessionid LIMIT 1");
}
ServerMessage PixelMessage = new ServerMessage(629);
PixelMessage.AppendUInt(Item.uint_0);
PixelMessage.AppendInt32(Item.FireWorkCount);
PixelMessage.AppendBoolean(false);
PixelMessage.AppendInt32(Pixels); // pixels :D
PixelMessage.AppendBoolean(false);
PixelMessage.AppendInt32(Fireworks); // 10 fireworks :D
Session.SendMessage(PixelMessage);
if (Item.ExtraData == "0")
{
Item.ExtraData = "1";
Item.UpdateState(true, true);
}
Session.GetHabbo().CheckFireworkAchievements();
}
}
示例10: method_91
public void method_91(RoomItem RoomItem_0, RoomUser RoomUser_1)
{
RoomItem_0.ExtraData = "1";
RoomItem_0.UpdateState(false, true);
RoomItem_0.ReqUpdate(1);
List<RoomItem> list = new List<RoomItem>();
RoomUser_1.method_3(true);
foreach (RoomItem @class in this.Hashtable_0.Values)
{
if (@class != RoomItem_0 && !(@class.GetBaseItem().InteractionType.ToLower() != "bb_teleport"))
{
list.Add(@class);
}
}
if (list.Count > 0)
{
Random random = new Random((int)GoldTree.GetUnixTimestamp() * (int)RoomUser_1.uint_0);
int index = random.Next(0, list.Count);
list[index].ExtraData = "1";
list[index].UpdateState(false, true);
list[index].ReqUpdate(1);
this.byte_0[RoomUser_1.int_3, RoomUser_1.int_4] = 1;
this.byte_0[list[index].Int32_0, list[index].Int32_1] = 1;
RoomUser_1.method_7(list[index].Int32_0, list[index].Int32_1, list[index].Double_0);
RoomUser_1.UpdateNeeded = true;
}
}
示例11: method_21
//.........这里部分代码省略.........
flag = true;
}
break;
}
try
{
List<RoomItem> list3 = this.method_93(RoomItem_0.Int32_0, RoomItem_0.Int32_1);
if (list3 == null)
{
result = false;
return result;
}
foreach (RoomItem current2 in list3)
{
text = current2.GetBaseItem().InteractionType.ToLower();
if (text != null)
{
int num4;
if (!(text == "wf_cnd_phx"))
{
if (!(text == "wf_cnd_trggrer_on_frn"))
{
string[] collection;
List<string> list;
List<RoomItem> list4;
if (!(text == "wf_cnd_furnis_hv_avtrs"))
{
if (!(text == "wf_cnd_has_furni_on"))
{
if (text == "wf_cnd_time_more_than")
{
num++;
current2.ExtraData = "1";
current2.UpdateState(false, true);
current2.ReqUpdate(1);
if (current2.WiredCounter >= double.Parse(current2.string_2, CultureInfo.InvariantCulture))
{
num2++;
break;
}
}
else if (text == "wf_cnd_time_less_than")
{
num++;
current2.ExtraData = "1";
current2.UpdateState(false, true);
current2.ReqUpdate(1);
if (current2.WiredCounter <= double.Parse(current2.string_2, CultureInfo.InvariantCulture))
{
num2++;
break;
}
}
else
continue;
}
num4 = num2;
num++;
current2.ExtraData = "1";
current2.UpdateState(false, true);
current2.ReqUpdate(1);
current2.method_10();
if (current2.string_3.Length <= 0)
{
continue;
}
示例12: OnPlace
public override void OnPlace(GameClient Session, RoomItem RoomItem_0)
{
RoomItem_0.ExtraData = "0";
RoomItem_0.UpdateState(true, false);
}
示例13: PickUpPowerUp
public void PickUpPowerUp(RoomItem item, RoomUser user)
{
switch (item.freezePowerUp)
{
case FreezePowerUp.BlueArrow:
user.FreezeRange++;
break;
case FreezePowerUp.Snowballs:
user.FreezeBalls++;
break;
case FreezePowerUp.GreenArrow:
case FreezePowerUp.OrangeSnowball:
user.freezePowerUp = item.freezePowerUp;
break;
case FreezePowerUp.Shield:
ActivateShield(user);
break;
case FreezePowerUp.Heart:
{
if (user.FreezeLives <= 2)
{
user.FreezeLives++;
this.room.GetGameManager().AddPointToTeam(user.team, 10, user);
}
/*ServerMessage message = new ServerMessage();
message.Init(Outgoing.UpdateFreezeLives);
message.AppendInt32(user.InternalRoomID);
message.AppendInt32(user.FreezeLives);
user.GetClient().SendMessage(message);*/
break;
}
}
item.freezePowerUp = FreezePowerUp.None;
item.ExtraData = "1" + item.ExtraData;
item.UpdateState(false, true);
}
示例14: SetRandomPowerUp
public void SetRandomPowerUp(RoomItem item)
{
if (string.IsNullOrEmpty(item.ExtraData))
{
switch (this.rnd.Next(1, 11))
{
case 2:
item.ExtraData = "2000";
item.freezePowerUp = FreezePowerUp.BlueArrow;
break;
case 3:
item.ExtraData = "3000";
item.freezePowerUp = FreezePowerUp.Snowballs;
break;
case 4:
item.ExtraData = "4000";
item.freezePowerUp = FreezePowerUp.GreenArrow;
break;
case 5:
item.ExtraData = "5000";
item.freezePowerUp = FreezePowerUp.OrangeSnowball;
break;
case 6:
item.ExtraData = "6000";
item.freezePowerUp = FreezePowerUp.Heart;
break;
case 7:
item.ExtraData = "7000";
item.freezePowerUp = FreezePowerUp.Shield;
break;
default:
item.ExtraData = "1000";
item.freezePowerUp = FreezePowerUp.None;
break;
}
item.method_8().method_38(item.Int32_0, item.Int32_1);
item.UpdateState(false, true);
}
}
示例15: OnTrigger
public override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
if (UserHasRights)
{
int num = 0;
if (Item.ExtraData.Length > 0)
{
num = int.Parse(Item.ExtraData);
}
if (Request == 0)
{
if (num <= -1)
{
num = 0;
}
else
{
if (num >= 0)
{
num = -1;
}
}
}
else
{
if (Request >= 1)
{
if (Request == 1)
{
if (!Item.method_8().frzTimer)
{
Item.method_8().frzTimer = true;
Item.ReqUpdate(1);
if (Session != null)
{
RoomUser RoomUser_ = Session.GetHabbo().CurrentRoom.GetRoomUserByHabbo(Session.GetHabbo().Id);
Item.method_8().method_14(RoomUser_);
Item.method_8().GetFreeze().StartGame();
}
}
else
{
Item.method_8().frzTimer = false;
Item.method_8().GetFreeze().StopGame();
}
}
else
{
if (Request == 2)
{
num += 60;
if (num >= 600)
{
num = 0;
}
}
}
}
}
Item.ExtraData = num.ToString();
Item.UpdateState(true, true);
}
}