Register for your free account! | Forgot your password?

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

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

Advertisement



[Development] 5018 Conquer Server Source

Discussion on [Development] 5018 Conquer Server Source within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
[Development] 5018 Conquer Server Source

deleted by request.
~Yuki~ is offline  
Thanks
1 User
Old 07/18/2010, 11:48   #2
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
#Reserved
~Yuki~ is offline  
Old 07/18/2010, 11:52   #3
 
elite*gold: 0
Join Date: Jan 2010
Posts: 84
Received Thanks: 13
nice , you wiLL reLease?
furkan141415 is offline  
Old 07/18/2010, 11:56   #4
 
elite*gold: 0
Join Date: Oct 2009
Posts: 768
Received Thanks: 550
Quote:
Originally Posted by ~Yuki~ View Post
Tell me wich Database type you would prefer
MySQL
PGSQL
Binary
Or tell me others...
MySQL properly configured that's managed by Subsonic within the C# source.
-impulse- is offline  
Old 07/18/2010, 12:26   #5
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
Quote:
Originally Posted by -impulse- View Post
MySQL properly configured that's managed by Subsonic within the C# source.
_Emme_ is offline  
Old 07/18/2010, 12:29   #6
 
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
Yeah, Go with mysql.
MonstersAbroad is offline  
Old 07/18/2010, 12:50   #7


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
MsSql, or why not do a few databases and have an option to determine which database type you wish to use.
Korvacs is offline  
Old 07/18/2010, 12:57   #8
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
why would i implement more if im only using one
~Yuki~ is offline  
Old 07/18/2010, 13:00   #9


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by ~Yuki~ View Post
why would i implement more if im only using one
Because i beleive you stated that you might release it, and many people have different oppinions of what is a good database, so why not give them the choice of which they want to use?
Korvacs is offline  
Old 07/18/2010, 13:04   #10
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
Well true. Soo MySQL will be included, but what else? FlatFile? any fast classes?
~Yuki~ is offline  
Old 07/18/2010, 13:18   #11
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
Go with subsonic, srsly. I'll help ya if you get stuck
_Emme_ is offline  
Thanks
1 User
Old 07/18/2010, 14:50   #12
 
elite*gold: 0
Join Date: May 2006
Posts: 297
Received Thanks: 58
MySql would probebly the cleanest.
And easy 2 handle.

Goodluck Yuki!!!
pintser is offline  
Old 07/18/2010, 15:12   #13


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Quote:
Originally Posted by EmmeTheCoder View Post
Go with subsonic, srsly. I'll help ya if you get stuck
Can you post some examples of Subsonic and some speed tests?
Korvacs is offline  
Old 07/18/2010, 15:30   #14
 
elite*gold: 0
Join Date: May 2010
Posts: 298
Received Thanks: 57
Here's subsonic querying
Code:
//find a single product by ID
var product = Product.SingleOrDefault(x => x.ProductID == 1);
 
//get a list of products based on some criteria
var products = Product.Find(x => x.ProductID <= 10);
 
//get a list of server-side paged products
var products = Product.GetPaged(0,10);
 
//query using Linq
var products = from p in Product.All()
          join od in OrderDetail.All() on p.ProductID equals od.ProductID
          select p;
MonstersAbroad is offline  
Old 07/18/2010, 15:52   #15
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,162
Quote:
Originally Posted by Korvacs View Post
Can you post some examples of Subsonic and some speed tests?
It autogenerates the queries, so basically all you have to do is call the autogenerated class and spawn a new class and direct it values to the database values.

Example (Load NPCs)

Code:
public static void LoadNPCs()
        {
            NpcspawnCollection npcs = new NpcspawnCollection();
            npcs.LoadAndCloseReader(Npcspawn.FetchAll());
            for (int x = 0; x < npcs.Count; x++)
            {
                Npc npc = new Npc();
                npc.UID = (uint)npcs[x].Id;
                npc.Facing = (ConquerAngle)npcs[x].Direction;
                npc.Type = (ushort)npcs[x].Type;
                npc.MapID = (Maps)npcs[x].MapID;
                npc.MapObjType = MapObjectType.Npc;
                npc.X = (ushort)npcs[x].X;
                npc.Y = (ushort)npcs[x].Y;
                npc.Status = (Flags)npcs[x].Status;
                npc.Owner = npc;
                if (Kernel.Maps.ContainsKey((uint)npc.MapID))
                {
                    if (Kernel.Maps[(uint)npc.MapID].ContainsKey(FileIO.DMap.Map.coordinates))
                    {
                    AddNPC:
                        if (Kernel.Objects.ContainsKey(npc.MapID))
                        {
                            Kernel.Objects[npc.MapID].Add(npc);
                        }
                        else
                        {
                            QuadTree<IMapObject> tree = new QuadTree<IMapObject>(new System.Drawing.Rectangle(0, 0, (Kernel.Maps[(uint)npc.MapID][Map.coordinates] as MapCoordinate).Width, (Kernel.Maps[(uint)npc.MapID][FileIO.DMap.Map.coordinates] as MapCoordinate).Height));
                            Kernel.Objects.Add(npc.MapID, tree);
                            goto AddNPC;
                        }
                    }
                }
            }
            IConsole.WriteLine(string.Format(" NPCs: {0}", npcs.Count), ConsoleColor.Cyan);
        }


