Page 1 of 1

Kick and Ban (Please Read)

Posted: 29 Mar 2012, 13:18
by Bosskafett
Hello!

I understand this is both in the docs and a few posts on this subject. I gathered this:
------------------
var dataObj:Object = {}

dataObj.id = userId.toString()
dataObj.msg = msg

smartFox.sendXtMessage("$dmn", "kick", dataObj)
----------------
Where exactly does that go? How does that work?? I honestly cant find any other information about this matter, apart from the code above.

Please reply! D:

Thanks Guys,
Jack

Re: Kick and Ban (Please Read)

Posted: 29 Mar 2012, 15:36
by rjgtav
Hello.
That code goes in the client code. Please keep in mind that the user needs to be a Moderator in order to be able to send that request, otherwise that request will be ignored by the server.

Re: Kick and Ban (Please Read)

Posted: 29 Mar 2012, 16:39
by Bosskafett
Hey rjgtav,

Thanks for getting back to me. When I put this in the SmartFoxClient, do I execute the process by saying something in the chat bar? Is it something like: ban <user> / kick <user>

Thanks,
Jack

Re: Kick and Ban (Please Read)

Posted: 29 Mar 2012, 19:39
by rjgtav
You can do it whatever way you want. If you want, you can use a simple button. Simply add that code to a function and call it when ever you need it.

Re: Kick and Ban (Please Read)

Posted: 30 Mar 2012, 05:31
by Bosskafett
Alright:)

Yet, is it the user ID you target?? I dont want to only be able to kick myself.
I've never seen that code mak up before, and is extremely confusing. Please explain how to use it :)

Whats the client and what is data obj? How can a button define a specific user???? The code seems somewhat incomplete. Argh, Im confused.

help!
jack

Re: Kick and Ban (Please Read)

Posted: 30 Mar 2012, 08:43
by Bax
Bosskafett , you should create a function (activated by a button or what else) which executes the code you wrote in the first post. The userID is the id of the user you want to kick or ban. Also, in order to kick or ban the user running that function must have moderation privileges.
Sorry, but I believe you really need to better study the SFS documentation and API documentation.

Re: Kick and Ban (Please Read)

Posted: 30 Mar 2012, 14:59
by Bosskafett
Why thank you Baxy, I understand now :D

Re: Kick and Ban (Please Read)

Posted: 30 Mar 2012, 15:08
by Bosskafett
So you add a moderator to the Config.xml but the user isnt a moderator when you login. :/

Re: Kick and Ban (Please Read)

Posted: 30 Mar 2012, 20:37
by rjgtav
Hmm... Have you restarted the server after you added the user to the config? And is the username you entered on the config exactly the same of that user?
And are you using custom-login? If so, you need to manually set that user a moderator, after the successful login...

Re: Kick and Ban (Please Read)

Posted: 31 Mar 2012, 21:42
by Bosskafett
Its not custom login. I use PHP for that, its strange. This is how its set out:

<Moderators status="on">
<Mod name="Jack"/>
</Moderators>

Is that right??

Cheers,
jack

Re: Kick and Ban (Please Read)

Posted: 31 Mar 2012, 21:52
by rjgtav
Hmm... Moderators only work if you specify both an username and a password... To increase security... Otherwise anyone could be a moderator... It was only needed to login with the mod's username. You configure it like:

<Moderators status="on">
<Mod name="modName" pwd="modPass" />
</Moderators>

Re: Kick and Ban (Please Read)

Posted: 02 Apr 2012, 22:24
by Bosskafett
Alright, cheers mate;

:D