Pandemic - SOURCE CODE INSIDE

Post here about scripting and programming for HaloPC (audio, network, ai, etc.)
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Pandemic - SOURCE CODE INSIDE

Post by FleetAdmiralBacon »

Image
Pandemic
Installer download:
Image
Download the newest client here!
[url=pandemic://joinchat.pantalk]Join the Official Pandemic Chat Room[/url]

Pandemic is an instant messaging client I am working on using VB.net.
The server is a Python script, but don't underestimate its power. The .net socket libraries are extremely lacking when it comes to maintaining clients properly, resulting in burst connections. My Python server handles everything with ease, and even allows for multiple clients to run on the same network (which, though not all that amazing for an IM client, is still pretty cool)

Moving on to the actual client, it was written in VB.net and maintains a connection with a server (currently hard-coded with my IP) and awaits very specific string-based signals for all the different things it does (messages, responses to "is this person online?", etc.)

The client currently uses HTML through a web browser control. There are some bugs that need fixing, but they're being worked on.


I will not provide a download at this time. If you want the client, send me a PM.
(Note that when complete, I will release the source code to Pandemic for anyone who wants to see how to do it themselves)
Image
Last edited by FleetAdmiralBacon on Mon Oct 08, 2007 1:24 pm, edited 12 times in total.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
Tural




Conceptionist Acolyte Bloodhound Recreator
Socialist Connoisseur Droplet Scorched Earth
Grunge

Posts: 15628
Joined: Thu Jun 16, 2005 3:44 pm
Location: Lincoln, NE
Contact:

Post by Tural »

Any plans to implement file/image sending?
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

Actually, yes, I do have plans for both.
At this time, however, images can be sent simply through an HTML img tag.
There is also no security on the HTML, but I will be implementing automatic closing of opened tags when a message is sent, or possibly an a regular-expression-based bbCode message format rather than HTML.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
T1xAnton




Coagulator Recreator Connoisseur

Posts: 1213
Joined: Sat Mar 25, 2006 8:54 pm
Location: Corbin, KY
Contact:

Post by T1xAnton »

This looks really good Fleet. :D
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

Got some new updates.
Image

Fixed a lot of bugs in the friends list, added functionality for avatars and a short description line (a la MSN). Again, if you want to test it out, just send me a PM and I'll be happy to give you the client.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
Sgt.Peppers




Snitch! Connoisseur

Posts: 2277
Joined: Thu Jul 06, 2006 1:25 pm
Location: Texas

Post by Sgt.Peppers »

Cool, maybe this will become the new AIM.

:D
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

A few little updates:
- Accounts are now password protected and stored on a MySQL server. Unfortunately, the server at oasis-games.com is not remote-accessible, so in the meantime, it is running off of one my own computer.
- The old IE web browser control that powers the chat window has been replaced with a Gecko-based one. It will require you to download and install the control's libraries which VB.net refuses to include properly, but also makes things better for anyone used to Firefox (plus PNG alpha blending on computers without IE 7)
- New, fluid Friends List. The method of updating the friends list has been radically improved. You can't see it in the pics, but the old method caused the list to flash, and sometimes even duplicate (triplicate, or more) users. The new method only updates the list be resetting the values in each friend block and only adds a new one if it can't find one for the given friend.
- Web browser does not accept focus. This is a new things that means a lot for chats as a new message no longer keeps you from typing.


As I've said before, the source will be released upon completion, but the addition of the MySQL server will force me to remove all parts related to connecting with my own laptop. However, as I will be releasing the server as well (it's a Python script, so you can actually get it running on most servers), you can modify the source yourself to connect to your own server. I will also be making the client only capable of reading from the database and will be storing passwords as hashes, just in case someone does get my password out of the executable (which as everyone here is a modder of sorts, that's highly likely)

So, to conclude, I've fixed tons of problems and made it even easier to use. As always, PM me for a release. Those people that did ask for it will get it as soon as I get some profile management things up and running.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
SpecOp44




Advisor Recreator Snitch! Critic

Posts: 2008
Joined: Tue Jun 06, 2006 12:34 pm
Location: The Canadarm

Post by SpecOp44 »

Looks very nice. I like it alot.
Image
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

I have a crude little site now for updates and downloads:
Take a look.
You can download the newest client from there.
Registration is done through the client.
I will start the server at 4:00PM EST.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
CptnNsan0




Stylist Snitch! Collaborator Commentator

Posts: 1904
Joined: Thu Jun 15, 2006 5:49 am
Location: Durham, NC

Post by CptnNsan0 »

This looks really nice bacon. I'll download it and give it a try.

edit: nvm I don't have the framework and it wont install on my computer :cry:
Image
Not Removing This
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

CptnNsan0 wrote:edit: nvm I don't have the framework and it wont install on my computer :cry:
*cough*pirate*cough*
That's .net for you. I've always preferred good old VB6, but the compiler doesn't run properly on Vista : (

Edit: After hours of work, I've fixed a major bug where new messages caused the chat window to steal focus.
You can now download version 1.1.
Note: Do not extract the friends.txt included with the new release if have already "installed" the program!

Edit:
Wow, no replies since the last update.
Anyway, 1.3 is now complete! Your avatar, last user name, whether you've closed the friends list, and your "profile" are now saved. I have also added new features to the server, like the ability to boot all clients to the logout screen (there is good reason for this, trust me, you'll know when it comes). Another new addition is the "default" avatar, shown when you don't select an avatar (or enter nothing into the box). This default avatar is the Pandemic logo. Offline users are seen with a grayed out Pandemic logo. Also, you now have the option of adding friends from the client. Though a crude interface is used (just like with everything else at this point), it will relieve the hassle of having to open your friends list in notepad. Finally, I have fixed the "Invisible" status. This is a server-side change, and so it works on older clients. When you are set to invisible, you can send messages but can only receive messages from friends that you have sent a message to. You will appear offline and with no avatar or profile, and friends will not be able to start conversations with you.

