Results 1 to 2 of 2

Thread: Version 2014.03.08

  1. #1
    Assadministrator kung foo man's Avatar
    Join Date
    Jun 2012
    Location
    trailerpark
    Posts
    2,011
    Thanks
    2,102
    Thanked 1,084 Times in 753 Posts

    Version 2014.03.08

    Hey all,

    I finally got around to add the native script functions from Richard and merged all changes of Mitch.

    Download: http://killtube.org/downloads/libcod/2014_03_08/

    List of new functions:

    PHP Code:
    Scr_Function scriptFunctions[] = {
        {
    "printf"gsc_utils_printf0},
        {
    "printfline"gsc_utils_printfline0}, // adds \n at end
        
        #if COMPILE_MYSQL == 1
        
    {"mysql_init"              gsc_mysql_init              0},
        {
    "mysql_real_connect"      gsc_mysql_real_connect      0},
        {
    "mysql_close"             gsc_mysql_close             0},
        {
    "mysql_query"             gsc_mysql_query             0},
        {
    "mysql_errno"             gsc_mysql_errno             0},
        {
    "mysql_error"             gsc_mysql_error             0},
        {
    "mysql_affected_rows"     gsc_mysql_affected_rows     0},
        {
    "mysql_store_result"      gsc_mysql_store_result      0},
        {
    "mysql_num_rows"          gsc_mysql_num_rows          0},
        {
    "mysql_num_fields"        gsc_mysql_num_fields        0},
        {
    "mysql_field_seek"        gsc_mysql_field_seek        0},
        {
    "mysql_fetch_field"       gsc_mysql_fetch_field       0},
        {
    "mysql_fetch_row"         gsc_mysql_fetch_row         0},
        {
    "mysql_free_result"       gsc_mysql_free_result       0},
        {
    "mysql_real_escape_string"gsc_mysql_real_escape_string0},
        
    #endif
        
        #if COMPILE_MEMORY == 1
        
    {"memory_malloc" gsc_memory_malloc 0},
        {
    "memory_free"   gsc_memory_free   0},
        {
    "memory_int_get"gsc_memory_int_get0},
        {
    "memory_int_set"gsc_memory_int_set0},
        {
    "memory_memset" gsc_memory_memset 0},
        
    #endif

        #if COMPILE_UTILS == 1
        
    {"disableGlobalPlayerCollision"gsc_utils_disableGlobalPlayerCollision0},
        {
    "getAscii"                    gsc_utils_getAscii                    0},
        {
    "system"                      gsc_utils_system                      0},
        {
    "file_link"                   gsc_utils_file_link                   0},
        {
    "file_unlink"                 gsc_utils_file_unlink                 0},
        {
    "file_exists"                 gsc_utils_file_exists                 0},
        {
    "FS_LoadDir"                  gsc_utils_FS_LoadDir                  0},
        {
    "getType"                     gsc_utils_getType                     0},
        {
    "stringToFloat"               gsc_utils_stringToFloat               0},
        {
    "rundll"                      gsc_utils_rundll                      0},
        {
    "RemoveCommand"               gsc_utils_RemoveCommand               0},
        
    #endif
        
        #if COMPILE_TCC == 1
        
    {"tcc_new"             gsc_tcc_new             0},
        {
    "tcc_add_include_path"gsc_tcc_add_include_path0},
        {
    "tcc_add_file"        gsc_tcc_add_file        0},
        {
    "tcc_run"             gsc_tcc_run             0},
        {
    "tcc_delete"          gsc_tcc_delete          0},
        
    #endif
        
        
    {NULLNULL0}
    }; 
    List of new entity methods:

    PHP Code:
    Scr_Method scriptMethods[] = {
        {
    "printf"gsc_player_printf0}, // rather use sprintf() to re-use iprintlnbold() etc.?
        
        #if COMPILE_PLAYER == 1
        
    {"getStance"             gsc_player_stance_get         0},
        {
    "setVelocity"           gsc_player_velocity_set       0},
        {
    "addVelocity"           gsc_player_velocity_add       0},
        {
    "getVelocity"           gsc_player_velocity_get       0},
        {      
    "aimButtonPressed"gsc_player_button_ads         0},
        {     
    "leftButtonPressed"gsc_player_button_left        0},
        {    
    "rightButtonPressed"gsc_player_button_right       0},
        {  
    "forwardButtonPressed"gsc_player_button_forward     0},
        {     
    "backButtonPressed"gsc_player_button_back        0},
        { 
    "leanleftButtonPressed"gsc_player_button_leanleft    0},
        {
    "leanrightButtonPressed"gsc_player_button_leanright   0},
        {     
    "jumpButtonPressed"gsc_player_button_jump        0},
        {
    "getIP"                 gsc_player_getip              0},
        {
    "getPing"               gsc_player_getping            0},
        {
    "getSpectatorClient"    gsc_player_spectatorclient_get0},
        {
    "ClientCommand"         gsc_player_ClientCommand      0},
        {
    "getLastConnectTime"    gsc_player_getLastConnectTime 0},
        {
    "getLastMSG"            gsc_player_getLastMSG         0},
        {
    "setAlive"              gsc_entity_setalive           0},
        {
    "setBounds"             gsc_entity_setbounds          0},
        
    #endif
        
        
    {NULLNULL0}
    }; 
    When you update to this version, you need to clean up the old std-closer-wrapper mess (be happy about that! ). Best is to rename the std-folder and just fix every "missing function" script-error one by one.

    I hope every libcod developer is updating to this version, so we won't get separated by old/new version, so sharing code stays simple.

    Questions / wishes etc. are all welcome.

    Many regards,
    kung foo man
    timescale 0.01

  2. The Following 5 Users Say Thank You to kung foo man For This Useful Post:

    DjTranceFire (9th March 2014),Mitch (8th March 2014),RobsoN (8th March 2014),smect@ (8th March 2014),YuriJurek (8th March 2014)

  3. #2
    Global Mossaderator Mitch's Avatar
    Join Date
    Nov 2012
    Posts
    654
    Thanks
    204
    Thanked 450 Times in 305 Posts
    Very nice =].
    It might be better to remove RemoveCommand. Because it might break your server when you remove the wrong command. I only added it to test if i could replace rcon map with a cvar. But it didn't work as i hoped. When i removed the map function the new map wouldn't load.

    Edit: i checked if you can use the same custom function and methods in Windows. You can hook the call of the custom function the same way. But you can't do the same with the custom method, because it isn't a separate call. It is probably possible by hooking one of call that are in the custom method call.

    What is the difference between a function and an method?
    Edit: Ah a method automatically sends the entity number to the custom method.

    Edit: I have got it now working on Windows. (1.3 only)
    https://github.com/M-itch/libcod_win...7623029a0260a1

    There is one function missing: Cmd_ExecuteString. (to do rcon tell, rcon say)
    Last edited by Mitch; 8th March 2014 at 13:57.

  4. The Following User Says Thank You to Mitch For This Useful Post:

    kung foo man (8th March 2014)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •