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 01:53

  • 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 06/15/2009, 08:02   #166
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
No idea, never used this source.
Zeroxelli is offline  
Old 06/15/2009, 08:36   #167
 
ih8you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
fast reply.... Anyway Since i got it to work thanks to you I thought id make a console command that saves chars. i got this right now

Code:
}
        public static void Parse(GameClient Client, string From, string To, string Msg)
        {
            string[] args = Msg.Split(' ');
            args[0] = args[0].ToLower();

            switch (args[0])
            {
                case ".save": // First attampt
                    {
                        SaveCharacter(Client);
                        Console.WriteLine("Characters Have Been Saved");
                        break;
                    }
Where in Database.cs Do i put this
ih8you is offline  
Old 06/15/2009, 09:13   #168
 
Zeroxelli's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
Again, don't know the source. I'd assume PacketHandler, PacketParser, or ChatHandler would contain commands though
Zeroxelli is offline  
Old 06/15/2009, 09:24   #169
 
ih8you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
yea maybe =/ you should have alook at it =P
ih8you is offline  
Old 06/16/2009, 00:58   #170
 
LordSesshomaru's Avatar
 
elite*gold: 0
Join Date: Mar 2009
Posts: 48
Received Thanks: 15
If you are using Rev 3+ Commands are exucted through the Commands.cs. Anyone could see this plainly. Sorry for lack of helping having a full-time job and full time gf is hard to work on my source. Tho i broke off of hybrids base to my own base. I still implemented some of hybrids theories and Idea's.

Commands are handled in the Commands.cs file add you commands there example

Code:
      public static void Parse(GameClient Client, string From, string To, string Msg)
        {
            try
            {
                string[] args = Msg.Split(' ');
                args[0] = args[0].ToLower();

                CmdLog.WriteLine(Client.Entity.Name + ": " + Msg + " (" + DateTime.Now.ToString() + ")");
                CmdLog.Flush();

                switch (args[0])
                {
                    case "@heal":
                        {
                            Client.Entity.Hitpoints = Client.Entity.MaxHitpoints;
                            Sync.HP(Client);
                            break;
                        }
}
               case "@save":
                        {
                            Database.SaveCharacter(Client);
                            Message.Send(Client, "Character saved!", 0x00FFFFFF, MessagePacket.TopLeft);
                            break;
                        }
                    case "@scroll":
                        {
                            Client.PrevMap = Client.Entity.MapID;
                            switch (args[1].ToLower())
                            {
                                case "tc":
                                    Client.Teleport(1002, 431, 379);
                                    break;
                                case "pc":
                                    Client.Teleport(1011, 190, 271);
                                    break;
                                case "am":
                                    Client.Teleport(1020, 567, 576);
                                    break;
                                case "dc":
                                    Client.Teleport(1000, 500, 650);
                                    break;
                                case "bi":
                                    Client.Teleport(1015, 723, 573);
                                    break;
                                case "ma":
                                    Client.Teleport(1036, 200, 200);
                                    break;
                                case "arena":
                                    Client.Teleport(1005, 52, 69);
                                    break;
                            }
                            break;
                        }
                }
            }
            catch (Exception e)
            {
                Client.Send(new MessagePacket("[Command Error] " + e.Message, 0x00FF0000, MessagePacket.TopLeft));
                Console.WriteLine(e);
            }
        }
    }
}
If you dont have the command.cs file please download Rev3 or Tao's rev , You always want to use try-catch blocks with commands and things , The way a try-catch block works if some-thing goes wrong with the command or code it will catch the code meaning it will go to the catch and still continue with the code , Example for @item command
LordSesshomaru is offline  
Old 06/16/2009, 08:29   #171
 
ih8you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
So even console commands go in commands.cs. like .close will close the server even if its it commands?
ih8you is offline  
Old 06/16/2009, 08:46   #172
 
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
Quote:
Originally Posted by ih8you View Post
So even console commands go in commands.cs. like .close will close the server even if its it commands?
No.
kinshi88 is offline  
Old 06/16/2009, 09:20   #173
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
Commands.cs include only players commands, it has nothing to do with console's command. The commands for console goes where you set the Console.ReadLine(); statment and you can do it like

string Command = Console.ReadLine();
switch(Command.ToLower())
{
case "close": Enviroment.Exit(Enviroment.ExitCode); break;
case "sendmsg": foreach(GameClient Cl in Kernel.GamePool.Values)
{
Cl.Send(new MessagePacket("Hello everyone", 0,MessagePacket.Center));
}Console.ReadLine();break;
default: Console.ReadLine(); break;
}
alexbigfoot is offline  
Old 06/16/2009, 14:02   #174
 
ih8you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
Quote:
Originally Posted by alexbigfoot View Post
Commands.cs include only players commands, it has nothing to do with console's command. The commands for console goes where you set the Console.ReadLine(); statment and you can do it like

string Command = Console.ReadLine();
switch(Command.ToLower())
{
case "close": Enviroment.Exit(Enviroment.ExitCode); break;
case "sendmsg": foreach(GameClient Cl in Kernel.GamePool.Values)
{
Cl.Send(new MessagePacket("Hello everyone", 0,MessagePacket.Center));
}Console.ReadLine();break;
default: Console.ReadLine(); break;
}
Thanks, Im used to lotf. This is a change.

Oh and u made a typo at "Enviroment" should be Environment

will that close command save the characters
ih8you is offline  
Old 06/24/2009, 03:39   #175
 
elite*gold: 0
Join Date: Apr 2008
Posts: 39
Received Thanks: 0
what version is this server?
random321 is offline  
Old 06/24/2009, 08:07   #176
 
elite*gold: 0
Join Date: Sep 2007
Posts: 59
Received Thanks: 3
Carzy-X ana ba7bk walhhy we 3arf ank hats3den fe source 5095 bas u come back kalmny 3al al yahoo or 0171875404
khaledzorro1 is offline  
Old 06/26/2009, 03:23   #177
 
ImFlamedCOD's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 378
Received Thanks: 141
random 5017

Super BUMP!!!

PHP Code:
If anyone needs help coding with hybrids source please feel free to ask i would be more than willing to help you with anything not updating it to 518thohehe 
#Merged
ImFlamedCOD is offline  
Old 07/09/2009, 08:13   #178
 
elite*gold: 0
Join Date: Oct 2008
Posts: 11
Received Thanks: 0
*** why cant anyone one make a source that doesnt take some of my life away to set up a server and have friends play with out bugs is that too hard to ask
biodrowski is offline  
Old 07/09/2009, 13:45   #179

 
Kiyono's Avatar
 
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
Quote:
Originally Posted by biodrowski View Post
*** why cant anyone one make a source that doesnt take some of my life away to set up a server and have friends play with out bugs is that too hard to ask
Then get a crappy source like LOTF where everything more or less works.
Kiyono is offline  
Old 07/10/2009, 10:45   #180
 
ImFlamedCOD's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 378
Received Thanks: 141
Quote:
Originally Posted by Kiyono View Post
Then get a crappy source like LOTF where everything more or less works.
I agree 50 % , No source is perfect, and most certain no source is better or the best. I would have to say all source have a or are a diy self deal.(do it yourself) Why people do not understand the real importance of this, and the level of programing required for this is why people call them newbs.

If your going to complain , whine , or flame about something , you just wasted 2 minutes of you life , that you could have used more productively one progressing in something. . .
ImFlamedCOD 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 01:55.


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.