当前位置: 首页>>代码示例>>C#>>正文


C# ServerMessage.AppendRawUInt方法代码示例

本文整理汇总了C#中ServerMessage.AppendRawUInt方法的典型用法代码示例。如果您正苦于以下问题:C# ServerMessage.AppendRawUInt方法的具体用法?C# ServerMessage.AppendRawUInt怎么用?C# ServerMessage.AppendRawUInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ServerMessage的用法示例。


在下文中一共展示了ServerMessage.AppendRawUInt方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MoveWallItem

        internal void MoveWallItem()
        {
            Room Room = ButterflyEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

            if (Room == null || !Room.CheckRights(Session))
            {
                return;
            }

            uint itemID = Request.PopWiredUInt();
            string wallPositionData = Request.PopFixedString();

            RoomItem Item = Room.GetRoomItemHandler().GetItem(itemID);

            if (Item == null)
                return;

            try
            {
                WallCoordinate coordinate = new WallCoordinate(":" + wallPositionData.Split(':')[1]);
                Item.wallCoord = coordinate;
            }
            catch
            {
                Response.Init(516);
                Response.AppendInt32(11);
                SendResponse();

                return;
            }

            Room.GetRoomItemHandler().UpdateItem(Item);

            ServerMessage LeaveMessage = new ServerMessage(84);
            LeaveMessage.AppendRawUInt(Item.Id);
            LeaveMessage.AppendStringWithBreak(string.Empty);
            LeaveMessage.AppendBoolean(false);
            Room.SendMessage(LeaveMessage);

            ServerMessage Message = new ServerMessage(83);
            Item.Serialize(Message);
            Room.SendMessage(Message);
        }
开发者ID:habb0,项目名称:Bfly,代码行数:43,代码来源:Rooms.cs

示例2: RemoveRoomItem

        private void RemoveRoomItem(RoomItem Item)
        {
            if (Item.IsWallItem)
            {
                ServerMessage Message = new ServerMessage(84);
                Message.AppendRawUInt(Item.Id);
                Message.AppendStringWithBreak("");
                Message.AppendBoolean(false);
                room.SendMessage(Message);
            }
            else if (Item.IsFloorItem)
            {
                ServerMessage Message = new ServerMessage(94);
                Message.AppendRawUInt(Item.Id);
                Message.AppendStringWithBreak("");
                Message.AppendBoolean(false);
                room.SendMessage(Message);
            }

            if (Item.IsWallItem)
                mWallItems.Remove(Item.Id);
            else
            {
                room.GetGameMap().RemoveFromMap(Item);
                mFloorItems.Remove(Item.Id);
            }

            RemoveItem(Item);

            room.GetRoomUserManager().UpdateUserStatusses();

            if (WiredHandler.TypeIsWire(Item.GetBaseItem().InteractionType))
            {
                room.GetWiredHandler().RemoveWiredItem(Item.Coordinate);
            }
        }
开发者ID:habb0,项目名称:Bfly,代码行数:36,代码来源:RoomItemHandling.cs

示例3: FlushSettings

        internal void FlushSettings()
        {
            List<ServerMessage> messages = new List<ServerMessage>();

            lock (GetRoomItemHandler().mFloorItems)
            {
                foreach (RoomItem Item in GetRoomItemHandler().mFloorItems.Values)
                {
                    ServerMessage Message = new ServerMessage(94);
                    Message.AppendRawUInt(Item.Id);
                    Message.AppendStringWithBreak("");
                    Message.AppendBoolean(false);
                    messages.Add(Message);
                }
            }

            lock (GetRoomItemHandler().mWallItems)
            {
                foreach (RoomItem Item in GetRoomItemHandler().mWallItems.Values)
                {
                    ServerMessage Message = new ServerMessage(84);
                    Message.AppendRawUInt(Item.Id);
                    Message.AppendStringWithBreak("");
                    Message.AppendBoolean(false);
                    messages.Add(Message);
                }
            }

            SendMessage(messages);

            mCycleEnded = true;
            using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                GetRoomItemHandler().SaveFurniture(dbClient);

            Tags.Clear();
            UsersWithRights.Clear();
            Bans.Clear();
            ActiveTrades.Clear();

            if (GotFreeze())
                freeze = new Freeze(this);
            if (GotBanzai())
                banzai = new BattleBanzai(this);
            if (GotSoccer())
                soccer = new Soccer(this);
            if (gameItemHandler != null)
                gameItemHandler = new GameItemHandler(this);
        }
开发者ID:habb0,项目名称:Bfly,代码行数:48,代码来源:Room.cs

示例4: RemoveAllFurniture

        internal List<RoomItem> RemoveAllFurniture(GameClient Session)
        {
            List<RoomItem> ReturnList = new List<RoomItem>();
            foreach (RoomItem Item in mFloorItems.Values.ToArray())
            {
                Item.Interactor.OnRemove(Session, Item);
                ServerMessage Message = new ServerMessage(94);
                Message.AppendRawUInt(Item.Id);
                Message.AppendStringWithBreak("");
                Message.AppendBoolean(false);
                room.SendMessage(Message);

                //mFloorItems.Remove(Item.Id);

                ReturnList.Add(Item);
            }

            foreach (RoomItem Item in mWallItems.Values.ToArray())
            {
                Item.Interactor.OnRemove(Session, Item);
                ServerMessage Message = new ServerMessage(84);
                Message.AppendRawUInt(Item.Id);
                Message.AppendStringWithBreak("");
                Message.AppendBoolean(false);
                room.SendMessage(Message);
                //mWallItems.Remove(Item.Id);

                ReturnList.Add(Item);
            }

            mWallItems.Clear();
            mFloorItems.Clear();

            mRemovedItems.Clear();

            mMovedItems.Clear();
            mAddedItems.Clear();
            mRollers.QueueDelegate(new onCycleDoneDelegate(ClearRollers));

            using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.runFastQuery("DELETE FROM items_rooms WHERE room_id = " + room.RoomId);
            }

            room.GetGameMap().GenerateMaps();
            room.GetRoomUserManager().UpdateUserStatusses();

            if (room.GotWired())
            {
                room.GetWiredHandler().OnPickall();
            }

            return ReturnList;
        }
开发者ID:habb0,项目名称:Bfly,代码行数:54,代码来源:RoomItemHandling.cs


注:本文中的ServerMessage.AppendRawUInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。