Updates and Goodies!

Hello, all!

I have lots of exciting updates today! Firstly, you may have noticed another site change recently. I added “Web Apps” to the menu so I’d have a place to add browser apps, since they don’t really fit in the Downloads category.

After has been moved into there, and I’ve added OurDocs as well! OurDocs is a online document collaboration app. It allows two or more people to work on the same document at the same time. It’s kinda like “multiplayer OneNote”. It also has a chat feature and some other stuff, and I’ll be adding more things as I have time.

A lot of back-end code I wrote for OurDocs applied to After as well. While factoring in the updates, I decided I’d create a public repository on GitHub where I could share little helper methods and other pieces of code that others might find useful. You can find it here: https://github.com/This-Will-Be-Your-Username

I also put a lot of work into After today, and I’ll be posting an update on there as well.

That’s it for now! Take care!

Socket Server Example

Hello all!

I’m reposting this entry that I had originally posted in my After dev blog. Since I’ve begun rewriting After as a web app, all the code I’d written for it will be thrown out. But I still think it’s pretty cool information to share, so here it is. 🙂

—– Original Post from February 23, 2016 —–

For my first post on the topic of C# and UWP, I suppose it would be fitting to write about the first challenge I faced when developing After: How do I create a socket server?

I had experimented with socket servers previously in WPF applications, but I didn’t have very much experience with them. Also, UWP apps use a different library for sockets, and I’d never sent anything other than strings over them. So it was kind of intimidating at first. However, the API is very similar to WPF’s socket library, and after breaking it down and taking it one step at a time, it was a lot more simple than I had anticipated.

Just like WPF apps, stream sockets have a listener class that fires a connection received event upon connection requests. So I set up my StreamSocketListener like so. In this case, I used a static class and static methods for my socket server, but you can instantiate it any way you want.

So far, pretty straight-forward, but a few comments might be warranted. For event binding on static or persistent objects, I always remove before I add. I had an issue once with events getting bound multiple times, likely due to poor coding practices. 😀 Hey, I’m still learning! But since no exceptions are thrown by attempting to remove a binding that doesn’t exist, I don’t see any harm in doing so, and it ensures that there will always only be one binding.

VMS is the view model for the server. Current is a singleton instantiation of it. The Port property is bound two-way to the text box where the port number is entered. The SocketLookup collection will be used later to retrieve the sockets for individual connections based on their ID/username.

Now we have a server listening for connections. Here’s what happens with incoming connections.

I’ve removed the majority of what occurs here for security reasons, since sharing this information could assist someone in circumventing my security. This is where you want to perform any initial security checks (i.e. banned IPs, DoS protection, etc.). If everything checks out, I assign a GUID to the socket and send it back to the client so it’s aware of its own ID. I then pass the socket and its ID to ConnectionToClient, which is responsible for handling all communication from this point on. On the client side, the connection is getting passed to a respective ConnectionToServer class. 🙂

The ConnectToClient method handles the account authentication and assigns a username to the socket. We’ll skip that since it uses the same techniques as what follows, which is basically an infinite loop that will handle the rest of the incoming data from the socket for the remainder of its lifetime.

First, it waits for data to come in on the network stream. Everything I send over a stream socket is preceded by exactly 4 bytes, which is a UInt32 that lets the receiving data reader know how much data to read. There are other ways to handle the reading data from network streams, but this is the way I chose.

Everything that’s sent from server to client and back is serialized into XML, so it’s expecting the incoming data to be a string. It sends that string to the Utilities.Deserialize method, which will convert the string into an object. I’ll go over how the serialization works in my next post.

Next, we send that object to ReceiveDataFromClient for processing. Every object that’s sent over the network stream has a common interface. By checking the type of class being received, the receiver knows which method to call that will execute the logic necessary to process it. For example, if the data coming in is of type Message, there could be a ShowMessage method on it that will display the message according to its properties.

This loop repeats indefinitely until an error is encountered. The example above merely logs the player out, but you could also include advanced error handling depending on the situation, such as reconnection attempts, etc.

Well, that’s all for the socket server, I think! In later posts, I’ll talk about how the serialization works and how to construct your classes that will be used to send data over the network (also called Data Transfer Objects or DTOs).

Take care!

– Jared

Beta Release of Game Cloud

Good evening, everyone!

I’m incredibly excited to share with you all that I finally have a beta release available for my latest application: Game Cloud! Please share this with all your nerdy/gamer friends. 🙂 I need beta testers and lots of feedback before the final release, and any additional word-of-mouth exposure would be super helpful. Head over to the downloads page to grab the portable exe.

So what is Game Cloud, you ask? Well, allow me to tell you! It’s a cloud-based storage app specifically designed for PC games. Anyone who plays games through Steam should be familiar with the concept, which they call Steam Cloud. It syncs your saved games automatically, so you can play a game on one computer and pick up where you left off on another. Game Cloud does the same thing, only it can be used for any game, not just supported Steam games.

This project has been a much larger undertaking than I had originally anticipated, but the results have been totally worth it. It’s fully functioning and ready to use. I just need to add some finishing touches, get feedback from actual users, and continue testing a little more thoroughly to make sure all the bugs have been worked out.

