public ObjectUpdateComposer(Item Item, int UserId, bool HideWired = false) : base(ServerPacketHeader.ObjectUpdateMessageComposer) { WriteInteger(Item.Id); WriteInteger((HideWired && WiredUtillity.TypeIsWired(Item.GetBaseItem().InteractionType) && (Item.GetBaseItem().InteractionType != InteractionType.highscore && Item.GetBaseItem().InteractionType != InteractionType.highscorepoints)) ? 31294061 : Item.GetBaseItem().SpriteId); WriteInteger(Item.GetX); WriteInteger(Item.GetY); WriteInteger(Item.Rotation); WriteString(String.Format("{0:0.00}", TextHandling.GetString(Item.GetZ))); WriteString(String.Empty); if (Item.LimitedNo > 0) { WriteInteger(1); WriteInteger(256); WriteString(Item.ExtraData); WriteInteger(Item.LimitedNo); WriteInteger(Item.LimitedTot); } else { ItemBehaviourUtility.GenerateExtradata(Item, this); } WriteInteger(-1); // to-do: check WriteInteger(1); //(Item.GetBaseItem().Modes > 1) ? 1 : 0 WriteInteger(UserId); }
private void WriteFloorItem(Item Item, int UserID) { WriteInteger(Item.Id); WriteInteger(Item.GetBaseItem().SpriteId); WriteInteger(Item.GetX); WriteInteger(Item.GetY); WriteInteger(Item.Rotation); WriteString(String.Format("{0:0.00}", TextHandling.GetString(Item.GetZ))); WriteString(String.Empty); if (Item.LimitedNo > 0) { WriteInteger(1); WriteInteger(256); WriteString(Item.ExtraData); WriteInteger(Item.LimitedNo); WriteInteger(Item.LimitedTot); } else { ItemBehaviourUtility.GenerateExtradata(Item, this); } WriteInteger(-1); // to-do: check WriteInteger((Item.GetBaseItem().Modes > 1) ? 1 : 0); WriteInteger(UserID); }
internal void SerializeStatus(ServerMessage Message) { if (IsSpectator) { return; } Message.AppendInt32(VirtualId); Message.AppendInt32(X); Message.AppendInt32(Y); Message.AppendStringWithBreak(TextHandling.GetString(Z)); Message.AppendInt32(RotHead); Message.AppendInt32(RotBody); Message.AppendString("/"); foreach (KeyValuePair <string, string> Status in Statusses) { Message.AppendString(Status.Key); if (Status.Value != string.Empty) { Message.AppendString(" "); Message.AppendString(Status.Value); } Message.AppendString("/"); } Message.AppendStringWithBreak("/"); }
public ObjectAddComposer(Item Item, Room Room) : base(ServerPacketHeader.ObjectAddMessageComposer) { base.WriteInteger(Item.Id); base.WriteInteger(Item.GetBaseItem().SpriteId); base.WriteInteger(Item.GetX); base.WriteInteger(Item.GetY); base.WriteInteger(Item.Rotation); base.WriteString(String.Format("{0:0.00}", TextHandling.GetString(Item.GetZ))); base.WriteString(String.Empty); if (Item.LimitedNo > 0) { base.WriteInteger(1); base.WriteInteger(256); base.WriteString(Item.ExtraData); base.WriteInteger(Item.LimitedNo); base.WriteInteger(Item.LimitedTot); } else { ItemBehaviourUtility.GenerateExtradata(Item, this); } base.WriteInteger(-1); // to-do: check base.WriteInteger((Item.GetBaseItem().Modes > 1) ? 1 : 0); base.WriteInteger(Item.UserID); base.WriteString(Item.Username); }
public void method_15(ServerMessage Message5_0) { if (!this.bool_11) { Message5_0.AppendInt32(this.VirtualId); Message5_0.AppendInt32(this.X); Message5_0.AppendInt32(this.Y); Message5_0.AppendString(TextHandling.GetString(this.double_0)); Message5_0.AppendInt32(this.int_7); Message5_0.AppendInt32(this.BodyRotation); StringBuilder builder = new StringBuilder(); builder.Append("/"); foreach (KeyValuePair <string, string> pair in this.Statusses) { builder.Append(pair.Key); if (pair.Value != string.Empty) { builder.Append(" "); builder.Append(pair.Value); } builder.Append("/"); } builder.Append("/"); Message5_0.AppendString(builder.ToString()); if (this.Statusses.ContainsKey("sign")) { this.RemoveStatus("sign"); } } }
public ObjectAddComposer(Item item) : base(ServerPacketHeader.ObjectAddMessageComposer) { WriteInteger(item.Id); WriteInteger(item.GetBaseItem().SpriteId); WriteInteger(item.GetX); WriteInteger(item.GetY); WriteInteger(item.Rotation); WriteString($"{TextHandling.GetString(item.GetZ):0.00}"); WriteString(string.Empty); if (item.LimitedNo > 0) { WriteInteger(1); WriteInteger(256); WriteString(item.ExtraData); WriteInteger(item.LimitedNo); WriteInteger(item.LimitedTot); } else { ItemBehaviourUtility.GenerateExtradata(item, this); } WriteInteger(-1); // to-do: check WriteInteger(item.GetBaseItem().Modes > 1 ? 1 : 0); WriteInteger(item.UserId); WriteString(item.Username); }
internal void SerializeStatus(ServerMessage Message) { Message.AppendInt32(this.VirtualId); Message.AppendInt32(this.X); Message.AppendInt32(this.Y); Message.AppendString(TextHandling.GetString(this.Z)); Message.AppendInt32(this.RotHead); Message.AppendInt32(this.RotBody); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("/"); if (this.IsPet && this.PetData.Type == 16u) { stringBuilder.Append("/" + this.PetData.MoplaBreed.GrowStatus + ((this.Statusses.Count >= 1) ? "/" : "")); } lock (this.Statusses) { foreach (KeyValuePair <string, string> current in this.Statusses) { stringBuilder.Append(current.Key); if (current.Value != string.Empty) { stringBuilder.Append(" "); stringBuilder.Append(current.Value); } stringBuilder.Append("/"); } } stringBuilder.Append("/"); Message.AppendString(stringBuilder.ToString()); }
internal void SerializeStatus(ServerMessage Message) { if (IsSpectator) { return; } Message.AppendInt32(VirtualId); Message.AppendInt32(X); Message.AppendInt32(Y); Message.AppendString(TextHandling.GetString(Z)); Message.AppendInt32(RotHead); Message.AppendInt32(RotBody); StringBuilder StatusComposer = new StringBuilder(); StatusComposer.Append("/"); foreach (KeyValuePair <string, string> Status in Statusses) { StatusComposer.Append(Status.Key); if (Status.Value != string.Empty) { StatusComposer.Append(" "); StatusComposer.Append(Status.Value); } StatusComposer.Append("/"); } StatusComposer.Append("/"); Message.AppendString(StatusComposer.ToString()); RemoveStatus("sign"); // fix for infinitive signs }
private ServerMessage UpdateItemOnRoller(RoomItem pItem, Point NextCoord, uint pRolledID, Double NextZ) { ServerMessage mMessage = new ServerMessage(); mMessage.Init(Outgoing.ObjectOnRoller); // Cf mMessage.AppendInt32(pItem.GetX); mMessage.AppendInt32(pItem.GetY); mMessage.AppendInt32(NextCoord.X); mMessage.AppendInt32(NextCoord.Y); mMessage.AppendInt32(1); mMessage.AppendUInt(pItem.Id); mMessage.AppendString(TextHandling.GetString(pItem.GetZ)); mMessage.AppendString(TextHandling.GetString(NextZ)); mMessage.AppendUInt(pRolledID); //room.SendMessage(mMessage); //SetFloorItem(null, pItem, NextCoord.X, NextCoord.Y, pItem.Rot, false, true); SetFloorItem(pItem, NextCoord.X, NextCoord.Y, NextZ); return(mMessage); }
internal ServerMessage UpdateUnitOnRoller(RoomUnit unit, Point pNextCoord, uint pRollerID, Double NextZ) { ServerMessage mMessage = new ServerMessage(0); mMessage.Init(Outgoing.ObjectOnRoller); // Cf mMessage.AppendInt32(unit.X); mMessage.AppendInt32(unit.Y); mMessage.AppendInt32(pNextCoord.X); mMessage.AppendInt32(pNextCoord.Y); mMessage.AppendInt32(0); mMessage.AppendUInt(pRollerID); mMessage.AppendInt32(2); mMessage.AppendInt32(unit.VirtualID); mMessage.AppendString(TextHandling.GetString(unit.Z)); mMessage.AppendString(TextHandling.GetString(NextZ)); room.GetGameMap().UpdateUnitMovement(new Point(unit.X, unit.Y), new Point(pNextCoord.X, pNextCoord.Y), unit); room.GetGameMap().Map[unit.X, unit.Y] = 1; unit.X = pNextCoord.X; unit.Y = pNextCoord.Y; unit.Z = NextZ; room.GetGameMap().Map[unit.X, unit.Y] = 0; return(mMessage); }
private void WriteFloorItem(Item Item, int UserID, bool HideWired) { WriteInteger(Item.Id); WriteInteger((HideWired && WiredUtillity.TypeIsWired(Item.GetBaseItem().InteractionType) && (Item.GetBaseItem().InteractionType != InteractionType.highscore && Item.GetBaseItem().InteractionType != InteractionType.highscorepoints)) ? 31294061 : Item.GetBaseItem().SpriteId); WriteInteger(Item.GetX); WriteInteger(Item.GetY); WriteInteger(Item.Rotation); WriteString(String.Format("{0:0.00}", TextHandling.GetString(Item.GetZ))); WriteString(String.Empty); if (Item.LimitedNo > 0) { WriteInteger(1); WriteInteger(256); WriteString(Item.ExtraData); WriteInteger(Item.LimitedNo); WriteInteger(Item.LimitedTot); } else { ItemBehaviourUtility.GenerateExtradata(Item, this); } WriteInteger(-1); // to-do: check WriteInteger(1); //(Item.GetBaseItem().Modes > 1) ? 1 : 0 WriteInteger(UserID); }
public override void Compose(ServerPacket packet) { packet.WriteInteger(Item.Id); packet.WriteInteger(Item.GetBaseItem().SpriteId); packet.WriteInteger(Item.GetX); packet.WriteInteger(Item.GetY); packet.WriteInteger(Item.Rotation); packet.WriteString(String.Format("{0:0.00}", TextHandling.GetString(Item.GetZ))); packet.WriteString(String.Empty); if (Item.LimitedNo > 0) { packet.WriteInteger(1); packet.WriteInteger(256); packet.WriteString(Item.ExtraData); packet.WriteInteger(Item.LimitedNo); packet.WriteInteger(Item.LimitedTot); } else { ItemBehaviourUtility.GenerateExtradata(Item, packet); } packet.WriteInteger(-1); // to-do: check packet.WriteInteger((Item.GetBaseItem().Modes > 1) ? 1 : 0); packet.WriteInteger(Item.UserID); packet.WriteString(Item.Username); }
private void WriteFloorItem(Item item, int userId) { WriteInteger(item.Id); WriteInteger(item.GetBaseItem().SpriteId); WriteInteger(item.GetX); WriteInteger(item.GetY); WriteInteger(item.Rotation); WriteString($"{TextHandling.GetString(item.GetZ):0.00}"); WriteString(string.Empty); if (item.LimitedNo > 0) { WriteInteger(1); WriteInteger(256); WriteString(item.ExtraData); WriteInteger(item.LimitedNo); WriteInteger(item.LimitedTot); } else { ItemBehaviourUtility.GenerateExtradata(item, this); } WriteInteger(-1); // to-do: check WriteInteger(item.GetBaseItem().Modes > 1 ? 1 : 0); WriteInteger(userId); }
internal ServerMessage UpdateUserOnRoller(RoomUser pUser, Point pNextCoord, uint pRollerID, Double NextZ) { ServerMessage mMessage = new ServerMessage(); mMessage.Init(230); // Cf mMessage.AppendInt32(pUser.X); mMessage.AppendInt32(pUser.Y); mMessage.AppendInt32(pNextCoord.X); mMessage.AppendInt32(pNextCoord.Y); mMessage.AppendInt32(0); mMessage.AppendUInt(pRollerID); mMessage.AppendString("J"); mMessage.AppendInt32(pUser.VirtualId); mMessage.AppendStringWithBreak(TextHandling.GetString(pUser.Z)); mMessage.AppendStringWithBreak(TextHandling.GetString(NextZ)); room.GetGameMap().UpdateUserMovement(new Point(pUser.X, pUser.Y), new Point(pNextCoord.X, pNextCoord.Y), pUser); room.GetGameMap().GameMap[pUser.X, pUser.Y] = 1; pUser.X = pNextCoord.X; pUser.Y = pNextCoord.Y; pUser.Z = NextZ; room.GetGameMap().GameMap[pUser.X, pUser.Y] = 0; return(mMessage); }
internal void OnUserWalk(RoomUser user) { if (BaseItem.IsSeat) { user.AddStatus("sit", TextHandling.GetString(BaseItem.Z)); user.Z = Z; user.Rot = Rot; user.NeedsUpdate = true; } }
public bool MoveBall(RoomItem item, RoomUser mover, int newX, int newY) { if (item == null || item.GetBaseItem() == null /*|| mover == null || mover.GetHabbo() == null*/) { return(false); } if (!room.GetGameMap().itemCanBePlacedHere(newX, newY)) { return(false); } if (mover != null && mover.handelingBallStatus == 1) { if (room.GetGameMap().SquareHasUsers(newX, newY)) { return(false); } } Point oldRoomCoord = item.Coordinate; Double NewZ = room.GetGameMap().Model.SqFloorHeight[newX, newY]; ServerMessage mMessage2 = new ServerMessage(Outgoing.BallUpdate); // Cf mMessage2.AppendUInt(item.Id); mMessage2.AppendInt32(item.GetBaseItem().SpriteId); mMessage2.AppendInt32(newX); mMessage2.AppendInt32(newY); mMessage2.AppendInt32(4); // rot; mMessage2.AppendString((String.Format("{0:0.00}", TextHandling.GetString(item.GetZ)))); mMessage2.AppendString((String.Format("{0:0.00}", TextHandling.GetString(item.GetZ)))); mMessage2.AppendUInt(0); mMessage2.AppendUInt(0); mMessage2.AppendString(item.ExtraData); mMessage2.AppendInt32(-1); mMessage2.AppendUInt(0); mMessage2.AppendUInt(item.OwnerId); room.SendFastMessage(mMessage2); if (oldRoomCoord.X == newX && oldRoomCoord.Y == newY) { return(false); } item.SetState(newX, newY, item.GetZ, Gamemap.GetAffectedTiles(item.GetBaseItem().Length, item.GetBaseItem().Width, newX, newY, item.Rot)); if (mover != null) { return(soccer.HandleFootballGameItems(new Point(newX, newY), mover)); } return(false); }
internal void SerializeStatus(ServerMessage Message, String Status) { Message.AppendInt32(VirtualID); Message.AppendInt32(X); Message.AppendInt32(Y); Message.AppendString(TextHandling.GetString(Z)); Message.AppendInt32(RotHead); Message.AppendInt32(RotBody); StringBuilder StatusComposer = new StringBuilder(); Message.AppendString(Status); }
internal void MovePuck(RoomItem item, GameClient mover, int newX, int newY, Team team) { if (!this.room.GetGameMap().itemCanBePlacedHere(newX, newY)) { return; } Point coordinate1 = item.Coordinate; double k = (double)this.room.GetGameMap().Model.SqFloorHeight[newX, newY]; if (coordinate1.X == newX && coordinate1.Y == newY) { return; } item.ExtraData = ((int)team).ToString(); item.UpdateNeeded = true; item.UpdateState(); ServerMessage serverMessage1 = new ServerMessage(); serverMessage1.Init(Outgoing.ItemAnimationMessageComposer); ServerMessage serverMessage2 = serverMessage1; Point coordinate2 = item.Coordinate; int x = coordinate2.X; serverMessage2.AppendInt32(x); ServerMessage serverMessage3 = serverMessage1; coordinate2 = item.Coordinate; int y = coordinate2.Y; serverMessage3.AppendInt32(y); serverMessage1.AppendInt32(newX); serverMessage1.AppendInt32(newY); serverMessage1.AppendInt32(1); serverMessage1.AppendUInt(item.Id); serverMessage1.AppendString(TextHandling.GetString(item.GetZ)); serverMessage1.AppendString(TextHandling.GetString(k)); serverMessage1.AppendInt32(1); this.room.SendMessage(serverMessage1); this.room.GetRoomItemHandler().SetFloorItem(mover, item, newX, newY, item.Rot, false, false, false, false); if (mover == null || mover.GetHabbo() == null) { return; } RoomUser roomUserByHabbo = mover.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(mover.GetHabbo().Id); if (!this.banzaiStarted) { return; } this.HandleBanzaiTiles(new Point(newX, newY), team, roomUserByHabbo); }
//internal void ResetStatus() //{ // Statusses = new Dictionary<string, string>(); //} internal virtual void Serialize(ServerMessage Message) { Message.AppendInt32(ID); Message.AppendString(Name); Message.AppendString(Motto); Message.AppendString(Figure); Message.AppendInt32(VirtualID); Message.AppendInt32(X); Message.AppendInt32(Y); Message.AppendString(TextHandling.GetString(Z)); Message.AppendInt32(RotBody); // ??? Message.AppendInt32(GetTypeID()); // Rest is up to the derived classes }
internal void SerializeStatus(ServerMessage Message, String Status) { if (IsSpectator) { return; } Message.AppendInt32(VirtualId); Message.AppendInt32(X); Message.AppendInt32(Y); Message.AppendString(Z < 0 ? TextHandling.GetString(0) : TextHandling.GetString(Z)); Message.AppendInt32(RotHead); Message.AppendInt32(RotBody); Message.AppendString(Status); }
internal void SerializeStatus(ServerMessage Message, string Status) { if (this.IsSpectator) { return; } Message.AppendInt32(this.VirtualId); Message.AppendInt32(this.X); Message.AppendInt32(this.Y); Message.AppendString(TextHandling.GetString(this.Z)); Message.AppendInt32(this.RotHead); Message.AppendInt32(this.RotBody); new StringBuilder(); Message.AppendString(Status); }
internal void MovePuck(RoomItem item, GameClient client, int newX, int newY, Team team) { if (!_room.GetGameMap().ItemCanBePlacedHere(newX, newY)) { return; } var oldRoomCoord = item.Coordinate; double newZ = _room.GetGameMap().Model.SqFloorHeight[newX][newY]; if (oldRoomCoord.X == newX && oldRoomCoord.Y == newY) { return; } item.ExtraData = ((int)team).ToString(); item.UpdateNeeded = true; item.UpdateState(); var serverMessage = new ServerMessage(LibraryParser.OutgoingRequest("ItemAnimationMessageComposer")); serverMessage.AppendInteger(oldRoomCoord.X); serverMessage.AppendInteger(oldRoomCoord.Y); serverMessage.AppendInteger(newX); serverMessage.AppendInteger(newY); serverMessage.AppendInteger(1); serverMessage.AppendInteger(item.Id); serverMessage.AppendString(TextHandling.GetString(item.Z)); serverMessage.AppendString(TextHandling.GetString(newZ)); serverMessage.AppendInteger(-1); _room.SendMessage(serverMessage); _room.GetRoomItemHandler().SetFloorItem(client, item, newX, newY, item.Rot, false, false, false, false, false); if (client == null || client.GetHabbo() == null) { return; } var roomUserByHabbo = client.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(client.GetHabbo().Id); if (!IsBanzaiActive) { return; } HandleBanzaiTiles(new Point(newX, newY), team, roomUserByHabbo); }
public ServerPacket UpdateItemOnRoller(Item pItem, Point NextCoord, int pRolledID, double NextZ) { var mMessage = new ServerPacket(ServerPacketHeader.SlideObjectBundleMessageComposer); mMessage.WriteInteger(pItem.GetX); mMessage.WriteInteger(pItem.GetY); mMessage.WriteInteger(NextCoord.X); mMessage.WriteInteger(NextCoord.Y); mMessage.WriteInteger(1); mMessage.WriteInteger(pItem.Id); mMessage.WriteString(TextHandling.GetString(pItem.GetZ)); mMessage.WriteString(TextHandling.GetString(NextZ)); mMessage.WriteInteger(pRolledID); SetFloorItem(pItem, NextCoord.X, NextCoord.Y, NextZ); return(mMessage); }
private ServerPacket UpdateItemOnRoller(Item pItem, Point NextCoord, double NextZ) { ServerPacket serverMessage = new ServerPacket(ServerPacketHeader.SlideObjectBundleMessageComposer); serverMessage.WriteInteger(pItem.GetX); serverMessage.WriteInteger(pItem.GetY); serverMessage.WriteInteger(NextCoord.X); serverMessage.WriteInteger(NextCoord.Y); serverMessage.WriteInteger(1); serverMessage.WriteInteger(pItem.Id); serverMessage.WriteString(TextHandling.GetString(pItem.GetZ)); serverMessage.WriteString(TextHandling.GetString(NextZ)); serverMessage.WriteInteger(0); this.SetFloorItem(pItem, NextCoord.X, NextCoord.Y, NextZ); return(serverMessage); }
public ServerPacket UpdateUserOnRoller(RoomUser pUser, Point pNextCoord, int pRollerID, Double NextZ) { var mMessage = new ServerPacket(ServerPacketHeader.SlideObjectBundleMessageComposer); mMessage.WriteInteger(pUser.X); mMessage.WriteInteger(pUser.Y); mMessage.WriteInteger(pNextCoord.X); mMessage.WriteInteger(pNextCoord.Y); mMessage.WriteInteger(0); mMessage.WriteInteger(pRollerID); mMessage.WriteInteger(2); mMessage.WriteInteger(pUser.VirtualId); mMessage.WriteString(TextHandling.GetString(pUser.Z)); mMessage.WriteString(TextHandling.GetString(NextZ)); _room.GetGameMap().UpdateUserMovement(new Point(pUser.X, pUser.Y), new Point(pNextCoord.X, pNextCoord.Y), pUser); _room.GetGameMap().GameMap[pUser.X, pUser.Y] = 1; pUser.X = pNextCoord.X; pUser.Y = pNextCoord.Y; pUser.Z = NextZ; _room.GetGameMap().GameMap[pUser.X, pUser.Y] = 0; if (pUser != null && pUser.GetClient() != null && pUser.GetClient().Habbo != null) { List <Item> Items = _room.GetGameMap().GetRoomItemForSquare(pNextCoord.X, pNextCoord.Y); foreach (Item IItem in Items.ToList()) { if (IItem == null) { continue; } _room.GetWired().TriggerEvent(WiredBoxType.TriggerWalkOnFurni, pUser.GetClient().Habbo, IItem); } Item Item = _room.GetRoomItemHandler().GetItem(pRollerID); if (Item != null) { _room.GetWired().TriggerEvent(WiredBoxType.TriggerWalkOffFurni, pUser.GetClient().Habbo, Item); } } return(mMessage); }
internal void MovePuck(RoomItem item, GameClient mover, int newX, int newY, Team team) { RoomUser user = mover.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(mover.GetHabbo().Id); if (!room.GetGameMap().itemCanBePlacedHere(newX, newY)) { return; } Point oldRoomCoord = item.Coordinate; Double NewZ = room.GetGameMap().Model.SqFloorHeight[newX, newY]; if (oldRoomCoord.X == newX && oldRoomCoord.Y == newY) { return; } // item.ExtraData = ((int)team).ToString(); // item.UpdateNeeded = true; // item.UpdateState(); var mMessage = new ServerMessage(Outgoing.ObjectOnRoller); // Cf mMessage.AppendInt32(item.GetX); mMessage.AppendInt32(item.GetY); mMessage.AppendInt32(newX); mMessage.AppendInt32(newY); mMessage.AppendInt32(1); mMessage.AppendUInt(item.Id); mMessage.AppendString(TextHandling.GetString(item.GetZ)); mMessage.AppendString(TextHandling.GetString(item.GetZ)); mMessage.AppendUInt(item.Id); room.SendMessage(mMessage); room.GetRoomItemHandler().SetFloorItem(mover, item, newX, newY, item.Rot, false, false, false, false); if (mover == null || mover.GetHabbo() == null) { return; } if (room.GetGameManager().IsGameStarted() && !room.GetGameManager().IsGamePaused()) { HandleBanzaiTiles(new Point(newX, newY), team, user); } }
internal bool MoveBall(RoomItem item, GameClient mover, int newX, int newY) { if (item == null || item.GetBaseItem() == null /*|| mover == null || mover.GetHabbo() == null*/) { return(false); } if (!_room.GetGameMap().ItemCanBePlacedHere(newX, newY)) { return(false); } var oldRoomCoord = item.Coordinate; var itemIsOnGameItem = GameItemOverlaps(item); double newZ = _room.GetGameMap().Model.SqFloorHeight[newX][newY]; var mMessage = new ServerMessage(); mMessage.Init(LibraryParser.OutgoingRequest("ItemAnimationMessageComposer")); // Cf mMessage.AppendInteger(item.Coordinate.X); mMessage.AppendInteger(item.Coordinate.Y); mMessage.AppendInteger(newX); mMessage.AppendInteger(newY); mMessage.AppendInteger(1); mMessage.AppendInteger(item.Id); mMessage.AppendString(TextHandling.GetString(item.Z)); mMessage.AppendString(TextHandling.GetString(newZ)); mMessage.AppendInteger(item.Id); _room.SendMessage(mMessage); if (oldRoomCoord.X == newX && oldRoomCoord.Y == newY) { return(false); } item.SetState(newX, newY, item.Z, Gamemap.GetAffectedTiles(item.GetBaseItem().Length, item.GetBaseItem().Width, newX, newY, item.Rot)); if (itemIsOnGameItem || mover == null || mover.GetHabbo() == null) { return(false); } HandleFootballGameItems(new Point(newX, newY), _room.GetRoomUserManager().GetRoomUserByHabbo(mover.GetHabbo().Id)); return(false); }
public UpdateFootBallComposer(Item Item, int newX, int newY) : base(ServerPacketHeader.ObjectUpdateMessageComposer) { WriteInteger(Item.Id); WriteInteger(Item.GetBaseItem().SpriteId); WriteInteger(newX); WriteInteger(newY); WriteInteger(4); // rot; WriteString((String.Format("{0:0.00}", TextHandling.GetString(Item.GetZ)))); WriteString((String.Format("{0:0.00}", TextHandling.GetString(Item.GetZ)))); WriteInteger(0); WriteInteger(0); WriteString(Item.ExtraData); WriteInteger(-1); WriteInteger(0); WriteInteger(Item.UserID); }
internal void MoveBall(RoomItem item, GameClient mover, int newX, int newY, RoomUser user) { if (item == null || mover == null) { return; } if (!room.GetGameMap().itemCanBePlacedHere(newX, newY)) { return; } Point oldRoomCoord = item.Coordinate; // bool itemIsOnGameItem = GameItemOverlaps(item); Double NewZ = room.GetGameMap().Model.SqFloorHeight[newX, newY]; ServerMessage mMessage = new ServerMessage(); mMessage.Init(Outgoing.ItemAnimationMessageComposer); // Cf mMessage.AppendInt32(item.Coordinate.X); mMessage.AppendInt32(item.Coordinate.Y); mMessage.AppendInt32(newX); mMessage.AppendInt32(newY); mMessage.AppendInt32(1); mMessage.AppendUInt(item.Id); mMessage.AppendString(TextHandling.GetString(item.GetZ)); mMessage.AppendString(TextHandling.GetString(NewZ)); mMessage.AppendUInt(item.Id); room.SendMessage(mMessage); item.ExtraData = "11"; item.UpdateNeeded = true; if (oldRoomCoord.X == newX && oldRoomCoord.Y == newY) { return; } if (!room.GetRoomItemHandler().SetFloorItem(mover, item, newX, newY, item.Rot, false, false, false, false)) { room.GetRoomItemHandler().SetFloorItem(item, newX, newY, NewZ); } HandleFootballGameItems(item.Coordinate, user); }
public ServerPacket TeleportUser(RoomUser pUser, Point pNextCoord, int pRollerID, double NextZ) { ServerPacket serverMessage = new ServerPacket(ServerPacketHeader.SlideObjectBundleMessageComposer); serverMessage.WriteInteger(pUser.X); serverMessage.WriteInteger(pUser.Y); serverMessage.WriteInteger(pNextCoord.X); serverMessage.WriteInteger(pNextCoord.Y); serverMessage.WriteInteger(0); serverMessage.WriteInteger(pRollerID); serverMessage.WriteInteger(2); serverMessage.WriteInteger(pUser.VirtualId); serverMessage.WriteString(TextHandling.GetString(pUser.Z)); serverMessage.WriteString(TextHandling.GetString(NextZ)); pUser.SetPos(pNextCoord.X, pNextCoord.Y, NextZ); return(serverMessage); }