Esempio n. 1
0
        public void Set_ClanInfoUpdate(ByteBuffer buff)
        {
            if (this.label_clan_level.InvokeRequired)
            {
                Set_ClanInfoUpdate_Callback d = new Set_ClanInfoUpdate_Callback(Set_ClanInfoUpdate);
                label_clan_level.Invoke(d, new object[] { buff });
                return;
            }

            string mem_name  = buff.ReadString(); //Util.Get_String(buff,ref offset);
            uint   mem_level = buff.ReadUInt32(); //System.BitConverter.ToInt32(buff,offset);offset+=4;
            uint   mem_class = buff.ReadUInt32(); //System.BitConverter.ToUInt32(buff,offset);offset+=4;

            buff.ReadUInt32();                    //sex
            buff.ReadUInt32();                    //race
            uint mem_online = buff.ReadUInt32();  //online

            buff.ReadUInt32();                    //pledge type
            buff.ReadUInt32();                    //yellow name for sponsor

            bool found = false;

            foreach (System.Windows.Forms.ListViewItem obj in Globals.l2net_home.listView_char_clan.Items)
            {
                if (System.String.Equals(obj.SubItems[0].Text, mem_name))
                {
                    obj.SubItems[1].Text = mem_level.ToString();
                    obj.SubItems[2].Text = Util.GetClass(mem_class);
                    if (mem_online != 0)
                    {
                        if (obj.SubItems[3].Text == "X")
                        {
                        }
                        else
                        {
                            Globals.ClanOnline++;
                            obj.SubItems[3].Text = "X";
                        }
                    }
                    else
                    {
                        if (obj.SubItems[3].Text == " ")
                        {
                        }
                        else
                        {
                            Globals.ClanOnline--;
                            obj.SubItems[3].Text = " ";
                        }
                    }

                    found = true;
                }
            }

            if (!found)
            {
                System.Windows.Forms.ListViewItem ObjListItem = Globals.l2net_home.listView_char_clan.Items.Add(mem_name);
                ObjListItem.SubItems.Add(mem_level.ToString());
                ObjListItem.SubItems.Add(Util.GetClass(mem_class));
                if (mem_online == 1)
                {
                    Globals.ClanOnline++;
                    ObjListItem.SubItems.Add("X");
                }
                else
                {
                    ObjListItem.SubItems.Add(" ");
                }

                Globals.ClanMembers++;
            }

            label_clan_online.Text = Globals.m_ResourceManager.GetString("col_Online") + ": " + Globals.ClanOnline.ToString() + "/" + Globals.ClanMembers.ToString();
        }
Esempio n. 2
0
        public void Set_ClanInfoUpdate(ByteBuffer buff)
        {
            if (this.label_clan_level.InvokeRequired)
            {
                Set_ClanInfoUpdate_Callback d = new Set_ClanInfoUpdate_Callback(Set_ClanInfoUpdate);
                label_clan_level.Invoke(d, new object[] { buff });
                return;
            }

            string mem_name = buff.ReadString();//Util.Get_String(buff,ref offset);
            uint mem_level = buff.ReadUInt32();//System.BitConverter.ToInt32(buff,offset);offset+=4;
            uint mem_class = buff.ReadUInt32();//System.BitConverter.ToUInt32(buff,offset);offset+=4;
            buff.ReadUInt32();//sex
            buff.ReadUInt32();//race
            uint mem_online = buff.ReadUInt32();//online
            buff.ReadUInt32();//pledge type
            buff.ReadUInt32();//yellow name for sponsor

            bool found = false;
            foreach (System.Windows.Forms.ListViewItem obj in Globals.l2net_home.listView_char_clan.Items)
            {
                if (System.String.Equals(obj.SubItems[0].Text, mem_name))
                {
                    obj.SubItems[1].Text = mem_level.ToString();
                    obj.SubItems[2].Text = Util.GetClass(mem_class);
                    if (mem_online != 0)
                    {
                        if (obj.SubItems[3].Text == "X")
                        {
                        }
                        else
                        {
                            Globals.ClanOnline++;
                            obj.SubItems[3].Text = "X";
                        }
                    }
                    else
                    {
                        if (obj.SubItems[3].Text == " ")
                        {
                        }
                        else
                        {
                            Globals.ClanOnline--;
                            obj.SubItems[3].Text = " ";
                        }
                    }
                    
                    found = true;
                }
            }

            if (!found)
            {
                System.Windows.Forms.ListViewItem ObjListItem = Globals.l2net_home.listView_char_clan.Items.Add(mem_name);
                ObjListItem.SubItems.Add(mem_level.ToString());
                ObjListItem.SubItems.Add(Util.GetClass(mem_class));
                if (mem_online == 1)
                {
                    Globals.ClanOnline++;
                    ObjListItem.SubItems.Add("X");
                }
                else
                {
                    ObjListItem.SubItems.Add(" ");
                }

                Globals.ClanMembers++;
            }

            label_clan_online.Text = Globals.m_ResourceManager.GetString("col_Online") + ": " + Globals.ClanOnline.ToString() + "/" + Globals.ClanMembers.ToString();
        }