Text chat area help

Greetings.

I am new to panda3d, but have a lot of python experience. I’ve been looking for a 3d engine that supports python in order to experiment with and develop prototypes on.

I’ve been playing around with some client server ideas, and want to try out a quick chat server. Just a simple one with usernames on the right, a text entry line, and lines of text above.

Are there any tutorials or examples that use anyhting like this that I could take a look at? all the examples I’ve seen use singular text boxes, where the values do not change.

Thanks for any ideas.

You may want to use the networking tut provided with Panda3D, search the net and the forums for examples of chatservers or just wait another week until I have my Chat-Server finished (it is far from being finished, but it is a working piece of my work I want to use later on. I am commenting it atm to give some help back that members here provided in the past weeks :slight_smile:

I guess there are some usefull hints how to make a chatserver/client, but I guess you need to strip it quite a bit to have a SIMPLE chatserver…

I guess the more interesting part for you will be the CLIENT where I found a quite a bit more understandable (no offense…) way to display the text in the Panda3D window.

However, I have 1 problem left to solve… How can I make sure that given variables are DIGITS/NUMBERS? I mean: I want to transmit a number/value (-unlimited < x < unlimited) that the user is able to type in. How can I do a sanity check to make sure that the user sent a NUMBER and not a letter/word?

Regards, Bigfoot29

You can use Python’s try … except syntax to validate the integer conversion:

try:
  intValue = int(userStr)
except:
  print "Value is not an integer: %s" % (userStr)

David

Hmmm… I thought there was a way except Exception handling, but of course, thats a way that will work :slight_smile:

Thanks David!

Regards, Bigfoot29