Register for your free account! | Forgot your password?

You last visited: Today at 17:14

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

Advertisement



Saving things on 5165

Discussion on Saving things on 5165 within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Post Saving things on 5165

Where can I add this in my 5165 source? (what it does is it saves everything every 60 seconds and on the console it says "Game Saved Automatically")
Code:
                Thread.Sleep(60 * 1000);
                Database.SaveKOs();
                Database.SaveEmpire();
                Features.Guilds.SaveGuilds();
                Features.SkillsClass.Save();
                Console.WriteLine("Game Saved automatically.");
copz1337 is offline  
Old 02/12/2010, 22:49   #2
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
Quote:
Originally Posted by copz1337 View Post
Where can I add this in my 5165 source? (what it does is it saves everything every 60 seconds and on the console it says "Game Saved Automatically")
Code:
                Thread.Sleep(60 * 1000);
                Database.SaveKOs();
                Database.SaveEmpire();
                Features.Guilds.SaveGuilds();
                Features.SkillsClass.Save();
                Console.WriteLine("Game Saved automatically.");
Lmao your console will get spammed like shiz, but wouldn't you have to make a completely new thread for it?
Arcо is offline  
Old 02/12/2010, 22:51   #3
 
Nullable's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 390
Received Thanks: 321
Thread.Sleep? this will lag up the main thread unless you're doing this in a different thread(which i doubt you do), use a timer..
Nullable is offline  
Old 02/12/2010, 22:52   #4
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
ok how can i change it then x.x and yea im debating on the console msg.

can this work?

Code:
(Tick + (60 * 1000) < (uint)Environment.TickCount)
copz1337 is offline  
Old 02/12/2010, 22:56   #5
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
Quote:
Originally Posted by copz1337 View Post
ok how can i change it then x.x and yea im debating on the console msg.

can this work?

Code:
(Tick + (60 * 1000) < (uint)Environment.TickCount)
Just go with what nullable said, make a timer for it.
Arcо is offline  
Old 02/12/2010, 23:02   #6
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Quote:
Originally Posted by .Arco View Post
Just go with what nullable said, make a timer for it.
i dont know how to make a timer >.>
copz1337 is offline  
Old 02/14/2010, 07:12   #7
 
elite*gold: 0
Join Date: Sep 2009
Posts: 321
Received Thanks: 60
we coem back to the question where would u put the timer XD
LegalConquer is offline  
Old 02/14/2010, 12:12   #8


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
In Program.cs:

Find:

Code:
        public static System.Timers.Timer DropEventTimer = null;
Place bellow:

Code:
        public static System.Timers.Timer RandomEvent = null;
Find:

Code:
World.MobsStart = true;
Place bellow:

Code:
                RandomEvent = new System.Timers.Timer(60000);
                RandomEvent.Elapsed += new System.Timers.ElapsedEventHandler(RandomEvent_Elapsed);
                RandomEvent.Start();
Find:

Code:
        static void MobThread_Execute()
Place above:

Code:
        static void RandomEvent_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            throw new NotImplementedException();
        }
Replace:

Code:
throw new NotImplementedException();
With:

Code:
                Database.SaveKOs();
                Database.SaveEmpire();
                Features.Guilds.SaveGuilds();
                Features.SkillsClass.Save();
                Console.WriteLine("Game Saved automatically.");
Done.
Korvacs is offline  
Thanks
4 Users
Old 02/14/2010, 13:33   #9
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
Thanks i will try this, hope it works......
salem rey is offline  
Old 02/14/2010, 14:41   #10
 
elite*gold: 0
Join Date: Sep 2009
Posts: 321
Received Thanks: 60
Sick Sounds Good But will it spam Cmd console?
LegalConquer is offline  
Old 02/14/2010, 15:15   #11


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
It will, you can remove the Console.WriteLine("Game Saved automatically."); line and it wont.
Korvacs is offline  
Old 02/14/2010, 15:23   #12
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
I got a problem when i add this monster didnt spawn.
salem rey is offline  
Old 02/14/2010, 17:00   #13
 
elite*gold: 0
Join Date: Sep 2009
Posts: 321
Received Thanks: 60
works fine for me its been on an hour now and i asked people on my server and they say all spawns are working fine.
LegalConquer is offline  
Old 02/15/2010, 11:17   #14
 
salem rey's Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
Ill double check mine
salem rey is offline  
Old 02/15/2010, 17:19   #15
 
elite*gold: 0
Join Date: Feb 2009
Posts: 700
Received Thanks: 79
Quote:
Originally Posted by Korvacs View Post
In Program.cs:

Find:

Code:
        public static System.Timers.Timer DropEventTimer = null;
Place bellow:

Code:
        public static System.Timers.Timer RandomEvent = null;
Find:

Code:
World.MobsStart = true;
Place bellow:

Code:
                RandomEvent = new System.Timers.Timer(60000);
                RandomEvent.Elapsed += new System.Timers.ElapsedEventHandler(RandomEvent_Elapsed);
                RandomEvent.Start();
Find:

Code:
        static void MobThread_Execute()
Place above:

Code:
        static void RandomEvent_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
        {
            throw new NotImplementedException();
        }
Replace:

Code:
throw new NotImplementedException();
With:

Code:
                Database.SaveKOs();
                Database.SaveEmpire();
                Features.Guilds.SaveGuilds();
                Features.SkillsClass.Save();
                Console.WriteLine("Game Saved automatically.");
Done.
Alright thanks alot.
copz1337 is offline  
Reply


Similar Threads Similar Threads
A few things about 5165
08/28/2010 - CO2 Private Server - 11 Replies
Alright well I noticed that on 5165, I get lower fps then ANY other client I run. I don't know why. But anyway that's 1 thing, if anyone can provide an fps unlocker for 5165 that'd be great. And another question is about the low hp effect that comes up as an outline and blinks on your screen when you have low hp. How do I disable that effect? Thanks to anyone who is willing to help. Oh and also where can I edit the attack speed? Because I remember I told someone to change it for it to be...
How to remove a few things from 5165 client
07/13/2010 - CO2 Private Server - 4 Replies
I really don't like a few things in the 5165 client. For example, when you hit status and look at your char's gear, the button in the middle that says Check/Restore.. it's useless and looks bad. How can I remove that? Another thing is, when you say something, there's a button on the left of the chat that says the talk status so TALK or WHISPER etc.. it's useless and I want to remove it as well. And finally, when you have low hp, your screen gets surrounded in red indicating you got low hp, and...
[Help Request] Saving a Custom System (5165)
03/08/2010 - CO2 Private Server - 10 Replies
Hey you guys, I need help. =\ http://i746.photobucket.com/albums/xx110/brokentw ilight91/cute.png I know that sounds lame but it's really hard for me and I've been trying for days. My goal is to save a variable M and D to a character file in a folder called "example" (Like the Flower System's save system). http://i746.photobucket.com/albums/xx110/brokentw ilight91/Capture-7.png This is what I have for the System's cs (located in Features called Example.cs): using System;
Things about the new client/ Help with a few things
08/23/2009 - S4 League - 7 Replies
Okay... After the update I rescanned for a few things. I have SP, Fumbi Address, Master Address, Run Speed and Jump speed. I noticed freezing your SP seems to disconnect you. I also can't find a Z pointer that last longer than a few restarts (probably not looking deep enough, but haven't been bored enough to spend hours searching for pointers) I'm wondering if anyone else has successfully frozen their SP value without a disconnect I'm also wondering if anyone has a pointer for Z and...



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


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.