Register for your free account! | Forgot your password?

You last visited: Today at 12:05

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Release]Hashtable

Discussion on [Release]Hashtable within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old 09/20/2008, 23:14   #16
 
plasma-hand's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 442
Received Thanks: 105
omg hashtables are leet

Quote:
Console.WriteLine("Hello World")
Holy **** i did it
plasma-hand is offline  
Old 09/20/2008, 23:18   #17
 
~*NewDuuDe*~'s Avatar
 
elite*gold: 111
Join Date: Feb 2008
Posts: 2,161
Received Thanks: 646
Quote:
Originally Posted by plasma-hand View Post
omg hashtables are leet



Holy **** i did it
Code:
Console.WriteLine("U R PRO!!!");
Console.ReadLine();
~*NewDuuDe*~ is offline  
Old 09/20/2008, 23:46   #18
 
THE BAT's Avatar
 
elite*gold: 0
Join Date: Aug 2006
Posts: 63
Received Thanks: 28
LOL

use Dictionary<,> instead of Hashtable is you are using .NET 2 or above
THE BAT is offline  
Old 09/20/2008, 23:48   #19
 
taguro's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Quote:
Originally Posted by THE BAT View Post
LOL

use Dictionary<,> instead of Hashtable is you are using .NET 2 or above
ummmm, k...
taguro is offline  
Old 09/21/2008, 00:31   #20
 
© Haydz's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
Quote:
Originally Posted by THE BAT View Post
LOL

use Dictionary<,> instead of Hashtable is you are using .NET 2 or above
theres always one broken tool in the toolbox
© Haydz is offline  
Old 10/21/2008, 07:27   #21
 
Tw3ak's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,489
Received Thanks: 301
Or if ya wanted to do hashtables the right way would be something more like this.

Code:
        public Hashtable _allChars = new Hashtable();
        public Hashtable AllChars
        {
            get
            {
                if (this._allChars == null)
                {
                    lock (World.SyncRoot)
                    {
                        if (this._allChars == null)
                        {
                            // Initial capacity of 500 and fastest lookup load factor of 0.1f.
                            // load factor ranges from 0.1f to 1.0f. 0.1f means very fast lookups
                            // but increased memory consumption. It also slows the Add/Remove.
                            // Since world iterates this collection a lot, smallest load factor is necessary.
                            this._allChars = new Hashtable(500, 0.1f);
                        }
                    }
                }
                return this._allChars;
            }
        }
Of course this is how it is done using singleton with standard lock plus double-check with public sealed class rather then those public static ones you all use and get the enumeration errors and null ref errors in the hashtables from world.
Tw3ak is offline  
Old 10/21/2008, 12:11   #22
 
elite*gold: 0
Join Date: Nov 2007
Posts: 306
Received Thanks: 75
Code:
public Hashtable hash = new Hashtable();
public uint b = 0;
while(true) {
hash.Add(b, b*20);
b++;
}
Rechocto is offline  
Old 12/04/2008, 18:50   #23
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
thank you :*
alexbigfoot is offline  
Reply




All times are GMT +1. The time now is 12:05.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.