--- deliantra/server/include/plugin.h 2006/08/26 08:44:06 1.13 +++ deliantra/server/include/plugin.h 2007/05/28 21:15:56 1.16 @@ -1,7 +1,26 @@ -/*****************************************************************************/ -/* Crossfire plugin support - (C) 2001 by Yann Chachkoff. */ -/* This code is placed under the GPL. */ -/*****************************************************************************/ +/* + * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. + * + * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team + * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992,2007 Frank Tore Johansen + * + * Crossfire TRT is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 + * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * The authors can be reached via e-mail to + */ /*****************************************************************************/ /* Headers needed. */ @@ -13,20 +32,9 @@ /*****************************************************************************/ /* This one does not exist under Win32. */ /*****************************************************************************/ -#ifndef WIN32 #include -#endif -#undef MODULEAPI -#ifdef WIN32 -#ifdef PYTHON_PLUGIN_EXPORTS -#define MODULEAPI __declspec(dllexport) -#else -#define MODULEAPI __declspec(dllimport) -#endif -#else #define MODULEAPI -#endif #include #include @@ -41,45 +49,7 @@ /*****************************************************************************/ /* This one does not exist under Win32. */ /*****************************************************************************/ -#ifndef WIN32 #include -#endif - -/*****************************************************************************/ -/* Event ID codes. I sorted them to present local events first, but it is */ -/* just a 'cosmetic' thing. */ -/*****************************************************************************/ -/*****************************************************************************/ -/* Local events. Those are always linked to a specific object. */ -/*****************************************************************************/ -// how about making this an enum -#define EVENT_NONE 0 /* No event. This exists only to reserve the "0". */ -#define EVENT_APPLY 1 /* Object applied-unapplied. */ -#define EVENT_ATTACK 2 /* Monster attacked or Scripted Weapon used. */ -/*NOT GENERATED*/#define EVENT_DEATH 3 -#define EVENT_DROP 4 /* Object dropped on the floor. */ -#define EVENT_PICKUP 5 /* Object picked up. */ -#define EVENT_SAY 6 /* Someone speaks. */ -#define EVENT_STOP 7 /* Thrown object stopped. */ -#define EVENT_TIME 8 /* Triggered each time the object can react/move. */ -#define EVENT_THROW 9 /* Object is thrown. */ -#define EVENT_TRIGGER 10 /* Button pushed, lever pulled, etc. */ -#define EVENT_CLOSE 11 /* Container closed. */ -#define EVENT_TIMER 12 /* Timer connected triggered it. */ -#define EVENT_MOVE 28 /* Monster move */ -/*****************************************************************************/ -/* Global events. Those are never linked to a specific object. */ -/*****************************************************************************/ -#define EVENT_CLOCK 14 /* Global time event. */ -#define EVENT_CRASH 15 /* Triggered when the server crashes. Not recursive*/ -#define EVENT_SHOUT 24 /* A player 'shout' something. */ -#define EVENT_TELL 25 /* A player 'tell' something. */ -#define EVENT_MUZZLE 26 /* A player was Muzzled (no_shout set). */ -#define EVENT_KICK 27 /* A player was Kicked by a DM */ -//#define EVENT_PLAYER_USE_SKILL 36 /* player was just trying to use a skill */ -//#define EVENT_MONSTER_USE_SKILL 37 /* monster was just trying to use a skill*/ -#define EVENT_DROP_ON 41 /* Something was dropped on this (floor) */ -/* should add FREE_MAP, FREE_PLAYER */ #define NR_EVENTS 42 @@ -105,11 +75,7 @@ typedef int (*f_plug_postinit) (void); typedef int (*f_plug_init)(const char* iversion, f_plug_api gethooksptr); -#ifndef WIN32 #define LIBPTRTYPE void* -#else -#define LIBPTRTYPE HMODULE -#endif typedef struct _crossfire_plugin { @@ -127,19 +93,10 @@ extern int plugin_number; extern crossfire_plugin* plugins_list; -#ifdef WIN32 - -#define plugins_dlopen(fname) LoadLibrary(fname) -#define plugins_dlclose(lib) FreeLibrary(lib) -#define plugins_dlsym(lib,name) GetProcAddress(lib,name) - -#else /*WIN32 */ - #define plugins_dlopen(fname) dlopen(fname,RTLD_NOW|RTLD_GLOBAL) #define plugins_dlclose(lib) dlclose(lib) #define plugins_dlsym(lib,name) dlsym(lib,name) #define plugins_dlerror() dlerror() -#endif /* WIN32 */ /* OBJECT-RELATED HOOKS */