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


C# GameClients类代码示例

本文整理汇总了C#中GameClients的典型用法代码示例。如果您正苦于以下问题:C# GameClients类的具体用法?C# GameClients怎么用?C# GameClients使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: OnUserLeaveRoom

 public override void OnUserLeaveRoom(GameClients.GameClient Client)
 {
     if (GetRoom().Owner.ToLower() == Client.GetHabbo().Username.ToLower())
     {
         GetRoom().RemoveBot(GetRoomUser().VirtualId, false);
     }
 }
开发者ID:habb0,项目名称:uberEmu-stabilized,代码行数:7,代码来源:GuideBot.cs

示例2: Execute

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length == 1)
            {
                Session.SendWhisper("Please enter a dance ID. (1-4)");
                return;
            }

            int DanceId = Convert.ToInt32(Params[1]);
            if (DanceId < 0 || DanceId > 4)
            {
                Session.SendWhisper("Please enter a dance ID. (1-4)");
                return;
            }

            List<RoomUser> Users = Room.GetRoomUserManager().GetRoomUsers();
            if (Users.Count > 0)
            {
                foreach (RoomUser U in Users.ToList())
                {
                    if (U == null)
                        continue;

                    if (U.CarryItemID > 0)
                        U.CarryItemID = 0;

                    U.DanceId = DanceId;
                    Room.SendMessage(new DanceComposer(U, DanceId));
                }
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:31,代码来源:MassDanceCommand.cs

示例3: DoTrigger

        protected override void DoTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.WiredFurniTriggerEvent);
            message.AddBoolean(false);
            message.AddInt32(0);
            message.AddInt32(0);
            message.AddInt32(Item.GetBaseItem().SpriteId);
            message.AddUInt32(Item.Id);

            if (Item.wiredHandler != null)
            {
                EntersRoom handler = (EntersRoom)Item.wiredHandler;

                if (!string.IsNullOrEmpty(handler.userName))
                    message.AddString(handler.userName);
                else
                    message.AddString(string.Empty);
            }
            else
            {
                message.AddString(string.Empty);
            }

            message.AddInt32(0);
            message.AddInt32(0);
            message.AddInt32(7);
            message.AddInt32(0);
            message.AddString(string.Empty);

            Session.SendMessage(message);
                        
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:32,代码来源:RoomEnterTriggerWired.cs

示例4: Execute

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length == 1)
            {
                Session.SendWhisper("Please enter the username of the user you wish to summon.");
                return;
            }

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient == null)
            {
                Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
                return;
            }

            if (TargetClient.GetHabbo() == null)
            {
                Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
                return;
            }

            if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
            {
                Session.SendWhisper("Get a life.");
                return;
            }

            TargetClient.SendNotification("You have been summoned to " + Session.GetHabbo().Username + "!");
            if (!TargetClient.GetHabbo().InRoom)
                TargetClient.SendMessage(new RoomForwardComposer(Session.GetHabbo().CurrentRoomId));
            else
                TargetClient.GetHabbo().PrepareRoom(Session.GetHabbo().CurrentRoomId, "");
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:33,代码来源:SummonCommand.cs

示例5: Execute

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            RoomUser ThisUser = Session.GetHabbo().CurrentRoom.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (ThisUser == null)
                return;

            if (Params.Length == 1)
            {
                Session.SendWhisper("Please enter an ID of a dance.");
                return;
            }

            int DanceId;
            if (int.TryParse(Params[1], out DanceId))
            {
                if (DanceId > 4 || DanceId < 0)
                {
                    Session.SendWhisper("The dance ID must be between 0 and 4!");
                    return;
                }

                Session.GetHabbo().CurrentRoom.SendMessage(new DanceComposer(ThisUser, DanceId));
            }
            else
                Session.SendWhisper("Please enter a valid dance ID.");
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:26,代码来源:DanceCommand.cs

示例6: Execute

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length == 1)
            {
                Session.SendWhisper("Please enter the username you wish to flag.");
                return;
            }

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient == null)
            {
                Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
                return;
            }

            if (TargetClient.GetHabbo().GetPermissions().HasRight("mod_tool"))
            {
                Session.SendWhisper("You are not allowed to flag that user.");
                return;
            }
            else
            {
                TargetClient.GetHabbo().LastNameChange = 0;
                TargetClient.GetHabbo().ChangingName = true;
                TargetClient.SendNotification("Please be aware that if your username is deemed as inappropriate, you will be banned without question.\r\rAlso note that Staff will NOT allow you to change your username again should you have an issue with what you have chosen.\r\rClose this window and click yourself to begin choosing a new username!");
                TargetClient.SendMessage(new UserObjectComposer(TargetClient.GetHabbo()));
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:28,代码来源:FlagUserCommand.cs

示例7: DoTrigger

        protected override void DoTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool UserHasRights)
        {
            ServerMessage message = PacketHandelingManager.GetRecycledItem(OutputCode.WiredFurniActionEvent);
            message.AddBoolean(false);
            message.AddInt32(0);
            message.AddInt32(0);
            message.AddInt32(Item.GetBaseItem().SpriteId);
            message.AddUInt32(Item.Id);

            message.AddString(string.Empty);
            message.AddInt32(2);

            if (Item.wiredHandler != null)
            {
                GiveScore handler = (GiveScore)Item.wiredHandler;
                message.AddInt32(handler.scoreToGive);
                message.AddInt32(handler.maxCountPerGame);
            }
            else
            {
                message.AddInt32(0); //Points 
                message.AddInt32(0); //Rounds
            }

            message.AddInt32(0);
            message.AddInt32(6);
            message.AddInt32(0);
            message.AddInt32(0);
            message.AddString(string.Empty);

            Session.SendMessage(message);
                        
        }
