Learning C# In A Week... Otherwise I Fail University

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I have one week to learn all of cop networking otherwise I'm failing my semester and getting kicked out of University oh that hurt my foot H this will be fun this particular assignment seems simple enough I need to create a chat system so something like Discord except it's not simple because this entire criteria of every feature that needs to be implemented exists and it's like five pages long the man in charge of this monstrosity is Gary that's not his actual name by the way and I'm scared of this man for a number of reasons firstly he always includes this demonic smiley face emoji in his emails and that's like the only reason he's actually a really nice guy so I read through the assignment brief like five times yeah I'm committed one hopes that I will understand it better which I did but also didn't but I can't let that slow me down because I only have 7 days for this particular project I need to use C and make the entire networking system it's the best starting point is Visual Studio empty console project but here is the problem section five of that really long criteria list I showed earlier specifically says I will need UI otherwise I fail so to solve that problem I will be using something called WPF and win forms which is basically an easy way to implement an interface into any project so it's the next day and I spent all of yesterday making this UI and yes I know it's ugly but at the same time I think it's good enough to get me the marks plus there is only 6 days left so I feel like this will have to do okay so the actual Step One is setting up the networking part so here's the thing I'm Paul and I can't afford to have a server running 24/7 so instead I'll create a separate application for the server and a separate application for the client that way the person testing this thing can just be the host themselves if that makes sense okay so I did some behind the scenes work and we should now be able to create an instance of the server pass in the IP address and port and then just start it oh actually The Client app will also need to do a similar thing so I'll create an instance and this time it will be the client instance and connect to the same IP and port and well I'll just run the client and I'll also add an error message just in case something goes wrong now if I press this button we have a command window open up and um okay cool yeah we're connected Okay so yesterday I managed to get the main networking part in place as you just saw I also managed to get it link to the UI so right now when you launch the app you can enter a name and connect as that user you can also disconnect from the server at any point but unfortunately we still have this massive list of features I need to add so uh I think let's just get going okay so clearly the first thing I need is a way to send messages I mean it's literally a chat system so here's what I'm thinking we can use this thing called packets so basically a user will type whatever message they want and hit send then the system behind the scenes will take the string and convert it into bytes this will be known as the package we can then transport this package to the server which will then distribute it to every connected client and I guess then we just need a way to display it let's test it out okay so it's um not working right I realized it is actually working but I forgot that we also need to send it to the client that sent the message AK yourself it's a little bit confusing but basically you also need to see the message that you send and I wasn't doing that another thing that we can really easily add is private messages the system will work exactly the same except the server won't distribute the package to every single client but only to the one that the message is addressed to but here's the thing there is no way to address a message right now so what I did is I created a user list on the side right here that will display every connected user that way you can just simply press a user on the side that you want to send the message to and just type the message as normal and if we hit send you can see the message has been sent yay only that person has received it as well which is which is good okay so another part of that really long criteria list asks me to create different ways to send messages what this means is I need the ability to use different protocols right now I am using something called TCP to send messages basically all you need to know is that this method is slow but also secure so to please the examiners and Gary I will also create a method to use UDP to send messages that way I'm hoping by having two different protoc calls I will get the marks so to use UDP I will just create a new listener get it ready to receive data and then use it to send the messages I will also create a button to be able to switch between the two protocols and now if I type a message we are currently using TCP to send it but if I click this button and now send the message we can see it's sent via UDP now while we are talking about security I also need to add some for this I will add some basic encryption now at its most basic level encryption is the process of protecting information or data by using mathematical models to scramble in such a way part basically we're going to take the message that someone sends scramble it up and once our server receives it we will have a key to descramble it so this is my simple encrypt and decrypt function and the thing is I don't always want to send encrypted messages so I will also add a checkbox and only do it when this is ticked so now if I type a message and hit send we can see it's encrypted okay so the chat system is working but for some reason Gary is demanding that this project has some sort of game in it like why now for my game I would just add RPS rock paper scissors it's probably the oldest game known to man in my opinion it's the best game ever and some people think nothing will ever top it but at this moment in time I hate it I dislike it and in fact I despise it okay so I got the entire game working now you can play against someone lose draw win and whatnot and here is how it works I created a new screen just for the game I then added a feature that lets players join the game once two users are in the game will automatically start each player can choose either rock paper or scissors and once both choices are made the program determines who won and kicks both players out the actual RPS game has a few packets that are used to determine what to do firstly we have a join packet that handles joining the actual game packet that handles the game itself and finally the reset packet that resets the game okay so I just woke up and it's the last day and I still need to add this thing called a graphical solution which is worth 15 marks now just for context this is a lot now originally I was going to add a feature where users can upload images and others can view them so some sort of gallery thing but I'm not sure if that's going to give me the full marks so instead I now have 24 hours to implement a painting application the idea is that users will be able to paint on a shared canvas this means that if I draw something others will be able to see it too and to be honest I have no idea how to do that or where to start right okay so after some thinking I think I know how I will do this for starters I created this new screen where the painting will take place I also added some buttons that will represent the different colors and line thicknesses I then created a packet called Paint that will handle the painting data so to be honest there is a few things that we need to know about any stroke that a person makes on the canvas firstly it's the color and thickness which is fairly straightforward but then we also need to know its position on the canvas so for this I need to know where it begins and where it ends so we can represent that data with X+ 1 X+ 2 y+ one and y+ 2 then once the stroke is made we can send this data to the server and the server will then distribute it to every connected client so I have this method here that will draw a line with the data that it receives I should mention that this drawing thing right now only works with straight lines I know that's a bit scuffed and it's not exactly painting or drawing but hopefully I think it should be enough for full marks so let's test it out okay so yes it works I can now draw stuff and others can also see it and the different colors and Strikes also work okay so um I guess let's just uh submit this project and see uh how we do hey so it's actually been like a month Maybe a little longer since you saw that last part but I got an email this morning saying that the results are in so I figured let's check it out and I'll show it in the video okay so if we actually go onto the course itself and look at the assignment submission oh my gosh okay I got 91% which is actually very good cuz it's out of 100 and I'm more than happy with that um so yeah I mean I I passed I'm not getting kicked out of University or anything like that so um I think yeah that this is the end of the video guys so if you enjoyed please like subscribe and whatnot and uh yeah I I'll see you guys next time bye
Info
Channel: Zyger
Views: 307,463
Rating: undefined out of 5
Keywords: Learning C# In A Week, zyger, i learned c#, learning c#, creating a chat system, i have one week to learn programming, learning programming in a week, gamedev, programming, learning networking in a week, 30 minutes, 7 days, 24 hours, 48 hours, game dev, i made a voxel engine, i made a graphics engine, i made a physics engine, learning programming in a week otherwise i fail university, I Need To Learn C# In A Week... Otherwise I Fail University, arceola, scratch, unity
Id: ZVEOxTyxbk4
Channel Id: undefined
Length: 9min 4sec (544 seconds)
Published: Fri Jan 26 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.