Difference for plugins/cfpython/cfpython.c from version 1.3 to 1.4


version 1.3 version 1.4
Line 682
 
Line 682
 {  {
     int hooktype = 1;      int hooktype = 1;
     int rtype = 0;      int rtype = 0;
       FILE*   scriptfile;
   
     printf("CFPython 2.0a post init\n");      printf("CFPython 2.0a post init\n");
     registerGlobalEvent =   gethook(&rtype,hooktype,"cfapi_system_register_global_event");      registerGlobalEvent =   gethook(&rtype,hooktype,"cfapi_system_register_global_event");
Line 705
 
Line 706
     registerGlobalEvent(NULL,EVENT_TELL,PLUGIN_NAME,globalEventListener);      registerGlobalEvent(NULL,EVENT_TELL,PLUGIN_NAME,globalEventListener);
     registerGlobalEvent(NULL,EVENT_MUZZLE,PLUGIN_NAME,globalEventListener);      registerGlobalEvent(NULL,EVENT_MUZZLE,PLUGIN_NAME,globalEventListener);
     registerGlobalEvent(NULL,EVENT_KICK,PLUGIN_NAME,globalEventListener);      registerGlobalEvent(NULL,EVENT_KICK,PLUGIN_NAME,globalEventListener);
   
       scriptfile = fopen(cf_get_maps_directory("python/events/python_init.py"),"r");
       if (scriptfile != NULL)
       {
           PyRun_SimpleFile(scriptfile, cf_get_maps_directory("python/events/python_init.py"));
           fclose(scriptfile);
       }
   
     return 0;      return 0;
 }  }
   
Line 740
 
Line 749
             context->activator = Crossfire_Object_wrap(op);              context->activator = Crossfire_Object_wrap(op);
             strcpy(context->script,cf_get_maps_directory("python/events/python_born.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_born.py"));
             cfob = (Crossfire_Object*)context->activator;              cfob = (Crossfire_Object*)context->activator;
             printf("- Player Born: %s\n", cfob->obj->name);  
             break;              break;
         case EVENT_PLAYER_DEATH:          case EVENT_PLAYER_DEATH:
             op = va_arg(args, object*);              op = va_arg(args, object*);
             context->who = Crossfire_Object_wrap(op);              context->who = Crossfire_Object_wrap(op);
             strcpy(context->script,cf_get_maps_directory("python/events/python_player_death.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_player_death.py"));
             cfob = (Crossfire_Object*)context->who;              cfob = (Crossfire_Object*)context->who;
             printf("- Player GDeath: %s\n", cfob->obj->name);  
             break;              break;
         case EVENT_GKILL:          case EVENT_GKILL:
             op = va_arg(args, object*);              op = va_arg(args, object*);
Line 755
 
Line 762
             context->activator = Crossfire_Object_wrap(op);              context->activator = Crossfire_Object_wrap(op);
             strcpy(context->script,cf_get_maps_directory("python/events/python_gkill.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_gkill.py"));
             cfob = (Crossfire_Object*)context->who;              cfob = (Crossfire_Object*)context->who;
             printf("- Player GKill: %s\n", cfob->obj->name);  
             break;              break;
         case EVENT_LOGIN:          case EVENT_LOGIN:
             pl = va_arg(args, player*);              pl = va_arg(args, player*);
Line 765
 
Line 771
                 strcpy(context->message,buf);                  strcpy(context->message,buf);
             strcpy(context->script,cf_get_maps_directory("python/events/python_login.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_login.py"));
             cfpl = (Crossfire_Player*)context->activator;              cfpl = (Crossfire_Player*)context->activator;
             printf("- Player Login: %s\n", cfpl->obj->name);  
             break;              break;
         case EVENT_LOGOUT:          case EVENT_LOGOUT:
             pl = va_arg(args, player*);              pl = va_arg(args, player*);
Line 775
 
