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 02:31

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

Advertisement



[Release] Getting/Writing correct strings

Discussion on [Release] Getting/Writing correct strings within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 773
Received Thanks: 441
[Release] Getting/Writing correct strings

Yo... simple way to fix chat/name strings:

BTW: I dunno if it was already posted here... so if it was ... sorry for the inconvenience :]

Code:
    public class StringPacker
    {
        public static string GetString(byte[] array, int offset, int count)
        {
            string pszWords = "";
            for (int x = offset; x < offset + count; x++)
            {
                if (x >= array.Length)
                    break;
                if (array[x] < 128)
                    pszWords += Convert.ToChar(array[x]);
                else
                    pszWords += Encoding.Unicode.GetString(
                        new byte[2] { array[x], 0 });
            }
            return pszWords;
        }
    }
excample using it on chat:
Code:
            int iPos = 26;
            pszSpeaker = StringPacker.GetString(iMsg, iPos, iMsg[25]); iPos = 27 + pszSpeaker.Length;
            pszHearer = StringPacker.GetString(iMsg, iPos, iMsg[iPos - 1]); iPos = 29 + pszSpeaker.Length + pszHearer.Length;
            pszWords = StringPacker.GetString(iMsg, iPos, iMsg[iPos - 1]);
example to write:

Code:
                    for (int i = 0; i < Args.Length; i++)
                        Buffer[(ushort)(i + Offset)] = (byte)Args[i];
cya!
12tails is offline  
Thanks
3 Users
Old 09/11/2011, 02:03   #2
 
.Beatz's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 1,190
Received Thanks: 516
Good release... As always 12tails
.Beatz is offline  
Old 09/11/2011, 08:55   #3
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
That... is so incredibly inefficient...
This thread needs to be deleted... that's such a bad example...
Spirited is offline  
Old 09/11/2011, 16:33   #4
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Why not just reverse the netStringPacker from euds source?... Makes it way, way simpler.

Example usages...

Code:
public string Speaker
        {
            get
            {
                string value;
                return StringPacker.GetString(0, out value) ? value : null;
            }
            set { StringPacker.SetString(0, value); }
        }

        public string Hearer
        {
            get
            {
                string value;
                return StringPacker.GetString(1, out value) ? value : null;
            }
            set { StringPacker.SetString(1, value); }
        }

        public string Emotion
        {
            get
            {
                string value;
                return StringPacker.GetString(2, out value) ? value : null;
            }
            set { StringPacker.SetString(2, value); }
        }

        public string Words
        {
            get
            {
                string value;
                return StringPacker.GetString(3, out value) ? value : null;
            }
            set { StringPacker.SetString(3, value); }
        }
It's lovely.


Tq strings have a counted number of strings. Net string packer is their own code they wrote to manage this system storing each string as its own string offset which lets you easily read, write or modify these strings.

Euds source is wonderful for finding all sorts of things like that.
pro4never is offline  
Thanks
2 Users
Old 09/11/2011, 16:56   #5
 
12tails's Avatar
 
elite*gold: 0
Join Date: Apr 2009
Posts: 773
Received Thanks: 441
i'm checking it right now :]
12tails is offline  
Reply


Similar Threads Similar Threads
[Release]S4Client Strings
07/24/2011 - S4 League Hacks, Bots, Cheats & Exploits - 23 Replies
Hallöchen ;3 Da ich gerade mit PE über das gepatchte S4 geschneit hab, will ich euch einfach mal die neue Stringlist geben... vielleicht ist ja was brauchbares dabei ;) Kleiner Ausschnitt: jdji jljejvjejl jejujljajvj_jejcjnjajhjc jnjojijtjijdjnjojcj_jtjcjejljejs jhjtjajejdj_jrjejpj_jljljijk jejujljajv jejrjojcjsj_jnjwjojdj_jhjcjujojt
Correct me if I'm wrong.
02/05/2010 - General Gaming Discussion - 0 Replies
Correct me if I'm wrong, but there aren't any working wonderspeed and zylon trainers now right?
Pa Correct nmn toh~
08/18/2008 - RF Online - 9 Replies
Sir..pa correct nmn sa makakabasa n2.. ung sinasabi po ng iba na sa Search lng mahahanap ung mga hacks na gusto ko... san ako mag Search d2 sa forums na toh oh sa iba?? pa correct ^^
correct me if i am wrong
11/24/2006 - Conquer Online 2 - 3 Replies
15k-exp per one scatter in lab 2k- exp per kill 15+2=17 now with exp pot 15+2=17x2=34k i never used exp pots before, please correct my calculation if iam wrong, and dont flame me



All times are GMT +2. The time now is 02:31.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.