Author Topic: The possible repercussions of OnPlayerSpeak  (Read 1426 times)

0 Members and 1 Guest are viewing this topic.

Offline -Bendarr-

  • Soldier
  • **
  • Posts: 104
The possible repercussions of OnPlayerSpeak
« on: June 20, 2009, 06:01:07 pm »
I've recently been adding some scripts to my server, and have COMPLETELY avoided using any "OnPlayerSpeak" scripts. All of the commands I've made (and DorkeyDear has made, his are better than mine) have been OnCommand and OnPlayerCommand, because the thought of a constant monitor for every time a person says something (people spam a LOT) has made me question the effect that that would have on my clan server, where eats/lag/etc are a big problem, and must be avoided (in R/S CTF eats are a huge problem).

I use an EnEsCe server which is so far the best server I've ever had to keep eats at bay, and I want to keep it this way. When I play in gathers, NA servers and Euro servers, I've noticed HUGE eat problems and bad lag due to the scripts required for a gather to run.

What do you guys think. I'm only assuming things, to be cautious, but a few !commands would be nice to have.

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: The possible repercussions of OnPlayerSpeak
« Reply #1 on: June 20, 2009, 06:13:49 pm »
You are being to cautious, if you have if text=blah in your onplayerspeak and it does not equal blah then nothing is done so it uses no cpu whatsoever.


Offline -Bendarr-

  • Soldier
  • **
  • Posts: 104
Re: The possible repercussions of OnPlayerSpeak
« Reply #2 on: June 20, 2009, 06:18:34 pm »
But it must monitor the chat to check IF the text = !command

So as long as you have something in OnPlayerSpeak, it IS being monitored...

Offline Hacktank

  • Camper
  • ***
  • Posts: 462
  • Soldat Scripter
    • HTZRPG
Re: The possible repercussions of OnPlayerSpeak
« Reply #3 on: June 20, 2009, 06:37:00 pm »
It is always being monitored anyway by the core game, the script just adds to what it looks for.


Offline chrisgbk

  • Moderator
  • Veteran
  • *****
  • Posts: 1739
Re: The possible repercussions of OnPlayerSpeak
« Reply #4 on: June 20, 2009, 07:15:35 pm »
You are being to cautious, if you have if text=blah in your onplayerspeak and it does not equal blah then nothing is done so it uses no cpu whatsoever.

It doesn't use no CPU; the act of checking for the match consumes CPU time.

But it should be a minimal effect, there should be no adverse reactions to adding checks for commands.

Offline croat1gamer

  • Veteran
  • *****
  • Posts: 1327
  • OMG CHANGING AVATAR!!! ^ω^
Re: The possible repercussions of OnPlayerSpeak
« Reply #5 on: June 21, 2009, 12:18:19 am »
The lag is caused due to the obvious thing that you play in NA and Euro gathers, where one of them isnt your local gather, so the lag is caused by you. Imo at least.
And dont use wireless.
Last year, I dreamt I was pissing at a restroom, but I missed the urinal and my penis exploded.

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: The possible repercussions of OnPlayerSpeak
« Reply #6 on: June 21, 2009, 01:04:35 am »
All OnPlayerSpeak calls are forced to run in a thread, so no matter what you do in OnPlayerSpeak, it will not cause server lag... Even if you put in a sleep().

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: The possible repercussions of OnPlayerSpeak
« Reply #7 on: June 21, 2009, 09:05:50 am »
All OnPlayerSpeak calls are forced to run in a thread, so no matter what you do in OnPlayerSpeak, it will not cause server lag... Even if you put in a sleep().
Why don't you thread all functions/procedures so people will be able to use  sleep()?

Offline ~Niko~

  • Rainbow Warrior
  • *****
  • Posts: 2410
Re: The possible repercussions of OnPlayerSpeak
« Reply #8 on: June 21, 2009, 10:17:38 am »
I simply don't understand why scripts use !blah texts to make things. Just use OnPlayerCommand, and per example, if  a player in a gather does !nuubia to change the map, the console should show a message like "this lamer has voted nuubia". Would be that some kind of solution?

Offline EnEsCe

  • Retired Soldat Developer
  • Flamebow Warrior
  • ******
  • Posts: 3101
  • http://enesce.com/
    • [eC] Official Website
Re: The possible repercussions of OnPlayerSpeak
« Reply #9 on: June 21, 2009, 10:19:29 am »
All OnPlayerSpeak calls are forced to run in a thread, so no matter what you do in OnPlayerSpeak, it will not cause server lag... Even if you put in a sleep().
Why don't you thread all functions/procedures so people will be able to use  sleep()?
Because threads can't have return values.......

Offline Gizd

  • Flagrunner
  • ****
  • Posts: 586
  • (Re)tired
    • Eat-this! community site
Re: The possible repercussions of OnPlayerSpeak
« Reply #10 on: June 21, 2009, 10:24:33 am »
I simply don't understand why scripts use !blah texts to make things. Just use OnPlayerCommand, and per example, if  a player in a gather does !nuubia to change the map, the console should show a message like "this lamer has voted nuubia". Would be that some kind of solution?
Newbies don't know how to use commands...


Is AppOnIdle threaded? It has no return value.
« Last Edit: June 21, 2009, 10:34:36 am by Gizd »

Offline ~Niko~

  • Rainbow Warrior
  • *****
  • Posts: 2410
Re: The possible repercussions of OnPlayerSpeak
« Reply #11 on: June 21, 2009, 10:35:11 am »
Newbies shouldn't play in private servers. They play in pubs where there's no need to type slashes, only to die.