开发者ID:BjkGkh,项目名称:R106,代码行数:33,代码来源:ActionGiveScoreWired.cs

示例8: OnPlace

        public void OnPlace(GameClients.GameClient Session, RoomItem Item)
        {
            Item.GetRoom().GetRoomItemHandler().HopperCount++;
            using (IQueryAdapter dbClient = SilverwaveEnvironment.GetDatabaseManager().getQueryreactor())
            {
                dbClient.setQuery("INSERT INTO items_hopper (hopper_id, room_id) VALUES (@hopperid, @roomid);");
                dbClient.addParameter("hopperid", Item.Id);
                dbClient.addParameter("roomid", Item.RoomId);
                dbClient.runQuery();
            }

            if (Item.InteractingUser != 0)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Item.InteractingUser);

                if (User != null)
                {
                    User.ClearMovement(true);
                    User.AllowOverride = false;
                    User.CanWalk = true;
                }

                Item.InteractingUser = 0;
            }
        }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:25,代码来源:InteractorHopper.cs

示例9: OnTrigger

        public void OnTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights)
        {
            if (Item == null || Item.GetRoom() == null || Session == null || Session.GetHabbo() == null)
                return;
            RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

            if (User == null)
            {
                return;
            }

            // Alright. But is this user in the right position?
            if (User.Coordinate == Item.Coordinate || User.Coordinate == Item.SquareInFront)
            {
                // Fine. But is this tele even free?
                if (Item.InteractingUser != 0)
                {
                    return;
                }

                User.TeleDelay = 2;
                Item.InteractingUser = User.GetClient().GetHabbo().Id;

            }
            else if (User.CanWalk)
            {
                User.MoveTo(Item.SquareInFront);
            }
        }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:29,代码来源:InteractorHopper.cs

示例10: Execute

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length == 1)
            {
                Session.SendWhisper("Please enter the username of the user you wish to alert.");
                return;
            }

            GameClient TargetClient = PlusEnvironment.GetGame().GetClientManager().GetClientByUsername(Params[1]);
            if (TargetClient == null)
            {
                Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
                return;
            }

            if (TargetClient.GetHabbo() == null)
            {
                Session.SendWhisper("An error occoured whilst finding that user, maybe they're not online.");
                return;
            }

            if (TargetClient.GetHabbo().Username == Session.GetHabbo().Username)
            {
                Session.SendWhisper("Get a life.");
                return;
            }

            string Message = CommandManager.MergeParams(Params, 2);

            TargetClient.SendNotification(Session.GetHabbo().Username + " alerted you with the following message:\n\n" + Message);
            Session.SendWhisper("Alert successfully sent to " + TargetClient.GetHabbo().Username);
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:32,代码来源:AlertCommand.cs

示例11: Execute

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            int TotalValue = 0;

            try
            {
                DataTable Table = null;
                using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                {
                    dbClient.SetQuery("SELECT `id` FROM `items` WHERE `user_id` = '" + Session.GetHabbo().Id + "' AND (`room_id`=  '0' OR `room_id` = '')");
                    Table = dbClient.getTable();
                }

                if (Table == null)
                {
                    Session.SendWhisper("You currently have no items in your inventory!");
                    return;
                }

                foreach (DataRow Row in Table.Rows)
                {
                    Item Item = Session.GetHabbo().GetInventoryComponent().GetItem(Convert.ToInt32(Row[0]));
                    if (Item == null)
                        continue;

                    if (!Item.GetBaseItem().ItemName.StartsWith("CF_") && !Item.GetBaseItem().ItemName.StartsWith("CFC_"))
                        continue;

                    if (Item.RoomId > 0)
                        continue;

                    string[] Split = Item.GetBaseItem().ItemName.Split('_');
                    int Value = int.Parse(Split[1]);

                    using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
                    {
                        dbClient.RunQuery("DELETE FROM `items` WHERE `id` = '" + Item.Id + "' LIMIT 1");
                    }

                    Session.GetHabbo().GetInventoryComponent().RemoveItem(Item.Id);

                    TotalValue += Value;

                    if (Value > 0)
                    {
                        Session.GetHabbo().Credits += Value;
                        Session.SendMessage(new CreditBalanceComposer(Session.GetHabbo().Credits));
                    }
                }

                if (TotalValue > 0)
                    Session.SendNotification("All credits have successfully been converted!\r\r(Total value: " + TotalValue + " credits!");
                else
                    Session.SendNotification("It appears you don't have any exchangeable items!");
            }
            catch
            {
                Session.SendNotification("Oops, an error occoured whilst converting your credits!");
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:60,代码来源:ConvertCreditsCommand.cs

示例12: OnTrigger

        public void OnTrigger(GameClients.GameClient Session, RoomItem Item, int Request, bool HasRights)
        {
            if (Item.ExtraData != "1" && Item.GetBaseItem().VendingIds.Count >= 1 && Item.InteractingUser == 0 && Session != null)
            {
                RoomUser User = Item.GetRoom().GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);

                if (User == null)
                {
                    return;
                }

                if (!Gamemap.TilesTouching(User.X, User.Y, Item.GetX, Item.GetY))
                {
                    User.MoveTo(Item.SquareInFront);
                    return;
                }

                Item.InteractingUser = Session.GetHabbo().Id;

                User.CanWalk = false;
                User.ClearMovement(true);
                User.SetRot(Rotation.Calculate(User.X, User.Y, Item.GetX, Item.GetY), false);

                Item.ReqUpdate(2, true);

                Item.ExtraData = "1";
                Item.UpdateState(false, true);
            }
        }
