How do I kick/ban people from a chat using OINC?
Also how would I go about sending PM's?
Printable View
How do I kick/ban people from a chat using OINC?
Also how would I go about sending PM's?
You'll have to program that yourself in POINC
How?
1) Learn Phyton
2) Get Poinc
3) ???
4) profit
Or you could do it through MMF and OINC..?
Nope, because the server with OINC within MMF2 can currently only start hosting a server, and close the server. That is all, no sending messages or disconnected clients.Quote:
Originally Posted by Asholay
POINC is the way to go.
I've made a full working lobby system - with kicking of players - using just MMF and logging on to oinc.darkkiller.dk?
A small example for Game_Master should be made, so there won't be a tit-for-tat back and forth on this topic.
Marv
Small example:
In the code, have text message "kick" received on subchannel 1: disconnect from OINC, or disconnect from channel, or whatever.
Then allow those "hosting" a game to kick players by sending message "kick" on subchannel 1..?
It works perfectly for me?
Yes, I had that idea also. But, unfortunatly, if you do that all peers will be disconnected as when the message is recieved, there is no way of selecting a peer to be disconnected. Remember that all peers recieve the message and will therefore be disconnected. Please correct me if I am wrong.
You need to go into more depth - in my game, for example, a maximum of 4 players can be in each game lobby (the host, and 3 joiners) - which makes life easier, as I just send a different message to kick a specific player - i.e "kick2" boots player 2, "kick3" boots player 3, and similar for "kick4".
When subchannel 80 (kick channel) picks up one of those messages, it knows whether you are being kicked, or another player is being kicked.
To do it with infinte players, I guess you could send a message "kick:"+$playername... then, if you receive a "kick:yourname" message, it knows you have been kicked, and can disconnect you.
Can't you send messages to specific peers? I recall seeing some actions like that the last time I checked the extension...
Yes, you can also send text to peer (select them by name first) - so I would imagine you could just send them the text "kick", which when picked up, removes them from your channel/whatever.
You can't expect a client to do what he's told... The kick should be performed by the server. In fact any important thing should be performed by the server. There is no way to be sure the client will disconnect, even if you ask him very kindly to do so.
Corentin - in that case, how can an individual "host" player do anything to a game, such a password protect it or kick players? Do they have to request that the server does it? And in that case, how do you stop rogue programs from doing the same to kick players, or hack passwords?
that's exactly the point of having the server perform the disconnection : the server is the only reliable thing. If you only want some users to be able to kick others, then you have to set some privileges with a password or something. EDIT : what I mean here is that the server will check if the user has the ability to kick before performing the kick. This has to be server-side
If you're considering hackers, then you just can't expect them to disconnect on a /kick message. It would be just like asking them "would you please leave ?".
hey, there's a way i plan to do this. On the log in, there is a space for the mod/admin password. The only people that can be RickyRombo are me and my mods (there will be mods hopefully) and then when you send the message you could have a condition of Self_Name$("OINC client")="RickyRombo" then kick from server. you know?
I'm not sure I understand your system RickyRombo, but if there is no server-side code, it's got to be insecure. I'm nothing like hacker and I cannot hex-edit code or memory values, but a hacker could change (locally) his name to be RickyRombo, or just skip this test or rewrite another client without this test, or anything...
And this wouldn't prevent a user from sending /kick messages, since no tests are made server-side !
hackers smackers. I've been working on this, and actually you can FORCE the "peer" to disconnect bub. And for banning, I tried to do something like:
Option ban selected ("Pop up Menu") [or something like that]
-Select peer by name
-Send Message to peer on subchannel 1-"ban"
Message Sent on Peer subchannel 1
+Received$("OINC client") = "ban"
-Send Message to server on subchannel 0-Host ip [where Host ip is a global value holding the peer's ip number]
-Disconnect
-End Application
Message Sent on Server subchannel 0
-Set Banned Ips to Banned Ips + Received$("OINC client")+"deliminator" [where Banned Ips is a global value storing the banned ips and deliminator is the deliminator being used in the string parser]
On channel join
-Send Message to Server on subchannel 2-Host ip
Message Sent on subchannel 2
-"String Parser" - Set source string to Banned Ips
-Set PeerName to Peer_Name$("OINC client") [where PeerName is the global string I use for the selected peers name]
-Start loop "BanCheck" listCount("String Parser") times
On loop "BanCheck"
+ListGetAt$("String Parser, Loopindex("BanCheck")+1)=Received$("OINC client")
-Select peer by name PeerName
-Send Message to peer on subchannel 1-"kick"
Message Sent to peer on subchannel 1
+ Received("OINC client") = "kick"
-Disconnect
-End Application
Which should at least keep the banned user off while the others are on
I don't think it works, though
EDIT: No it doesn't, at least not on my computer. Could someone help? Maybe work off of this or something?
What makes you think a hacker will actually send his IP and kindly disconnect, when receiving a /ban message ?
Once again you can't control what's happening on a remote machine. The hacker could be using another client, or could have modified yours. This can only be secure using server-side code.
EDIT : And I'm not talking about a hacker kicking/banning other users. Of course you can hope nobody's that stupid, but as soon as you give people the ability to do something bad, someone will have to do it :grin:
Who cares about hackers at this point. And no maybe not. But does the normal player choose to send their ip and choose to disconnect? no. You want server side, fine. But at the moment I'm just trying to figure out the easy part of kicking/banning. And forgive me for asking, but why would anyone want to hack a chat client? Wouldn't they be a little more interested in games...
RickyRombo, there is no end to the joy griefers get by ruining it for everyone else. It's best to build the system as secure as possible. Using poinc is pretty easy. It would be worth your time to install it and learn how to use it.
oh boy, a new programming language! Haha I thought I knew them all but theres more! No I guess I never knew very many, mostly just C++ and Scar. This might be challenging!
I'll check it out.
Python is fun, and when you learn it you'll be able to use Pygame or Ren'py. Not to mention you'll have learned the language that powers Google Apps Engine :)
Yeah - I caved in and have downloaded Python & Twisted...
I don't know where I'm going to store all this information :(
Well RickyRombo if you think you don't need security, just don't use it, I guess everything will be fine. As you said, there is probably no point in such a hack anyway... Yet if you think there is no use for security in this app, is there really a use for kicking/banning (especially if it's insecure) ?
I only posted about this because I don't want people reading this topic to believe it was a solution for serious projects. And then to prove such a system wasn't possible client-side.
Have fun with Python ! ;)
Thanks for all your support! I (with the help of others) have sucessfully made a chat now with:
• Chat
• An online group draw
• Smileys
• PM's
• A kicking feature for mods
Anyone know how I would make a password login system/user account creator?
Okay, here goes...
This is exactly what we're trying to prevent people from doing with OINC. This is exactly why we've provided different server solutions (in contrast to Moo that only had the extension server) so people would never be restricted by MMF.
MMF2 is NOT and never will be feasible for server development, and client-side protection is NOT an option!
Some people might think that their current client-side protected servers work well, but in the end, they hit the stumbling block on various issues-- hackers emerges (trust me, they will), adding server-side features (AI, quests and whatever) is near impossible, and debugging is quite hard.
I've seen it happen multiple times (client-side protection, ask me for references), and the result has always hit a block in the end (this is an especially awful position to be in if the game has actually claimed some kind of notice).
So the overal rule for OINC server development is:
[size:14pt]Use POINC or C++ OINC for server development; I (we?) will not provide much help with servers made in MMF2.[/size]
I'm not sure whether I've mentioned this before, but I would be really happy to help people out with stuff in Poinc (I've done so several times already, actually). Python (in combination with Twisted) is seriously a breeze to work with, and I'm positively sure you guys will love it if you get to open your eyes for it! :)
Add me on MSN (and please, only Poinc things, I'm already severely occupied socially ;) ) and I'll be there.
Mathias - I'm just running though Python and stuff, what's your MSN? I may call on you some time!
The Python tutorial could be written in another language for all I understand. I don't even know where to start scripting! Anyone know of a completely average Joe english tutorial?
Seriously, they brag about being so easy to use... that sure makes me feel like an IDIOT.
http://docs.python.org/tutorial/
Read, practice, read, practice. Do this until something clicks for you.
RickyRombo. Don't feel like an idiot. It is just like MMF or any other application. Confusing and a lot of questions, then after you do it for awhile then it gets easier. For example, you see questions on the forums here that you think it is simple, but for the person asking it it is hard.
Don't be discouraged. Some of the things I read on the forum here is way over my head and I have been clicking for 10 years. Download Python and start doing your thing. Sometimes people get a little over zealous when they say something is easy. Don't worry and go for it.
Marv
That was the tutorial I was talking about.
I'm trying! Just one question - how to start scriptng? Scripting itself seems to be the easy part, but is there an editor or something? I got from that tutorial that there is a viewer or whatever that you can only open a certain way. Is that the editor? Just where do I write my script?
http://notepad-plus.sourceforge.net/uk/site.htm
I feel the same way. I've been trying to learn Python for a few months now. I'm getting the hang of some things, but it's been a VERY slow process for me. I still haven't written my own text-based game yet. I still have to learn a lot of the basic features. I'm glad you said this though, because I feel the same way. People talk about how easy it is always making me feel dumb =[. But, Nirvam gave some good advice. I feel better now.Quote:
Originally Posted by RickyRombo
IDLE comes with Python. That's the interpreter for Python, (the editor so to say that comes with it) should be in your start bar somewhere. There are other IDEs you could choose to use if you don't like IDLE, you could use notepad ++ which Pkeod suggested, or Pyscripter, or DrPython.Quote:
Originally Posted by RickyRombo
Anyways, good luck to ya.
Thanks I'm going to need it :S haha I'm taking a break from scripting right now so I can make a Wheel of Fortune clone for someones birthday.
I think that when they say that Python is easy, they're comparing it with C++ or any similar language. :P
Anyway, once feel comfortable with the language/programming, your time will be easy ;) Remember, try to think "clean".