[C] AntiMove

ehthe

Retired Staff
Contributor
Joined
Apr 26, 2015
Messages
1,029
Reaction score
896
Points
216
Just did that in my free time (meaning it should work but it may not), have fun :)
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "public_errors.h"
#include "public_errors_rare.h"
#include "public_definitions.h"
#include "public_rare_definitions.h"
#include "clientlib_publicdefinitions.h"
#include "ts3_functions.h"
#include "plugin.h"

static struct TS3Functions ts3Functions;
const char* ts3plugin_name() {
    return "Anti move";
}
const char* ts3plugin_version() {
    return "0.1";
}
int ts3plugin_apiVersion() {
    return 20;
}
const char* ts3plugin_author() {
    return "ehthe for r4p3.net";
}
const char* ts3plugin_description() {
    return "I WANT TO STAY HERE GOD DAMNIT !";
}
void ts3plugin_setFunctionPointers(const struct TS3Functions funcs) {
    ts3Functions = funcs;
}
int ts3plugin_init() {
    return 0;
}
void ts3plugin_shutdown() {
}


void ts3plugin_freeMemory(void* data) {
    free(data);
}

void ts3plugin_onClientMoveMovedEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, __attribute__ ((unused)) uint64 newChannelID, __attribute__ ((unused)) int visibility, __attribute__ ((unused)) anyID moverID, __attribute__ ((unused)) const char* moverName, __attribute__ ((unused)) const char* moverUniqueIdentifier, __attribute__ ((unused)) const char* moveMessage) {
    static anyID myself;
    if (ts3Functions.getClientID(serverConnectionHandlerID, &myself) != ERROR_ok) {
        return;
    }
    if(clientID == myself) {
        ts3Functions.requestClientMove(serverConnectionHandlerID, clientID, oldChannelID, "", NULL);
    }
}

void ts3plugin_onClientKickFromChannelEvent(uint64 serverConnectionHandlerID, anyID clientID, uint64 oldChannelID, __attribute__ ((unused)) uint64 newChannelID, __attribute__ ((unused)) int visibility, __attribute__ ((unused)) anyID kickerID, __attribute__ ((unused)) const char* kickerName, __attribute__ ((unused)) const char* kickerUniqueIdentifier, __attribute__ ((unused)) const char* kickMessage) {
    static anyID myself;
    if (ts3Functions.getClientID(serverConnectionHandlerID, &myself) != ERROR_ok) {
        return;
    }
    if(clientID == myself) {
        ts3Functions.requestClientMove(serverConnectionHandlerID, clientID, oldChannelID, "", NULL);
    }
}
 

ehthe

Retired Staff
Contributor
Joined
Apr 26, 2015
Messages
1,029
Reaction score
896
Points
216
No source for any of those except the lua one :p
 

ehthe

Retired Staff
Contributor
Joined
Apr 26, 2015
Messages
1,029
Reaction score
896
Points
216
Too lazy to do it, plus I haven't looked at the changes. But it is so simple anyone hwo wants to do it could do it :)
 
Top