Register for your free account! | Forgot your password?

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

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

Advertisement



Fluent NHibernate very strange manner.

Discussion on Fluent NHibernate very strange manner. within the CO2 Private Server forum part of the Conquer Online 2 category.

Closed Thread
 
Old   #1
 
badguy4you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 477
Received Thanks: 178
Fluent NHibernate very strange manner.

When i try to add a value to the database using

Code:
string charname = "Dan";
var account = new Account
{
    Username = charname
};
AccountRepository.Add(account);
It is added very normal

but when i try to add the value that i was read from the stream using

Code:
string charname = reader.ReadString(false, length + 1);
Console.WriteLine(charname);

 var account = new Account
 {
     Username = charname
 };
 AccountRepository.Add(account);
It adds a null value to the database although the printed line is just the string i want to add.
badguy4you is offline  
Old 10/17/2012, 20:48   #2
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,224
Received Thanks: 868
Obviously an error with the ReadString
_DreadNought_ is offline  
Thanks
1 User
Old 10/17/2012, 20:55   #3
 
badguy4you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 477
Received Thanks: 178
The read string is working fine i think because when i print the value i see it is the same what i expected

Example : when i send Hello the read string prints Hello
badguy4you is offline  
Old 10/17/2012, 21:06   #4
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,224
Received Thanks: 868
PM teamviewer ID/pass
_DreadNought_ is offline  
Thanks
1 User
Old 10/17/2012, 22:01   #5
 
Ultimation's Avatar
 
elite*gold: 0
Join Date: Mar 2005
Posts: 1,426
Received Thanks: 1,571
string username = new String(rdr.ReadChars(rdr.ReadByte()));
Ultimation is offline  
Thanks
1 User
Old 10/17/2012, 22:09   #6
 
badguy4you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 477
Received Thanks: 178
Quote:
Originally Posted by Ultimation View Post
string username = new String(rdr.ReadChars(rdr.ReadByte()));
Thanks to you and mainly for Dread who joined me with team viewer and found where the problem occures

The value was starting with \0 that was preventing the database from accepting it.

still don't know why this \0 is added to the value.
badguy4you is offline  
Thanks
1 User
Old 10/17/2012, 22:13   #7
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,224
Received Thanks: 868
Quote:
Originally Posted by badguy4you View Post
Thanks to you and mainly for Dread who joined me with team viewer and found where the problem occures

The value was starting with \0 that was preventing the database from accepting it.

still don't know why this \0 is added to the value.
I deserve just as much credit for helping you as Ultimation does for that code. Should be honored he even visited this forum :P besides, he showed me basically everything I used to help you narrow down the problem.

If you implement a variation of the code he gave you it will work fine.
_DreadNought_ is offline  
Thanks
1 User
Old 10/17/2012, 22:20   #8
 
badguy4you's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 477
Received Thanks: 178
Ofcourse Ultimation is one of the members i really appreciate here alot besides you Dread. so back to the topic i think just to take it the easy way i'll add the value \0 to my database escaping function so it gets replaced automatically.

I really searched my code very well and i don't see any reason for that \0 before the input.

then i simply do that

Code:
            var account = new Account
            {
                Username = Escape.Cut(charname),
                Password = "B",
                RegDate = "C",
                Email = "D",
                Sq = "E",
                Sa = "F",
                Status = 0,
                SessionHash = 0
            };
badguy4you is offline  
Old 10/17/2012, 22:44   #9
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,224
Received Thanks: 868
If that works for you then do it, Though that's not fixing the root problem however it's a bypass but you'll need to fix it eventually.

#Request closed problem solved.
_DreadNought_ is offline  
Old 10/18/2012, 02:02   #10
 
JohnHeatz's Avatar
 
elite*gold: 150
Join Date: Apr 2010
Posts: 9,739
Received Thanks: 8,977
#Closed as requested
JohnHeatz is offline  
Closed Thread


Similar Threads Similar Threads
[Hex] How to disable manner.txt
11/09/2011 - RO Exploits, Hacks, Bots & Guides - 3 Replies
1. There is a simple way, just create a folder and name it DATA, create a text file, and name it MANNER.TXT, open it and write // NO INSULT Launch your RO and you can insult everybody hehe :pimp:
Need fluent German speaker for quick translation :))
11/01/2011 - Off Topic - 2 Replies
jsut need some help with an ingame ticket.
[Verlosung]Strange Flamethrower|Strange Kunai
10/05/2011 - Team Fortress 2 - 16 Replies
Schreibt einfach eine Zahl zwischen 1 und 5. Jeder kann nur eine der beiden Waffen gewinnen. Viel Glück!
Can anyone trade a strange rocket launcher for a strange pistol?
09/27/2011 - Team Fortress 2 - 1 Replies
bleh
[I speak fluent English] Can't restore .bak VSRO files
09/14/2011 - SRO Private Server - 4 Replies
Hello, I'm wondering if I can have a moment of someones time. With the VSRO files, I try and use .bak SQL Dump files to restore a DB so I can run the server, however it gives me filenotfound errors with reference to .MDF and .LDF files on a D:\ drive which I do not have... Can someone help? Much appreciated, hoopla123



All times are GMT +2. The time now is 03:54.


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.