Line 780
                 strcpy(context->message,buf);                  strcpy(context->message,buf);
             strcpy(context->script,cf_get_maps_directory("python/events/python_logout.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_logout.py"));
             cfpl = (Crossfire_Player*)context->activator;              cfpl = (Crossfire_Player*)context->activator;
             printf("- Player Logout: %s\n", cfpl->obj->name);  
             break;              break;
         case EVENT_REMOVE:          case EVENT_REMOVE:
             op = va_arg(args, object*);              op = va_arg(args, object*);
             context->activator = Crossfire_Object_wrap(op);              context->activator = Crossfire_Object_wrap(op);
             strcpy(context->script,cf_get_maps_directory("python/events/python_remove.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_remove.py"));
             cfob = (Crossfire_Object*)context->activator;              cfob = (Crossfire_Object*)context->activator;
             printf("- Player Remove: %s\n", cfob->obj->name);  
             break;              break;
         case EVENT_SHOUT:          case EVENT_SHOUT:
             op = va_arg(args, object*);              op = va_arg(args, object*);
Line 792
 
Line 795
                 strcpy(context->message,buf);                  strcpy(context->message,buf);
             strcpy(context->script,cf_get_maps_directory("python/events/python_shout.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_shout.py"));
             cfob = (Crossfire_Object*)context->activator;              cfob = (Crossfire_Object*)context->activator;
             printf("- Player Shout: %s\n", cfob->obj->name);  
             break;              break;
         case EVENT_MUZZLE:          case EVENT_MUZZLE:
             op = va_arg(args, object*);              op = va_arg(args, object*);
Line 802
 
Line 804
                 strcpy(context->message,buf);                  strcpy(context->message,buf);
             strcpy(context->script,cf_get_maps_directory("python/events/python_muzzle.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_muzzle.py"));
             cfob = (Crossfire_Object*)context->activator;              cfob = (Crossfire_Object*)context->activator;
             printf("- Player Muzzle: %s\n", cfob->obj->name);  
             break;              break;
         case EVENT_KICK:          case EVENT_KICK:
             op = va_arg(args, object*);              op = va_arg(args, object*);
Line 812
 
Line 813
                 strcpy(context->message,buf);                  strcpy(context->message,buf);
             strcpy(context->script,cf_get_maps_directory("python/events/python_kick.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_kick.py"));
             cfob = (Crossfire_Object*)context->activator;              cfob = (Crossfire_Object*)context->activator;
             printf("- Player Kick: %s\n", cfob->obj->name);  
             break;              break;
         case EVENT_MAPENTER:          case EVENT_MAPENTER:
             op = va_arg(args, object*);              op = va_arg(args, object*);
             context->activator = Crossfire_Object_wrap(op);              context->activator = Crossfire_Object_wrap(op);
             strcpy(context->script,cf_get_maps_directory("python/events/python_mapenter.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_mapenter.py"));
             cfob = (Crossfire_Object*)context->activator;              cfob = (Crossfire_Object*)context->activator;
             printf("- Player Mapenter: %s\n", cfob->obj->name);  
             break;              break;
         case EVENT_MAPLEAVE:          case EVENT_MAPLEAVE:
             op = va_arg(args, object*);              op = va_arg(args, object*);
             context->activator = Crossfire_Object_wrap(op);              context->activator = Crossfire_Object_wrap(op);
             strcpy(context->script,cf_get_maps_directory("python/events/python_mapleave.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_mapleave.py"));
             cfob = (Crossfire_Object*)context->activator;              cfob = (Crossfire_Object*)context->activator;
             printf("- Player Mapleave: %s\n", cfob->obj->name);  
             break;              break;
         case EVENT_CLOCK:          case EVENT_CLOCK:
             strcpy(context->script,cf_get_maps_directory("python/events/python_clock.py"));              strcpy(context->script,cf_get_maps_directory("python/events/python_clock.py"));
Line 848
 
Line 846
     Py_XINCREF(context->activator);      Py_XINCREF(context->activator);
     Py_XINCREF(context->third);      Py_XINCREF(context->third);
   
     printf("- Script file : %s\n", context->script);  
     scriptfile = fopen(context->script,"r");      scriptfile = fopen(context->script,"r");
     if (scriptfile == NULL)      if (scriptfile == NULL)
     {      {


Legend:
line(s) removed in v.1.3 
line(s) changed
 line(s) added in v.1.4

File made using version 1.98 of cvs2html by leaf at 2011-07-21 16:59