本文整理汇总了C#中RoomItem.ReqUpdate方法的典型用法代码示例。如果您正苦于以下问题:C# RoomItem.ReqUpdate方法的具体用法?C# RoomItem.ReqUpdate怎么用?C# RoomItem.ReqUpdate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RoomItem
的用法示例。
在下文中一共展示了RoomItem.ReqUpdate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTrigger
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
if (session == null)
return;
RoomUser user = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (user == null)
return;
if (user.Coordinate != item.SquareInFront && user.CanWalk)
{
user.MoveTo(item.SquareInFront);
return;
}
if (!item.GetRoom().GetGameMap().CanWalk(item.SquareBehind.X, item.SquareBehind.Y, user.AllowOverride))
return;
if (item.InteractingUser == 0)
{
item.InteractingUser = user.HabboId;
user.CanWalk = false;
if (user.IsWalking && (user.GoalX != item.SquareInFront.X || user.GoalY != item.SquareInFront.Y))
user.ClearMovement();
user.AllowOverride = true;
user.MoveTo(item.Coordinate);
item.ReqUpdate(4, true);
}
}
示例2:
void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
if (Item.ExtraData != "1" && Item.GetBaseItem().VendingIds.Count >= 1 && Item.InteractingUser == 0 && Session != null)
{
RoomUser user = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (user == null)
return;
if (!Gamemap.TilesTouching(user.X, user.Y, Item.GetX, Item.GetY))
{
user.MoveTo(Item.SquareInFront);
return;
}
Item.InteractingUser = Session.GetHabbo().Id;
//user.ClearMovement(true);
user.SetRot(Rotation.Calculate(user.X, user.Y, Item.GetX, Item.GetY), false);
Item.ReqUpdate(2, true);
Item.ExtraData = "1";
Item.UpdateState(false, true);
}
}
示例3: OnTrigger
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
if (item.ExtraData == "1" || !item.GetBaseItem().VendingIds.Any() || item.InteractingUser != 0u ||
session == null)
return;
var roomUserByHabbo = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (roomUserByHabbo == null)
return;
if (!Gamemap.TilesTouching(roomUserByHabbo.X, roomUserByHabbo.Y, item.X, item.Y))
{
roomUserByHabbo.MoveTo(item.SquareInFront);
return;
}
item.InteractingUser = session.GetHabbo().Id;
roomUserByHabbo.CanWalk = false;
roomUserByHabbo.ClearMovement();
roomUserByHabbo.SetRot(PathFinder.CalculateRotation(roomUserByHabbo.X, roomUserByHabbo.Y, item.X, item.Y));
item.ReqUpdate(2, true);
item.ExtraData = "1";
item.UpdateState(false, true);
}
示例4: OnTrigger
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
RoomUser roomUser = null;
if (session != null)
roomUser = item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(session.GetHabbo().Id);
if (roomUser == null)
return;
if (Gamemap.TilesTouching(item.X, item.Y, roomUser.X, roomUser.Y))
{
if (item.ExtraData == "-1")
return;
if (request == -1)
{
item.ExtraData = "0";
item.UpdateState();
return;
}
item.ExtraData = "-1";
item.UpdateState(false, true);
item.ReqUpdate(4, true);
return;
}
roomUser.MoveTo(item.SquareInFront);
}
示例5: OnTrigger
public void OnTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights)
{
RoomUser User = null;
if (Session != null)
User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
if (User == null)
return;
if (Gamemap.TilesTouching(Item.GetX, Item.GetY, User.X, User.Y))
{
if (Item.ExtraData != "-1")
{
if (Request == -1)
{
Item.ExtraData = "0";
Item.UpdateState();
}
else
{
Item.ExtraData = "-1";
Item.UpdateState(false, true);
Item.ReqUpdate(4, true);
}
}
}
else
{
User.MoveTo(Item.SquareInFront);
}
}
示例6: OnTrigger
public override void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
if (item.ExtraData == "-1")
return;
item.ExtraData = "-1";
item.UpdateState(false, true);
item.ReqUpdate(3, true);
}
示例7: OnWiredTrigger
public override void OnWiredTrigger(RoomItem item)
{
if (item.ExtraData == "-1")
return;
item.ExtraData = "-1";
item.UpdateState(false, true);
item.ReqUpdate(3, true);
}
示例8: OnTrigger
public void OnTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights)
{
if (Item.ExtraData != "-1")
{
Item.ExtraData = "-1";
Item.UpdateState(false, true);
Item.ReqUpdate(3, true);
}
}
示例9: OnWiredTrigger
public void OnWiredTrigger(RoomItem Item)
{
if (Item.ExtraData != "0")
{
Item.ExtraData = "0";
Item.UpdateState(false, true);
Item.ReqUpdate(10, true);
}
}
示例10: OnWiredTrigger
public void OnWiredTrigger(RoomItem item)
{
if (item.ExtraData != "0")
{
return;
}
item.ExtraData = "1";
item.UpdateState(false, true);
item.ReqUpdate(4, true);
}
示例11: OnWiredTrigger
public void OnWiredTrigger(RoomItem item)
{
if (item.ExtraData == "-1")
{
return;
}
item.ExtraData = "-1";
item.UpdateState();
item.ReqUpdate(10, true);
}
示例12: OnTrigger
public void OnTrigger(GameClient Session, RoomItem Item, int Request, bool HasRights)
{
if (!HasRights)
{
return;
}
if (Item.ExtraData == "0")
{
Item.ExtraData = "1";
Item.UpdateState(false, true);
Item.ReqUpdate(4, true);
}
}
示例13: ExecuteAction
public void ExecuteAction(RoomItem theItem)
{
if (theItem.ExtraData == "0")
{
theItem.ExtraData = ButterflyEnvironment.GetRandomNumber(1, 4).ToString();
theItem.ReqUpdate(20, false);
}
else if (theItem.ExtraData != "-1")
{
theItem.ExtraData = "-1";
}
theItem.UpdateState(false, true);
}
示例14: OnTrigger
public void OnTrigger(GameClient session, RoomItem item, int request, bool hasRights)
{
if (!hasRights)
{
return;
}
if (item.ExtraData != "0")
{
return;
}
item.ExtraData = "1";
item.UpdateState(false, true);
item.ReqUpdate(4, true);
}
示例15:
void IFurniTrigger.OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
if (!UserHasRights)
{
return;
}
if (Item.ExtraData != "-1")
{
Item.ExtraData = "-1";
Item.UpdateState();
Item.ReqUpdate(10, true);
}
}