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


C# RoomUser.AddStatus方法代码示例

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


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

示例1: ActivateStatus

        public static void ActivateStatus(RoomUser User)
        {
            if (User == null)
            {
                return;
            }

            if (UserIsOnSwimTile(User) && !User.Statusses.ContainsKey("swim"))
            {
                User.AddStatus("swim", "");
            }
        }
开发者ID:RootkitR,项目名称:Essential-5.1,代码行数:12,代码来源:SwimmingPool.cs

示例2: OnUserAdd

        /// <summary>
        ///     Handles the <see cref="E:UserAdd" /> event.
        /// </summary>
        /// <param name="user"></param>
        private void OnUserAdd(RoomUser user)
        {
            try
            {
                if (user?.GetClient() == null || user.GetClient().GetHabbo() == null)
                    return;

                GameClient client = user.GetClient();

                if (client?.GetHabbo() == null || _userRoom == null)
                    return;

                if (!user.IsSpectator)
                {
                    DynamicRoomModel model = _userRoom.GetGameMap().Model;
                    if (model == null) return;
                    user.SetPos(model.DoorX, model.DoorY, model.DoorZ);
                    user.SetRot(model.DoorOrientation, false);

                    user.AddStatus(_userRoom.CheckRights(client, true) ? "flatctrl 4" : "flatctrl 1", string.Empty);

                    user.CurrentItemEffect = ItemEffectType.None;

                    if (!user.IsBot && client.GetHabbo().IsTeleporting)
                    {
                        client.GetHabbo().IsTeleporting = false;
                        client.GetHabbo().TeleportingRoomId = 0;

                        RoomItem item = _userRoom.GetRoomItemHandler().GetItem(client.GetHabbo().TeleporterId);

                        if (item != null)
                        {
                            item.ExtraData = "2";
                            item.UpdateState(false, true);
                            user.SetPos(item.X, item.Y, item.Z);
                            user.SetRot(item.Rot, false);
                            item.InteractingUser2 = client.GetHabbo().Id;
                            item.ExtraData = "0";
                            item.UpdateState(false, true);
                        }
                    }
                    if (!user.IsBot && client.GetHabbo().IsHopping)
                    {
                        client.GetHabbo().IsHopping = false;
                        client.GetHabbo().HopperId = 0;

                        RoomItem item2 = _userRoom.GetRoomItemHandler().GetItem(client.GetHabbo().HopperId);

                        if (item2 != null)
                        {
                            item2.ExtraData = "1";
                            item2.UpdateState(false, true);
                            user.SetPos(item2.X, item2.Y, item2.Z);
                            user.SetRot(item2.Rot, false);
                            user.AllowOverride = false;
                            item2.InteractingUser2 = client.GetHabbo().Id;
                            item2.ExtraData = "2";
                            item2.UpdateState(false, true);
                        }
                    }
                    if (!user.IsSpectator)
                    {
                        ServerMessage serverMessage =
                            new ServerMessage(LibraryParser.OutgoingRequest("SetRoomUserMessageComposer"));
                        serverMessage.AppendInteger(1);
                        user.Serialize(serverMessage, _userRoom.GetGameMap().GotPublicPool);
                        _userRoom.SendMessage(serverMessage);
                    }
                    if (!user.IsBot)
                    {
                        ServerMessage serverMessage2 = new ServerMessage();
                        serverMessage2.Init(LibraryParser.OutgoingRequest("UpdateUserDataMessageComposer"));
                        serverMessage2.AppendInteger(user.VirtualId);
                        serverMessage2.AppendString(client.GetHabbo().Look);
                        serverMessage2.AppendString(client.GetHabbo().Gender.ToLower());
                        serverMessage2.AppendString(client.GetHabbo().Motto);
                        serverMessage2.AppendInteger(client.GetHabbo().AchievementPoints);
                        _userRoom.SendMessage(serverMessage2);
                    }
                    if (_userRoom.RoomData.Owner != client.GetHabbo().UserName)
                    {
                        Yupi.GetGame()
                            .GetAchievementManager()
                            .ProgressUserAchievement(client, "ACH_RoomEntry", 1);
                    }
                }
                if (client.GetHabbo().GetMessenger() != null)
                    client.GetHabbo().GetMessenger().OnStatusChanged(true);
                client.GetMessageHandler().OnRoomUserAdd();

                //if (client.GetHabbo().HasFuse("fuse_mod")) client.GetHabbo().GetAvatarEffectsInventoryComponent().ActivateCustomEffect(102);
                //if (client.GetHabbo().Rank == Convert.ToUInt32(Yupi.GetDbConfig().DbData["ambassador.minrank"])) client.GetHabbo().GetAvatarEffectsInventoryComponent().ActivateCustomEffect(178);

                if (OnUserEnter != null)
                    OnUserEnter(user, null);
                if (_userRoom.GotMusicController() && _userRoom.GotMusicController())
//.........这里部分代码省略.........
开发者ID:bblackv,项目名称:Yupi,代码行数:101,代码来源:RoomUserManager.cs

示例3: UserGoToTile

        internal void UserGoToTile(RoomUser roomUsers, bool invalidStep)
        {
            // If The Tile that the user want to Walk is Invalid!
            if (invalidStep || (roomUsers.PathStep >= roomUsers.Path.Count) ||
                ((roomUsers.GoalX == roomUsers.X) && (roomUsers.GoalY == roomUsers.Y)))
            {
                // Erase all Movement Data..
                roomUsers.IsWalking = false;
                roomUsers.ClearMovement();
                roomUsers.HandelingBallStatus = 0;
                RoomUserBreedInteraction(roomUsers);

                // Check if he is in a Horse, and if if Erase Horse and User Movement Data
                if (roomUsers.RidingHorse && !roomUsers.IsPet)
                {
                    RoomUser horseStopWalkRidingPet = GetRoomUserByVirtualId(Convert.ToInt32(roomUsers.HorseId));

                    if (horseStopWalkRidingPet != null)
                    {
                        ServerMessage horseStopWalkRidingPetMessage =
                            new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserStatusMessageComposer"));
                        horseStopWalkRidingPetMessage.AppendInteger(1);
                        horseStopWalkRidingPet.SerializeStatus(horseStopWalkRidingPetMessage, "");
                        _userRoom.SendMessage(horseStopWalkRidingPetMessage);

                        horseStopWalkRidingPet.IsWalking = false;
                        horseStopWalkRidingPet.ClearMovement();
                    }
                }

                // Finally Update User Status
                UpdateUserStatus(roomUsers, false);
                return;
            }

            // Ins't a Invalid Step.. Continuing.
            // Region Set Variables
            int pathDataCount = roomUsers.Path.Count - roomUsers.PathStep - 1;
            Vector2D nextStep = roomUsers.Path[pathDataCount];

            // Increase Step Data...
            roomUsers.PathStep++;

            // Check Against if is a Valid Step...
            if (_userRoom.GetGameMap()
                .IsValidStep3(roomUsers, new Vector2D(roomUsers.X, roomUsers.Y), new Vector2D(nextStep.X, nextStep.Y),
                    (roomUsers.GoalX == nextStep.X) && (roomUsers.GoalY == nextStep.Y), roomUsers.AllowOverride,
                    roomUsers.GetClient()))
            {
                // If is a PET Must Give the Time Tick In Syncrony with User..
                if (roomUsers.RidingHorse && !roomUsers.IsPet)
                {
                    RoomUser horsePetAi = GetRoomUserByVirtualId(Convert.ToInt32(roomUsers.HorseId));

                    if (horsePetAi != null)
                        horsePetAi.BotAi.OnTimerTick();
                }

                // Horse Ridding need be Updated First
                if (roomUsers.RidingHorse)
                {
                    // Set User Position Data
                    UserSetPositionData(roomUsers, nextStep);
                    CheckUserSittableLayable(roomUsers);

                    // Add Status of Walking
                    roomUsers.AddStatus("mv",
                        +roomUsers.SetX + "," + roomUsers.SetY + "," + ServerUserChatTextHandler.GetString(roomUsers.SetZ));
                }

                // Check if User is Ridding in Horse, if if Let's Update Ride Data.
                if (roomUsers.RidingHorse && !roomUsers.IsPet)
                {
                    RoomUser horseRidingPet = GetRoomUserByVirtualId(Convert.ToInt32(roomUsers.HorseId));

                    if (horseRidingPet != null)
                    {
                        string theUser = "mv " + roomUsers.SetX + "," + roomUsers.SetY + "," +
                                      ServerUserChatTextHandler.GetString(roomUsers.SetZ);
                        string thePet = "mv " + roomUsers.SetX + "," + roomUsers.SetY + "," +
                                     ServerUserChatTextHandler.GetString(horseRidingPet.SetZ);

                        ServerMessage horseRidingPetMessage =
                            new ServerMessage(LibraryParser.OutgoingRequest("UpdateUserStatusMessageComposer"));
                        horseRidingPetMessage.AppendInteger(2);
                        roomUsers.SerializeStatus(horseRidingPetMessage, theUser);
                        horseRidingPet.SerializeStatus(horseRidingPetMessage, thePet);
                        _userRoom.SendMessage(horseRidingPetMessage);

                        horseRidingPet.RotBody = roomUsers.RotBody;
                        horseRidingPet.RotHead = roomUsers.RotBody;
                        horseRidingPet.SetX = roomUsers.SetX;
                        horseRidingPet.SetY = roomUsers.SetY;
                        horseRidingPet.SetZ = roomUsers.SetZ - 1;
                        horseRidingPet.SetStep = true;

                        UpdateUserEffect(horseRidingPet, horseRidingPet.SetX, horseRidingPet.SetY);
                        UpdateUserStatus(horseRidingPet, false);
                    }
                }
//.........这里部分代码省略.........
开发者ID:bblackv,项目名称:Yupi,代码行数:101,代码来源:RoomUserManager.cs

示例4: UpdateUserEffect

        private void UpdateUserEffect(RoomUser User, int x, int y)
        {
            if (User.IsBot)
                return;
            byte NewCurrentUserItemEffect = room.GetGameMap().EffectMap[x, y];
            if (NewCurrentUserItemEffect > 0)
            {
                ItemEffectType Type = ByteToItemEffectEnum.Parse(NewCurrentUserItemEffect);
                if (Type != User.CurrentItemEffect)
                {
                    switch (Type)
                    {
                        case ItemEffectType.Iceskates:
                            {
                                if (User.GetClient().GetHabbo().Gender == "M")
                                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(38);
                                else
                                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(39);
                                User.CurrentItemEffect = ItemEffectType.Iceskates;
                                break;
                            }

                        case ItemEffectType.Normalskates:
                            {
                                if (User.GetClient().GetHabbo().Gender == "M")
                                {
                                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(55);
                                }
                                else
                                {
                                    User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(56);
                                }
                                //56=girls
                                //55=
                                User.CurrentItemEffect = Type;
                                break;
                            }
                        case ItemEffectType.Swim:
                            {
                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(29);
                                User.CurrentItemEffect = Type;
                                break;
                            }
                        case ItemEffectType.SwimLow:
                            {
                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(30);
                                User.CurrentItemEffect = Type;
                                break;
                            }
                        case ItemEffectType.SwimHalloween:
                            {
                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(37);
                                User.CurrentItemEffect = Type;
                                break;
                            }
                        case ItemEffectType.None:
                            {
                                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyCustomEffect(-1);
                                User.CurrentItemEffect = Type;
                                break;
                            }
                        case ItemEffectType.PublicPool:
                            {
                                User.AddStatus("swim", string.Empty);
                                User.CurrentItemEffect = Type;
                                break;
                            }

                    }
                }
            }
            else if (User.CurrentItemEffect != ItemEffectType.None && NewCurrentUserItemEffect == 0)
            {
                User.GetClient().GetHabbo().GetAvatarEffectsInventoryComponent().ApplyEffect(-1);
                User.CurrentItemEffect = ItemEffectType.None;
                User.RemoveStatus("swim");
            }
        }
开发者ID:habb0,项目名称:PiciEmulator,代码行数:78,代码来源:RoomUserManager.cs

示例5: method_46

        public void method_46(GameClient Session, bool bool_13)
        {

            RoomUser @class = new RoomUser(Session.GetHabbo().Id, this.Id, this.int_7++, Session.GetHabbo().IsVisible);
            if (@class != null && @class.GetClient() != null && @class.GetClient().GetHabbo() != null)
            {
                if (bool_13 || [email protected]_12)
                {
                    @class.bool_11 = true;
                }
                else
                {
                    @class.method_7(this.RoomModel.DoorX, this.RoomModel.DoorY, this.RoomModel.double_0);
                    @class.method_9(this.RoomModel.int_2);
                    if (this.CheckRights(Session, true))
                    {
                        @class.AddStatus("flatctrl", "useradmin");
                    }
                    else
                    {
                        if (this.method_26(Session))
                        {
                            @class.AddStatus("flatctrl", "");
                        }
                    }
                    if ([email protected] && @class.GetClient().GetHabbo().bool_7)
                    {
                        RoomItem class2 = this.method_28(@class.GetClient().GetHabbo().uint_5);
                        if (class2 != null)
                        {
                            @class.method_7(class2.GetX, class2.Int32_1, class2.Double_0);
                            @class.method_9(class2.int_3);
                            class2.uint_4 = Session.GetHabbo().Id;
                            class2.ExtraData = "2";
                            class2.UpdateState(false, true);
                        }
                    }
                    @class.GetClient().GetHabbo().bool_7 = false;
                    @class.GetClient().GetHabbo().uint_5 = 0u;
                    ServerMessage Message = new ServerMessage(Outgoing.SetRoomUser); // P
                    Message.AppendInt32(1);
                    @class.method_14(Message);
                    this.SendMessage(Message, null);
                }
                int num = this.method_5();
                @class.int_20 = num;
                this.RoomUsers[num] = @class;
                if (!bool_13)
                {
                    this.bool_10 = true;
                }

                Session.GetHabbo().CurrentRoomId = this.Id;
                Session.GetHabbo().GetMessenger().method_5(true);
                Session.GetHabbo().RoomVisits++;
                Session.GetHabbo().CheckRoomEntryAchievements();
                Session.GetHabbo().SendToRoom(this.Id);

                //  Session.SendMessage(Session.GetHabbo().CurrentRoom.RoomModel.RelativeHeightmap(Session.GetHabbo().CurrentRoom));

                if (Session.GetHabbo().FavouriteGroup > 0)
                {
                    GroupsManager class3 = Groups.GetGroupById(Session.GetHabbo().FavouriteGroup);
                    if (class3 != null && !this.list_17.Contains(class3))
                    {
                        this.list_17.Add(class3);
                        ServerMessage Message2 = new ServerMessage(Outgoing.Guilds); // Updated
                        Message2.AppendInt32(this.list_17.Count);
                        foreach (GroupsManager current in this.list_17)
                        {
                            Message2.AppendInt32(current.Id);
                            Message2.AppendStringWithBreak(current.Badge);
                        }
                        this.SendMessage(Message2, null);
                    }
                }
                if (!bool_13)
                {
                    this.method_51();
                    for (int i = 0; i < this.RoomUsers.Length; i++)
                    {
                        RoomUser class4 = this.RoomUsers[i];
                        if (class4 != null && class4.IsBot)
                        {
                            class4.BotAI.OnUserEnterRoom(@class);
                        }
                    }
                }

                ServerMessage RoomCompetition = new ServerMessage(Outgoing.RoomCompetition);
                RoomCompetition.AppendBoolean(true);
                RoomCompetition.AppendInt32(85);
                Session.SendMessage(RoomCompetition);

                bool RoomHasPoll = false;
                bool UserFilledPoll = false;
                using (DatabaseClient dbClient = Essential.GetDatabase().GetClient())
                {
                    if (dbClient.ReadDataRow("SELECT null FROM room_polls WHERE room_id = '" + Session.GetHabbo().CurrentRoomId + "' LIMIT 1") != null)
                    {
//.........这里部分代码省略.........
开发者ID:RootkitR,项目名称:Essential-5.1,代码行数:101,代码来源:Room.cs

示例6: HandleSetMovement

        private void HandleSetMovement(SquarePoint Point, RoomUser User, ref bool updated, bool setSquareMap)
        {
            int nextX = Point.X;
            int nextY = Point.Y;

            User.RemoveStatus("mv");

            //double nextZ = room.GetGameMap().SqAbsoluteHeight(nextX, nextY);
            double nextZ = room.GetGameMap().GetNewZForUser(nextX, nextY, User.Z);

            //if (room.GetGameMap().SquareOccupied(nextX, nextY, nextZ))
            //    return;

            if (User.UserIsRidingAHorse())
                nextZ += 1;

            User.Statusses.Remove("lay");
            User.Statusses.Remove("sit");
            if (!User.isFlying)
                User.AddStatus("mv", nextX + "," + nextY + "," + TextHandling.GetString(nextZ));
            else
                User.AddStatus("mv", nextX + "," + nextY + "," + TextHandling.GetString(nextZ + 4 + (0.5 * Math.Sin(0.7 * User.flyk))));

            int newRot = Rotation.Calculate(User.X, User.Y, nextX, nextY, User.moonwalkEnabled);

            User.RotBody = newRot;
            User.RotHead = newRot;

            User.SetStep = true;
            User.SetX = nextX;
            User.SetY = nextY;
            User.SetZ = nextZ;

            UpdateUserEffect(User, User.SetX, User.SetY);
            updated = true;
            User.UpdateNeeded = true;


            if (setSquareMap)
            {
                room.GetGameMap().GameMap[User.X, User.Y] = User.SqState; // REstore the old one
                User.SqState = room.GetGameMap().GameMap[User.SetX, User.SetY];//Backup the new one
                
                if (!room.AllowWalkthrough)
                    room.GetGameMap().GameMap[nextX, nextY] = 0;
            }
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:47,代码来源:RoomUserManager.cs


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