My plans for the next update include chat window management (still trying to work out how to change the window layout of forms that aren't MDI children) as well as *possibly* a WYSIWYG editor for messages. Another possibility for the next update is a cleaner interface for the "Change Avatar" and "Change Profile" (and "Add Friend"). Selecting a server IP may also be added, it all depends. A guarantee for the next version is a better method of handling the friends list file so that it will not need to be included with the program. This is a simple matter, so it will definitely appear in 1.4

In the mean time, you can download 1.3 and the newest server (for educational purposes only, as choosing a server is not yet implemented) here:
Pandemic Downloads
As with before, don't overwrite your friends list, though the included one has all but two users, they be the only two you care about.

That's it for this weekend. Don't expect any updates tomorrow as I will be at my friend's house most of the day.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
StalkingGrunt911




Recreator Connoisseur Acolyte Coroner
Sigma Pyre

Posts: 3618
Joined: Wed May 24, 2006 12:30 pm
Location: Florida!
Contact:

Post by StalkingGrunt911 »

Nice job Fleet. Looks really nice. Good job bro.
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

Good news for any one wishing to run their own server:
I've set up an entire page on how to get everything set up, as well as the newest version of the script. The new client (1.4) allows users to change the server they are attached to, as well.

Server requirements are:
+ A MySQL database that can be accessed remotely (preferably with room for an extra user)
+ A web server running some dynamic server-side script capable of inserting a row into a MySQL server (PHP script is included)
+ Python 2.5 to run the server script.

Pandemic Server Page

I have already helped someone set up their own server.
Updates to the script will be posted as I finish with them. Right now I'm working splitting the server into a console-based one and a background one. The background one does not require the administrator's attention, whereas the console-based one currently requires attention every so often to clear a list of UDP connections (used for extra features). This will soon be fixed as I add some stuff to automatically clear it every so often.

Anyway, if you're interested, read the page I wrote it (that's why I wrote it...). It contains a link to everything you'll need for the server, just fill in the blanks.

Also, I've been asked, no, do not keep the brackets in the Python script for the connection string and URL.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
[cc]z@nd!




Literarian 500

Posts: 2297
Joined: Tue May 04, 2004 1:52 pm
Location: michigan

Post by [cc]z@nd! »

kudos for doing all this, and releasing the source.

however, have you considered consolidating the SQL database into the server script? i was thinking, maybe you could have the server script access a file with usernames/hashed passwords in it instead of relying on an SQL databse to log in.