If intresting, here's the autogenerated code:


Code:
using System; 
using System.Text; 
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration; 
using System.Xml; 
using System.Xml.Serialization;
using SubSonic; 
using SubSonic.Utilities;
namespace Server.Conquer.DAL
{
	/// <summary>
	/// Strongly-typed collection for the Npcspawn class.
	/// </summary>
    [Serializable]
	public partial class NpcspawnCollection : ActiveList<Npcspawn, NpcspawnCollection>
	{	   
		public NpcspawnCollection() {}
        
        /// <summary>
		/// Filters an existing collection based on the set criteria. This is an in-memory filter
		/// Thanks to developingchris for this!
        /// </summary>
        /// <returns>NpcspawnCollection</returns>
		public NpcspawnCollection Filter()
        {
            for (int i = this.Count - 1; i > -1; i--)
            {
                Npcspawn o = this[i];
                foreach (SubSonic.Where w in this.wheres)
                {
                    bool remove = false;
                    System.Reflection.PropertyInfo pi = o.GetType().GetProperty(w.ColumnName);
                    if (pi.CanRead)
                    {
                        object val = pi.GetValue(o, null);
                        switch (w.Comparison)
                        {
                            case SubSonic.Comparison.Equals:
                                if (!val.Equals(w.ParameterValue))
                                {
                                    remove = true;
                                }
                                break;
                        }
                    }
                    if (remove)
                    {
                        this.Remove(o);
                        break;
                    }
                }
            }
            return this;
        }
		
		
	}
	/// <summary>
	/// This is an ActiveRecord class which wraps the npcspawns table.
	/// </summary>
	[Serializable]
	public partial class Npcspawn : ActiveRecord<Npcspawn>, IActiveRecord
	{
		#region .ctors and Default Settings
		
		public Npcspawn()
		{
		  SetSQLProps();
		  InitSetDefaults();
		  MarkNew();
		}
		
		private void InitSetDefaults() { SetDefaults(); }
		
		public Npcspawn(bool useDatabaseDefaults)
		{
			SetSQLProps();
			if(useDatabaseDefaults)
				ForceDefaults();
			MarkNew();
		}
        
		public Npcspawn(object keyID)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByKey(keyID);
		}
		 
		public Npcspawn(string columnName, object columnValue)
		{
			SetSQLProps();
			InitSetDefaults();
			LoadByParam(columnName,columnValue);
		}
		
		protected static void SetSQLProps() { GetTableSchema(); }
		
		#endregion
		
		#region Schema and Query Accessor	
		public static Query CreateQuery() { return new Query(Schema); }
		public static TableSchema.Table Schema
		{
			get
			{
				if (BaseSchema == null)
					SetSQLProps();
				return BaseSchema;
			}
		}
		
