i want to make a simple chat room in blender and have the python and commmand line implementation of the chat room.
I wanted to know how i can make a simple gui for the room.(Basically 2 frames/panes/panel-> 1 for showing the chat and 1 for entering the text; a “send” button)
You know, I was thinking about the same thing, perhaps we can work on this together, it could be useful for collaborative & learning purposes, I know that we could use it at theory.
i’m just a noob and started blender a couple of days ago… we can surely work together but i practically know nothing other than firing blender up.
cool idea and support
I am thinking avatars + tracking changes by user and time + Chat = real mature studio tool
then the coder can say “thats too many polygons” to the artist
and the “designer” can say that does not look how I intended etc
like Ubber second life for a small number of clients,
but work together in real time,
Try a .template_list() for the chat list.
To enter text use a .prop().
And a .operator() to send message.
Ill looking into coding something up for concept and design, when I have a bit more free time. I think that an add-on like this should be a group project, not because of complexity, the add-on should be fairly straight forward, but rather for concept and integration reasons, perhaps blenderartist could host it :), this way our user profiles here could be used there, blenderartist being the goto for all blender users I think, that and if blenderartist did host it, any lack of use on the forums as a result of an add-on such as this would still be beneficial to them I think.
There should definitely be an option to use a private server, or whatever, I admit that I know little about instant messenger traffic standards, but I am willing to learn all the gewy details.
I found a python example, connecting to an irc.
Its pritty basic.
I’m also trying to make a chat box while in game for my RTS and I elaborated these scripts. if a person wants to host a game he uses the script SERVER so the game host can provide messaging with the game hosted, else anybody that connects to the host uses the CLIENT script.
You guys might be a precious help
***Server (it gets messages without sending them)
from socket import *
from threading import Thread
# shortcuts
cont = bge.logic.getCurrentController()
scene = bge.logic.getCurrentScene()
objects = scene.objects
inactive = scene.objectsInactive
sensors = cont.sensors
actuators = cont.actuators
own = cont.owner
def clientHandler():
conn, addr = s.accept()
print(addr,"is Connected")
while 1:
data = conn.recv(1024)
if not data:
break
print("#", repr(data))
#def sendmessage():
# reply = own["Text"]
# if enter.positive:
# conn.sendall(reply)
HOST = '' #localhost / 192.168.1.1 / external IP
PORT = 8080
s = socket(AF_INET, SOCK_STREAM)
s.bind((HOST, PORT))
s.listen(8)
print("Server is running......")
for i in range(8):
Thread(target=clientHandler).start()
s.close()
client (it send messages without getting them)
from socket import *
HOST = ''
PORT = 8080
s = socket(AF_INET, SOCK_STREAM)
s.connect((HOST, PORT)) # client-side, connects to a host
print 'connected to', HOST, PORT
while True:
message = raw_input("#: ")
s.send(message)
s.close()
***I would like to give theses two scripts abilities to get and send messages, instead of one or another for each.
I have not yet programmed sockets but I would look at other projects. In the beginning you need to study lightweight solutions for learning purposes in order to understand concepts, but chances are that if you need to go BIG (if is tremendous need to do so) then you search for a full fledged solution that will relief you from this burden.