Cascade - C# 6.0 - Updated Regularly

Seriosk

Programmer;
Oct 29, 2016
256
105
What is Cascade?
Cascade is a Habbo Notification program that will send you notifications to the console window when new things happen involving your hotel... ye.. I know.. pretty damn simple and in some views pointless, but what the hell.. its something, and hopefully me or some other developer will maybe extend it and make it that little bit useful.

Development GitHub


aa254bcb143a4ad39d5d1e9c0a6effeb.png

Have fun, I have included the source so you guys can edit as you go along, didn't really put much effort in just had a spare hour to kill so thought I would make something simple, enjoy.. don't think I'll be pushing any updates for this after 3.0 unless anyone wants me to, but you can probably add other things such as notifications for other tables and what not

Also I know this isn't the best way to do this but its just an easy way for some people who just don't want to go to the trouble of setting up web sockets or anything like that... just edit config and go.

But Emulator Data is cached?
I know, if you want it to live-update then PM me and I'll give you the code to uncache the data that Cascade uses, other than that, you'll have to wait for a user logout and the emu to update the db... Everything else like bans, registrations, etc works just that the credits, pixels and other things involving the users table wont really be live because of the cached data..

UPDATE 1.1:
  • Improved query quality, faster and more specific i suppose...
UPDATE 2.0:
  • Can not get notified when a user enters the client (change of auth_ticket)
  • Can not get notified when a user logs in (Change of last_online)
  • Can now get notified when a user changes clothes (Change of look column)
  • Can now get notified when a user tries entering and they are banned (change of auth ticket + ban = true check)
  • Can now get notified when a new user is banned (checks for added records to ban table
UPDATE 3.0
  • Improved a lot of the codes quality.
  • Can now get notified when a user is ranked (change of rank).
  • Can now get notified if a users credits change.
  • Can now get notified if a users pixels change.
  • Can now get notified if a users vip_points change.
  • Can not get notified when a user changes their username
  • Your now told if there is a new version of Cascade available for download.
Plans for 4.0 (Let me know if you want a 4.0)
  • Ability to select different color text for each type of log
  • Individual config settings for each type of log (not just cascade.disable_all_cache_checks)
  • Automatic update feature, updates to the latest version
Bugs/Issues Known:
Just that sometimes data can be incorrect but usually 99% of the time its correct, for example if a machine was banned and there are two accounts online with that machine id, it might mistake the first one and the second one was actually banned..

Just want to clarify some things first.. so basically the timer interval basically determines the whole application, just make sure not to set it too low, I recommend 1000, I was able to get away with 200ms without it lagging, but I had like 10 users in my user table, for big hotels with a lot of users registered it may lag, it all depends on how fast your server is at executing MySQL querys, just try it and find a comfortable interval, obviously the lower it is, the faster you get updated.

You'll be told if your interval is too low because it will say "Timer is lagging" so ye, just make sure that isn't printing to the console.
 
Last edited:

Seriosk

Programmer;
Oct 29, 2016
256
105
Good, useful and smart release. Thank you!
Wow, this is super useful! Thanks[emoji106]

Good to know them few hours weren't totally waisted xD
 
Since a lot of you have requested extra features to be added to this such as group functionality, trade notifs and more, I have decided to do a 4.0. Not sure what will be in 4.0 at the moment, but I'll probably post a changelog of what will be added later tonight.
 

KylePr0zZ

Member
Jul 22, 2016
51
14
I have a question, can this be used outside of a server?, what I mean by that is can it be used without the program being on the same server as the databaseConnection that its going to be connecting to!? I have a Idea for version 4.0 and that is to have Multiple Emulator Support so you would make a configurable option to switch Emulators; Plus, Comet, Phoenix and then which ever you pick it will grab all the tables based on what emulator you configure to choose from.
 
Last edited:

Seriosk

Programmer;
Oct 29, 2016
256
105
I have a question, can this be used outside of a server?, what I mean by that is can it be used without the program being on the same server as the databaseConnection that its going to be connecting to!? I have a Idea for version 4.0 and that is to have Multiple Emulator Support so you would make a configurable option to switch Emulators; Plus, Comet, Phoenix and then which ever you pick it will grab all the tables based on what emulator you configure to choose from.

Love your idea for 4.0, its definitely an idea to consider. As for the cross-ip server accessibility question yes, the only issue with connecting over an ip that isn't local is the delay, it will slow things down a bit and you'll probably be pushed in to a corner where you'll have to raise your timer interval.

With 127.0.0.1 you don't have the horrible MySQL latency.. which is a shame because it would be good for hotel owners to use on their desktop with their hotel on a vps, but its not a total buzz kill, you can still use it, just the updates are not that fast.
 

Jaden

not so active
Aug 24, 2014
886
263
Noticed a few things while reviewing the source code
  • Using a MySQL pool is redundant instead of just using a 1 connection for such a small, single-threaded program.
  • Using a MySQL connection in general is redundant, and resource hogging to the server, suggest you take a look at IPC via shared pipes, or LAN connections... or just connect to the MUS server that the emulator established for no reason (barely utilized), then your idea of remote monitoring works simple.
  • You throw an argument exception in DatabaseSettings.cs which goes unhandled by the code that calls the function (you should try a different approach at error reporting).
  • Usage of "global" which is fine i guess since this is a simple, single-threaded application but just pointing that out. Read more:
  • In CascadeProcess.cs the usage of the System.Timers.Timer class is "redundant" (could be substituted for better performance/use of resources) since your program seems to be (should) be single-threaded. You don't need a thread-safe timer. Finally, that timer should never lag.
  • CascadeProcess.cs#L238 Your query should be more specific than that, rather than using "SELECT *"
  • Utility.cs you establish WebClient to check if the website works, just to establish ANOTHER WebClient to grab the source of the web page. Just use 1 WebClient.
  • CascadeUpdater.cs just check for updates when the application starts, a timer is not needed.
Getting bored with reviewing the source but I'll keep updating. Hopefully you take my criticism into consideration no matter how pessimistic (coughs, ***** ********) it may seem as you improve/add to the source code.
 
Last edited by a moderator:

Seriosk

Programmer;
Oct 29, 2016
256
105
Noticed a few things while reviewing the source code
  • Using a MySQL pool is redundant instead of just using a 1 connection for such a small, single-threaded program.
  • Using a MySQL connection in general is redundant, and resource hogging to the server, suggest you take a look at IPC via shared pipes, or LAN connections... or just connect to the MUS server that the emulator established for no reason (barely utilized), then your idea of remote monitoring works simple.
  • You throw an argument exception in DatabaseSettings.cs which goes unhandled by the code that calls the function (you should try a different approach at error reporting).
  • Usage of "global" which is fine i guess since this is a simple, single-threaded application but just pointing that out. Read more:
  • In CascadeProcess.cs the usage of the System.Timers.Timer class is "redundant" (could be substituted for better performance/use of resources) since your program seems to be (should) be single-threaded. You don't need a thread-safe timer. Finally, that timer should never lag.
  • CascadeProcess.cs#L238 Your query should be more specific than that, rather than using "SELECT *"
  • Utility.cs you establish WebClient to check if the website works, just to establish ANOTHER WebClient to grab the source of the web page. Just use 1 WebClient.
  • CascadeUpdater.cs just check for updates when the application starts, a timer is not needed.
Getting bored with reviewing the source but I'll keep updating. Hopefully you take my criticism into consideration no matter how pessimistic (coughs, ****** *******) it may seem as you improve/add to the source code.

I appreciate your comments, I just didn't have the motivation or time to go over the source code removing redundant code or duplicated code, I guess if I had more time all these would of been fixed.

I don't even think anyone would use it, its basically just in case someone wanted to learn how to do something like this, but your right I should of took the time to tidy up the code and not be lazy, and obviously write better code quality (including the MySQL querys).

Also when you say it wouldn't lag, I just added that so noobs didn't go on their 200mb ram VPS's and set the interval to something like 10 when I finally add more to the project, anyhow I don't think I will be adding anything to this project...

Thanks for the review anyhow, I guess its good for developers who want to add to this project or people using it who just want to adapt the source code with your improvements..
 
Last edited by a moderator:

Liraux

New Member
Oct 17, 2016
11
0
What is Cascade?
Cascade is a Habbo Notification program that will send you notifications to the console window when new things happen involving your hotel... ye.. I know.. pretty damn simple and in some views pointless, but what the hell.. its something, and hopefully me or some other developer will maybe extend it and make it that little bit useful.

Development GitHub


aa254bcb143a4ad39d5d1e9c0a6effeb.png

Have fun, I have included the source so you guys can edit as you go along, didn't really put much effort in just had a spare hour to kill so thought I would make something simple, enjoy.. don't think I'll be pushing any updates for this after 3.0 unless anyone wants me to, but you can probably add other things such as notifications for other tables and what not

Also I know this isn't the best way to do this but its just an easy way for some people who just don't want to go to the trouble of setting up web sockets or anything like that... just edit config and go.

But Emulator Data is cached?
I know, if you want it to live-update then PM me and I'll give you the code to uncache the data that Cascade uses, other than that, you'll have to wait for a user logout and the emu to update the db... Everything else like bans, registrations, etc works just that the credits, pixels and other things involving the users table wont really be live because of the cached data..

UPDATE 1.1:
  • Improved query quality, faster and more specific i suppose...
UPDATE 2.0:
  • Can not get notified when a user enters the client (change of auth_ticket)
  • Can not get notified when a user logs in (Change of last_online)
  • Can now get notified when a user changes clothes (Change of look column)
  • Can now get notified when a user tries entering and they are banned (change of auth ticket + ban = true check)
  • Can now get notified when a new user is banned (checks for added records to ban table
UPDATE 3.0
  • Improved a lot of the codes quality.
  • Can now get notified when a user is ranked (change of rank).
  • Can now get notified if a users credits change.
  • Can now get notified if a users pixels change.
  • Can now get notified if a users vip_points change.
  • Can not get notified when a user changes their username
  • Your now told if there is a new version of Cascade available for download.
Plans for 4.0 (Let me know if you want a 4.0)
  • Ability to select different color text for each type of log
  • Individual config settings for each type of log (not just cascade.disable_all_cache_checks)
  • Automatic update feature, updates to the latest version
Bugs/Issues Known:
Just that sometimes data can be incorrect but usually 99% of the time its correct, for example if a machine was banned and there are two accounts online with that machine id, it might mistake the first one and the second one was actually banned..

Just want to clarify some things first.. so basically the timer interval basically determines the whole application, just make sure not to set it too low, I recommend 1000, I was able to get away with 200ms without it lagging, but I had like 10 users in my user table, for big hotels with a lot of users registered it may lag, it all depends on how fast your server is at executing MySQL querys, just try it and find a comfortable interval, obviously the lower it is, the faster you get updated.

You'll be told if your interval is too low because it will say "Timer is lagging" so ye, just make sure that isn't printing to the console.


I have this problem can you help me ?
 

Seriosk

Programmer;
Oct 29, 2016
256
105
I have this problem can you help me ?
Hey, it seems like your users table doesn't have a column for pixels (Haven't checked the line your error is executing on but I am pretty sure that's what it is) so here you have multiple options

Simplest:
Open the source and edit the column to 'activity_points' (Or which ever you use)

Other:
Change your database structure to use pixels instead of what ever your using

If you don't or can't do this yourself message me on skype and I can help privately
lithq123
 

Users who are viewing this thread

Top