コード例 #1
0
        public void Handle_NameQuery(PacketIn packet)
        {
            WoWGuid guid = new WoWGuid(packet.ReadUInt64());
            string  name = packet.ReadString();

            packet.ReadByte();
            Race      Race   = (Race)packet.ReadUInt32();
            Gender    Gender = (Gender)packet.ReadUInt32();
            Classname Class  = (Classname)packet.ReadUInt32();


            if (objectMgr.objectExists(guid))        // Update existing Object
            {
                Object obj = objectMgr.getObject(guid);
                obj.Name = name;
                objectMgr.updateObject(obj);
            }
            else                    // Create new Object        -- FIXME: Add to new 'names only' list?
            {
                Object obj = new Object(guid);
                obj.Name = name;
                objectMgr.addObject(obj);

                /* Process chat message if we looked them up now */
                for (int i = 0; i < ChatQueued.Count; i++)
                {
                    ChatQueue message = (ChatQueue)ChatQueued[i];
                    if (message.GUID.GetOldGuid() == guid.GetOldGuid())
                    {
                        Log.WriteLine(LogType.Chat, "[{1}] {0}", message.Message, name);
                        ChatQueued.Remove(message);
                    }
                }
            }
        }
コード例 #2
0
    public static void HandleNameQueryResponse(ref PacketReader packet, ref World manager)
    {
        WoWGuid guid = new WoWGuid(packet.ReadUInt64());
        string  name = packet.ReadString();

        packet.ReadByte();
        Race      Race   = (Race)packet.ReadUInt32();
        Gender    Gender = (Gender)packet.ReadUInt32();
        Classname Class  = (Classname)packet.ReadUInt32();


        if (manager.objectMgr.objectExists(guid))    // Update existing Object
        {
            Assets.Scripts.World.Object obj = manager.objectMgr.getObject(guid);
            obj.Name = name;
            manager.objectMgr.updateObject(obj);
        }
        else                // Create new Object        -- FIXME: Add to new 'names only' list?
        {
            Assets.Scripts.World.Object obj = new Assets.Scripts.World.Object(guid);
            obj.Name = name;
            manager.objectMgr.addObject(obj);

            for (int i = 0; i < ChatHandler.ChatQueued.Count; i++)
            {
                ChatHandler.ChatQueue message = (ChatHandler.ChatQueue)ChatHandler.ChatQueued[i];
                if (message.GUID.GetOldGuid() == guid.GetOldGuid())
                {
                    //MainWorld.ChatHeads.Add("[" + obj.Name + "] " + MainWorld.ChatTag + message.Message + "\n");
                    ChatHandler.ChatQueued.Remove(message);
                }
            }
        }
    }
コード例 #3
0
 private uint CalculateHash(string content)
 {
     return(content.GetStableHashCode() +
            Id.GetStableHashCode() +
            (!ClassnameChanged.HasDelegate ? Classname.GetStableHashCode() : 0) +
            Enum.GetName(typeof(MediaQueries), MediaQuery).GetStableHashCode() +
            Enum.GetName(typeof(PseudoClasses), PseudoClass).GetStableHashCode() +
            GlobalStyle.GetStableHashCode());
 }
コード例 #4
0
        public void bind1()
        {
            String        user_isgrade = Server.UrlDecode(Request.Cookies["Userisgrade"].Value);
            SqlConnection conn         = new SqlConnection(ConfigurationManager.ConnectionStrings["ConString"].ToString());

            conn.Open();
            SqlCommand cmd = new SqlCommand();

            cmd.Connection = conn;
            String str = "select * from Class where Clgrade='" + user_isgrade + "'";

            cmd.CommandText = str;
            SqlDataAdapter sda = new SqlDataAdapter(cmd);
            DataSet        ds  = new DataSet();

            sda.Fill(ds);
            Class.DataSource     = ds.Tables[0].DefaultView;
            Class.DataTextField  = "Clno";
            Class.DataValueField = "Clnum";
            Class.DataBind();
            Classname.DataSource     = ds.Tables[0].DefaultView;
            Classname.DataTextField  = "Clno";
            Classname.DataValueField = "Clnum";
            Classname.DataBind();
            str             = "select DISTINCT Teacher.* from Teacher,Work1 where Teacher.Tnum=Work1.Wtnum and Work1.Wclnum='" + Class.SelectedItem.Value.Trim() + "'";
            cmd.CommandText = str;
            SqlDataAdapter sda1 = new SqlDataAdapter(cmd);
            DataSet        ds1  = new DataSet();

            sda1.Fill(ds1);
            Teacher.Items.Clear();
            Teacher.DataSource     = ds1.Tables[0].DefaultView;
            Teacher.DataTextField  = "Tname";
            Teacher.DataValueField = "Tnum";
            Teacher.DataBind();
            conn.Close();
        }
コード例 #5
0
ファイル: ServerClass.cs プロジェクト: PazerOP/DemoLib
 public override int GetHashCode()
 {
     return(unchecked (Classname.GetHashCode() + DatatableName.GetHashCode()));
 }
コード例 #6
0
        public new DataTable Select()
        {
            MySqlDataAdapter adp = new MySqlDataAdapter(string.Format("prc_{0}_Select", Classname.ToLower()), Tools.Baglanti);

            adp.SelectCommand.CommandType = CommandType.StoredProcedure;
            DataTable dt = new DataTable();

            adp.Fill(dt);
            return(dt);
        }