Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 08:48

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

Advertisement



[Release] Extremely basic (but working/bugless) C# Source

Discussion on [Release] Extremely basic (but working/bugless) C# Source within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Closed Thread
 
Old 03/29/2012, 23:46   #331

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by PKDemon View Post
i know this is an old post but can anyone re-upload as meagupload links dont work anymore ?
Kiyono is offline  
Old 09/11/2012, 02:51   #332
 
elite*gold: 0
Join Date: Jan 2010
Posts: 54
Received Thanks: 6
Hi,
Today, this source it is still good to learn?
by what I learned C#, and I want to know if I can use to create my server.
and also, someone could guide,i do not know how to connect the database at the source
and what client take??
Thank a lot all, and sorry for my bad english.
jitus2 is offline  
Old 09/11/2012, 07:11   #333
 
.Ryu's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
Quote:
Originally Posted by jitus2 View Post
Hi,
Today, this source it is still good to learn?
by what I learned C#, and I want to know if I can use to create my server.
and also, someone could guide,i do not know how to connect the database at the source
and what client take??
Thank a lot all, and sorry for my bad english.
The source is targeted a 5017 and setting it up is easy you just open Program.cs and scroll down a little bit and you will see a IP there change it to yours build then debug and your good to go
.Ryu is offline  
Thanks
1 User
Old 09/11/2012, 11:39   #334
 
elite*gold: 0
Join Date: Jun 2007
Posts: 22
Received Thanks: 7
Quote:
Originally Posted by .Ryu View Post
The source is targeted a 5017 and setting it up is easy you just open Program.cs and scroll down a little bit and you will see a IP there change it to yours build then debug and your good to go
Not the most informative for a newbie.

Download the source, and a Conquer client version 5017, Extract the source into a folder and then open up the project is an IDE (Such as Visual studio or C# Express) double click on Program.cs in soultion explorer (Tools->Soultion Explorer) If you can't see it and then look through the code for some sort of IP, I'll be around somewhere called "void Authserver_receive" or something similar.

Once changed, Up the top of the IDE around the top-center there should be a green arrow thing, Click that, it will build(save and compile) the edited project and then start it up in debug mode.
manager2 is offline  
Thanks
1 User
Old 09/11/2012, 16:47   #335
 
elite*gold: 0
Join Date: Jan 2010
Posts: 54
Received Thanks: 6
Hi,
Thank you both.
I was in the project, and I put the location of the database, now and I put the location of the: Database Loaded. For ip, I put it in program.cs, can you check if this is the correct location, because it still does not work




NOTA:
In the server.dat
I have also put the address IP hamachi.

NOTA2:
I have another problem
Now, when I try,
it makes me:



I need your help please
Thank all
Cordially.
jitus2 is offline  
Old 09/11/2012, 21:04   #336
 
.Ryu's Avatar
 
elite*gold: 0
Join Date: Dec 2009
Posts: 583
Received Thanks: 119
Quote:
Originally Posted by jitus2 View Post
Hi,
Thank you both.
Use ConquerLoader if your not already
.Ryu is offline  
Old 09/11/2012, 23:04   #337
 
elite*gold: 0
Join Date: Jan 2010
Posts: 54
Received Thanks: 6
I try with your link, it always arrives not connect :-(
Did you check if I put IP adress the right place?
Thank you!
NOTA:
it works now!!!
I solved the problem.
Just, here: authSocket.Port = 9958;
Replaced by 9959 (Same number as "LoaderSet" )
Thank!
I am now ready to learn
I took V3, is it good?
jitus2 is offline  
Old 09/12/2012, 13:36   #338
 
elite*gold: 0
Join Date: Sep 2010
Posts: 27
Received Thanks: 0
can any one upload source on mediafire or other links please
ragab2 is offline  
Old 09/12/2012, 14:03   #339
 
elite*gold: 0
Join Date: Jan 2010
Posts: 54
Received Thanks: 6
Here:

say thank you to Kiyono
jitus2 is offline  
Old 09/12/2012, 15:38   #340
 
elite*gold: 0
Join Date: Sep 2010
Posts: 27
Received Thanks: 0
how i run this please and thanks for helping
ragab2 is offline  
Old 10/06/2012, 20:39   #341
 
elite*gold: 0
Join Date: Jan 2010
Posts: 54
Received Thanks: 6
Quote:
Originally Posted by punkmak2 View Post
Here we go.


Portals Implementation.

1) Create a new Class file in the folder Interfaces called "IPortals.cs"

2) Replace all the code in newly created file IPortals.cs with the code below.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConquerServer_Basic
{
    public interface IPortal
    {
        ushort CurrentMapID { get; set; }
        ushort CurrentX { get; set; }
        ushort CurrentY { get; set; }
        ushort DestinationMapID { get; set; }
        ushort DestinationX { get; set; }
        ushort DestinationY { get; set; }
    }

    public class Portal : IPortal
    {
        private ushort _CurrentMapID;
        private ushort _CurrentX;
        private ushort _CurrentY;
        private ushort _DestinationMapID;
        private ushort _DestinationX;
        private ushort _DestinationY;

        public Portal()
        {
        }

        public Portal(ushort CurrentMapID, ushort CurrentX, ushort CurrentY, ushort DestinationMapID, ushort DestinationX, ushort DestinationY)
        {
            _CurrentMapID = CurrentMapID;
            _CurrentX = CurrentX;
            _CurrentY = CurrentY;
            _DestinationMapID = DestinationMapID;
            _DestinationX = DestinationX;
            _DestinationY = DestinationY;
        }

        public ushort CurrentMapID
        {
            get
            {
                return _CurrentMapID;
            }

            set
            {
                _CurrentMapID = value;
            }
        }
        public ushort CurrentX
        {
            get
            {
                return _CurrentX;
            }

            set
            {
                _CurrentX = value;
            }
        }
        public ushort CurrentY
        {
            get
            {
                return _CurrentY;
            }

            set
            {
                _CurrentY = value;
            }
        }
        public ushort DestinationMapID
        {
            get
            {
                return _DestinationMapID;
            }

            set
            {
                _DestinationMapID = value;
            }
        }
        public ushort DestinationX
        {
            get
            {
                return _DestinationX;
            }

            set
            {
                _DestinationX = value;
            }
        }
        public ushort DestinationY
        {
            get
            {
                return _DestinationY;
            }

            set
            {
                _DestinationY = value;
            }
        }
    }
}

