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


C# ClientMessage.PopWiredBoolean方法代码示例

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


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

示例1: 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:habb0,项目名称:Snowlight,代码行数:17,代码来源:Global.cs

示例2: PerformRoomAction

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

            RoomInstance Instance = RoomManager.GetInstanceByRoomId(Message.PopWiredUInt32());

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

            bool SetLock = Message.PopWiredBoolean();
            bool SetName = Message.PopWiredBoolean();
            bool KickAll = Message.PopWiredBoolean();

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

            if (!SetName)
            {
                foreach (string Tag in Instance.Info.Tags)
                {
                    Tags.Add(Tag);
                }
            }

            Instance.Info.EditRoom(SetName ? "Inappropriate to hotel management" : Instance.Info.Name, SetName ?
                "Inappropriate to hotel management" : Instance.Info.Description, SetLock ? RoomAccessType.Locked :
                Instance.Info.AccessType, SetLock ? string.Empty : Instance.Info.Password, Instance.Info.MaxUsers,
                SetName ? 0 : Instance.Info.CategoryId, Tags, Instance.Info.AllowPets, Instance.Info.AllowPets,
                Instance.Info.DisableRoomBlocking, Instance.Info.HideWalls, Instance.Info.WallThickness,
                Instance.Info.FloorThickness);

            if (KickAll)
            {
                Instance.KickRoom(true);
            }

            if (KickAll || SetName || SetLock)
            {
                using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
                {
                    StringBuilder Details = new StringBuilder();

                    Details.Append("Room '" + Instance.Info.Name + "' (ID " + Instance.Info.Id + "): ");
                    int i = 0;

                    if (SetName)
                    {
                        Details.Append("Name set to 'Inappropriate to hotel management'");
                        i++;
                    }

                    if (KickAll)
                    {
                        if (i > 0)
                        {
                            Details.Append(", ");
                        }

                        Details.Append("Kicked all users from room");
                        i++;
                    }

                    if (SetLock)
                    {
                        if (i > 0)
                        {
                            Details.Append(", ");
                        }

                        Details.Append("Locked room");
                        i++;
                    }

                    ModerationLogs.LogModerationAction(MySqlClient, Session, "Performed room moderation action",
                        Details.ToString());
                }
            }
        }
开发者ID:fuding,项目名称:Snowlight,代码行数:83,代码来源:ModerationHandler.cs

示例3: 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:habb0,项目名称:Snowlight,代码行数:49,代码来源:RoomItemHandler.cs

示例4: OnFriendRequestDecline

        private static void OnFriendRequestDecline(Session Session, ClientMessage Message)
        {
            bool HandleAll = Message.PopWiredBoolean();
            int Amount = Message.PopWiredInt32();

            using (SqlDatabaseClient MySqlClient = SqlDatabaseManager.GetClient())
            {
                if (HandleAll)
                {
                    MySqlClient.SetParameter("userid", Session.CharacterId);
                    MySqlClient.SetParameter("confirmed", 0);
                    MySqlClient.SetParameter("amount", Amount);
                    MySqlClient.ExecuteNonQuery("DELETE FROM messenger_friendships WHERE user_1_id = @userid AND confirmed = @confirmed");
                }
                else
                {
                    // Precaution: limit queries to 50
                    if (Amount > 50)
                    {
                        Amount = 50;
                    }

                    for (int i = 0; i < Amount; i++)
                    {
                        uint RequestId = Message.PopWiredUInt32();
                        DestroyFriendship(MySqlClient, Session.CharacterId, RequestId);
                    }
                }
            }
        }
开发者ID:DaimOwns,项目名称:Snowlight,代码行数:30,代码来源:MessengerHandler.cs

示例5: OpenPublicConnection

        private static void OpenPublicConnection(Session Session, ClientMessage Message)
        {
            bool UnknownData1 = Message.PopWiredBoolean();
            uint RoomId = Message.PopWiredUInt32();
            bool UnknownData2 = Message.PopWiredBoolean();

            PrepareRoom(Session, RoomId, string.Empty);
        }
开发者ID:DaimOwns,项目名称:Snowlight,代码行数:8,代码来源:RoomHandler.cs

示例6: GetRoomInfo

        private static void GetRoomInfo(Session Session, ClientMessage Message)
        {
            RoomInfo Info = RoomInfoLoader.GetRoomInfo(Message.PopWiredUInt32());

            if (Info == null)
            {
                return;
            }

            bool Bool1 = Message.PopWiredBoolean(); // true when entering a room, otherwise always false
            bool Bool2 = Message.PopWiredBoolean(); // true when requesting info before entering (stalking etc), otherwise always false??

            Session.SendData(RoomInfoComposer.Compose(Info, Bool1, Bool2));
        }
开发者ID:DaimOwns,项目名称:Snowlight,代码行数:14,代码来源:RoomHandler.cs


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