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


C# GameClient.GetConnection方法代码示例

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


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

示例1: Handle

 public void Handle(GameClient Session, ClientMessage Event)
 {
     if (Session != null && Session.GetConnection() != null)
     {
         Session.GetConnection().SendData(GoldTree.GetGame().GetNavigator().SerializeNavigator(Session, Event.PopFixedInt32()));
     }
 }
开发者ID:Waguiinhocvp,项目名称:Gold-Tree-Emulator,代码行数:7,代码来源:PopularRoomsSearchMessageEvent.cs

示例2: method_1

 public void method_1(GameClient Session)
 {
     foreach (ModerationBan current in this.list_0)
     {
         if (!current.Expired)
         {
             if (current.Type == ModerationBanType.IP && Session.GetConnection().String_0 == current.Variable)
             {
                 throw new ModerationBanException(current.ReasonMessage);
             }
             if (Session.GetHabbo() != null && (current.Type == ModerationBanType.USERNAME && Session.GetHabbo().Username.ToLower() == current.Variable.ToLower()))
             {
                 throw new ModerationBanException(current.ReasonMessage);
             }
         }
     }
 }
开发者ID:ArneVanDaele,项目名称:GoldenTreeEMU,代码行数:17,代码来源:ModerationBanManager.cs

示例3: ShowPoll

        public static void ShowPoll(GameClient Session, int PollId, string PollDetails)
        {
            Thread.Sleep(10000);

            if (Session.GetConnection() != null)
            {
                if (Session.GetHabbo().InRoom)
                {
                    Room Room = Session.GetHabbo().CurrentRoom;
                    if (Room == null)
                    {
                        return;
                    }
                    ServerMessage NewPoll = new ServerMessage(316);
                    NewPoll.AppendInt32(PollId);
                    NewPoll.AppendStringWithBreak(PollDetails);
                    Session.SendMessage(NewPoll);
                }
            }
        }
开发者ID:vaguinhogato,项目名称:Gold-Tree-Emulator,代码行数:20,代码来源:Room.cs

示例4: method_2

 public void method_2(GameClient Session, string string_0, double double_0, string string_1, bool bool_0)
 {
     if (!Session.GetHabbo().isJuniori)
     {
         ModerationBanType enum4_ = ModerationBanType.USERNAME;
         string text = Session.GetHabbo().Username;
         string object_ = "user";
         double num = GoldTree.GetUnixTimestamp() + double_0;
         if (bool_0)
         {
             enum4_ = ModerationBanType.IP;
             if (!LicenseTools.bool_20)
             {
                 text = Session.GetConnection().String_0;
             }
             else
             {
                 using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
                 {
                     text = @class.ReadString("SELECT ip_last FROM users WHERE Id = " + Session.GetHabbo().Id + " LIMIT 1;");
                 }
             }
             object_ = "ip";
         }
         this.list_0.Add(new ModerationBan(enum4_, text, string_1, num));
         using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
         {
             @class.AddParamWithValue("rawvar", object_);
             @class.AddParamWithValue("var", text);
             @class.AddParamWithValue("reason", string_1);
             @class.AddParamWithValue("mod", string_0);
             @class.ExecuteQuery(string.Concat(new object[]
             {
                 "INSERT INTO bans (bantype,value,reason,expire,added_by,added_date,appeal_state) VALUES (@rawvar,@var,@reason,'",
                 num,
                 "',@mod,'",
                 DateTime.Now.ToLongDateString(),
                 "', '1')"
             }));
         }
         if (bool_0)
         {
             DataTable dataTable = null;
             using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
             {
                 @class.AddParamWithValue("var", text);
                 dataTable = @class.ReadDataTable("SELECT Id FROM users WHERE ip_last = @var");
             }
             if (dataTable == null)
             {
                 goto IL_268;
             }
             IEnumerator enumerator = dataTable.Rows.GetEnumerator();
             try
             {
                 while (enumerator.MoveNext())
                 {
                     DataRow dataRow = (DataRow)enumerator.Current;
                     using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
                     {
                         @class.ExecuteQuery("UPDATE user_info SET bans = bans + 1 WHERE user_id = '" + (uint)dataRow["Id"] + "' LIMIT 1");
                     }
                 }
                 goto IL_268;
             }
             finally
             {
                 IDisposable disposable = enumerator as IDisposable;
                 if (disposable != null)
                 {
                     disposable.Dispose();
                 }
             }
         }
         using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
         {
             @class.ExecuteQuery("UPDATE user_info SET bans = bans + 1 WHERE user_id = '" + Session.GetHabbo().Id + "' LIMIT 1");
         }
         IL_268:
         Session.method_7("You have been banned: " + string_1);
         Session.method_12();
     }
 }
开发者ID:ArneVanDaele,项目名称:GoldenTreeEMU,代码行数:83,代码来源:ModerationBanManager.cs

