Click here to Skip to main content
15,891,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
So i have this space client/server game that uses sql database to store data (loginname, password, etc, etc). The database creation happens in SQL Server Management Studio 2005, then i have to make a empty database and execute sql query to make the database match the server.

The database is working fine unless you attack (engage) and then cancel the attack (disengage) a bot (AI) in the game. Then it wont save data to the database (e.g when create new character, log off the game and then try to logon, it says different password - data wasn't saved to the database).

After hours of researching i found the exact code that cause the bug:

C#
DatabasePlayerAdapter.set_UserEngageCheck(check, BotMemory.BotNameToCheck(Victom));


So i assume it happens in the .set_UserEngageCheck, which is located in the DatabasePlayerAdaptes.cs file in the project. Here's the code:


C#
public static int get_UserEngageCheck(int i)
{
    return get_Player(i).EngageCheck;
}


Any ideas how do i fix this ? Thanks!

What I have tried:

Nothing really. Just found out where the bug actually occurs. I am pretty new to C# so i don't really know how to fix.
Posted
Updated 8-Mar-16 2:38am
v2
Comments
Sinisa Hajnal 8-Mar-16 2:33am    
This is not where the bug occurs.

You found the line, superb, but now you have to go and drill down. Check get_Player(i) -> does it return correct player? If so, does it do something (login or whatever) with player data before returning? Does EngageCheck property do something in the background?

1 solution

As Sinisa mentioned, only you can debug this. We can't run your code and can't see what is happening. Step into each function to find where the problem actually is.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900