Author Topic: OnRequestGame(IP: string; State: unchangable): useless;  (Read 1884 times)

0 Members and 1 Guest are viewing this topic.

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
OnRequestGame(IP: string; State: unchangable): useless;
« on: September 12, 2008, 09:33:11 am »
Code: [Select]
function OnRequestGame(IP: string; State: integer): integer;
begin
WriteLn(IP+' requests game... so this function was called.');
State := 4;
Result := State;
end;

Ok, there's the idea, Hello World. The function gets called if I join the game... but eh, yes, I can join the game :/
I already removed all OnRequestGame functions from other scripts, same result: I can join without getting any error message, State 4 means banned IP.

Someone already had this problem... or solved it?
« Last Edit: September 12, 2008, 09:35:20 am by Mr »

Offline xmRipper

  • Soldat Beta Team
  • Flagrunner
  • ******
  • Posts: 742
    • Personal
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #1 on: September 12, 2008, 09:52:39 am »
Code: [Select]
function OnRequestGame(IP: string; State: integer): integer;
begin
  WriteLn(IP+' requests game... so this function was called.');
  Result := 4;
end;
Co-Founder / CTO @ Macellan
Founder Turkish Soldat Community

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #2 on: September 12, 2008, 10:19:30 am »
Already tried that, won't work.

Offline Norbo

  • Camper
  • ***
  • Posts: 338
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #3 on: September 12, 2008, 10:59:46 am »
because you are an admin of the server.

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #4 on: September 12, 2008, 11:26:17 am »
No, I joined with my external IP without adminlog.
So please, try it out byself...



- EDIT -
Problem solved, the default script was still active, there it says Result := State :/
« Last Edit: September 12, 2008, 11:34:36 am by Mr »

Offline M[a]nny

  • Soldat Beta Team
  • Major
  • ******
  • Posts: 52
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #5 on: May 27, 2009, 03:35:46 pm »
I've got same problem. How did you solve that?
PS: I don't have any other script using OnRequestGame event.
« Last Edit: May 27, 2009, 03:41:09 pm by M[a]nny »

Offline y0uRd34th

  • Camper
  • ***
  • Posts: 325
  • [i]Look Signature![/i]
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #6 on: May 28, 2009, 06:44:45 am »
Post the script you use, would help alot...

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #7 on: May 28, 2009, 08:58:51 am »
I've got same problem. How did you solve that?
PS: I don't have any other script using OnRequestGame event.
Make sure you are doing Result := value; and not State := whatever

Offline M[a]nny

  • Soldat Beta Team
  • Major
  • ******
  • Posts: 52
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #8 on: May 28, 2009, 09:44:47 am »
Code: [Select]
function OnRequestGame(IP: string;State: integer):integer;
begin
  result := 4;
end;

Where should be mistake? ???

PS: To subscribe my problem... it is the same as last one. It really doesn't matter what is written in OnRequestGame event... all players trying to connect to my sever should be banned. But they aren't :o
« Last Edit: May 28, 2009, 09:53:03 am by M[a]nny »

Offline DorkeyDear

  • Veteran
  • *****
  • Posts: 1507
  • I also go by Curt or menturi
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #9 on: May 28, 2009, 01:03:18 pm »
Code seems to be fine.
Double check that there are no other scripts modifying OnRequestGame.
You may want to also make sure that scripting is enabled in server.ini. I believe I found it default disabled when I downloaded 2.6.5 / 2.6.4.

Offline M[a]nny

  • Soldat Beta Team
  • Major
  • ******
  • Posts: 52
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #10 on: May 29, 2009, 04:23:54 pm »
I know where is problem now! I've got 2 directories. In the first dir are used some events, like OnJoinGame, OnLeaveGame etc. The problem is, in the second directory - there is OnJoinGame event, too! And if this happens, it will cause ignoration of OnRequestGame event... and there it is. If i turn off second dir, it's okay.

The question is... why all other events work instead of this one? Really... I don't know. What should I do?

Offline y0uRd34th

  • Camper
  • ***
  • Posts: 325
  • [i]Look Signature![/i]
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #11 on: May 30, 2009, 04:05:01 am »
If I understand right, you got 3 script, 2 use OnJoinGame? When they are just little you may try put the two OnJoinGame procedures into one..

Offline M[a]nny

  • Soldat Beta Team
  • Major
  • ******
  • Posts: 52
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #12 on: May 30, 2009, 04:26:06 am »
It might help but when I use more scripts? And many kind of scripts? I can't put it into one.

Offline y0uRd34th

  • Camper
  • ***
  • Posts: 325
  • [i]Look Signature![/i]
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #13 on: May 30, 2009, 06:06:05 am »
Hmm, try using the scripts you really need? But if you really want to make them not join, why you just don't set a password up?

Offline M[a]nny

  • Soldat Beta Team
  • Major
  • ******
  • Posts: 52
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #14 on: May 30, 2009, 07:01:03 am »
The last script was only as example, of course :)
I'm trying to make my own ban system. I've got more servers and if somebody is banned in one, he/she should be banned in other, too! And that's why i'm working on this. In the root of the soldat server would be banlist.txt file with list of IPs to ban. That's all.

Offline M[a]nny

  • Soldat Beta Team
  • Major
  • ******
  • Posts: 52
Re: OnRequestGame(IP: string; State: unchangable): useless;
« Reply #15 on: May 30, 2009, 10:01:25 am »
HA!
Fixed!
It is only about order of compiling script files. File where is written OnRequestGame event has to be in directory called with last word in alphabet (e.g. "zzz"), so the file with this event will be taken as LAST ONE! And that's it :)

Thanks for all replies, anyway.