3) In Database/Database.cs add the following code.
Code:
public static void LoadPortals()
        {
            string[] Portals = File.ReadAllLines(DatabasePath + @"\Misc\Portals.ini");
            for (int i = 0; i < Portals.Length; i++)
            {
                string[] Portal = Portals[i].Split(' ');

                IPortal portal = new Portal();
                portal.CurrentX = Convert.ToUInt16(Portal[0]);
                portal.CurrentY = Convert.ToUInt16(Portal[1]);
                portal.CurrentMapID = Convert.ToUInt16(Portal[2]);
                portal.DestinationX = Convert.ToUInt16(Portal[3]);
                portal.DestinationY = Convert.ToUInt16(Portal[4]);
                portal.DestinationMapID = Convert.ToUInt16(Portal[5]);

                if (!Kernel.Portals.ContainsKey(portal.CurrentX.ToString() + portal.CurrentY.ToString() + portal.CurrentMapID.ToString()))
                    Kernel.Portals.Add(portal.CurrentX.ToString() + portal.CurrentY.ToString() + portal.CurrentMapID.ToString(), portal);
                else
                    Console.WriteLine(portal.CurrentX.ToString() + " " + portal.CurrentY.ToString() + " " + portal.CurrentMapID.ToString());
            }
            Console.WriteLine("Portals Loaded");
        }
4) In Server Base Code/Kernel.cs add a new Dictionary to the Kernel class.
Code:
public static Dictionary<string, IPortal> Portals = new Dictionary<string, IPortal>();
5) In Program.cs, in the class Main() under Database.LoadDatabase(); add.
Code:
Database.LoadPortals();
6) In Networking/Packets/Data Packet.cs add a new const ushort.
Code:
Portal = 85,
7) In Networking/PacketProcessor.cs in the void Process, under the case 1010 add.
Code:
case DataPacket.Portal:
                                Portal(Client, cPacket);
                                break;
