Register for your free account! | Forgot your password?

You last visited: Today at 12:24

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

Advertisement



[RELEASE]More DMaps

Discussion on [RELEASE]More DMaps within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
[RELEASE]More DMaps

This for tanels 5165 source
Replace your DMap.cs with this:
Code:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

namespace CoSX
{
    public class DMaps
    {
        public static int DMapsLoaded = 0;
        /*DMAP LIST*/ public static ArrayList MapsNeeded = new ArrayList() { 1019, 700, 1020, 1021, 1025, 1026, 1027, 1028, 5000, 1037, 1039, 1040, 1041, 1060, 1061, 1062, 1064, 1082, 1098, 1099, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1201, 1202, 1203, 1204, 1205, 1206, 1207, 1208, 1209, 1210, 1211, 1212, 1213, 1214, 1215, 1216, 1505, 1506, 1507, 1508, 1509, 1550, 1551, 2021, 2022, 2023, 2024, 1730, 1731, 1732, 1733, 1734, 1735, 1736, 1737, 1738, 700, 1070, 1075, 1076, 1077, 1078, 1079, 1090, 1091, 1080, 1081, 1050, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1006, 1007, 1008, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, 6001, 6000, 1018, 1005, 1038, 1000, 1001, 1002, 1036, 1037, 1039, 1011, 1015, 1020, 1028, 1785 };
        public static Hashtable H_DMaps = new Hashtable();
        public static bool Loaded = false;
        public static void Load()
        {
            if (Directory.Exists(Program.ConquerPath))
            {
                int Maps = 0;
                uint Time = Native.timeGetTime();
                Program.WriteLine("Starting to load DMaps.");
                FileStream FS = new FileStream(Program.ConquerPath + @"ini\GameMap.dat", FileMode.Open);
                BinaryReader BR = new BinaryReader(FS);

                uint MapCount = BR.ReadUInt32();
                for (uint i = 0; i < MapCount; i++)
                {
                    ushort MapID = (ushort)BR.ReadUInt32();
                    string Path = Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadInt32()));
                    if (MapsNeeded.Contains((int)MapID))
                    {
                        DMap D = new DMap(MapID, Path);
                        H_DMaps.Add(MapID, D);
                        Maps += 1;
                    }
                    BR.ReadInt32();
                }
                BR.Close();
                FS.Close();
                Loaded = true;
                DMapsLoaded = Maps;
                Program.WriteLine("Total DMaps: " + DMapsLoaded);
                Program.WriteLine("DMaps loaded successfully in " + (Native.timeGetTime() - Time) + " milliseconds.");
            }
            else
                Program.WriteLine("The specified Conquer Online folder doesn't exist. DMaps couldn't be loaded.");
        }
    }
    public struct DMapCell
    {
        private Boolean _noAccess;
        public Boolean High;
        public DMapCell(Boolean noAccess)
        {
            _noAccess = noAccess;
            High = false;
        }

        public Boolean NoAccess
        {
            get
            {
                return _noAccess;
            }

            internal set
            {
                _noAccess = value;
            }
        }
    }
    public class DMap
    {
        private Int32 Width;
        private Int32 Height;
        private DMapCell[,] Cells;

        public DMap(ushort MapID, string Path)
        {
            Program.WriteLine("Loading " + MapID.ToString() + " : " + Program.ConquerPath + Path + "");
            if (File.Exists(Program.ConquerPath + Path))
            {
                FileStream FS = new FileStream(Program.ConquerPath + Path, FileMode.Open);
                BinaryReader BR = new BinaryReader(FS);
                BR.ReadBytes(268);
                Width = BR.ReadInt32();
                Height = BR.ReadInt32();
                Cells = new DMapCell[Width, Height];

                byte[] cell_data = BR.ReadBytes(((6 * Width) + 4) * Height);
                int offset = 0;

                for (int y = 0; y < Width; y++)
                {
                    for (int x = 0; x < Height; x++)
                    {
                        Boolean noAccess = BitConverter.ToBoolean(cell_data, offset) != false;

                        if (MapID == 1002)
                        {
                            if (x >= 606 && x <= 641)
                                if (y >= 674 && y <= 680)
                                    noAccess = false;
                            if (x >= 148 && x <= 194)
                                if (y >= 541 && y <= 546)
                                    noAccess = false;
                        }
                        Cells[x, y] = new DMapCell(noAccess);
                        if (MapID == 1038)
                        {
                            if (x <= 119)
                                Cells[x, y].High = true;
                            if (x >= 120 && x <= 216 && y <= 210)
                                Cells[x, y].High = true;
                        }
                        offset += 6;

                    }
                    offset += 4;
                }
                BR.Close();
                FS.Close();
            }
        }

        public DMapCell GetCell(ushort X, ushort Y)
        {
            return Cells[X, Y];
        }
    }
}
done
.Summer is offline  
Old 06/13/2010, 06:32   #2
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
And whats the difference between this and the original version?
Arcо is offline  
Old 06/13/2010, 06:42   #3
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
just loading more LOL.
the other loads like 10dmaps.
this loads 101.
.Summer is offline  
Old 06/13/2010, 06:50   #4
 
