Game Development Community

Object Not Found

by Matthew Grint · in Torque Game Engine · 08/03/2005 (9:47 am) · 22 replies

Hi,
I bought TGE on Monday and since then have been playing around with several files and arranging a login system, but have run into a strange error which unfortunately I don't understand. The error is:
starter.fps/server/scripts/game.cs (0): Unable to find object: '2776' attempting to call function 'delete'

According to this message, the error is in game.cs, but on line 0 (I think) - my problem is I don't understand where the actual error is occuring, as there is no line 0. Also, the object (in the example, '2776') increments by 2 everytime. I am really not sure what is going on, if it's any help this occured while trying to install the following:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=4085 ("Persistant Character Server" by Daniel Neilsen)

Any help would be very much appreciated,
Thanks for your time,
Matthew 'Krast0r' Grint
Page «Previous 1 2
#1
08/03/2005 (10:17 am)
Looking at the resourse , i see the last function is;

function clientLoginFailed(%client){
%client.delete();}

I guess your failing login?

Try put in some error code to trace it. Like this:-

function clientLoginFailed(%client){
error("function clientLoginFailed - %client ===== "@%client);
%client.delete();}
#2
08/03/2005 (10:33 am)
Thanks so much for your help, i've bodged it a bit to get it working until i find the error in my PHP. Thanks a lot.
#3
08/03/2005 (10:36 am)
Quote:
starter.fps/server/scripts/game.cs (0): Unable to find object: '2776' attempting to call function 'delete'

This means that the client you're trying to delete, does not exist on the server where you're calling this command from. (or it has already been deleted)

The objects ID is incremented by 2 each time because you're passing a new client ID each time the function is called, probably because you disconnected and reconnected.
#4
08/03/2005 (10:55 am)
I've figured it all out now, I was confused because the error was related to a completely different function which failed due to a pervious error, all i've got to do now is figure out why that damn error keeps occuring!
Thanks for your help guys, really appreciate it.
#5
08/03/2005 (11:17 am)
Ok, i've run into another problem with this (already). This function:

