Discussion on [Release] Extremely basic (but working/bugless) C# Source within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.
This is what I got for saving and loading (i watched how SaveInventory and LoadInventory was done I added SaveProf(Client); under SaveInventory in the SaveCharacter method and i also put LoadProf(Client); under LoadInventory in the LoadCharacter method.
I got this in GameClient:
public Dictionary<ushort, ISkill> m_Profs = new Dictionary<ushort, ISkill>(50);
public ISkill[] Profs;
When i use the command @prof 480 5 it says: [Command Error] Object reference not set to an instance of an object.
when adding a skill/prof you add it in the m_Profs or Profs? adding it in m_Profs wouldnt give any error, but adding it in Profs ( ISkill[] Profs; ) should... anyway I use the dictionary because its more easy to handle it(as for me)...
when adding a skill/prof you add it in the m_Profs or Profs? adding it in m_Profs wouldnt give any error, but adding it in Profs ( ISkill[] Profs; ) should... anyway I use the dictionary because its more easy to handle it(as for me)...
/* Returns false if already contained, true if it is added */
public bool LearnProf(ISkill Prof)
{
if (m_Profs.ContainsKey(Prof.ID))
{
m_Profs[Prof.ID] = Prof;
Prof.Send(this);
CreateProfInstance();
return false;
}
else
{
this.m_Profs.Add(Prof.ID, Prof);
Prof.Send(this);
CreateProfInstance();
return true;
}
}
This is how I let a prof be learned :P
So I add the Profs to m_Profs and the values from m_Profs go
into Profs and it saves with a foreach ISkill Prof in Profs.
I think thats wrong?
Quote:
public static void SaveProf(GameClient Client)
{
IniFile wrtr = new IniFile(DatabasePath + @"\Profs\" + Client.Username + ".ini");
sbyte i = 0;
int numberOfProfs = Client.m_Profs.Count;
for (ushort num=0; num <= numberOfProfs; num++)
{
wrtr.Write("Proficiencys", "Prof[" + i.ToString() + "]", Client.m_Profs[num].ToString());
}
wrtr.Write("Proficiencys", "Count", i.ToString());
}
Uhm it works same as ur save what u posted.
But it doesnt save good like mine did.
It only save:
Quote:
[Proficiencys]
Count=0
It doesnt save the prof's so I think maybe its a Null pointer exception or something?
Means that the m_Profs is empty :P and that means that @prof ID Level
doesnt work that good or LearnProf works not good?
Or must I code something that will display the Prof in the client?
because when i use @prof 480 2 i dont see anything in the prof section in the client
but it has to display a club image with lvl 2 :P
I am! Well not really i am helping out my friend who is developing on the server that we will run together while i teach him C# i continue with my source in vb.net. I am Semi-Pro vb.net user and can make a server in C# but i am not great at it (guess u could said it would turn out worse then loft). I got out C# server along with my VB server working with newest patch yet again. But this time i dint use the Manged OpenSSL. I will post some codes later on for some things if i can get around to it . Right now i cant be bothered to fix some of my mistakes and post it i guess i am lazy right now. But i hope everyone that is still developing a server under this marvelous release will have some curtsy and help keep it alive.
[Huge-Release] All-In-One Basic NPC Scripts For The 5165 Source! 02/19/2010 - CO2 PServer Guides & Releases - 30 Replies Well I'm sorry that I spammed the whole forum full of my posts So pro4never and .Ryu gave me the idea of making this All-In-One thread about all my NPC's! THESE ARE UPDATED DAILY!
NOTE: TO PEOPLE... SOME OF THE CODES ARE NOT MADE BY ME! I USUALLY JUST FIXED/UPDATED THE BASIC ONES! SORRY I'M LEARNING ON HOW TO CODE!
1. Birth-Island-NPC's(The NPC text is not from "REAL CONQUER" SORRY!...)
#region BirthOldGeneralYang
case 425:
{
[RELEASE] Basic LOTF Source 09/03/2009 - CO2 PServer Guides & Releases - 17 Replies hey this is a basic lotf source edited based off shadowco, if you dont like it then dont post here... flames will be told on!!! :D i will tell on you to the mods if you flame
What it has...
- LuckyTime
- Guard
- 24/7 GW