2016-01-05 23:22:55

Greetings to all!
Who can lay please online chat in the following languages:
Python
BGT
Vb 6
VB.net
C #
C ++
I am a language where it is easier to network applications.
Thanks in advance!

2016-01-08 16:18:59

hello
i tell you in C++ how to do it
you need a network library which sends and receives data (you can use your operating system's socket library such as winsock
now, get keyboard input from the user, and send it to server
the server get the input and broadcast that
another thing which i want to say is, if you want to implement something like irc chat, try irclib
any questions?

2016-01-10 22:54:27

I need information in c ++, and those languages that have been specified in the list.

2016-01-11 19:46:01

Hi,
I would not do chat in BGT. It is rather... difficult and complicated. The others, though... that's complicated too. It's harder than it sounds.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2016-01-11 23:28:32

Assuming you mean you want to know more about networking in the various languages, the answer will be more or less the same for all of them. All programming languages are more or less the same, they all have loops, variables, etc. The only differences between them are syntax and a feature here and there.

Having said that, in Python you can network between different applications using the built in Socket module, or use the Python Twisted library which can make things abit easier. Really though, you may find reading books and tutorials on general networking principles like Sockets, TCP and UDP protocols, Client Server models, etc. much more useful than language specific networking questions, and if you don't know how to program you should definitely learn more about that first.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2016-01-12 09:32:05 (edited by visualstudio 2016-01-12 09:33:25)

you need a network library first (it makes your life easier)
or os speciffic socket api
then you need to implement a server which get's messages from clients and send it back to other clients
look at sdl_net, it has an example of chat client and server
maybe you need to create a private messaging system, but instead of broadcasting the message to others, it just send it to 1 client

2016-01-13 04:28:39

Before you do anything that involves networking, I recommend you learn how a network functions and how the internet functions. If you don't have an in-depth knowledge of how the internet functions (how frames are processed, what the different OSI and TCP/IP models are and what the 7 and 4 layers do, respectively, etc), you will not understand how your code words, and you may then have poorer code or poorer performance.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2016-02-10 17:34:50

I'm currently experimenting in writing games with 3 languages, BGT, PureBasic, and Python. My final choice will of course be the one that will satisfy all my needs. Here are my findings and opinions.
BGT: BGT is probably the only one that has all required stuff for writing audio games (sound menus, sound positioning, speaking numbers, pathfinder, audio forms), and that's why it's made for. However, it's syntax is C-like and I prefere more easily readable syntax like the one in Python and Basic languages. Also for some game stuff, such as creating maps and enemies, you'll probably need to spend more lines of code in BGT than you'll need with Python or PB.
PureBasic: I was nostalgic about BNS Basic that I've learned to use back in late 2003. So I decided to buy PB in order to experiment with no limitation and to use it for some smaller app projects. It has the ability to pack sounds into the executable, which is good if I wanna protect my sounds from modifying by other users. The only thing that I have to find out yet is how much time it will take for me to transition from Python to PB, since there are big differences in some parts of the language big_smile.
Python: Python would be the best choice for me, I'm programming in Python for 6 years and I will not have to learn new stuff required for transitioning to other programming language. However, the one and only reason why I don't feel good at writing games in Python is that I can't easily pack and encrypt sound files like I can do it in BGT. If I ever find the easy way on how to pack and encrypt sounds so they can't be modified by users, then I will not have to look forward, and I can choose Python and Pyglet with not too much thinking. It's always easier to write the game in something that you already know to use quite well, than with something that's new to you.

2016-02-10 22:52:17

It took me awhile to figure out, but you can pack arbitrary data files like password protected zips into your executable in Pyinstaller. If you like I can explain the process, which also involves loading your assets a little differently to link to them properly at runtime.

-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2016-02-11 00:24:38

That would be cool if you could explain it, I use pyinstaller as well.

Check out the new reality software site. http://realitysoftware.noip.us

2016-02-11 01:28:08 (edited by magurp244 2016-02-11 01:59:40)

Something to keep in mind is that I ran into problems with case sensative files at times, so it might not hurt to double check the capitalization of your file extentions and names. Now, assuming your using the latest Pyinstaller lets say you want to pack a zip file containing your music and want to load it at run time, you start by adding this function to your py script:

def resource_path(relative_path):
    """ Get absolute path to resource, works for dev and for PyInstaller """
    if hasattr(sys, '_MEIPASS'):
        return os.path.join(sys._MEIPASS, relative_path)

    return os.path.join(os.path.abspath("."), relative_path)

This finds the absolute path to the temporary folder created at run time when running the executable, and where the zip file should end up. Next we load and unpack the audio files, in this example i'm using one of my own OpenAL functions to load the sound into self.sound, if your using a different method you may need to use resource_path(fileName) to link to the file.

import zipfile
import os
import sys

myzipfile = zipfile.ZipFile(resource_path('data.zip'),'r')

#if you have a password on the zip, this line sets the zipfile password for reading, otherwise exclude.
#myzipfile.setpassword('password')

for fileName in myzipfile.namelist():
    if fileName == 'sound.wav':
        myzipfile.extract(fileName,resource_path(''))
        self.sound = load_sound(fileName)
        os.remove(resource_path(fileName))

After that we run Pyinstaller.py to generate a spec file and apply the tag to pack it as a single file:

pyinstaller.py --onefile --noconsole yourprogram.py

Then we edit the spec file and put in the line to include our zip file between the "pyz = PYZ" and "exe = EXE" lines:

a.datas += [('data.zip','C:\folder\\data.zip', 'DATA')]

Then we recompile the spec file:

pyinstaller.py yourprogram.spec

This will grab and include the zipfile into the final executable and unpack it into the temporary folder created when the program is run. There are a few extra steps you can take to protect the zip by compiling your main script as a PYC binary and using a separate loader script, or running it through an obfusticator to make the script less readable in case anyone tries to extract it and lookup the password.


Edit: If anyones curious here's the OpenAL loader class i'm using, which unfortunately only works with wav files:

import wave
import os
import sys

class load_sound(object):
    def __init__(self,filename):
        self.name = filename
    #load/set audio file
        if len (sys.argv) < 2:
            print ("Usage: %s wavefile" % os.path.basename(sys.argv[0]))
            print ("    Using an example wav file...")
            dirname = os.path.dirname(os.path.realpath(__file__))
##            dirname += '/data/'
            fname = os.path.join(dirname, filename)
        else:
            fname = sys.argv[1]

        wavefp = wave.open(fname)
        channels = wavefp.getnchannels()
        bitrate = wavefp.getsampwidth() * 8
        samplerate = wavefp.getframerate()
        wavbuf = wavefp.readframes(wavefp.getnframes())
        self.duration = (len(wavbuf) / float(samplerate))/2
        self.length = len(wavbuf)
        formatmap = {
            (1, 8) : al.AL_FORMAT_MONO8,
            (2, 8) : al.AL_FORMAT_STEREO8,
            (1, 16): al.AL_FORMAT_MONO16,
            (2, 16) : al.AL_FORMAT_STEREO16,
        }
        alformat = formatmap[(channels, bitrate)]

        self.buf = al.ALuint(0)
        al.alGenBuffers(1, self.buf)
    #allocate buffer space to: buffer, format, data, len(data), and samplerate
        al.alBufferData(self.buf, alformat, wavbuf, len(wavbuf), samplerate)

    def delete(self):
        al.alDeleteBuffers(1, self.buf)
-BrushTone v1.3.3: Accessible Paint Tool
-AudiMesh3D v1.0.0: Accessible 3D Model Viewer

2016-02-16 09:46:57

Check this chat programming sample

http://csharp.net-informations.com/comm … amming.htm

Warner