-
[Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
@Update 2: http://www.mediafire.com/?of54d1n94g4557c
Started on Packetfinder, coded some packets and made an incomingheaders and outgoingheaders class + some minor edits.
__
Hello RaGEZONE!
I've had a little bit of free time the past months and made 300 bases for emulators in C#. I want to start a emulator once in my life and finish it, so I decided to relax and really look over every code 50x. I'm now working on the best sockets I could ever make before I'm going to start on something else. I want you to say what you think of these sockets (and maybe use them?). I want to do this same thing with my database handler too when I've finished it, but I don't have much time and no experience in MySQL in C#.
DL: Starlight.rar
Please comment on what you think about the sockets and tell me if you find any bugs?
(I know it's not much but I want to make everything 100% perfect before I start the next step)
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Thanks for the release Azaidi, good work.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
How Lasse said, good work. I like how you do your things. Step for step is better as one step with much bugs.
Thanks, JustTime.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
I'll not create a new thread this time, Starlight Emulator 0.2: Starlight 0.2.rar
What do you think about this base? I'm going to continue with R63A because I don't want to go into the R63B bullshit with shuffling headers etc.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Why keep releasing? No one has used it.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Hi,
I'd recommend you to put all handlers (Handler.SetIncomingHeader) to it's own classes (makes it easier to look through). And I'd recommend doing the same thing for packets (A new class per packet), it gives a more "smooth" overview. Rather than that, I think it's great :)
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
Quackster
Why keep releasing? No one has used it.
Still useful for those who are searching for this sort of thing and they come across this.
OT: Looking sweet
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
Quackster
Why keep releasing? No one has used it.
Because I'd like some good feedback on my coding and this might be useful for some people?
-
[Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
Quackster
Why keep releasing? No one has used it.
Pretty awful for someone to say. Like your emu was finished. Sure Sulake forbid you but work under a Latino alias or something. They won't know the difference.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
FullmetalPride
Pretty awful for someone to say. Like your emu was finished. Sure Sulake forbid you but work under a Latino alias or something. They won't know the difference.
If Sulake finds out (and sure, they will) he will have even more troubles.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
Quackster
Why keep releasing? No one has used it.
You forget.. Not everyone has decided to go R63B.. It has alot of bugs unless you can fix them. So this 'could' help users.
~ Mikey
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
Mister. M
You forget.. Not everyone has decided to go R63B.. It has alot of bugs unless you can fix them. So this 'could' help users.
~ Mikey
Or you could just use a complete/near complete server instead. :laugh:
http://cdn.memegenerator.net/instanc...x/38401253.jpg
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
Quackster
People has lifes too, even people here @ RZ!! :o
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
Aquel
Hi,
I'd recommend you to put all handlers (Handler.SetIncomingHeader) to it's own classes (makes it easier to look through). And I'd recommend doing the same thing for packets (A new class per packet), it gives a more "smooth" overview. Rather than that, I think it's great :)
Thanks, I've done this now and cleaned up some code. This is the kind of feedback I want.
I will put all Incoming Headers in separate static functions in one class so people can easily find any incoming packet without having to go through 100+ files.
I will also put the outgoing packet structures in a separate static class without any work going on, just changing parameters -> servermessage so the code will look a lot cleaner and it will be very easy to change it to R63B if I'm going to do that.
Quote:
Originally Posted by
Quackster
What's up with discouraging other developers?
I'm not doing this for making my own hotel, I'm doing it for the coding experience, what you should do it for anyway. If you want to run a succesful hotel use Phoenix Cracked, because this will never beat it. But I'm still going to work on this untill it becomes usefull and code CMS'es on this.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Good work, looking forward to see some more from you. :)
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
azaidi
What's up with discouraging other developers?
I'm not doing this for making my own hotel, I'm doing it for the coding experience, what you should do it for anyway. If you want to run a succesful hotel use Phoenix Cracked, because this will never beat it. But I'm still going to work on this untill it becomes usefull and code CMS'es on this.
Because Sulake told him to aha :P
OnTopic: Anyway nice, looked through this good stuff keep it up :P
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
FullmetalPride
Pretty awful for someone to say. Like your emu was finished. Sure Sulake forbid you but work under a Latino alias or something. They won't know the difference.
Oh god, you just ruined his opportunity to do that.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
Quackster
Or you could just use a complete/near complete server instead. :laugh:
Haha haha like what near complete server? :laugh:
Butterfly is just crap to use as a base though it is stable its still crap.
Quote:
Originally Posted by
Aquel
Oh god, you just ruined his opportunity to do that.
Quacky wont do that since he listens to people that tell him what to do / not to do.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
tdid
Haha haha like what near complete server? :laugh:
Butterfly is just crap to use as a base though it is stable its still crap.
Quacky wont do that since he listens to people that tell him what to do / not to do.
Butterfly aint crap..
Far from that, original uberEmu is crap! (the leaked released one.. sorry.)
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Update: Starlight 0.3.rar
Can someone find out why the pathfinding is so bugged? (It works but you walk like an autistic dog) Also please give me some feedback about the coding, I can't do anything with the usual "not useful" or "nice".
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
tdid
Haha haha like what near complete server? :laugh:
Butterfly is just crap to use as a base though it is stable its still crap.
Quacky wont do that since he listens to people that tell him what to do / not to do.
I wasn't talking about Butterfly. I was talking about Holograph, Thor. They're pretty decent.
Quote:
Originally Posted by
azaidi
What's up with discouraging other developers?
I'm not doing this for making my own hotel, I'm doing it for the coding experience.
If you're doing it for your own coding experience, I don't see why it has to be released. It doesn't have sufficient features to run a hotel so therefore it's useless.
Quote:
Originally Posted by
azaidi
Update:
Starlight 0.3.rar
Can someone find out why the pathfinding is so bugged? (It works but you walk like an autistic dog) Also please give me some feedback about the coding, I can't do anything with the usual "not useful" or "nice".
There are reasons for your multiple issues with your pathfinder. Firstly let me point them out to you;
- You create a new thread each time the user walks (very unstable). It should be per room instead.
- This method call
Should be 500 milliseconds instead, this processes the thread with less speed so it's like normal walking. If you want to see how a pathfinder is properly implemented, look at Room.java from the Sierra leak. The syntax is almost the same so you should be able to understand it.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
Quackster
I wasn't talking about Butterfly. I was talking about Holograph, Thor. They're pretty decent.
If you're doing it for your own coding experience, I don't see why it has to be released. It doesn't have sufficient features to run a hotel so therefore it's useless.
There are reasons for your multiple issues with your pathfinder. Firstly let me point them out to you;
- You create a new thread each time the user walks (very unstable). It should be per room instead.
- This method call
Should be 500 milliseconds instead, this processes the thread with less speed so it's like normal walking. If you want to see how a pathfinder is properly implemented, look at Room.java from the Sierra leak. The syntax is almost the same so you should be able to understand it.
Sorry to not update the thread every 2 seconds, I already fixed pathfinding yesterday. I know about the roomhandling, I'm gonna recode it after this works better and I cleaned up some code so recoding is easier. Also, I released it here because I want feedback from some coders. If you'd like to come on Skype to give me a lot of feedback about my coding I'll close this thread if you want. I just want to improve my coding by listening to other people's advice.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Add some try { } catch or it will hang.
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Ok, kids, let me explain how this stuff works. First of all, adding a try-catch block around ANY code would NEVER make it hang less.
Having one thread per room is shooting yourself in your foot. It would cause X = amount of loaded rooms to be added to your CPU to be cycled. It scales incredibly poorly and literary eats up system resources.
The way to go is pooling, as I did in Butterfly. It would probably be a better idea to use a timer or something like that, but the way I did it in bfly was good enough. The difference between this and the other approach is that the OS handles how many threads should be running, not the amount of rooms that is loaded. That way it is more scalable and the calls are asynchronous.
Edit:
Also, here is a way better socket which I used in bfly: https://github.com/martinmine/Connectivity It basically talks directly to the Winsock API so you don't need all the overhead caused by the generalized socket class in .NET
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
maritnmine
Ok, kids, let me explain how this stuff works. First of all, adding a try-catch block around ANY code would NEVER make it hang less.
Having one thread per room is shooting yourself in your foot. It would cause X = amount of loaded rooms to be added to your CPU to be cycled. It scales incredibly poorly and literary eats up system resources.
The way to go is pooling, as I did in Butterfly. It would probably be a better idea to use a timer or something like that, but the way I did it in bfly was good enough. The difference between this and the other approach is that the OS handles how many threads should be running, not the amount of rooms that is loaded. That way it is more scalable and the calls are asynchronous.
Edit:
Also, here is a way better socket which I used in bfly:
https://github.com/martinmine/Connectivity It basically talks directly to the Winsock API so you don't need all the overhead caused by the generalized socket class in .NET
Are 500ms timers for the pathfinders, and then one thread cycling through all rooms better?
-
Re: [Starlight] SocketAsyncEventArgs Sockets 0.1 - BETA
Quote:
Originally Posted by
azaidi
Are 500ms timers for the pathfinders, and then one thread cycling through all rooms better?
500ms is standard. Having one thread which calls the cycle function on ALL the rooms is just as bad as having one thread per room. If one thread lags, all the other rooms would lag as well. Therefore, thread-pooling.