I'm looking to change the default port on a bot from 5190 to 80. I would assume one does this via preferences.
I've tried everything I can think of to get the preferences to work in .NET. The example c# aimcc client contains a custom code page called "PrefsHook.cs" that contains 3 classes - 2 public (PrefsHook and SimpleDictionary) and one private (SimpleDitionaryEnumerator). I've tried using that page, but the example as is has issues.
Just compiling it gives you an error that the "items" collection, which contains the name/value pairs of the preferences and their values is never initialized and will always be null. This tells me that the code was written, but never actually tested (the primary code, AcshBuddy.cs that uses it only sets a session's PrefsHook property to an instance of PrefsHook, but never actually uses it.
I've tried code such as the following (after making the items[] collection public):
PrefsHook prefs = new PrefsHook();
Systems.Collections.DictionaryEntry item1 = new System.Collections.DictionaryEntry("aimcc.connect.host.port", "80"); // also tried this with integer 80
PrefsHook.prefsDict.items = new System.Collections.DictionaryEntry[1] {item1};
s.PrefsHook = prefs;
In addition I've tried to .Clear() the items and then subsequently to .Add("aimcc.connect.host.port", "80")
Also, i've tried .Reset("aimcc.connect.host.port") and then prefs.SetValue("aimcc.connect.host.port", "80")
All have been with no luck. I cannot find any examples in C# on how to use the preferences. I saw the java example, but cannot find a suitable way to translate that to C# (since the available members are different...or it could be that the version used in the java example is different than the version of the library I'm using). The error I was getting originally was 0x80040221 which is "ACC_E_WRITE_FAILED". When i tracked it down it was because the items[] collection was not being initialized (as stated above).
I know I'm not the greatest programmer in the world, so it seems that I'm missing something fairly obvious that should make this far easier.
Thanks in advance.
D

RE: What version of .net?
OK, https is a red herring--let's try something else. There's a bug in AIMCC 1.6 that login can fail if the local machine's system clock is way off. Is your clock way off?