[(Awesome)RELEASE] CoEmuv2.Nano(5095) Source Code

06/11/2009 00:00 mero12#661
Guys what ip i should write it Hamachi ip or Internet Ip?!!!! This 127.0.0.1!!!!????? PLz Guys help me!
06/11/2009 00:22 Zeroxelli#662
127.0.0.1 = Localhost
Meaning only your computer may access it.
06/11/2009 00:29 mero12#663
Thanks but can anyone show it by A vid???!!!
06/11/2009 00:56 WHITELIONX#664
Zeroxelli Thank you I found that my username and password were not corresponding to each other. It is no wonder it wouldn`t load haha login and game server running now
06/11/2009 00:57 Zeroxelli#665
No problem :)

Glad it's working for you.
06/11/2009 04:50 Zehava333#666
I cannot get the coemu.exe and server.dat to accept anything other than 127.0.0.1 if I change it, after I put in my name and pass it just crashes. Any suggestions?

Solved, sorry for the idiot question.
06/11/2009 15:21 auraboreal#667
I need Help!!

[Only registered and activated users can see links. Click Here To Register...]

thanks!
06/11/2009 16:51 damianpesta#668
Quote:
Originally Posted by auraboreal View Post
I need Help!!

[Only registered and activated users can see links. Click Here To Register...]

thanks!
wtf? Is your internal IP really a 10.4.4.1? or u just made it up...? Use 127.0.0.1 its default one.
06/11/2009 19:10 Zeroxelli#669
Holy crap, I haven't seen that IP in years. That's the range for the old Lotus Domino test's..

On-Topic: Use 127.0.0.1 as he says, otherwise you won't even get to the loginserver. For your external IP check [Only registered and activated users can see links. Click Here To Register...]
06/11/2009 19:46 WHITELIONX#670
What is the mysql fetch array for accounts and characters? Currently it is $res and I want my reg page to give details on how many accounts there are and how many characters there are online, I already have it stating when it is on and offline lol.
06/11/2009 20:11 Zeroxelli#671
Eh, not gonna test anything, I'll just write something out

EDIT: Wait, 1 second. STATIC CLASS. Okay, changed some things.

First off, in MySQL do
Code:
ALTER TABLE characters ADD Online TINYINT(1) NOT NULL DEFAULT 0 AFTER Name;
Now, somewhere at the top of Database.cs under
Code:
	public static class Database
	{
add
Code:
        public static List<int> OnlinePlayers = new List<int>();
        public static void AddOnline(int UID)
        {
            if (!OnlinePlayers.Contains(UID))
                OnlinePlayers.Add(UID);
        }
        public static void RemOnline()
        {
            OnlinePlayers.Clear();
        }
        public static void UpdateOnline()
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE characters SET Online=0", DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
            foreach (int UID in OnlinePlayers)
            {
                MySqlCommand sCmd = new MySqlCommand("UPDATE characters SET `Online` = 1 WHERE `CharID` = " + UID, DatabaseConnection.NewConnection());
                sCmd.ExecuteNonQuery();
                sCmd.Connection.Close();
                sCmd.Connection.Dispose();
                sCmd.Dispose();
            }
        }
Now, somewhere add a timer like this
Code:
Timer UpdateOnline = new Timer();
UpdateOnline.Interval = 60000;// One minute
UpdateOnline.Elapsed += delegate
{
    Database.Database.RemOnline();
    foreach (ClientSocket CSock in Nano.ClientPool.Values)
    {
        Database.Database.AddOnline(CSock.Client.ID);
    }
    Database.Database.UpdateOnline();
};
UpdateOnline.Start();
Now for the PHP, something like
PHP Code:
$db = mysql_connect('localhost', 'root', 'password');
if (
mysql_select_db('conqueremu'))
{
    
$query = mysql_query('SELECT Name FROM characters WHERE Online=1');
    echo 
"<b>Online players</b><br />\n";
    while (
$row = mysql_fetch_array($query))
    {
        echo 
"{$row['Name']}<br />\n";
    }
}
else die (
mysql_error()); 
It works, I just tested it.
06/11/2009 20:37 WHITELIONX#672
ALTER TABLE characters ADD Online TINYINT(1) NOT NULL DEFAULT 0 AFTER Name; <<<---in MySQL Command Line Client? If so it says database not selected
06/11/2009 20:39 Zeroxelli#673
Yeah, you gotta do
Code:
USE conqueremu;
First.
06/11/2009 21:17 YukiXian#674
Yay got rage and ToxicFog working :
[Only registered and activated users can see links. Click Here To Register...]
06/11/2009 21:24 WHITELIONX#675
Lol it must have installed it anyways because when I checked through navicat I could see online :D

I might have slightly messed something up I got four errors

public static void InitialItems(int CharID, int Class) <<<----Expected class, delegate, enum, interface, or struct (void being the one highlighted as the problem)

case 10:
{
MySqlCommand Cmd = new MySqlCommand("INSERT INTO items(CharID, Position, ItemID, Plus, Minus, Enchant, Soc1, Soc2, Dura, MaxDura) VALUES(" + CharID + "," + 4 + "," + 410302 + "," + 0 + "," + 0 + "," + 0 + "," + 0 + "," + 0 + "," + 10 + "," + 10 + ")", DatabaseConnection.NewConnection());
Cmd.ExecuteNonQuery();
Cmd.Connection.Close();
Cmd.Dispose();
MySqlCommand Cmd2 = new MySqlCommand("INSERT INTO items(CharID, Position, ItemID, Plus, Minus, Enchant, Soc1, Soc2, Dura, MaxDura) VALUES(" + CharID + "," + 3 + "," + 132003 + "," + 0 + "," + 0 + "," + 0 + "," + 0 + "," + 0 + "," + 10 + "," + 10 + ")", DatabaseConnection.NewConnection());
Cmd2.ExecuteNonQuery();

Same for those, But the last one

}
case 20:
{
The problem being with this message is Type or namespace definition, or end-of-file expected
That little symbol thing that is above case 20 is the problem. And in case 10 it is MySqlCommand that is the problem well they are the ones with the little squiggle thing under them.
It seems to have accepted everything else without errors though so I didn`t screw that part up :P