		private static void GetTableSchema() 
		{
			if(!IsSchemaInitialized)
			{
				//Schema declaration
				TableSchema.Table schema = new TableSchema.Table("npcspawns", TableType.Table, DataService.GetInstance("Unknown_Server"));
				schema.Columns = new TableSchema.TableColumnCollection();
				schema.SchemaName = @"";
				//columns
				
				TableSchema.TableColumn colvarUid = new TableSchema.TableColumn(schema);
				colvarUid.ColumnName = "UID";
				colvarUid.DataType = DbType.Int64;
				colvarUid.MaxLength = 8;
				colvarUid.AutoIncrement = false;
				colvarUid.IsNullable = false;
				colvarUid.IsPrimaryKey = true;
				colvarUid.IsForeignKey = false;
				colvarUid.IsReadOnly = false;
				colvarUid.DefaultSetting = @"";
				colvarUid.ForeignKeyTableName = "";
				schema.Columns.Add(colvarUid);
				
				TableSchema.TableColumn colvarId = new TableSchema.TableColumn(schema);
				colvarId.ColumnName = "ID";
				colvarId.DataType = DbType.Int64;
				colvarId.MaxLength = 8;
				colvarId.AutoIncrement = false;
				colvarId.IsNullable = false;
				colvarId.IsPrimaryKey = false;
				colvarId.IsForeignKey = false;
				colvarId.IsReadOnly = false;
				colvarId.DefaultSetting = @"";
				colvarId.ForeignKeyTableName = "";
				schema.Columns.Add(colvarId);
				
				TableSchema.TableColumn colvarMapID = new TableSchema.TableColumn(schema);
				colvarMapID.ColumnName = "MapID";
				colvarMapID.DataType = DbType.Int32;
				colvarMapID.MaxLength = 4;
				colvarMapID.AutoIncrement = false;
				colvarMapID.IsNullable = false;
				colvarMapID.IsPrimaryKey = false;
				colvarMapID.IsForeignKey = false;
				colvarMapID.IsReadOnly = false;
				colvarMapID.DefaultSetting = @"";
				colvarMapID.ForeignKeyTableName = "";
				schema.Columns.Add(colvarMapID);
				
				TableSchema.TableColumn colvarX = new TableSchema.TableColumn(schema);
				colvarX.ColumnName = "X";
				colvarX.DataType = DbType.Int16;
				colvarX.MaxLength = 2;
				colvarX.AutoIncrement = false;
				colvarX.IsNullable = false;
				colvarX.IsPrimaryKey = false;
				colvarX.IsForeignKey = false;
				colvarX.IsReadOnly = false;
				colvarX.DefaultSetting = @"";
				colvarX.ForeignKeyTableName = "";
				schema.Columns.Add(colvarX);
				
				TableSchema.TableColumn colvarY = new TableSchema.TableColumn(schema);
				colvarY.ColumnName = "Y";
				colvarY.DataType = DbType.Int16;
				colvarY.MaxLength = 2;
				colvarY.AutoIncrement = false;
				colvarY.IsNullable = false;
				colvarY.IsPrimaryKey = false;
				colvarY.IsForeignKey = false;
				colvarY.IsReadOnly = false;
				colvarY.DefaultSetting = @"";
				colvarY.ForeignKeyTableName = "";
				schema.Columns.Add(colvarY);
				
				TableSchema.TableColumn colvarType = new TableSchema.TableColumn(schema);
				colvarType.ColumnName = "Type";
				colvarType.DataType = DbType.Int32;
				colvarType.MaxLength = 4;
				colvarType.AutoIncrement = false;
				colvarType.IsNullable = false;
				colvarType.IsPrimaryKey = false;
				colvarType.IsForeignKey = false;
				colvarType.IsReadOnly = false;
				colvarType.DefaultSetting = @"";
				colvarType.ForeignKeyTableName = "";
				schema.Columns.Add(colvarType);
				
				TableSchema.TableColumn colvarDirection = new TableSchema.TableColumn(schema);
				colvarDirection.ColumnName = "Direction";
				colvarDirection.DataType = DbType.Int32;
				colvarDirection.MaxLength = 4;
				colvarDirection.AutoIncrement = false;
				colvarDirection.IsNullable = false;
				colvarDirection.IsPrimaryKey = false;
				colvarDirection.IsForeignKey = false;
				colvarDirection.IsReadOnly = false;
				colvarDirection.DefaultSetting = @"";
				colvarDirection.ForeignKeyTableName = "";
				schema.Columns.Add(colvarDirection);
				
				TableSchema.TableColumn colvarStatus = new TableSchema.TableColumn(schema);
				colvarStatus.ColumnName = "Status";
				colvarStatus.DataType = DbType.Int32;
				colvarStatus.MaxLength = 4;
				colvarStatus.AutoIncrement = false;
				colvarStatus.IsNullable = false;
				colvarStatus.IsPrimaryKey = false;
				colvarStatus.IsForeignKey = false;
				colvarStatus.IsReadOnly = false;
				colvarStatus.DefaultSetting = @"";
				colvarStatus.ForeignKeyTableName = "";
				schema.Columns.Add(colvarStatus);
				
				BaseSchema = schema;
				//add this schema to the provider
				//so we can query it later
				DataService.Providers["Unknown_Server"].AddSchema("npcspawns",schema);
			}
		}
		#endregion
		
		#region Props
		  
		[XmlAttribute("Uid")]
		[Bindable(true)]
		public long Uid 
		{
			get { return GetColumnValue<long>(Columns.Uid); }
			set { SetColumnValue(Columns.Uid, value); }
		}
		  
		[XmlAttribute("Id")]
		[Bindable(true)]
		public long Id 
		{
			get { return GetColumnValue<long>(Columns.Id); }
			set { SetColumnValue(Columns.Id, value); }
		}
		  
		[XmlAttribute("MapID")]
		[Bindable(true)]
		public int MapID 
		{
			get { return GetColumnValue<int>(Columns.MapID); }
			set { SetColumnValue(Columns.MapID, value); }
		}
		  
		[XmlAttribute("X")]
		[Bindable(true)]
		public short X 
		{
			get { return GetColumnValue<short>(Columns.X); }
			set { SetColumnValue(Columns.X, value); }
		}
		  
