Jump to content

code problem...


darkfreaks

Recommended Posts

I have tons of pages of code i am not sure where the problem lies but it is sposed to be when you move to an empty section of the map it is sposed to make it so the kingdom stats are empty therefore you get a new kingdom to settle however at the moment it keeps displaying the current settle kingdom info for 1-2 clicks in every direction then it finally changes. im not sure what could be causing this so im attaching the files i think it may be in.

 

 

example account:

 

User:Bryce

Pass:doom

 

login as me. to see for yourself

 

http://ageofmonarchy.com

 

[attachment deleted by admin]

Link to comment
Share on other sites

That's a lot of code to swim through... unfortunately prolly not going to have time to look at that much... but I want to play the game now though... ha.

 

But to try to help you, find the part of the code that creates the new kingdom first....

I think that maybe it's not clearing out old data from a database or something... try before creating a new kingdom resetting all arrays, database variables for previous kingdoms, and any variable you are reusing that has no data that needs to be passed along... I haven't even looked at the code so don't know how this is done but it is my first thought.

Link to comment
Share on other sites

I'll take a look at that specific file and see if anythings jumps at me then.

 

EDIT:

well there goes my theory... for the most part.

That below should already check for what I was thinking... but still maybe it's not setting itself to zero. Does it in all browsers? I'm just wondering if maybe it's a cache issue?

  $def_population = 0;
  $def_food       = 0;
  $def_tax        = 0;
etc..........

Link to comment
Share on other sites

function record count from class core:

  function recordCount($table,$where='')
      {
        $sql = 'SELECT COUNT(*) AS jumlah FROM '.$table;
        if (!empty($where)){
            $sql .= ' WHERE '.$where;
        }
        $res = mysql_query($sql);
        return mysql_result($res,0,'jumlah');
    }

 

think this could be possibly flawed function wise

Link to comment
Share on other sites

Ok, just following a debug step is all. Ask the obvious question first was all.  I didn't see nothing out of ordinary with the settle file. So maybe it's not your code, well technically that is, does it do it in all browsers (I know already asked that). If yes then limits to issues then it's not browser issue to deal with. If no then find out if caching causing issue with certain browsers.

 

I doubt that's the issue though to be honest just something to check.

Other then that run some error checking at random segments of the code just outputting data from the variables just to see if they output what they want when you want them.

 

I'll try to take a deeper look at this later, it's an interesting issue.

 

EDIT:

think this could be possibly flawed function wise

Try the debug code around that and see if it indeed does what you think the variables are before and after the function. I've got to go for the weekend actually away from the internet :(. So hopefully someone here can help you.

Link to comment
Share on other sites

 $c_west= (empty($infoLoc['cannons_west']))? '0'   : ($infoLoc['cannons_west']);

 

i'm pretty sure the above code is not always returning empty and this is the problem anyone else agree :confused:

 

Um... just got back from my fur-low of the weekend and looked at your code. Not sure if you resolved anything yet. But have you tried using less efficient code to see if it will work. Just for S & G's. Try running isset() tests after you've zeroed everything out and just as a redundant step if it isset then make it zero. Like I said not efficient, but if you think that's the problem and it resolves it with a redundant step then at least you know for sure.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.