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


C# ServerPacket.AppendRawInt32方法代码示例

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


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

示例1: TryRedeemVoucher

        public void TryRedeemVoucher(GameClient Session, string Code)
        {
            if (!IsValidCode(Code))
            {
                ServerPacket Error = new ServerPacket(213);
                Error.AppendRawInt32(1);
                Session.SendPacket(Error);
                return;
            }

            int Value = GetVoucherValue(Code);

            TryDeleteVoucher(Code);

            if (Value > 0)
            {
                Session.GetHabbo().Credits += Value;
                Session.GetHabbo().UpdateCreditsBalance(true);
            }

            Session.SendPacket(new ServerPacket(212));
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:22,代码来源:VoucherHandler.cs

示例2: RemoveUserFromRoom

        public void RemoveUserFromRoom(GameClient Session, Boolean NotifyClient, Boolean NotifyKick)
        {
            /*
            ServerMessage SendReminder = new ServerMessage(7);
            SendReminder.AppendString("");
            SendMessage(SendReminder);
            */

            try
            {
                if (Session == null)
                {
                    return;
                }

                RoomUser User = GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (!UserList.Remove(GetRoomUserByHabbo(Session.GetHabbo().Id)))
                {
                    return;
                }

                if (NotifyClient)
                {
                    if (NotifyKick)
                    {
                        ServerPacket packet = new ServerPacket(33);
                        packet.AppendInt32(4008);
                        Session.SendPacket(packet);
                    }

                    Session.SendPacket(new ServerPacket(18));
                }

                List<RoomUser> PetsToRemove = new List<RoomUser>();

                if (!User.IsSpectator)
                {
                    if (User != null)
                    {
                        UserMatrix[User.X, User.Y] = false;

                        ServerPacket LeaveMessage = new ServerPacket(29);
                        LeaveMessage.AppendRawInt32(User.VirtualId);
                        SendMessage(LeaveMessage);
                    }

                    if (Session.GetHabbo() != null)
                    {
                        if (HasActiveTrade(Session.GetHabbo().Id))
                        {
                            TryStopTrade(Session.GetHabbo().Id);
                        }

                        if (Session.GetHabbo().Username.ToLower() == Owner.ToLower())
                        {
                            if (HasOngoingEvent)
                            {
                                Room Room = UberEnvironment.GetGame().GetRoomManager().GetRoom(Session.GetHabbo().CurrentRoomId);

                                if (Room == null || Room.Event == null)
                                {
                                    return;
                                }

                                Event = null;

                                ServerPacket Message = new ServerPacket(370);
                                Message.AppendStringWithBreak("-1");
                                SendMessage(Message);
                            }
                        }

                        Session.GetHabbo().OnLeaveRoom();
                    }
                }

                if (!User.IsSpectator)
                {
                    UpdateUserCount();

                    List<RoomUser> Bots = new List<RoomUser>();

                    foreach (RoomUser Usr in UserList)
                    {
                        if (!Usr.IsBot)
                        {
                            continue;
                        }

                        Bots.Add(Usr);
                    }

                    foreach (RoomUser Bot in Bots)
                    {
                        Bot.BotAI.OnUserLeaveRoom(Session);

                        if (Bot.IsPet && Bot.PetData.OwnerId == Session.GetHabbo().Id && !CheckRights(Session, true))
                        {
                            PetsToRemove.Add(Bot);
//.........这里部分代码省略.........
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:101,代码来源:Room.cs

示例3: RemoveBot

        public void RemoveBot(int VirtualId, bool Kicked)
        {
            RoomUser User = GetRoomUserByVirtualId(VirtualId);

            if (User == null || !User.IsBot)
            {
                return;
            }

            User.BotAI.OnSelfLeaveRoom(Kicked);

            ServerPacket LeaveMessage = new ServerPacket(29);
            LeaveMessage.AppendRawInt32(User.VirtualId);
            SendMessage(LeaveMessage);

            UserMatrix[User.X, User.Y] = false;

            UserList.Remove(User);
        }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:19,代码来源:Room.cs


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