So please share this with your friends! I’m excited to hear what other gamers think about it and see how well it holds up to real-world use.

Thanks and goodnight!

Emails Haven’t Been Received Lately

Hey, all.

Well, this is a rather embarrassing post I have to make, so I’ll just come right out with it.  When I transferred my site to the new hosting provider, I messed up some of the new code for processing emails.  It worked fine during my tests, but apparently I haven’t been receiving any emails from the contact page for the past couple months.

I sincerely apologize if anyone has tried to reach me and hasn’t gotten a response.  Unfortunately, the issue wasn’t caught by my error handling, so I have no idea how many people that might be.

The issue has been fixed, though, and I hope anyone reading this will resend any questions or comments they may have sent previously.

Thank you!

Translucency Is Moving (…Has Moved!)

(The below was copied from my old site.  I’m now on my new host!  Yay!)

Hello, all!

I’m currently in the process of moving the website to a new host.  Unfortunately, I wasn’t able to bring the domain name with me.  So the new website will be at http://translucency.info

This site will be up until I have the new one set up, at which point there will be redirect notice.  It’ll remain until roughly the end of the year, then this domain name will be dropped.

I’m excited to get set up on the new host!  It’s a Windows server, and I’m much more comfortable using Microsoft technologies.  Just recently, I began writing some basic web services for After and another app I’m working on using PHP.  I wasn’t 100% happy with PHP, nor very knowledgeable, but I was able to get things working eventually.  Using ASP.NET for my web services will significantly increase my efficiency, and will also make me a happy programmer.  🙂

Oh, and my next app is going to be a-a-a-a-a-awesome!  I can’t wait to get a beta version on here.

– Jared

Sleepy Kids Available on the Windows Store

Hello, everyone!

Despite the lack of updates during the past few months, Translucency is still live and well. I’ve been working with Microsoft for several weeks to iron out some issues between my developer account and the Microsoft store, which was preventing me from moving forward with my first app.

With that all cleared up, I’m happy to announce that Sleepy Kids is now available on the Windows Store! Here is the direct link to the Store page: https://www.microsoft.com/store/apps/9nblggh1jn8t

Sleepy Kids is a Universal Windows App that will run on any Windows 10 device. Information is also available on the download page.

Most of my development time has been spent on my upcoming game, After. I’ve made a ton of progress since my last post, but I’m not yet ready to reveal too many details. There’s a link on the navigation bar that will lead to the development blog. All information and updates related to After will be on there. I’ll be activating the link soon, and updates will start becoming more frequent.

I’ll also be launching a Kickstarter campaign for After. My goal is to have that ready by February, but nothing’s set in stone. You’ll know when it’s close, though. I’ll be plastering information all over the place with annoying frequency to reach as many people as possible. You, my dear friends, will be asked to help spread the word!

Well, that’s all for now. Feel free to check out Sleepy Kids, report any bugs, rate and review it on the store page, etc.

Thanks!

– Jared

Windows 10 Development

It’s been a while since I posted an update.  Wow, almost 4 months already?  I’m definitely overdue to inform my avid followers on my recent activities.  (I’m laughing maniacally to myself in a dark room downstairs while writing this to myself.)

I’ve been hard at work on my first Windows Store/Windows Phone app.  I started with the Windows 8.1 framework, but since the Windows 10 UWP (Universal Windows Platform) has recently become available, I ported it over to that.

I’m almost finished, but there are a few features I won’t be able to test until the Windows 10 Store becomes available in 4 days.  Hopefully I’ll have it wrapped up and out the door quickly.  I’m excited to experience the new Windows marketplace from a developer’s perspective!

After that, I’ll be diving into the creation of a game for the Windows 10 platform!

Edit: Oh! I almost forgot to mention. My application was accepted by Microsoft BizSpark, and they are \”sponsoring\” me in the creation of my game and other apps. They gave me a free 3-year subscription to MSDN, which lets me download and use all kinds of software for free. I also get $150 a month to spend on Windows Azure services. With Windows Azure, I can create virtual machines and other cloud services. I’m currently running 2 VMs, one to run as a server for my game and another as a development test environment. Microsoft is really kinda awesome!

Photo Manager’s Official Release

I’ve released the official 1.0 version of Photo Manager. I’m considering it now to be out of beta! Woohoo! The Backup tab has been removed from the Advanced mode since I don’t think the feature would be very useful. The Clean Up Duplicates feature is completed.

I made some changes to the website as well. I took down the Source and Subscribe links since they weren’t being used much. The mailing list thing was kind of overkill anyway. I’ve moved my source control from Bitbucket to Visual Studio Online, and I started using Team Foundation instead of Git. And boy, do I love it! I’m not sure if I’ll make my repos public again, though.

Now that all my desktop apps are in general release, I’m going to focus on mobile apps for Windows and Windows Phone. I still have other ideas for desktop apps, and I’m sure I’ll get around to them some day. I’ll be posting updates when I have something available on the Windows Store!