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


C# ClientMessage.PopWiredInt32方法代码示例

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


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

示例1: AlertRoom

        private static void AlertRoom(Session Session, ClientMessage Message)
        {
            if (!Session.HasRight("moderation_tool"))
            {
                return;
            }

            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);

            if (Instance == null)
            {
                Session.SendData(NotificationMessageComposer.Compose("Could not send room alert."));
                return;
            }

            int Unknown1 = Message.PopWiredInt32();
            int AlertMode = Message.PopWiredInt32();
            string AlertMessage = Message.PopString();
            bool IsCaution = AlertMode != 3;

            Instance.SendModerationAlert(AlertMessage, IsCaution);

            using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
            {
                ModerationLogs.LogModerationAction(MySqlClient, Session, "Sent room " + (IsCaution ? "caution" : "message"),
                    "Room " + Instance.Info.Name + " (ID " + Instance.RoomId + "): '" + AlertMessage + "'");
            }
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:28,代码来源:ModerationHandler.cs

示例2: BanUser

        private static void BanUser(Session Session, ClientMessage Message)
        {
            if (!Session.HasRight("moderation_tool"))
            {
                return;
            }

            uint UserId = Message.PopWiredUInt32();
            string MessageText = Message.PopString();
            double Length = (Message.PopWiredInt32() * 3600);

            Session TargetSession = SessionManager.GetSessionByCharacterId(UserId);

            if (TargetSession == null || TargetSession.HasRight("moderation_tool"))
            {
                Session.SendData(NotificationMessageComposer.Compose("This user is not online or you do not have permission to ban them.\nPlease use housekeeping to ban users that are offline."));
                return;
            }

            SessionManager.StopSession(TargetSession.Id);

            using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
            {
                ModerationBanManager.BanUser(MySqlClient, UserId, MessageText, Session.CharacterId, Length);
                ModerationLogs.LogModerationAction(MySqlClient, Session, "Banned user",
                    "User '" + TargetSession.CharacterInfo.Username + "' (ID " + TargetSession.CharacterId + ") for " +
                    Length + " hours: '" + MessageText + "'");
            }
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:29,代码来源:ModerationHandler.cs

示例3: SubmitAnswer

        private static void SubmitAnswer(Session Session, ClientMessage Message)
        {
            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);

            if (Instance == null)
            {
                return;
            }

            RoomActor Actor = Instance.GetActorByReferenceId(Session.CharacterId);

            if (Actor == null)
            {
                return;
            }

            int AnswerId = Message.PopWiredInt32();

            lock (mInfobusQuestions)
            {
                if (mInfobusQuestions.ContainsKey(Instance.RoomId))
                {
                    mInfobusQuestions[Instance.RoomId].SubmitAnswer(Actor.Id, AnswerId);
                }
            }
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:26,代码来源:InfobusManager.cs

示例4: ApplyEffect

        private static void ApplyEffect(Session Session, ClientMessage Message)
        {
            int EffectSpriteId = Message.PopWiredInt32();

            if (EffectSpriteId < 0)
            {
                EffectSpriteId = 0;
            }

            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);

            if (Instance == null)
            {
                return;
            }

            RoomActor Actor = Instance.GetActorByReferenceId(Session.CharacterId);

            if (Actor == null || (EffectSpriteId != 0 && !Session.AvatarEffectCache.HasEffect(EffectSpriteId, true)))
            {
                return;
            }

            Actor.ApplyEffect(EffectSpriteId);
            Session.CurrentEffect = EffectSpriteId;
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:26,代码来源:Inventory.cs

示例5: OnSessionLatencyTest

        private static void OnSessionLatencyTest(Session Session, ClientMessage Message)
        {
            // Sesion timer sends a number to the server and expects it right back.
            // Maybe something to do with latency testing... or a keepalive?
            // Seems like a waste of bandwith since we're using pinging

            Session.SendData(LatencyTestResponseComposer.Compose(Message.PopWiredInt32()));
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:8,代码来源:Global.cs

示例6: ActivateEffect

        private static void ActivateEffect(Session Session, ClientMessage Message)
        {
            AvatarEffect Effect = Session.AvatarEffectCache.GetEffect(Message.PopWiredInt32(), false, true);

            // If we do not have an effect that needs activating OR if we already have an effect
            // of this sort which IS activated, stop.
            if (Effect == null || Session.AvatarEffectCache.HasEffect(Effect.SpriteId, true))
            {
                return;
            }

            Effect.Activate();
            Session.SendData(UserEffectActivatedComposer.Compose(Effect));
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:14,代码来源:Inventory.cs

示例7: OnClientConfig

        private static void OnClientConfig(Session Session, ClientMessage Message)
        {
            int Volume = Message.PopWiredInt32();
            bool Something = Message.PopWiredBoolean();

            if (Volume < 0)
            {
                Volume = 0;
            }

            if (Volume > 100)
            {
                Volume = 100;
            }

            Session.CharacterInfo.ConfigVolume = Volume;
        }
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:17,代码来源:Global.cs

示例8: EditRoom

        private static void EditRoom(Session Session, ClientMessage Message)
        {
            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);

            if (Instance == null || !Instance.CheckUserRights(Session, true))
            {
                return;
            }

            // [email protected]'s [email protected] is where I handle business. [email protected]@[email protected]@IbuttsechsAAAA

            uint Id = Message.PopWiredUInt32();

            if (Id != Instance.RoomId)
            {
                return;
            }

            string Name = UserInputFilter.FilterString(Message.PopString()).Trim();
            string Description = UserInputFilter.FilterString(Message.PopString()).Trim();
            RoomAccessType AccessType = (RoomAccessType)Message.PopWiredInt32();
            string Password = UserInputFilter.FilterString(Message.PopString()).Trim();
            int UserLimit = Message.PopWiredInt32();
            int CategoryId = Message.PopWiredInt32();
            int TagCount = Message.PopWiredInt32();

            List<string> Tags = new List<string>();

            for (int i = 0; (i < TagCount && i < 2); i++)
            {
                string Tag = UserInputFilter.FilterString(Message.PopString()).Trim().ToLower();

                if (Tag.Length > 32)
                {
                    Tag = Tag.Substring(0, 32);
                }

                if (Tag.Length > 0 && !Tags.Contains(Tag))
                {
                    Tags.Add(Tag);
                }
            }

            bool AllowPets = (Message.ReadBytes(1)[0] == 65);
            bool AllowPetEating = (Message.ReadBytes(1)[0] == 65);
            bool AllowBlocking = (Message.ReadBytes(1)[0] == 65);
            bool HideWalls = (Message.ReadBytes(1)[0] == 65);
            int WallThickness = Message.PopWiredInt32();
            int FloorThickness = Message.PopWiredInt32();

            if (WallThickness < -2 || WallThickness > 1)
            {
                WallThickness = 0;
            }

            if (FloorThickness < -2 || FloorThickness > 1)
            {
                FloorThickness = 0;
            }

            if (HideWalls && !Session.HasRight("club_vip"))
            {
                HideWalls = false;
            }

            if (Name.Length > 60) // was 25
            {
                Name = Name.Substring(0, 60);
            }

            if (Description.Length > 128)
            {
                Description = Description.Substring(0, 128);
            }

            if (Password.Length > 64)
            {
                Password = Password.Substring(0, 64);
            }

            if (UserLimit > Instance.Model.MaxUsers)
            {
                UserLimit = Instance.Model.MaxUsers;
            }

            if (Name.Length == 0)
            {
                Name = "Room";
            }

            if (AccessType == RoomAccessType.PasswordProtected && Password.Length == 0)
            {
                AccessType = RoomAccessType.Open;
            }

            Instance.Info.EditRoom(Name, Description, AccessType, Password, UserLimit, CategoryId, Tags, AllowPets,
                AllowPetEating, AllowBlocking, HideWalls, WallThickness, FloorThickness);

            Session.SendData(RoomUpdatedNotification1Composer.Compose(Instance.RoomId));
            Instance.BroadcastMessage(RoomUpdatedNotification2Composer.Compose(Instance.RoomId));
//.........这里部分代码省略.........
开发者ID:DaimOwns,项目名称:ProRP,代码行数:101,代码来源:RoomHandler.cs

示例9: MoveFloorItem

        private static void MoveFloorItem(Session Session, ClientMessage Message)
        {
            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);

            if (Instance == null || !Instance.CheckUserRights(Session))
            {
                return;
            }

            Item Item = Instance.GetItem(Message.PopWiredUInt32());

            if (Item == null || Item.Definition.Type != ItemType.FloorItem)
            {
                return;
            }

            Vector2 NewPosition = new Vector2(Message.PopWiredInt32(), Message.PopWiredInt32());
            int NewRotation = Message.PopWiredInt32();

            bool IsRotationOnly = (Item.RoomId == Instance.RoomId && Item.RoomPosition.X == NewPosition.X &&
                    Item.RoomPosition.Y == NewPosition.Y && NewRotation != Item.RoomRotation);

            Vector3 FinalizedPosition = Instance.SetFloorItem(Session, Item, NewPosition, NewRotation);

            if (FinalizedPosition != null)
            {
                Item.MoveToRoom(null, Instance.RoomId, FinalizedPosition, NewRotation, string.Empty);
                RoomManager.MarkWriteback(Item, false);

                Instance.RegenerateRelativeHeightmap();
                Instance.BroadcastMessage(RoomItemUpdatedComposer.Compose(Item));

                ItemEventDispatcher.InvokeItemEventHandler(Session, Item, Instance, ItemEventType.Moved,
                    IsRotationOnly ? 1 : 0);

                QuestManager.ProgressUserQuest(Session, IsRotationOnly ? QuestType.FURNI_ROTATE : QuestType.FURNI_MOVE);

                if (FinalizedPosition.Z > Instance.Model.Heightmap.FloorHeight[FinalizedPosition.X, FinalizedPosition.Y])
                {
                    QuestManager.ProgressUserQuest(Session, QuestType.FURNI_STACK);
                }
            }
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:43,代码来源:RoomItemHandler.cs

示例10: HandleSave

        public void HandleSave(Session Session, ClientMessage Message)
        {
            uint ItemId = Message.PopWiredUInt32();

            if (!mInstance.CheckUserRights(Session) || !mWired.ContainsKey(ItemId))
            {
                return;
            }

            Item item = mInstance.GetItem(ItemId);

            if (item == null)
            {
                return;
            }

            WiredData data = mWired[ItemId];

            String Data1 = "";
            int Data2 = 0;
            int Data3 = 0;
            int Data4 = 0;
            int Time = 0;
            String Data5 = "";

            Message.PopWiredInt32();
            Data2 = Message.PopWiredInt32();

            Boolean Simple = true;

            if (item.Definition.Behavior == ItemBehavior.WiredEffect)
            {
                switch (WiredTypesUtil.EffectFromInt(item.Definition.BehaviorData))
                {
                    case WiredEffectTypes.match_to_sshot:
                    case WiredEffectTypes.move_rotate:
                    case WiredEffectTypes.teleport_to:
                    case WiredEffectTypes.toggle_state:
                        Simple = false;
                        break;
                }
            }

            if (item.Definition.Behavior == ItemBehavior.WiredTrigger)
            {
                switch (WiredTypesUtil.TriggerFromInt(item.Definition.BehaviorData))
                {
                    case WiredTriggerTypes.state_changed:
                    case WiredTriggerTypes.walks_off_furni:
                    case WiredTriggerTypes.walks_on_furni:
                        Simple = false;
                        break;
                    case WiredTriggerTypes.periodically:
                        item.RequestUpdate(Data2);
                        break;
                }
            }

            if (!Simple)
            {
                Data3 = Message.PopWiredInt32();

                if (item.Definition.Behavior == ItemBehavior.WiredEffect && WiredTypesUtil.EffectFromInt(item.Definition.BehaviorData) == WiredEffectTypes.match_to_sshot)
                {
                    Data4 = Message.PopWiredInt32();
                }

                Message.PopString();
                int c = Message.PopWiredInt32();
                for (int i = 0; i < c; i++)
                {
                    uint tmp = Message.PopWiredUInt32();
                    if (mInstance.GetItem(tmp) == null)
                    {
                        continue;
                    }
                    if (tmp != 0)
                    {
                        Data1 += "" + tmp.ToString() + "|";
                    }
                }

                Time = Message.PopWiredInt32();
            }
            else
            {
                Data1 = Message.PopString();
                Data3 = Message.PopWiredInt32();
            }

            if (item.Definition.Behavior == ItemBehavior.WiredEffect)
            {
                switch (WiredTypesUtil.EffectFromInt(item.Definition.BehaviorData))
                {
                    case WiredEffectTypes.match_to_sshot:
                        String[] Selected = Data1.Split('|');

                        foreach (String ItemIdS in Selected)
                        {
                            uint SelectedItemId;
//.........这里部分代码省略.........
开发者ID:DaimOwns,项目名称:ProRP,代码行数:101,代码来源:WiredManager.cs

示例11: CreateOrEditEvent

        private static void CreateOrEditEvent(Session Session, ClientMessage Message)
        {
            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);

            if (Instance == null || !Instance.CheckUserRights(Session, true) || Instance.Info.AccessType != RoomAccessType.Open)
            {
                return;
            }

            int CategoryId = Message.PopWiredInt32();
            string Name = UserInputFilter.FilterString(Message.PopString()).Trim();
            string Description = UserInputFilter.FilterString(Message.PopString()).Trim();
            int TagCount = Message.PopWiredInt32();
            List<string> Tags = new List<string>();

            for (int i = 0; (i < TagCount && i < 2); i++)
            {
                string Tag = UserInputFilter.FilterString(Message.PopString()).Trim().ToLower();

                if (Tag.Length > 25)
                {
                    Tag = Tag.Substring(0, 25);
                }

                if (Tag.Length > 0 && !Tags.Contains(Tag))
                {
                    Tags.Add(Tag);
                }
            }

            if (!Instance.HasOngoingEvent)
            {
                Session.MessengerFriendCache.BroadcastToFriends(MessengerFriendEventComposer.Compose(Session.CharacterId,
                    MessengerFriendEventType.EventStarted, Name));
            }

            Instance.StartOrUpdateEvent(Name, Description, CategoryId, Tags);
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:38,代码来源:RoomHandler.cs

示例12: SetBadgeOrder

        private static void SetBadgeOrder(Session Session, ClientMessage Message)
        {
            int i = 0;
            Dictionary<int, Badge> NewSettings = new Dictionary<int, Badge>();

            while (Message.RemainingLength > 0)
            {
                if (i > 5)
                {
                    continue;
                }

                int SlotId = Message.PopWiredInt32();
                string BadgeCode = Message.PopString();
                Badge BadgeRef = RightsManager.GetBadgeByCode(BadgeCode);

                if (BadgeRef == null || !Session.BadgeCache.ContainsCode(BadgeCode) || SlotId >= 6 ||
                    SlotId <= 0 || NewSettings.ContainsKey(SlotId))
                {
                    continue;
                }

                NewSettings.Add(SlotId, BadgeRef);

                i++;
            }

            using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
            {
                Session.BadgeCache.UpdateBadgeOrder(MySqlClient, NewSettings);
            }

            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);

            if (Instance == null)
            {
                return;
            }

            Instance.BroadcastMessage(RoomUserBadgesComposer.Compose(Session.CharacterId, Session.BadgeCache.EquippedBadges));
            QuestManager.ProgressUserQuest(Session, QuestType.PROFILE_BADGE);
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:42,代码来源:Inventory.cs

示例13: OnPurchase

        private static void OnPurchase(Session Session, ClientMessage Message)
        {
            int PageId = Message.PopWiredInt32();
            uint ItemId = Message.PopWiredUInt32();
            string Data = Message.PopString();

            CatalogPage Page = CatalogManager.GetCatalogPage(PageId);

            if (Page == null || Page.DummyPage || !Page.Visible || (Page.RequiredRight.Length > 0 &&
                !Session.HasRight(Page.RequiredRight)))
            {
                return;
            }

            using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
            {
                switch (Page.Template)
                {
                    default:

                        CatalogItem Item = Page.GetItem(ItemId);

                        if (Item == null || (Item.ClubRestriction == 1 && !Session.HasRight("club_regular")) ||
                            (Item.ClubRestriction == 2 && !Session.HasRight("club_vip")))
                        {
                            return;
                        }

                        HandlePurchase(MySqlClient, Session, Item, Data);
                        break;

                    case "club_buy":

                        CatalogClubOffer Offer = CatalogManager.GetClubOffer(ItemId);

                        if (Offer == null || (Offer.Price > 0 && Session.CharacterInfo.CreditsBalance < Offer.Price)
                            || (int)Offer.Level < (int)Session.SubscriptionManager.SubscriptionLevel)
                        {
                            return;
                        }

                        string BasicAchievement = "ACH_BasicClub";
                        string VipAchievement = "ACH_VipClub";

                        // Extend membership and take credits
                        Session.CharacterInfo.UpdateCreditsBalance(MySqlClient, -Offer.Price);
                        Session.SubscriptionManager.AddOrExtend((int)Offer.Level, Offer.LengthSeconds);

                        // Check if we need to manually award basic/vip badges
                        bool NeedsBasicUnlock = !Session.BadgeCache.ContainsCodeWith(BasicAchievement);
                        bool NeedsVipUnlock = !Session.BadgeCache.ContainsCodeWith(VipAchievement);

                        // Reload the badge cache (reactivating any disabled subscription badges)
                        Session.BadgeCache.ReloadCache(MySqlClient, Session.AchievementCache);

                        // Calculate progress
                        int Progress = (int)Math.Ceiling((double)(Offer.LengthDays / 31));

                        if (Progress <= 0)
                        {
                            Progress = 1;
                        }

                        // Progress VIP achievement
                        if (Offer.Level >= ClubSubscriptionLevel.VipClub)
                        {
                            NeedsVipUnlock = !AchievementManager.ProgressUserAchievement(MySqlClient,
                                Session, VipAchievement, Progress) && NeedsVipUnlock;
                        }
                        else
                        {
                            NeedsVipUnlock = false;
                        }

                        // Progress basic achievement
                        NeedsBasicUnlock = !AchievementManager.ProgressUserAchievement(MySqlClient,
                            Session, BasicAchievement, Progress) && NeedsBasicUnlock;

                        // Virtually unlock the basic achievement without reward if needed
                        if (NeedsBasicUnlock)
                        {
                            Achievement Achievement = AchievementManager.GetAchievement(BasicAchievement);

                            if (Achievement != null)
                            {
                                UserAchievement UserAchievement = Session.AchievementCache.GetAchievementData(
                                    BasicAchievement);

                                if (UserAchievement != null)
                                {
                                    Session.SendData(AchievementUnlockedComposer.Compose(Achievement, UserAchievement.Level,
                                        0, 0));
                                }
                            }
                        }

                        // Virtually unlock the VIP achievement without reward if needed
                        if (NeedsVipUnlock)
                        {
                            Achievement Achievement = AchievementManager.GetAchievement(VipAchievement);
//.........这里部分代码省略.........
开发者ID:BjkGkh,项目名称:BobbaRP,代码行数:101,代码来源:CatalogPurchaseHandler.cs

示例14: TakeRights

        private static void TakeRights(Session Session, ClientMessage Message)
        {
            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);

            if (Instance == null || !Instance.CheckUserRights(Session, true))
            {
                return;
            }

            int Amount = Message.PopWiredInt32();

            for (int i = 0; (i < Amount && i <= 100); i++)
            {
                uint UserId = Message.PopWiredUInt32();

                if (UserId > 0 && Instance.TakeUserRights(UserId))
                {
                    Session.SendData(RoomRightsRemovedConfirmationComposer.Compose(Instance.RoomId, UserId));
                }
            }
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:21,代码来源:RoomHandler.cs

示例15: UpdateMoodlight

        private static void UpdateMoodlight(Session Session, ClientMessage Message)
        {
            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Session.CurrentRoomId);

            if (Instance == null || !Instance.CheckUserRights(Session, true))
            {
                return;
            }

            Item Item = Instance.MoodlightItem;

            if (Item == null)
            {
                return;
            }

            MoodlightData Data = MoodlightData.GenerateFromFlags(Item.Flags);
            int PresetId = Message.PopWiredInt32();
            MoodlightPreset Preset = null;

            if (Data.Presets.ContainsKey(PresetId))
            {
                Preset = Data.Presets[PresetId];
            }

            if (Preset == null)
            {
                return;
            }

            Preset.BackgroundOnly = !Message.PopWiredBoolean();
            Preset.ColorCode = UserInputFilter.FilterString(Message.PopString().Trim());
            Preset.ColorIntensity = Message.PopWiredInt32();

            if (!MoodlightData.IsValidColor(Preset.ColorCode))
            {
                return;
            }

            Item.Flags = Data.ToItemFlagData();
            Item.DisplayFlags = Data.ToDisplayData();

            using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
            {
                Item.SynchronizeDatabase(MySqlClient, true);
            }

            Item.BroadcastStateUpdate(Instance);
        }
开发者ID:DaimOwns,项目名称:ProRP,代码行数:49,代码来源:RoomItemHandler.cs


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