Raised This Month: $ Target: $400
 0% 

checking latency between server frames


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Sylwester
Veteran Member
Join Date: Oct 2006
Location: Poland
Old 10-21-2010 , 17:32   Re: checking latency between server frames
Reply With Quote #5

PHP Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Server fps latency checker"
#define VERSION "0"
#define AUTHOR "twoj_stary"

new bool:on_off
new g_fh

public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
register_srvcmd("check_fps""switch_check")
}

public 
server_frame()
{
    static 
Float:last_frame
    
if(!on_off)
        return
    new 
Float:curr_frame get_gametime()
    new 
tmp[16]
    
formatex(tmp15"%f^n"curr_frame-last_frame)
    
fputs(g_fhtmp)
    
last_frame curr_frame
}

public 
switch_check()
{
    static 
filename[128]
    if(!(
on_off=!on_off))
    {
        
server_print("stopped checking, saving report file to %s"filename)
        
fclose(g_fh)
        return
    }

    
get_basedir(filename127)
    
format(filename127,  "%s/logs/frame_time_%d.log"filenameget_systime())
    
g_fh fopen(filename"wt")
    if(!
g_fh)
    {
        
on_off=false
        server_print
("failed to open log file %s"filename)
        return
    }
    
server_print("starting to check latency of each server frame")
}

public 
plugin_end()
{
    if(
g_fh)
        
fclose(g_fh)

__________________
Impossible is Nothing
Sylwester is offline
 



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 10:21.


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