Register for your free account! | Forgot your password?

Go Back   elitepvpers > Shooter > S4 League
You last visited: Today at 20:13

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

Advertisement



[emu]how to sync data in sql with the server?

Discussion on [emu]how to sync data in sql with the server? within the S4 League forum part of the Shooter category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jun 2008
Posts: 5
Received Thanks: 0
[emu]how to sync data in sql with the server?

Code:
public void CreateCharacter(ulong accID, uint slot, uint avatar)
        {
            using (var con = GetConnection())
            {
                using (var cmd = BuildQuery(con, "INSERT INTO account_characters(AccountID, Slot, Avatar) VALUES(@AccountID, @Slot, @Avatar)", "@AccountID", accID, "@Slot", slot, "@Avatar", avatar))
                {
                    cmd.ExecuteNonQuery();
                }
                using (var cmd = BuildQuery(con,
                    "INSERT INTO account_inventory(AccountID, Category, SubCategory, ItemID, ProductID, EffectID, PurchaseTime, ExpireTime, Energy) VALUES(@AccountID, @Category, @SubCategory, @ItemID, @ProductID, @EffectID, @PurchaseTime, @ExpireTime, @Energy); SHOW TABLE STATUS LIKE 'account_inventory';",
                    "@AccountID", accID, "@Category", 3, "@SubCategory", 10, "@ItemID", 1, "@ProductID", 3, "@EffectID", 0, "@PurchaseTime", 1398784884, "@ExpireTime", -1, "@Energy", 2400))
                {
                    cmd.ExecuteNonQuery();
                }
                using (var cmd = BuildQuery(con,
                    "INSERT INTO account_inventory(AccountID, Category, SubCategory, ItemID, ProductID, EffectID, PurchaseTime, ExpireTime, Energy) VALUES(@AccountID, @Category, @SubCategory, @ItemID, @ProductID, @EffectID, @PurchaseTime, @ExpireTime, @Energy); SHOW TABLE STATUS LIKE 'account_inventory';",
                    "@AccountID", accID, "@Category", 2, "@SubCategory", 0, "@ItemID", 1, "@ProductID", 2, "@EffectID", 0, "@PurchaseTime", 1398785050, "@ExpireTime", -1, "@Energy",2400))
                {
                    cmd.ExecuteNonQuery();
                }
            }
        }
im using "insert into" successfully add specific items to player inventory in sql,but im encounter a new problem.the sql database has store the new items that i added ,but it didn't shows in the player inventory in game mode,i must log out to server selection and re-log in, now i can see the items refresh on the inventory list,so i guess the sql data information isn't sync with the server in realtime,so can anyone could help me modify the code to implement the function that i can see items in inventory not just in sql database after first time character created? thanks
cloudslsw is offline  
Reply


Similar Threads Similar Threads
Sync Progress
10/26/2012 - DarkOrbit - 2 Replies
This morning 9am GMT+1 the servers of dark orbit will be down for about an hour. Greetz.
De-sync from your server
01/14/2008 - WoW Exploits, Hacks, Tools & Macros - 14 Replies
So here is the basics of what you need to do. 1. Go to the Aldor bank in Shattrath 2. Face A'dal (the "snowflake" in the middle of Shattrath) 3. Pop a Dream Vision potion or use eyes of the beast for you hunters out there 4. Run to the exact opposite side of Shattrath to the Scryer's bank 5. On the left there will be a ramp. Go up the ramp and out of Shattrath



All times are GMT +2. The time now is 20:13.


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.