Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[C#, PHP, R38] Project Aurora

Status
Not open for further replies.
C# / Java Programmer
Joined
Jan 1, 2007
Messages
346
Reaction score
177
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

I think he might be high on something since I also don't really understand what he is trying to say.

Probably, but I think he meant to say excited haha. Pretty sure the two words work interchangeably in Brazilian.
 
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Navigator search works (for now) as good as possible.

The rooms I have:

XIjpfcI - [C#, PHP, R38] Project Aurora - RaGEZONE Forums


When I search on "Josh":

q2WPuU7 - [C#, PHP, R38] Project Aurora - RaGEZONE Forums


When I search on my player name (Raiden):

N2fz67f - [C#, PHP, R38] Project Aurora - RaGEZONE Forums


(don't get fooled, the "Search users" thing doesn't do anything)

Super small snippet:

PHP:
                dbConnection.SetQuery("SELECT * FROM rooms WHERE name LIKE    [USER=111754]search[/USER] OR owner_id IN (SELECT id FROM players WHERE username LIKE    [USER=111754]search[/USER])");
                dbConnection.AddParameter(    [USER=111754]search[/USER]", "%" + search + "%");

                result = dbConnection.GetTable();
 

Attachments

You must be registered for see attachments list
Last edited:
Junior Spellweaver
Joined
Aug 30, 2010
Messages
172
Reaction score
35
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Dear developer,

Aurora Emulator is a projectname of Mikey (@EvilCoder). You should change your name because it already exist.
 
Joined
Jun 23, 2010
Messages
2,318
Reaction score
2,195
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Dear developer,

Aurora Emulator is a projectname of Mikey (@EvilCoder). You should change your name because it already exist.

Dear not developer of (both?) Aurora(s),

The person in question can ask that same question by himself. However, it's not like his emulator is that known by everybody. In fact it's forgotten and out dated.

(I actually had to Google it first to make sure I didn't post anything stupid. As it turns out: I'm glad I did!)
 
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Dear developer,

Aurora Emulator is a projectname of Mikey (@EvilCoder). You should change your name because it already exist.

If it was active, well known or something, I would've known it. Since it's not, I didn't and so I won't change it.

If that owner wants me to rename it, I'd be glad to. But then that person has to ask it for himself.

Love the mention inside your code tag :)

Urgh why is this still a thing? RZ should fix this... why would you want to mention anybody in a CODE/PHP tag lol.
 
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

A small update:

Rooms before room icon save:
SLmgUka - [C#, PHP, R38] Project Aurora - RaGEZONE Forums


What I change the icon into:
dG6XWkG - [C#, PHP, R38] Project Aurora - RaGEZONE Forums


Rooms after room icon save:
N5edzZv - [C#, PHP, R38] Project Aurora - RaGEZONE Forums


(NOTE: IGNORE the UberEmu and Bfly githubs, NO code is taken from it, only reference to packets!)

PHP:
string query = "UPDATE rooms SET ";
            MySqlParameter[] parameters = new MySqlParameter[columns.Length + 1];

            for (int i = 0; i < columns.Length && i < values.Length; i++)
            {
                if (i > 0)
                    query += ", ";

                query += $"{columns[i]} = @{columns[i]}";
                parameters[i] = new MySqlParameter($"@{columns[i]}", values[i]);
            }

            query += " WHERE id = @ roomId";
            parameters[parameters.Length - 1] = new MySqlParameter("@ roomId", Id);
 

Attachments

You must be registered for see attachments list
git bisect -m
Loyal Member
Joined
Sep 2, 2011
Messages
2,171
Reaction score
916
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

A small update:

Rooms before room icon save:
SLmgUka - [C#, PHP, R38] Project Aurora - RaGEZONE Forums


What I change the icon into:
dG6XWkG - [C#, PHP, R38] Project Aurora - RaGEZONE Forums


Rooms after room icon save:
N5edzZv - [C#, PHP, R38] Project Aurora - RaGEZONE Forums


(NOTE: IGNORE the UberEmu and Bfly githubs, NO code is taken from it, only reference to packets!)

PHP:
string query = "UPDATE rooms SET ";
            MySqlParameter[] parameters = new MySqlParameter[columns.Length + 1];

            for (int i = 0; i < columns.Length && i < values.Length; i++)
            {
                if (i > 0)
                    query += ", ";

                query += $"{columns[i]} = @{columns[i]}";
                parameters[i] = new MySqlParameter($"@{columns[i]}", values[i]);
            }

            query += " WHERE id = @ roomId";
            parameters[parameters.Length - 1] = new MySqlParameter("@ roomId", Id);

What the duck is this injectable query...
 

Attachments

You must be registered for see attachments list
Newbie Spellweaver
Joined
Nov 21, 2011
Messages
66
Reaction score
12
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

I think use += for the string query is not the best way.
 
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

I think use += for the string query is not the best way.

Then what? There's no way to generate a query based on parameters of a function (which will only be made in the emulator, without user input, and the user input there is is stored in MySqlParameter) without using +=.
 
Newbie Spellweaver
Joined
Nov 21, 2011
Messages
66
Reaction score
12
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Then what? There's no way to generate a query based on parameters of a function (which will only be made in the emulator, without user input, and the user input there is is stored in MySqlParameter) without using +=.

I said for concat string, i always prefer to use a stringbuilder or something like that
 
Junior Spellweaver
Joined
May 21, 2011
Messages
154
Reaction score
47
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

I said for concat string, i always prefer to use a stringbuilder or something like that

So what does the StringBuilder class do better than a "+=" operator in this scenario?
 
Newbie Spellweaver
Joined
Nov 21, 2011
Messages
66
Reaction score
12
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

So what does the StringBuilder class do better than a "+=" operator in this scenario?

I dont know what is the max lenght of columns will be, but is a question of permormance. I give you a stackoverflow post for read, not for state there and be beautifull...



PD: I know use StringBuilder will not be the best way, but i dont know what is the lenght of the columns you use on the for, but think on it, use the best way can save your butt a lot of times
 
Newbie Spellweaver
Joined
Nov 21, 2011
Messages
66
Reaction score
12
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Not returning a new string when appending.

TRUE!:love:


As martinmine say on his post: http://forum.ragezone.com/f331/write-emulator-991142/

Understand what happens under the hood
If you want to write effective code, you must understand what happens under the hood of the code you are using.

Write maintainable code

Under the hood isn't the same use strings.Join(), StringBuilder or +=, and i have to say StringBuilder
is the easiest code to keep, in my thinking
 
Custom Title Activated
Loyal Member
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Okay, I will use StringBuilder then. As for how much columns, it can be either 1, 2, 3 or like 8. It depends on where you use it.
 
Newbie Spellweaver
Joined
Nov 21, 2011
Messages
66
Reaction score
12
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Okay, I will use StringBuilder then. As for how much columns, it can be either 1, 2, 3 or like 8. It depends on where you use it.

You can try with string.Join(STR, ",") it will be better too :p
 
Status
Not open for further replies.
Back
Top