anyways, BIG credit to you for making and releasing this. i have a feeling i might use this as a framework of sorts for my own client/server app. i've got my hopes set on a proxy application, but with the client written in C++.
ASPARTAME: in your diet soda and artificial sweeteners. also, it's obviously completely safe. it's not like it will cause tumors or anything. >.>
always remember: guilty until proven innocent
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

I've added tons of new settings, enough to deserve an entire preferences page.

Image
Image
Image


Most notable among these new settings are the fonts and server name, making messages better and servers easier to connect to.

You can also use the new web installer to run Pandemic off of our site (please don't, though)

Pandemic 1.5 - RAR, 202kb
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
Prey




Connoisseur Snitch! Pyre Articulatist 500

Posts: 1026
Joined: Wed Dec 27, 2006 6:49 am
Location: UK
Contact:

Post by Prey »

Image
Halo 2 Prophet - Skin with ease with the simple 3D point and click interface.
Halo 3 Research Thread - Contribute to the research into Halo 3.
User avatar
LuxuriousMeat





Posts: 824
Joined: Thu Nov 03, 2005 6:43 pm
Location: zzzzzzzzzzzzzzzz
Contact:

Post by LuxuriousMeat »

I get this when I login:
Image
Image
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

The server was not up when you were attempting to log in, so the client never got a response containing the SQL connection string, so the MySQL connection function flipped out. (Either that, or it was up, but it was the new server, in which case, you won't get a connection string, but rather the registration URL, and then it'll flip out)

The newest security update should fix that as the client no longer connects to the MySQL server, rather, the Python server does it. I'm also working on a file-based system to ease things for other server administrators (it's working, but I'm not going to convert over just yet)

Also, yes, as I mentioned, big security update. The client no longer receives any information from the MySQL database, but rather just sends the user name and password over to the server. The server then decides whether or not to return the "Login success" message containing the connection information.
This change took place due to a possible hack I was informed of.
Later versions will require only the Python server script to be running, and no important information will be sent to the client.

Edit:
I've decided that instead of just releasing the source code, I'd do an entire tutorial in parts on how I did everything in Pandemic, and everything I ended up cutting.
Topics will include:
[VB.net]
- Creating a UDP Socket server in VB.net (deprecated)
- Connection to a UDP socket server in VB.net
- Managing multiple forms (chat windows)
- Creating a list control that can be accessed by its contents
- Scrolling a custom list control
- Tray icons
- Converting System.Drawing.Image to System.Drawing.Bitmap
- Working with the Mozilla ActiveX Control
- Working with the WebBrowser control
- Preventing focus stealing
- Creating a top-level form that doesn't steal the focus
- Stacking "Toasts" (see above)
- Application settings
- Resolving host names to IPs
- Grabbing images from the internet for use in a PictureBox
- Interacting with a MySQL server (deprecated)
- Storing a friends list in a file
- Doing a proper MD5 hash
Let me know if there is anything I may have missed...
[Python]
- Running a UDP Socket server with SocketServer library
- Connecting to a MySQL database
- Multi-threading
- Running a command console why a background thread does all the work
- Connecting to a UDP Socket server
- Working with dictionaries and lists
I don't think I missed anything there...

Edit: 1.6 is now up. Various aesthetic updates as well as functional ones.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
User avatar
FleetAdmiralBacon




Critic Pyre Articulatist 500

Posts: 2377
Joined: Sat Nov 26, 2005 7:01 pm
Location: Ohio
Contact:

Post by FleetAdmiralBacon »

I think this would be an appropriate time for a bump...

I've fixed a ton of problems with both server and client and have finally cut MySQL from the list of requirements. The registration now runs on a file that contains the usernames and hashed passwords.

I've also added one major feature: chatrooms.
They're working quite nicely, if I do say so myself.


The server will be up tomorrow morning at the rate I'm going, but for now, you can always use mine.

Download Pandemic 1.7

Note: I have not yet updated the web-based version, if you absolutely have to use it, be patient.
Image
Everything you'll ever need to know about me.
Need help with Linux, C#, C, Python, Java, PHP, Javascript, CSS, or VB? I'm available from 3:00PM-8:00PM EST on weekdays.
Supermodder911




Connoisseur Coroner

Posts: 1262
Joined: Sun Sep 03, 2006 10:43 pm
Location: Michigan

Post by Supermodder911 »

this is cool if you finish this halomods would have to add a button for it like the aim and msn buttons lol.
Image
C Wizzle
Post Reply