Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 13:21

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

Advertisement



beginner in private server programming

Discussion on beginner in private server programming within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2014
Posts: 4
Received Thanks: 0
beginner in private server programming

Hello, I'm daniel and I'm a c# and vb.net programmer (well everything I write in a language i can manage and write it in the other language). I am not a professional since I am a self taught orgrammmer.

I've downloaded Redux source by pro4never and successfully ran the server. Well it was pretty easy to figure out how to add new npc and these basic stuff but for example when I go to the function or the procedure of writing the NPC I don't understand most of the code written inside them. In other words i dont know how does the system work.

I know basic programming skills and i want somone to tell me from where do I begin. Please don't mention links explaining the meaning of packets and these things, i just want to use.my programming skills in conquer development.

Summary: i know how to code, i know the basics of computer science(i mean theoretical and practical) like for example how to think and write an algorithm, I can use any dbms professionally and finally I know many of the features of the programming languages i use.

Sorry if my question isn't clear, excuse my English.
danielstudent is offline  
Old 11/14/2014, 00:30   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
The question isn't very clear because you claim you understand programming basics (syntax, flow of logic, data structures, etc) and yet are unable to understand what things are doing in the source.

While redux isn't exactly 'clean' in terms of documentation, things are labled half decently. It's pretty obvious what each function should be doing because it's what the function is called (there's plenty of exceptions, again I'm aware it's a mess).


Can you give us a SPECIFIC question on what it is you don't understand?

NPCs are really simple. There's a constructor where you set the ID for the script and the optional avatar the NPC will use when you talk to it.

Code:
  public NPC_102093(Game_Server.Player _client)
            :base (_client)
    	{
            ID = 102093;	
			Face = 123;    
    	}
You then have a run function which accepts the parameters Game_Server.Player (the player using the script) and a linkback (which npc option they have used)

Code:
   public override void Run(Game_Server.Player _client, ushort _linkback)
        {
            Responses = new List<NpcDialogPacket>();
            AddAvatar();
            switch (_linkback)
            {
                case 0:
                    AddText("What can I do for you?");
                    AddOption("Enter the guild area.", 1);
                    AddOption("Just passing by.", 255);
                    break;
                case 1:
                    _client.ChangeMap(1038, 350, 339);
                    break;
            }
            AddFinish();
            Send();
        }

We create a list of responses, add the avatar and then perform a switch statement based on what option the client has used. Depending on the option we either respond to the client (addtext, addoption, etc) or perform actions (change map)

You should be able to read through BASIC npcs like this to get an understanding of how the source is structured. You can then work your way towards larger things in terms of flow of logic but honestly it should be pretty simple to understand the basic flow of logic if you are familiar with entry level programming concepts.


Then again, I could have misunderstood the question and you could be referring to something completely different.
pro4never is offline  
Old 11/14/2014, 00:47   #3
 
elite*gold: 0
Join Date: Nov 2014
Posts: 4
Received Thanks: 0
Sorry i was writing on the phone and couldnt provide an example.
Well these codes are very simple to understand, but for example:
Code:
public void AddOption(string _value, byte _linkback)
        {
            var packet = NpcDialogPacket.Create();
            packet.Action = DialogAction.Option;
            packet.Linkback = _linkback;
            packet.Strings.AddString(_value);
            Responses.Add(packet);
        }
and
Code:
public unsafe struct NpcDialogPacket
    {
        public uint UID;
        public ushort ID;
        public byte Linkback;
        public DialogAction Action;
        public NetStringPacker Strings;

        public ushort PositionX
        {
            get { return (ushort)UID; }
            set { UID = (uint)((PositionY << 16) | value); }
        }

        public ushort PositionY
        {
            get { return (ushort)(UID >> 16); }
            set { UID = (uint)((value << 16) | PositionX); }
        }
        
        public static NpcDialogPacket Create ()
        {        
        	var packet = new NpcDialogPacket();
            packet.Strings = new NetStringPacker();
        	return packet;
        }

......
Well it is very clear what does each block do, but how I dont understand much of the code like for example I ran the server, and I found that attacking isn't working properly in the source (just an example), I dont think I can manage this bug even if I know what lines I have to edit and so on.
I have touched the source only since yesterday and if your comment is "you have to take some time to get used on everything and try again" just tell me so.

Ill reply tomorrow, goodnight and thanks.
danielstudent is offline  
Old 11/14/2014, 01:17   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
Packets are how the client and server communicate with eachother. Their structure is fixed (TQ decides them, not us) and it's our job to write code that allows us to easily write a block of data and send it over the network.

Those methods are all just to help make it easier to interact with that stream of data in a user friendly way. At the end of the day all it's doing is writing a group of bytes so they can be sent to the client or is used to interpret what data received from the client means.
pro4never is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Beginner - How to make a Private Server
04/11/2011 - CO2 Private Server - 8 Replies
Hello. First off all, my motherlanguage is german and my english isn't that great. So don't be angry cause of my bad english, please. My husband and I wanna make a privat server. I know how to make a Rootserver and he is able to program C# and other stuff. (Is ABLE and doesn't do it perfect.) But now I have a little problem. I found some tutorials, but sometimes they don't describe it with a rootserver or I can't understand every step, cause of my bad english. (Or mostly the tutorials...
Programming a private server?
04/01/2010 - CO2 Private Server - 9 Replies
Hi i was just wondering how do i make my own private server in C#? I mean like... i know that you need to learn how to program and stuff. But my problem is I can't apply my programming knowledge to conquer if that make sense. Say i'm coding all this stuff in C#, then compile it and all. It would come out as one of those cmd DOS file thingy right? So if someone could kindly point me in the right direction that would be appreciated.



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


Powered by vBulletin®
Copyright ©2000 - 2025, 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 ©2025 elitepvpers All Rights Reserved.