		[XmlAttribute("Y")]
		[Bindable(true)]
		public short Y 
		{
			get { return GetColumnValue<short>(Columns.Y); }
			set { SetColumnValue(Columns.Y, value); }
		}
		  
		[XmlAttribute("Type")]
		[Bindable(true)]
		public int Type 
		{
			get { return GetColumnValue<int>(Columns.Type); }
			set { SetColumnValue(Columns.Type, value); }
		}
		  
		[XmlAttribute("Direction")]
		[Bindable(true)]
		public int Direction 
		{
			get { return GetColumnValue<int>(Columns.Direction); }
			set { SetColumnValue(Columns.Direction, value); }
		}
		  
		[XmlAttribute("Status")]
		[Bindable(true)]
		public int Status 
		{
			get { return GetColumnValue<int>(Columns.Status); }
			set { SetColumnValue(Columns.Status, value); }
		}
		
		#endregion
		
		
			
		
		//no foreign key tables defined (0)
		
		
		
		//no ManyToMany tables defined (0)
		
        
        
		#region ObjectDataSource support
		
		
		/// <summary>
		/// Inserts a record, can be used with the Object Data Source
		/// </summary>
		public static void Insert(long varUid,long varId,int varMapID,short varX,short varY,int varType,int varDirection,int varStatus)
		{
			Npcspawn item = new Npcspawn();
			
			item.Uid = varUid;
			
			item.Id = varId;
			
			item.MapID = varMapID;
			
			item.X = varX;
			
			item.Y = varY;
			
			item.Type = varType;
			
			item.Direction = varDirection;
			
			item.Status = varStatus;
			
		
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		
		/// <summary>
		/// Updates a record, can be used with the Object Data Source
		/// </summary>
		public static void Update(long varUid,long varId,int varMapID,short varX,short varY,int varType,int varDirection,int varStatus)
		{
			Npcspawn item = new Npcspawn();
			
				item.Uid = varUid;
			
				item.Id = varId;
			
				item.MapID = varMapID;
			
				item.X = varX;
			
				item.Y = varY;
			
				item.Type = varType;
			
				item.Direction = varDirection;
			
				item.Status = varStatus;
			
			item.IsNew = false;
			if (System.Web.HttpContext.Current != null)
				item.Save(System.Web.HttpContext.Current.User.Identity.Name);
			else
				item.Save(System.Threading.Thread.CurrentPrincipal.Identity.Name);
		}
		#endregion
        
        
        
        #region Typed Columns
        
        
        public static TableSchema.TableColumn UidColumn
        {
            get { return Schema.Columns[0]; }
        }
        
        
        
        public static TableSchema.TableColumn IdColumn
        {
            get { return Schema.Columns[1]; }
        }
        
        
        
        public static TableSchema.TableColumn MapIDColumn
        {
            get { return Schema.Columns[2]; }
        }
        
        
        
        public static TableSchema.TableColumn XColumn
        {
            get { return Schema.Columns[3]; }
        }
        
        
        
        public static TableSchema.TableColumn YColumn
        {
            get { return Schema.Columns[4]; }
        }
        
        
        
        public static TableSchema.TableColumn TypeColumn
        {
            get { return Schema.Columns[5]; }
        }
        
        
        
        public static TableSchema.TableColumn DirectionColumn
        {
            get { return Schema.Columns[6]; }
        }
        
        
        
        public static TableSchema.TableColumn StatusColumn
        {
            get { return Schema.Columns[7]; }
        }
        
        
        
        #endregion
		#region Columns Struct
		public struct Columns
		{
			 public static string Uid = @"UID";
			 public static string Id = @"ID";
			 public static string MapID = @"MapID";
			 public static string X = @"X";
			 public static string Y = @"Y";
			 public static string Type = @"Type";
			 public static string Direction = @"Direction";
			 public static string Status = @"Status";
						
		}
		#endregion
		
		#region Update PK Collections
		
        #endregion
    
        #region Deep Save
		
        #endregion
	}
}

You should also know that entity framework is a bit faster than Subsonic, but querying has never been easier while using Subsonic, and it can handle a great deal of information without crashing
_Emme_ is offline  
Closed Thread


Similar Threads Similar Threads
[Development] Conquer Source Toolkit
09/05/2010 - CO2 Private Server - 22 Replies
#REMOVED. Do not re-release this please.
[Development] 4267 conquer server.
06/16/2010 - CO2 Private Server - 408 Replies
Heya, I've started a new development for a classic co server as I never saw one succesfull build up with a from scratch written and not leeched source. We're currently aiming to add-in bot protection, proxy detection and various protections to prevent hacking. So let's talk more about the source itsself, It's made from scratch and self written socket system, database handling is currently flatfile based. The loginserver is done but we're working on the gameserver now. (Will be...



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


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.