|
You last visited: Today at 01:53
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.
06/15/2009, 08:02
|
#166
|
elite*gold: 0
Join Date: May 2008
Posts: 1,769
Received Thanks: 1,143
|
No idea, never used this source.
|
|
|
06/15/2009, 08:36
|
#167
|
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
|
|
|
06/15/2009, 09:13
|
#168
|
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
|
|
|
06/15/2009, 09:24
|
#169
|
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
|
yea maybe =/ you should have alook at it =P
|
|
|
06/16/2009, 00:58
|
#170
|
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
|
|
|
06/16/2009, 08:29
|
#171
|
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?
|
|
|
06/16/2009, 08:46
|
#172
|
elite*gold: 20
Join Date: Apr 2008
Posts: 2,281
Received Thanks: 913
|
Quote:
Originally Posted by ih8you
So even console commands go in commands.cs. like .close will close the server even if its it commands?
|
No.
|
|
|
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;
}
|
|
|
06/16/2009, 14:02
|
#174
|
elite*gold: 0
Join Date: May 2008
Posts: 146
Received Thanks: 38
|
Quote:
Originally Posted by alexbigfoot
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
|
|
|
06/24/2009, 03:39
|
#175
|
elite*gold: 0
Join Date: Apr 2008
Posts: 39
Received Thanks: 0
|
what version is this server?
|
|
|
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
|
|
|
06/26/2009, 03:23
|
#177
|
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 518+ tho) hehe
#Merged
|
|
|
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
|
|
|
07/09/2009, 13:45
|
#179
|
elite*gold: 20
Join Date: Jun 2006
Posts: 3,296
Received Thanks: 925
|
Quote:
Originally Posted by biodrowski
*** 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.
|
|
|
07/10/2009, 10:45
|
#180
|
elite*gold: 0
Join Date: Jun 2009
Posts: 378
Received Thanks: 141
|
Quote:
Originally Posted by Kiyono
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. . .
|
|
|
 |
|
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.
|
|