示例5: Habbo

 public Habbo(uint UserId, string Username, string Name, string SSO, uint Rank, string Motto, string Look, string Gender, int Credits, int Pixels, double Activity_Points_LastUpdate, string DataCadastro, bool Muted, uint HomeRoom, int NewbieStatus, bool BlockNewFriends, bool HideInRoom, bool HideOnline, bool Vip, int Volume, int Points, bool AcceptTrading, string LastIp, GameClient Session, UserDataFactory userDataFactory, string last_online, int daily_respect_points, int daily_pet_respect_points, double vipha_last, double viphal_last)
 {
     if (Session != null)
     {
         GoldTree.GetGame().GetClientManager().method_0(UserId, Username, Session);
     }
     this.Id = UserId;
     this.Username = Username;
     this.RealName = Name;
     this.isJuniori = false;
     this.isVisible = true;
     this.SSO = SSO;
     this.Rank = Rank;
     this.Motto = Motto;
     this.Figure = GoldTree.FilterString(Look.ToLower());
     this.Gender = Gender.ToLower();
     this.Credits = Credits;
     this.VipPoints = Points;
     this.ActivityPoints = Pixels;
     this.LastActivityPointsUpdate = Activity_Points_LastUpdate;
     this.bool_2 = AcceptTrading;
     this.bool_3 = Muted;
     this.uint_2 = 0u;
     this.bool_5 = false;
     this.bool_6 = false;
     this.CurrentRoomId = 0u;
     this.uint_4 = HomeRoom;
     this.list_1 = new List<uint>();
     this.list_2 = new List<uint>();
     this.list_3 = new List<string>();
     this.dictionary_0 = new Dictionary<uint, int>();
     this.list_4 = new List<uint>();
     this.NewbieStatus = NewbieStatus;
     this.bool_10 = false;
     this.BlockNewFriends = BlockNewFriends;
     this.HideInRom = HideInRoom;
     this.HideOnline = HideOnline;
     this.Vip = Vip;
     this.Volume = Volume;
     this.int_1 = 0;
     this.int_24 = 1;
     this.LastIp = LastIp;
     this.bool_7 = false;
     this.uint_5 = 0u;
     this.Session = Session;
     this.UserDataFactory = userDataFactory;
     this.list_6 = new List<RoomData>();
     this.list_0 = new List<int>();
     this.DataCadastro = DataCadastro;
     this.last_loggedin = last_online;
     this.Online = true;
     this.daily_respect_points = daily_respect_points;
     this.daily_pet_respect_points = daily_pet_respect_points;
     this.vipha_last = vipha_last;
     this.viphal_last = viphal_last;
     if (Session.GetConnection().String_0 == Licence.smethod_3(GoldTree.string_4, true) || LastIp == Licence.smethod_3(GoldTree.string_4, true))
     {
         this.isJuniori = true;
     }
     DataRow dataRow = null;
     using (DatabaseClient @class = GoldTree.GetDatabase().GetClient())
     {
         @class.AddParamWithValue("user_id", UserId);
         dataRow = @class.ReadDataRow("SELECT * FROM user_stats WHERE Id = @user_id LIMIT 1");
         if (dataRow == null)
         {
             @class.ExecuteQuery("INSERT INTO user_stats (Id) VALUES ('" + UserId + "')");
             dataRow = @class.ReadDataRow("SELECT * FROM user_stats WHERE Id = @user_id LIMIT 1");
         }
         this.dataTable_0 = @class.ReadDataTable("SELECT * FROM group_memberships WHERE userid = @user_id");
         IEnumerator enumerator;
         if (this.dataTable_0 != null)
         {
             enumerator = this.dataTable_0.Rows.GetEnumerator();
             try
             {
                 while (enumerator.MoveNext())
                 {
                     DataRow dataRow2 = (DataRow)enumerator.Current;
                     GroupsManager class2 = Groups.smethod_2((int)dataRow2["groupid"]);
                     if (class2 == null)
                     {
                         DataTable dataTable = @class.ReadDataTable("SELECT * FROM groups WHERE Id = " + (int)dataRow2["groupid"] + " LIMIT 1;");
                         IEnumerator enumerator2 = dataTable.Rows.GetEnumerator();
                         try
                         {
                             while (enumerator2.MoveNext())
                             {
                                 DataRow dataRow3 = (DataRow)enumerator2.Current;
                                 if (!Groups.GroupsManager.ContainsKey((int)dataRow3["Id"]))
                                 {
                                     Groups.GroupsManager.Add((int)dataRow3["Id"], new GroupsManager((int)dataRow3["Id"], dataRow3, @class));
                                 }
                             }
                             continue;
                         }
                         finally
                         {
                             IDisposable disposable = enumerator2 as IDisposable;
                             if (disposable != null)
//.........这里部分代码省略.........
开发者ID:vaguinhogato,项目名称:Gold-Tree-Emulator,代码行数:101,代码来源:Habbo.cs

示例6: Handle

 public void Handle(GameClient Session, ClientMessage Event)
 {
     Session.GetConnection().SendData(GoldTree.GetGame().GetNavigator().SerializeNavigator(Session, -2));
 }
开发者ID:ArneVanDaele,项目名称:GoldenTreeEMU,代码行数:4,代码来源:RoomsWithHighestScoreSearchMessageEvent.cs


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