Raised This Month: $51 Target: $400
 12% 

Please help me with GameFrame


Post New Thread Reply   
 
Thread Tools Display Modes
DigiSoft
BANNED
Join Date: Feb 2009
Old 01-05-2010 , 10:39   Re: Please help me with GameFrame
Reply With Quote #11

It just doesn't work.
Whatever I put in
void CEmptyServerPlugin::GameFrame( bool simulating )
It just makes no difference.

Should I call this function from somewhere?


EDIT1: YESSS IT WORKS.

Quote:
void CEmptyServerPlugin::GameFrame( bool simulating )
{
if(difftime(gpGlobals->curtime, originalTime) > 5.0)
{
SayTextMsg(0, "IT WORKS");
originalTime = gpGlobals->curtime;
}
}

Last edited by DigiSoft; 01-05-2010 at 10:49.
DigiSoft is offline
DigiSoft
BANNED
Join Date: Feb 2009
Old 01-08-2010 , 12:01   Re: Please help me with GameFrame
Reply With Quote #12

Ok I have another question about GameFrame.

So on every 5 minutes I check ALL Active players for separate TCP connection.

Lets say some of the players have slow connection or times out so it will make time. Does this means that GameFrame will also wait for this client untill connection timeout?

So should I make separate thread that will be started by GameFrame and then stopped by itself?
DigiSoft is offline
BAILOPAN
Join Date: Jan 2004
Old 01-08-2010 , 13:07   Re: Please help me with GameFrame
Reply With Quote #13

If you block in GameFrame, the server will halt until you stop blocking. You probably want to use non-blocking sockets.

Don't touch the game thread from another thread.
__________________
egg
BAILOPAN is offline
DigiSoft
BANNED
Join Date: Feb 2009
Old 01-08-2010 , 13:09   Re: Please help me with GameFrame
Reply With Quote #14

Quote:
Originally Posted by BAILOPAN View Post
If you block in GameFrame, the server will halt until you stop blocking. You probably want to use non-blocking sockets.

Don't touch the game thread from another thread.
what are those non-blocking sockets?

Ok I am really confused about GameFrame. Does it mean if I write sleep(10000) in the GameFrame the server will stop for 10 seconds?

Last edited by DigiSoft; 01-08-2010 at 13:51.
DigiSoft is offline
BAILOPAN
Join Date: Jan 2004
Old 01-08-2010 , 16:54   Re: Please help me with GameFrame
Reply With Quote #15

Yes. Every callback you get from the game will be in the game's thread (unless you are hooking or intercepting things that happen in another thread - but this is rare and I myself don't even know any).

http://en.wikipedia.org/wiki/Asynchronous_I/O
__________________
egg
BAILOPAN is offline
DigiSoft
BANNED
Join Date: Feb 2009
Old 01-08-2010 , 17:04   Re: Please help me with GameFrame
Reply With Quote #16

Quote:
Originally Posted by BAILOPAN View Post
Yes. Every callback you get from the game will be in the game's thread (unless you are hooking or intercepting things that happen in another thread - but this is rare and I myself don't even know any).

http://en.wikipedia.org/wiki/Asynchronous_I/O
But what if you write new thread and I only start it with GameFrame and then the thread will continue separately.
Right?
DigiSoft is offline
BAILOPAN
Join Date: Jan 2004
Old 01-08-2010 , 18:49   Re: Please help me with GameFrame
Reply With Quote #17

Sure. Just don't reach into the game thread from another thread.

(FYI, spawning threads is not extremely cheap - you would probably want to create it once.)
__________________
egg
BAILOPAN is offline
DigiSoft
BANNED
Join Date: Feb 2009
Old 01-08-2010 , 18:59   Re: Please help me with GameFrame
Reply With Quote #18

Quote:
Originally Posted by BAILOPAN View Post
Sure. Just don't reach into the game thread from another thread.

(FYI, spawning threads is not extremely cheap - you would probably want to create it once.)
So what is your suggestion? What is the best method of checking someones TCP/IP protocol on every 5 minutes? How would you do it?
DigiSoft is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 01-08-2010 , 19:19   Re: Please help me with GameFrame
Reply With Quote #19

Just save it when they join. Their IP address won't be changing in the middle of the game.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
DigiSoft
BANNED
Join Date: Feb 2009
Old 01-08-2010 , 19:30   Re: Please help me with GameFrame
Reply With Quote #20

Quote:
Originally Posted by L. Duke View Post
Just save it when they join. Their IP address won't be changing in the middle of the game.
Yes I know that but I force the clients to run small program in the background that will communicate with the server.
So I want to check on every 5 minutes if the program is running in the background. Something like Anti Cheat.

The plugin works ok but I am concerned that the server might lags because of some players timeouts or slow connections.
DigiSoft is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 00:39.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode