Time – Giavapps Game Jolt API

 

About Time Functions

 

For more info about Time functions please visit the following link: http://gamejolt.com/game-api/doc/time

 

Time Functions

 

gj_time_fetch_all() Returns the time of the Game Jolt server. This function returns the id of the HTTP request. For more info: http://gamejolt.com/game-api/doc/time/fetch/

 

Code Examples

 

Fetching Game Jolt Server Time

 

Create Event

 

gj_init("game_id","private_key");//Initializes Giavapps Game Jolt API
request_user_auth = gj_user_auth("username","user_token");//Authenticates the user
request_time_fetch_all = –1;//Request for fetching Game Jolt server time

 

Game End Event

 

gj_deinit();//Deinitializes Giavapps Game Jolt API

 

Async – HTTP Event

 

if(gj_http_status() != 0){exit;}//Checks if the status is complete

gj_http_result();//Retrieves result data for gj_result_* functions

if(gj_http_id() == request_user_auth)//Checks if the id is equal to the http request id
{

if(gj_result_success())
{

show_debug_message("THE USER’S CREDENTIALS ARE VALID!");
request_time_fetch_all = gj_time_fetch_all();//Fetches Game Jolt server time

}
else
{

show_debug_message("THE USER’S CREDENTIALS ARE INVALID!");

}

}
else if(gj_http_id() == request_time_fetch_all)//Checks if the id is equal to the http request id
{

if(gj_result_success())
{

show_debug_message("TIME HAVE BEEN FETCHED!");

for(var r=0; r<gj_result_count(); r++)//Processes all results
{

show_debug_message("RESULT ID "+string(r)+":");

for(var f=0; f<gj_result_field_count(); f++)//Processes all fields
{

show_debug_message(gj_result_field_name(f)+"="+gj_result_field_value(r, gj_result_field_name(f)));

}

}

}
else
{

show_debug_message("TIME HAVE NOT BEEN FETCHED!");

}

}

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Comments are closed.