开发者ID:BjkGkh,项目名称:Custom-R2,代码行数:29,代码来源:InteractorVendor.cs

示例13: Execute

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            RoomUser User = Room.GetRoomUserManager().GetRoomUserByHabbo(Session.GetHabbo().Id);
            if (User == null || User.GetClient() == null)
                return;

            string[] headParts;
            string[] figureParts = Session.GetHabbo().Look.Split('.');
            foreach (string Part in figureParts)
            {
                if (Part.StartsWith("hd"))
                {
                    headParts = Part.Split('-');
                    if (!headParts[1].Equals("99999"))
                        headParts[1] = "99999";
                    else
                        return;

                    Session.GetHabbo().Look = Session.GetHabbo().Look.Replace(Part, "hd-" + headParts[1] + "-" + headParts[2]);
                    break;
                }
            }
            Session.GetHabbo().Look = PlusEnvironment.GetGame().GetAntiMutant().RunLook(Session.GetHabbo().Look);
            using (IQueryAdapter dbClient = PlusEnvironment.GetDatabaseManager().GetQueryReactor())
            {
                dbClient.RunQuery("UPDATE `users` SET `look` = '" + Session.GetHabbo().Look + "' WHERE `id` = '" + Session.GetHabbo().Id + "' LIMIT 1");
            }

            Session.SendMessage(new UserChangeComposer(User, true));
            Session.GetHabbo().CurrentRoom.SendMessage(new UserChangeComposer(User, false));
            return;
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:32,代码来源:FacelessCommand.cs

示例14: OnTrigger

 public override void OnTrigger(GameClients.GameClient Session, RoomItem RoomItem_0, int int_0, bool bool_0)
 {
     if(RoomItem_0.GetRoom().CheckRights(Session,true))
     {
         string imageUrl = "";
         int offsetX = 0;
         int offsetY = 0;
         int offsetZ = 0;
         int count = 0;
         string[] splitted = RoomItem_0.ExtraData.Split(Convert.ToChar(9));
         foreach(string s in RoomItem_0.ExtraData.Split(Convert.ToChar(9)))
         {
             try {
                 if (s == "imageUrl")
                     imageUrl = splitted[count +1];
                 if (s == "offsetX")
                     offsetX = int.Parse(splitted[count + 1]);
                 if (s == "offsetY")
                     offsetY = int.Parse(splitted[count + 1]);
                 if (s == "offsetZ")
                     offsetZ = int.Parse(splitted[count + 1]);
                 }catch{}
             count++;
         }
         string tosend = "17|" + RoomItem_0.uint_0 + "|" + imageUrl.Replace("https://","http://") + "|" + offsetX + "|" + offsetY + "|" + offsetZ;
         Essential.getWebSocketManager().getWebSocketByName(Session.GetHabbo().Username).Send(tosend);
     }
 }
开发者ID:RootkitR,项目名称:Essential-5.1,代码行数:28,代码来源:InteractorBackground.cs

示例15: Execute

        public void Execute(GameClients.GameClient Session, Rooms.Room Room, string[] Params)
        {
            if (Params.Length == 1)
            {
                Session.SendWhisper("Please provide a reason for muting the room to show to the users.");
                return;
            }

            if (!Room.RoomMuted)
                Room.RoomMuted = true;

            string Msg = CommandManager.MergeParams(Params, 1);

            List<RoomUser> RoomUsers = Room.GetRoomUserManager().GetRoomUsers();
            if (RoomUsers.Count > 0)
            {
                foreach (RoomUser User in RoomUsers)
                {
                    if (User == null || User.GetClient() == null || User.GetClient().GetHabbo() == null || User.GetClient().GetHabbo().Username == Session.GetHabbo().Username)
                        continue;

                    User.GetClient().SendWhisper("This room has been muted because: " + Msg);
                }
            }
        }
开发者ID:BjkGkh,项目名称:Boon,代码行数:25,代码来源:RoomMuteCommand.cs


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