Register for your free account! | Forgot your password?

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

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

Advertisement



Need Auto Save Code for 5165

Discussion on Need Auto Save Code for 5165 within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
sohaib's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
Need Auto Save Code for 5165

hi, my source don't save the caracters actions some times

ex: i was lvl 120 and i had 2000cps i was in TC , i level up to 200 and i get 5kkcps and i go to BI

i relog and i find my character lvl 120 with 2000cps in TC

a friend told me you have to make auto save code to save each 2min or 2sec whatever

but i don't know what's this code and where i put it

can some one help me please?

thanks
sohaib is offline  
Old 09/08/2010, 17:45   #2
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
Are u using /exit to close the console?
_DreadNought_ is offline  
Old 09/08/2010, 19:13   #3
 
sohaib's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
Sure
sohaib is offline  
Old 09/08/2010, 19:19   #4
 
sohaib's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
they relog and find their characters didn't save without closing or opening server or doing anything in the source
sohaib is offline  
Old 09/09/2010, 01:37   #5
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
By default, the source autosaves characters every 8 second.
Arcо is offline  
Old 09/09/2010, 05:12   #6
 
felipeboladao's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 255
Received Thanks: 273
make a command in cmd /close and add an event to command to save chars
felipeboladao is offline  
Old 09/09/2010, 06:05   #7
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
Just do a foreach statement
foreach (Character C in World.H_Chars.Values)
{
Database.SaveCharacter(C, C.MyClient.AuthInfo.Account);
}
Arcо is offline  
Old 09/09/2010, 06:50   #8
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,379
Or better yet... save the modified sections every time they are changed.

If not your server will ALWAYS be exploitable and ALWAYS have rollbacks (of differing sizes)
pro4never is offline  
Old 09/09/2010, 22:34   #9
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,783
Received Thanks: 5,304
That's a good idea, listen to p4n.
Arcо is offline  
Old 09/10/2010, 00:10   #10
 
sohaib's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
trying to understand
sohaib is offline  
Old 09/10/2010, 03:33   #11
 
elite*gold: 0
Join Date: Jul 2010
Posts: 223
Received Thanks: 23
Well he means that when something changes, it automatically saves the change. Unfortunately, this isn't possible on a flat database like the one you're probably using. If you made it save the entire character every time one aspect changed (like location), then the server will lag and eventually crash if too many people are online! =s

You need to use MySQL or MsSql (something I just learned today). I hope you figure out something! =]
Good luck!
-Fáng- is offline  
Old 09/10/2010, 11:47   #12
 
sohaib's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
it's not possible to make a C# script anywhere to save each 8sec or 2sec?
sohaib is offline  
Old 09/10/2010, 13:06   #13
 
elite*gold: 0
Join Date: Jul 2010
Posts: 223
Received Thanks: 23
Quote:
Originally Posted by sohaib View Post
it's not possible to make a C# script anywhere to save each 8sec or 2sec?
It is very possible... but it will make your server not able to handle a lot of people. Plus, the problem with it not saving and showing an error code is because the file is in use (aka. flat style database). Look into MySQL. It's a lot better! =]

If you're making just a simple server for friends... make a timer in the character's structure file (whatever that may be). Make the timer run when they login and make it save the character at an interval of 800. That should be 8 seconds... I can't remember if that's right. It will turn off when the character logs out since it's just a temporary server resource! Good luck!
-Fáng- is offline  
Old 09/10/2010, 16:50   #14


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Actually you could happily have a save system run every few seconds if you wanted, you just need to have it correctly threaded and use the right locks on the objects you wish to save, however personally i think its better to perform a small save for every change that occurs. It reduces the load when saving massively.
Korvacs is offline  
Old 09/10/2010, 22:12   #15
 
sohaib's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
guys, i'm waiting a reply like : Go to ****.cs , and search ************************ under this put *************

i'm not a C# coder , i'm a client editor and c3 artist , and the person who was coding the server gone
sohaib is offline  
Reply


Similar Threads Similar Threads
5165 Save or Load Character Problem.
07/29/2010 - CO2 Private Server - 5 Replies
alright so IDK wtf I did 2 dis source dat now wen I login and log out my character doesnt save sumhow and like his/her gears are all fucked up wen u login again like...a necklace is where da armor should be at lol...and da armor is like da weapon...so on...only like 3 things save... well I'm hoping I can get answers from dis...I'll post my SaveCharacter/LoadCharacter void here... public static Game.Character LoadCharacter(string Name, ref string Account) { try ...
Roll Back or No Save Bug!! 5165
07/11/2010 - CO2 Private Server - 1 Replies
Hi, i have a co pserver 5165, i'm getting a fucked bug well i made a video to more understand YouTube - mybug.wmv please tell me what's the problem, or if it's possible help me to fix it and if no one know how to fix, please give me a good 5165 source
5165 source Don't save
07/01/2010 - CO2 Private Server - 3 Replies
hi i have a co pserver 5165 well the server don't save for exemple some one was lvl 50 and had 50kcps he dropped 1kkcps and leveled up to 137, well he disconnect, and after 5 ou 10mn he relog, and he find himself lvl 50 and has 50kcps only so the server didin't saved, i have 2 or 3 players who have same problem
fix 100% code save characters lvl and all for 5165
03/09/2010 - CO2 PServer Guides & Releases - 6 Replies
hello all this code for save lvl character and cps open Database.cs and search return "Error: Character already exists!"; del this code and add this new code



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


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