Quote:
Originally Posted by walmartboi
Forward ports 9958, 9960, and 5816 on your router as UDP and TCP. Then everyone can connect to your server using your external IP address.
|
Appreciate the help, wasn't that, but I figured out what it was. Next project would be warehouse spots, I figure going through the character table and add each warehouse spot individually, unless theres an easier way. On a side note for those of you who cant figure out port forwarding and don't mind the risk, DMZ is a good way to enable all connections. Not sure if all routers have this feature, but Linksys do. But they're shitty routers anyway, again thanks for the help I'll keep updated on the warehouse solution.
Edit:
Found something that needs to be worked on sooner, any time someone exits char creation screen the server crashes. I'll see what I do but if leavemealone gets to it first use his.
Second Edit..:
Decided to work on something else first, I noticed that the level of the chars did not save, same as the money, I fixed the money at least in inventory with
Code:
public static void UpdateCharMoney(COClient Client)
{
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `Money` = "" + Client.Char.Money + "" WHERE `CharID` = "" + Client.Char.CharID + """, DatabaseConnection);
try
{
Command.ExecuteNonQuery();
}
catch
{
}
}
This worked perfectly, also I tried the same thing, but I might be dealing with a wrong class or something, because no matter what I tried, it wouldn't save the level, so I'm looking forward to some correction to this code:
Code:
public static void UpdateCharLevel(COClient Client)
{
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` Set `Level` = "" + Client.Char.Level + "" WHERE `CharID` = "" + Client.Char.CharID + """, DatabaseConnection);
try
{
Command.ExecuteNonQuery();
}
catch
{
}
}
Also, I was going over stat points remaining, I came up with this so far, but they wont save right and theres not a value for the chars mana attributes:
Code:
public static void UpdateStatPoints(COClient Client)
{
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `StatPoints` = "" + Convert.ToInt16(Client.Char.Level * 3 - (Client.Char.Str + Client.Char.Vit + Client.Char.Dex) ) + "" WHERE `CharID` = "" + Client.Char.CharID + """, DatabaseConnection);
try
{
Command.ExecuteNonQuery();
}
catch
{
}
}
Yet another edit:
Sorry for all the edits, though no one else is posting this late and I'd annoy myself if i double posted. Found the mana point count was labeled Client.Char.Spi. So that brings us to:
Code:
public static void UpdateStatPoints(COClient Client)
{
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `StatPoints` = "" + Convert.ToInt16(Client.Char.Level * 3 - (Client.Char.Str + Client.Char.Vit + Client.Char.Dex + Client.Char.Spi) ) + "" WHERE `CharID` = "" + Client.Char.CharID + """, DatabaseConnection);
try
{
Command.ExecuteNonQuery();
}
catch
{
}
}
Perhaps future(leavemealone) or korvacs could pm me and we could get together and add more database updating? I'm fairly new to C# in fact this is my first night with it, so if you can think of what I'm doing wrong with the updating off the top of your head let me know. You all need to post moar! I feel alone