本文整理汇总了C#中Pici.Messages.ServerMessage.AppendByte方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendByte方法的具体用法?C# ServerMessage.AppendByte怎么用?C# ServerMessage.AppendByte使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pici.Messages.ServerMessage
的用法示例。
在下文中一共展示了ServerMessage.AppendByte方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnTrigger
internal override void OnTrigger(GameClient Session, RoomItem Item, int Request, bool UserHasRights)
{
if (Session != null)
return;
RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
Point ItemCoordx1 = new Point(Item.Coordinate.X + 1, Item.Coordinate.Y);
Point ItemCoordx2 = new Point(Item.Coordinate.X - 1, Item.Coordinate.Y);
Point ItemCoordy1 = new Point(Item.Coordinate.X, Item.Coordinate.Y + 1);
Point ItemCoordy2 = new Point(Item.Coordinate.X, Item.Coordinate.Y - 1);
if (User == null)
{
return;
}
if (User.Coordinate != ItemCoordx1 && User.Coordinate != ItemCoordx2 && User.Coordinate != ItemCoordy1 && User.Coordinate != ItemCoordy2)
{
if (User.CanWalk)
{
User.MoveTo(Item.SquareInFront);
return;
}
}
else
{
int NewX = Item.Coordinate.X;
int NewY = Item.Coordinate.Y;
if (User.Coordinate == ItemCoordx1)
{
NewX = Item.Coordinate.X - 1;
NewY = Item.Coordinate.Y;
}
else if (User.Coordinate == ItemCoordx2)
{
NewX = Item.Coordinate.X + 1;
NewY = Item.Coordinate.Y;
}
else if (User.Coordinate == ItemCoordy1)
{
NewX = Item.Coordinate.X;
NewY = Item.Coordinate.Y - 1;
}
else if (User.Coordinate == ItemCoordy2)
{
NewX = Item.Coordinate.X;
NewY = Item.Coordinate.Y + 1;
}
if (Item.GetRoom().GetGameMap().ValidTile(NewX, NewY))
{
Double NewZ = Item.GetRoom().GetGameMap().SqAbsoluteHeight(NewX, NewY);
ServerMessage Message = new ServerMessage(230);
Message.AppendInt32(Item.Coordinate.X);
Message.AppendInt32(Item.Coordinate.Y);
Message.AppendInt32(NewX);
Message.AppendInt32(NewY);
Message.AppendInt32(1);
Message.AppendUInt(Item.Id);
Message.AppendByte(2);
Message.AppendStringWithBreak(TextHandling.GetString(NewZ));
Message.AppendString("M");
Item.GetRoom().SendMessage(Message);
Item.GetRoom().GetRoomItemHandler().SetFloorItem(User.GetClient(), Item, NewX, NewY, Item.Rot, false, false, true);
}
}
}