Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Programming
You last visited: Today at 16:15

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Programming for Idiots (C#) - Take 2

Discussion on Programming for Idiots (C#) - Take 2 within the CO2 Programming forum part of the Conquer Online 2 category.

Closed Thread
 
Old 12/19/2010, 11:40   #46
 
elite*gold: 0
Join Date: Oct 2007
Posts: 11
Received Thanks: 0
I think this tutorial is not very good, use the openbooks, these are better.
MoHdElX is offline  
Old 12/19/2010, 11:47   #47
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
Quote:
Originally Posted by MoHdElX View Post
I think this tutorial is not very good, use the openbooks, these are better.
This is not very descriptive . Can you explain why it's not well written, or why you would prefer using (what I assume is) books over this tutorial?

Edit:
Looking into what this "openbook" is -- he's refering to the following:


The biggest problem with this is the vast majority of the CO2-Community does not speak Dutch (or German). I'd also argue that because my guides aren't written in a sound-professional manor, it makes it more user-friendly, and easier for people to understand. I'd put money of the fact the OpenBook guide doesn't cover pointer-usuage as well. I'm yet to see a tutorial aimed at C# that does.
InfamousNoone is offline  
Thanks
3 Users
Old 12/19/2010, 16:07   #48
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
I might as well sticky this now since it's going to be stickied eventually. Do you want the other thread to remain stickied, merged with this or un-stickied?
tanelipe is offline  
Old 12/19/2010, 16:46   #49
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
You can unsticky the older thread. Thanks a lot in advance.

Edit:
Added Lesson Six - Delegates and Lambda Expressions
Added Lesson Seven - Properties and Modifiers
InfamousNoone is offline  
Thanks
1 User
Old 12/21/2010, 06:26   #50
 
xScott's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
looking good, lambda expressions always confused me,
you going to briefly touch events?

keep up the good work men!
xScott is offline  
Old 12/21/2010, 07:12   #51
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
Event's have practically been superseded by the Observable class in .NET 4.0. I don't see a real need for them any more. This class will be talked about in Unit 3.

Really, all you need to understand about lambda's is they're a short hand way of writing delegates. And essentially what is a delegate? A delegate is type used to represent a function.

So when someone writes:
Code:
(x) => x + 1;
What they're really saying is most likely:
Code:
int _method(int x) { return x + 1; }
InfamousNoone is offline  
Old 12/21/2010, 17:52   #52
 
xScott's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 322
Received Thanks: 63
Quote:
Originally Posted by InfamousNoone View Post
Event's have practically been superseded by the Observable class in .NET 4.0. I don't see a real need for them any more. This class will be talked about in Unit 3.

Really, all you need to understand about lambda's is they're a short hand way of writing delegates. And essentially what is a delegate? A delegate is type used to represent a function.

So when someone writes:
Code:
(x) => return x + 1;
What they're really saying is most likely:
Code:
int _method(int x) { return x + 1; }
pretty cool, cheers for the info.
keep up the good work man!
xScott is offline  
Old 12/21/2010, 19:21   #53
 
unknownone's Avatar
 
elite*gold: 20
Join Date: Jun 2005
Posts: 1,013
Received Thanks: 381
Quote:
Originally Posted by InfamousNoone View Post
So when someone writes:
Code:
(x) => return x + 1;
That aint valid lambda syntax. The return keyword there is unnecessary and won't compile. You can say x => x+ 1, or x => { return x + 1; }. The braces are necessary in the case of multi-statement lambdas or those returning a unit.

Also, in your delegates lesson, you mention that they're "safe function pointers". You miss out the major differences, that a method also has an object instance associated with it. One might call the C++ equivalent a functor. Delegates also hold an invocation list and are capable of assigning many methods to a single instance (the MulticastDelegate), where a native function pointer is single-dispatch only.

You should probably mention the special delegates Func<> and Action<> too, since they play a major role in lambdas.
unknownone is offline  
Old 12/22/2010, 02:44   #54
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
Quote:
Originally Posted by unknownone View Post
That aint valid lambda syntax. The return keyword there is unnecessary and won't compile. You can say x => x+ 1, or x => { return x + 1; }. The braces are necessary in the case of multi-statement lambdas or those returning a unit.
Oh, damn, you're right. I'll get that fixed.

Quote:
Originally Posted by unknownone View Post
Also, in your delegates lesson, you mention that they're "safe function pointers". You miss out the major differences, that a method also has an object instance associated with it. One might call the C++ equivalent a functor. Delegates also hold an invocation list and are capable of assigning many methods to a single instance (the MulticastDelegate), where a native function pointer is single-dispatch only.
I think in that case it's worth getting a Delegates (II) done, which I'll do today. I didn't want to go too indepth with the C++-analysis/difference because it's bad to assume the reader has knowledge of C++, but I have an idea how I'll get that fixed.

Quote:
Originally Posted by unknownone View Post
You should probably mention the special delegates Func<> and Action<> too, since they play a major role in lambdas.
I can't mention either of those yet as generics haven't been covered.

Thank a lot for the support. Will get the changes done today.

Added:
Lesson Eight - Delegates(II)
Lesson Nine - Generics and Delegates(III) -- 12/26/10
InfamousNoone is offline  
Thanks
4 Users
Old 12/31/2010, 22:45   #55
 
InfamousNoone's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,885
I'll continue with this starting tomorrow. Took a 5-day break to conduct some "research" (not particularly pertaining to events/topics contained in this thread). I'll try to see if I can get something up before I go out today but... I won't guarantee anything. However, come January (the 1st) I'll be starting again.
InfamousNoone is offline  
Thanks
2 Users
Old 01/01/2011, 19:47   #56
 
elite*gold: 0
Join Date: Jun 2009
Posts: 5
Received Thanks: 0
I'm probably going to get flamed for this and ****, but can you program CO Private Servers using C#? I tried learning C++ but that's ******' ridiculous and I heard that C# was basically the same thing but simplified. Anyway, if anyone can give me lessons one on one via MSN or AIM or whatever, please PM me and let me know. Thank you very much.
MatthiasObran5594 is offline  
Old 01/01/2011, 20:32   #57
 
.Kinshi's Avatar
 
elite*gold: 0
Join Date: Dec 2010
Posts: 341
Received Thanks: 255
Quote:
Originally Posted by MatthiasObran5594 View Post
I'm probably going to get flamed for this and ****, but can you program CO Private Servers using C#? I tried learning C++ but that's ******' ridiculous and I heard that C# was basically the same thing but simplified. Anyway, if anyone can give me lessons one on one via MSN or AIM or whatever, please PM me and let me know. Thank you very much.
Read these things and practice, once you get the basics down you can attempt a server.
There's also sources released all over here that you can look at and learn from.

You can also add me on msn:

When I'm free I help out a few people.
.Kinshi is offline  
Old 01/03/2011, 03:55   #58
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Quote:
Originally Posted by MatthiasObran5594 View Post
I'm probably going to get flamed for this and ****, but can you program CO Private Servers using C#? I tried learning C++ but that's ******' ridiculous and I heard that C# was basically the same thing but simplified. Anyway, if anyone can give me lessons one on one via MSN or AIM or whatever, please PM me and let me know. Thank you very much.
If you take a look at the private server sources you'll notice that for conquer anyways almost all of them are written in C#.

C# is perfectly capable of running a conquer pserver (as is java, C++ and a large number of other programming languages). As many more experienced programmers will tell you (translation: snobbish programmers) ANY programming languages has its ideal uses... it's debatable about if C# is truly ideal for a private server situation but the fact remains that using C# you will have a FAR greater set of example resources (both programmers and actual code examples). C# does sacrifice some performance but lets face it... unless your server is all of a sudden being pounded by like 1000 players on a single server you will NOT have a huge issue with C# (again... anyone can program something ****** in C#... or C++ and have it lag out and not be efficient. I'm talking about a PROPERLY written source here using all the language can offer)


So yes...

C# is fine and much simpler for most people to learn than C++. Sure, some people pick up C++ without any issue but lets face it... the average person will find C# a tad more forgiving and simple.
pro4never is offline  
Thanks
4 Users
Old 01/04/2011, 04:29   #59
 
ahsanahsan's Avatar
 
elite*gold: 0
Join Date: Nov 2007
Posts: 51
Received Thanks: 6
@InfamousNoone
I got a suggestion:
Wouldn't it be great if you put all the files into one folder? I know they only take about 1-3 sec to download each lesson but instead of clicking each lesson you would just download one folder that would have all of the files inside for each Unit?
ahsanahsan is offline  
Old 01/11/2011, 18:19   #60
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,001
Tutorials stopped?
tanelipe is offline  
Closed Thread


Similar Threads Similar Threads
Programming For Idiots (Tutorial) - In C#
05/25/2013 - CO2 Programming - 188 Replies
This tutorial has been superseded by: http://www.elitepvpers.com/forum/co2-programming/88 5939-programming-idiots-c-take-2-a.html Well for the next week (or so) due to being bored, I've started a video-tutorial called C# Programming for Idiots and yeah, by the end of it I'll demonstrate how to make a conquer server (patch 5016 and before) without the need of mysql, or anything like that; all you need is the Visual C# compiler, and WinRAR (To extract the videos). Visual C# Compiler:...
Programming for Idiots (Tutorial) C++
06/11/2012 - CO2 Programming - 20 Replies
Yeah, so in my relation to my C# one (http://www.elitepvpers.com/forum/co2-guides-templa tes/148675-programming-idiots-tutorial-c.html), which wasn't the best I felt I'll *try* make for it with this one. I've also got some spare time in between school, from when exams start, and a new Warlords server comes out... so yeah. Right, so before I post any links to the videos I'd like to point out, so I don't get bitched at by people saying, "this isn't real C++", most of the things I do will be...
[RE-OPENING]"Programming For Idiots (Tutorial) - In C#"
09/17/2009 - CO2 Programming - 20 Replies
At start i want to say THIS IS NOT MY GUIDE , GUIDE WAS MADE BY INFAMOUSNONE!!



All times are GMT +1. The time now is 16:16.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.