function CharLogin::onLine( %this, %line )
{
   %client = %this.clientid;
   //Check if webpage returns the word Verified on the frst line
   if(StrStr(%line, "Verified") !=-1)
   {
      cancel(%client.loginLoop);
      return;
   }

Tries to read the word "Verified" from a webpage. The script definitely accessed the webpage, and the word "Verified" is definitely displayed but the script is never able to find it. The webpage which displays the "Verified" message is:
www.mad-gaming.co.uk/auth/game_login.php

As I say, the page is deinitely accessed by the script every time.

Thanks for any help, this really has me puzzled!
#6
08/03/2005 (11:37 am)
Have you tried to fetch the content of that page and echo it on in the console?
#7
08/03/2005 (11:44 am)
Just tried that by adding:

error(%line);

It writes "Verified" to the console, so basically the script:

Accesses the page - Works
Reads the text - Works
Returns Correct - Fails

I really don't understand what is going on.
#8
08/03/2005 (11:56 am)
I don't mean to ask a stupid question, but have you checked to verify that %line contains what you think it should contain at that point?
#9
08/03/2005 (12:05 pm)
Yea, that's what I just did in the last post (with the error(); command) - I placed that so it shows the value of %line before it compares it, but it still doesn't work for some reason.

I'm sure it's something stupid but i just can't figure it out.
#10
08/03/2005 (12:18 pm)
Hmm, how about instead of using
if(StrStr(%line, "Verified") !=-1)
Since %line echoes back as "Verified", just use something simpler, like
if(%line $= "Verified")
#11
08/03/2005 (12:19 pm)
Sorry, that all happened while I was reading the thread and posting my response. What result are you getting returned from the StrStr call?
#12
08/03/2005 (12:27 pm)
If your strstr call is returning the correct value then perhaps your dso's need to be wiped. Delete all your *.dso files and try it again.
#13
08/03/2005 (12:35 pm)
Ok here is the current function:
function CharLogin::onLine( %this, %line )
{
   %client = %this.clientid;
   //Check if webpage returns the word Verified on the frst line
   if(StrStr(%line, "V") !=-1)
   {
      error(%line);
      %rar = StrStr(%line, "V");
      error(%rar);
      cancel(%client.loginLoop);
      return;
   }
   
   //otherwise, auth failed!
   error("- ",%line);
   clientLoginFailed(%client);
}

And here is the console output ( anything after "//" is something i have added to the log afterwards as a guide to what I think is happening)

V      // The contents of %line after the strstr();
0    // The contents of %rar
-       // The contents of %line from the error("-",%line); command
function clientLoginFailed - %client ===== 2368       // Error checking I added later, thanks to advice from this thread.
CDROP: 2368 local          // Client Dropping
-    // Repeats everything from - onwards
function clientLoginFailed - %client ===== 2368
starter.fps/server/scripts/game.cs (0): Unable to find object: '2368' attempting to call function 'delete'
- 
function clientLoginFailed - %client ===== 2368
starter.fps/server/scripts/game.cs (0): Unable to find object: '2368' attempting to call function 'delete'
- 
function clientLoginFailed - %client ===== 2368
starter.fps/server/scripts/game.cs (0): Unable to find object: '2368' attempting to call function 'delete'
- 
function clientLoginFailed - %client ===== 2368
starter.fps/server/scripts/game.cs (0): Unable to find object: '2368' attempting to call function 'delete'
- 
function clientLoginFailed - %client ===== 2368
starter.fps/server/scripts/game.cs (0): Unable to find object: '2368' attempting to call function 'delete'
- 
function clientLoginFailed - %client ===== 2368
starter.fps/server/scripts/game.cs (0): Unable to find object: '2368' attempting to call function 'delete'
-


This carries on a few times in the same repetition until the loop stops due to the 30 second timeout.


I'm still very, very confused and I have tried changing 'Verified' to 'V' and other varients including mixed use of whitespace in the PHP.

[UPDATE 20:44]
Tried deleting relevent (and irrelevant) .DSO files, but it has no effect on the error.
[/UPDATE]
#14
08/03/2005 (12:45 pm)
Well something is definately not right or you edited you console log wrong. If you were entering the if block for "if(StrStr(%line, "V") !=-1)" you would have 2 output lines, 1 saying "Verified", the next one echoing "0" (the line echoing %rar).

It looks like you are succeeding the first time but you are not cancelling the login loop correctly and when you call it again it is failing.
#15
08/03/2005 (12:47 pm)
Just looking through that code, the value of %rar (the StrStr command) is 0, this should make it TRUE and carry on the script, but it doesn't. Maybe the first StrStr command doesn't have the same value as %rar for some reason, any ideas how I could test this?

Thanks for your - continued - help.

[UPDATE 20:49]
Yea, I updated the function afterwards, the code is actually checking for "V" at the moment.
[/UPDATE]
#16
08/03/2005 (12:51 pm)
It looks like you edited this just as I posted and put the %rar line in :). It is making it true because your 2 echo statements are working, it looks like your cancel command isnt working.

I would check to make sure that %this.clientid is a valid client id. Then I would check to make sure that %this.clientid.loginloop is properly getting set to the schdeuleid returned from the schedule command you are calling.
#17
08/03/2005 (12:55 pm)
Ok, here is the code scheduling it:
%client.loginLoop = schedule(30000, 0, "clientLoginFailed", %client);

How could I check if the client id is valid?
#18
08/03/2005 (1:00 pm)
My guess is that %client.loginloop at your shcedule command does not equal %this.clientid.loginloop in your onLine function. Put an echo after your schedule and then put an echo before your cancel command and see if they are the same value. If they are not the same then you are not cancelling what you thinnk you are.
#19
08/03/2005 (1:06 pm)
Just tested it and after the schedule command it equals 4, before the cancel it also equals 4.
It must be something stupid i've missed in my inexperience.
#20
08/03/2005 (1:17 pm)
I have tried changing the strstr line to:
if(StrStr(%line, "V") !=1)

This works, so for some reason this line isn't working when the value is 0 (I think).
Page «Previous 1 2