8) In Networking/PacketProcessor.cs add the following code to the PacketProcessor class.
Code:
public static void Portal(GameClient Client, DataPacket Packet)
        {
            ushort portal_X = (ushort)(Packet.dwParam & 0xFFFF);
            ushort portal_Y = (ushort)(Packet.dwParam >> 16);

            string portal_ID = portal_X.ToString() + portal_Y.ToString() + Client.Entity.MapID.ToString();

            if (Kernel.Portals.ContainsKey(portal_ID))
            {
                Console.WriteLine("Portal {0}, {1}, {2}", portal_X, portal_Y, Client.Entity.MapID);

                if (Kernel.GetDistance(portal_X, portal_Y, Client.Entity.X, Client.Entity.Y) <= 1)
                {
                    Packet.ID = DataPacket.SetLocation;
                    Packet.UID = Client.Entity.UID;
                    Packet.dwParam = Kernel.Portals[portal_ID].DestinationMapID;
                    Packet.wParam1 = Kernel.Portals[portal_ID].DestinationX;
                    Packet.wParam2 = Kernel.Portals[portal_ID].DestinationY;

                    Client.Entity.MapID = Kernel.Portals[portal_ID].DestinationMapID;
                    Client.Entity.X = Kernel.Portals[portal_ID].DestinationX;
                    Client.Entity.Y = Kernel.Portals[portal_ID].DestinationY;

                    Client.Send(Packet);

                    Client.Screen.Reload(true,
                    delegate(IBaseEntity Sender, IBaseEntity Caller)
                    {
                        if (Caller.EntityFlag == EntityFlag.Player &&
                            Sender.EntityFlag == EntityFlag.Player)
                        {
                            GameClient __Client = Caller.Owner as GameClient;
                            __Client.Send(Client.Entity.SpawnPacket);
                        }
                        return 0;
                    }
                );
                }
                else
                    Client.Socket.Disconnect(); // INVALID_PORTAL (No Such Portal)


            }
            else
            {
                Console.WriteLine("Invailed Portal {0}, {1}, {2}", portal_X, portal_Y, Client.Entity.MapID);
                Client.Socket.Disconnect(); // INVALID_PORTAL (No Such Portal)
            }
        }
9) Finally you'll need the portal database. Download the Portals.rar that I've included and place it into Database/Misc
Hi,
I have a problem, I added the following code, and finally I have two errors:

And:

Thank for the help
jitus2 is offline  
Old 10/06/2012, 20:47   #342
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Please post the screenshot error messages into English. Thanks.
_DreadNought_ is offline  
Old 10/06/2012, 21:06   #343


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by _DreadNought_ View Post
Please post the screenshot error messages into English. Thanks.
1. The namespace «ConquerServer_Basic» already contains a definition for «Portal».
2. The name «cPacket» doesn't exist in the current context.
CptSky is offline  
Thanks
1 User
Old 10/08/2012, 16:59   #344
 
elite*gold: 0
Join Date: Jan 2010
Posts: 54
Received Thanks: 6
Help please...
two errors after added code portal
1. The namespace «ConquerServer_Basic» already contains a definition for «Portal».
2. The name «cPacket» doesn't exist in the current context.
jitus2 is offline  
Old 10/08/2012, 17:27   #345


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by jitus2 View Post
Help please...
two errors after added code portal
1. The namespace «ConquerServer_Basic» already contains a definition for «Portal».
2. The name «cPacket» doesn't exist in the current context.
Tu considères pas que les erreurs sont assez explicites ?

La classe « Portal » est déjà définie dans le projet (sachant qu'il n'y a qu'un seul nom d'espace). Donc, logiquement, tu as ajouté le code pour les portails, mais, tu n'as pas remplacé/enlevé l'ancien.

Le nom « cPacket » n'existe pas. Il te manque quelque chose... Cherche un peu, ça devrait pas être trop compliqué.

-----

Common, the errors aren't enough explicit ?

The class "Portal" is already defined in the project (knowing that there is only one namespace). So, logically, you added the code for the portals, but, you didn't replace/remove the old one.

The name "cPacket" doesn't exist. Something is missing. Search a bit, and you should find how to fix it... It's not complicated...
CptSky is offline  
Closed Thread


Similar Threads Similar Threads
[Huge-Release] All-In-One Basic NPC Scripts For The 5165 Source!
02/19/2010 - CO2 PServer Guides & Releases - 30 Replies
Well I'm sorry that I spammed the whole forum full of my posts So pro4never and .Ryu gave me the idea of making this All-In-One thread about all my NPC's! THESE ARE UPDATED DAILY! NOTE: TO PEOPLE... SOME OF THE CODES ARE NOT MADE BY ME! I USUALLY JUST FIXED/UPDATED THE BASIC ONES! SORRY I'M LEARNING ON HOW TO CODE! 1. Birth-Island-NPC's(The NPC text is not from "REAL CONQUER" SORRY!...) #region BirthOldGeneralYang case 425: {
[FINAL RELEASE]HuB- Source (BASIC) (Original LOTF easier workable)
11/14/2009 - CO2 PServer Guides & Releases - 25 Replies
#REMOVED
[RELEASE] Basic LOTF Source
09/03/2009 - CO2 PServer Guides & Releases - 17 Replies
hey this is a basic lotf source edited based off shadowco, if you dont like it then dont post here... flames will be told on!!! :D i will tell on you to the mods if you flame What it has... - LuckyTime - Guard - 24/7 GW



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


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.