 |
Crossfire Server, Trunk
1.75.0
|
Go to the documentation of this file.
23 static std::vector<std::pair<object *, tag_t>>
friends;
39 LOG(
llevError,
"add_friendly_object: Trying to add object already on list (%s)\n", op->
name);
54 auto find = std::find_if(
friends.begin(),
friends.end(), [&] (
auto item) { return item.first == op; });
56 if ((*find).second != op->
count) {
57 LOG(
llevError,
"remove_friendly_object, tags do no match, %s, %u != %u\n",
71 std::for_each(
friends.begin(),
friends.end(), [] (
const auto item) {
72 LOG(llevError,
"%s (%u)\n", item.first->name, item.second);
87 || ((*item).first->count != (*item).second)) {
97 LOG(
llevDebug,
"clean_friendly_list: Removed %d bogus links\n", count);
109 return std::find_if(
friends.begin(),
friends.end(), [&] (
auto item) { return item.first == op; }) !=
friends.end();
120 if (owner == NULL || object_get_owner(item.first) == owner) {
121 objectlink *add = get_objectlink();
122 add->id = item.second;
123 add->ob = item.first;
147 if (current ==
nullptr) {
150 auto pos = std::find_if(
friends.begin(),
friends.end(), [&] (
const auto item) { return item.first == current; });
155 return pos ==
friends.end() ? nullptr : (*pos).first;
void remove_friendly_object(object *op)
Removes the specified object from the linked list of friendly objects.
@ llevError
Error, serious thing.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
void dump_friendly_objects(void)
Dumps all friendly objects.
#define QUERY_FLAG(xyz, p)
object * get_next_friend(object *current)
Get the next object on the friendly list.
objectlink * get_friends_of(const object *owner)
Get a list of friendly objects for the specified owner.
tag_t count
Unique object number for this object.
void clear_friendly_list(void)
Totally clear the friendly list.
static std::vector< std::pair< object *, tag_t > > friends
List of all friendly objects, object and its count.
Used to link together several objects.
int is_friendly(const object *op)
Checks if the given object is already in the friendly list or not.
void clean_friendly_list(void)
It traverses the friendly list removing objects that should not be here (ie, do not have friendly fla...
#define FLAG_FREED
Object is in the list of free objects.
#define FLAG_FRIENDLY
Will help players.
sstring name
The name of the object, obviously...
void add_friendly_object(object *op)
Add a new friendly object to the list of friendly objects.
#define CLEAR_FLAG(xyz, p)
How to Install a Crossfire Server on you must install a python script engine on your computer Python is the default script engine of Crossfire You can find the python engine you have only to install them The VisualC Crossfire settings are for but you habe then to change the pathes in the VC settings Go in Settings C and Settings Link and change the optional include and libs path to the new python installation path o except the maps ! You must download a map package and install them the share folder Its must look like doubleclick on crossfire32 dsw There are projects in your libcross lib and plugin_python You need to compile all Easiest way is to select the plugin_python ReleaseLog as active this will compile all others too Then in Visual C press< F7 > to compile If you don t have an appropriate compiler you can try to get the the VC copies the crossfire32 exe in the crossfire folder and the plugin_python dll in the crossfire share plugins folder we will remove it when we get time for it o Last showing lots of weird write to the Crossfire mailing list
@ llevDebug
Only for debugging purposes.