zblowfish's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 130
Received Thanks: 18
Quote:
Originally Posted by .Summer View Post
just loading more LOL.
the other loads like 10dmaps.
this loads 101.
So instead of just posting the dmaps you added you want us to change the whole code?
zblowfish is offline  
Old 06/13/2010, 06:51   #5
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
was easier, then explain.
.Summer is offline  
Old 06/13/2010, 06:51   #6
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304

Just have them replace the line
Code:
public static ArrayList MapsNeeded
Why with all the pointlessness in your releases.
Another way to load more dmaps is to take out the mapsneeded check..
then you load all the dmaps.
Arcо is offline  
Old 06/13/2010, 06:53   #7
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
Quote:
Originally Posted by .Arco View Post

Just have them replace the line
Code:
public static ArrayList MapsNeeded
Why with all the pointlessness in your releases.
Another way to load more dmaps is to take out the mapsneeded check..
then you load all the dmaps.
True
.Summer is offline  
Old 06/13/2010, 06:55   #8
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
I think I may request a close on this.
This is just desperate for thanks.
Pretty much already released, but you did it the time consuming way.
Arcо is offline  
Thanks
1 User
Old 06/13/2010, 06:57   #9
 
elite*gold: 0
Join Date: May 2010
Posts: 630
Received Thanks: 130
Is not a re release, wich cant be closed, then cuz no rules breaked.
just a useless release LOL :P
but anyway i got no interest in it
.Summer is offline  
Old 06/13/2010, 08:39   #10
 
Huseby's Avatar
 
elite*gold: 106
Join Date: Oct 2006
Posts: 6,047
Received Thanks: 1,165
Even if it is pointless, its no reason to close it, =p.
Huseby is offline  
Old 06/13/2010, 18:21   #11


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Its an even more long-winded way of loading all dmaps, Yuki's original release is definately the simplest and most efficient way with minimal changes to the source code.

So im classing this as a re-release.

#Closed.
Korvacs is offline  
Thanks
2 Users
Closed Thread


Similar Threads Similar Threads
[Release]Load All Dmaps (5165)
11/15/2010 - CO2 PServer Guides & Releases - 19 Replies
As everyone releases shit like that ime give it a shot: Go to Dmap.cs and find if (MapsNeeded.Contains((int)MapID)) { DMap D = new DMap(MapID, Path); H_DMaps.Add(MapID, D); }
Dmaps
02/23/2010 - CO2 Private Server - 10 Replies
I have serious no clue how to make the dmaps in 5017 lotf =D. Anyone have the codes or can give me a hint? :handsdown:
DMaps
06/21/2005 - Conquer Online 2 - 1 Replies
Could someone attach some of their modified maps please? Thanks!
Dmaps which 1's are which
06/04/2005 - Conquer Online 2 - 7 Replies
does anyone have like a list of what map belongs to which .Dmap file(s), or is there any ways to find out that?



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


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.