These are chat archives for IndySockets/Indy

11th
Oct 2018
Alpinador
@dixiewarp_twitter
Oct 11 2018 08:45
good morning...... i'm trying get TIdIRC component running on Rad Studio C++ Builder 10.2.....
anybody knows about this?
Remy Lebeau
@rlebeau
Oct 11 2018 17:33
@dixiewarp_twitter are you having trouble with it?
Alpinador
@dixiewarp_twitter
Oct 11 2018 21:32
not really remy
just i dont know how put the nick of the guy when one of them talks
the nick of the users before the message
i dont know where get it
Kudzu
@czhower
Oct 11 2018 21:34
I think the server does that? Its been a long time since I worked in IRC.
Alpinador
@dixiewarp_twitter
Oct 11 2018 21:34
i use OnRaw event for detect when somebody sends message
not my username eh?
the name of one of the users list
i meant how know who talks when message enter?
because only say PRIVMSG ...message
but dont say the nick of the person that talks
Remy Lebeau
@rlebeau
Oct 11 2018 21:37
@dixiewarp_twitter when TIdIRC receives a message, the sender's nickname is put in the TIdIRC.FSenderNick member, and the sender's hostname in the TIdIRC.FSenderHost member, before the OnRaw event is triggered. Those members are then passed to various event handlers (OnPrivateMessage, OnCTCPQry, OnCTCPReply, OnNotice, etc), but not to OnRaw.
Alpinador
@dixiewarp_twitter
Oct 11 2018 21:37
let me look it
sendernick dont exist on that
i find name and nickname
but no sendernick
Remy Lebeau
@rlebeau
Oct 11 2018 21:41
@dixiewarp_twitter My mistake, there are no properties for them, just internal data members that are used with various events, but not OnRaw. So you will have to access the members directly. They are protected so you can derive a class from TIdIRC to declare your own properties to read them.
Alpinador
@dixiewarp_twitter
Oct 11 2018 21:43
nah
solved
is IdIRC->Name
now i can see it in messages
i put ListBox1->Items->Add(IdIRC1->Name + ": " + AMessage);
and now it put the nickname before the message
the problem now
is the rare encoding utf-8 with accents and colours
that sometimes shows rare chars
when they put accents and colors
Remy Lebeau
@rlebeau
Oct 11 2018 21:46
@dixiewarp_twitter Name is the component's name on the Form, not the sender's name
Alpinador
@dixiewarp_twitter
Oct 11 2018 21:46
im working in C++ builder friends
Remy Lebeau
@rlebeau
Oct 11 2018 21:47
@dixiewarp_twitter the IRC protocol doesn't have any notion of character encoodings or text colorings. Clients must manually parse the raw data to decide how to display it. TIdIRC doesn't do that for you. Though, if you knew the text was always UTF-8, you could set the IOHandler.DefStringEncoding to IndyTextEncoding_UTF8 beforehand. But IRC is more flexible than that, and there may be multiple charsets used in a single channel at a time. You might have to use IndyTextEncoding_8bit instead and manually parse the raw bytes to detect which charsets are being used.
Alpinador
@dixiewarp_twitter
Oct 11 2018 21:50
aha
where i can change to IndyTextEncoding_8bit ?
in idIRC component?
sorry for disturb with this
but i never deal with IndyIRC component
Remy Lebeau
@rlebeau
Oct 11 2018 21:57
@dixiewarp_twitter You can set it after calling Connect().
Alpinador
@dixiewarp_twitter
Oct 11 2018 22:00
i found IdIRC1->IOHandler->DefStringEncoding
but how change it?
IdIRC1->IOHandler->DefStringEncoding = "IndyTextEncoding_UTF8"; ????
i think it throws an compiling error
Remy Lebeau
@rlebeau
Oct 11 2018 22:01
@dixiewarp_twitter DefStringEncoding is a _di_IIdTextEncoding interface wrapper. IndyTextEncoding_... are functions in IdGlobal.hpp that return such interfaces, eg: IdIRC1->IOHandler->DefStringEncoding = IndyTextEncoding_UTF8();
Alpinador
@dixiewarp_twitter
Oct 11 2018 22:01
ahh
like a function!
sorry .... :D
now yes
compiled
let me check the output
im doing a Social Game multiuser and need a chat system you know?
Remy Lebeau
@rlebeau
Oct 11 2018 22:08
@dixiewarp_twitter I probably would not use IRC for that. Since you have to create a protocol to handle your game anyway, I would just design chat commands directly into that protocol instead. Unless you want the chats to be separate from the game
Alpinador
@dixiewarp_twitter
Oct 11 2018 22:12
the thing
is i tried with IdTCPClient and IdTCPServer
but i cant reach the other remote machine
and i make all
giving firewall app access on both machines
opening the router ports
and cant connect to server neither from server to client reversing the server action
and finally with IdIRC i think is better
because the game, have different zones (screens) and when first player enter in one empty ...the room is created
Remy Lebeau
@rlebeau
Oct 11 2018 22:16
@dixiewarp_twitter if you can't connect one peer to another, you are doing something wrong in your setup
Alpinador
@dixiewarp_twitter
Oct 11 2018 22:16
yes
i wondering what hell is it
but in 127.0.0.1 runs
Remy Lebeau
@rlebeau
Oct 11 2018 22:17
@dixiewarp_twitter I can't answer that without knowing what your setup actually is.
Alpinador
@dixiewarp_twitter
Oct 11 2018 22:17
but when you put an external IP and go to internet.....simply dont reach the app port
basically it's some functions for control the flow and broadcast to listeners and send msgs
but setup for connect is simply IP of host and port
Remy Lebeau
@rlebeau
Oct 11 2018 22:19
@dixiewarp_twitter Sounds like either you are not setting up port forwarding correctly in the server's router, or the server's ISP is blocking the incoming connection
Alpinador
@dixiewarp_twitter
Oct 11 2018 22:19
dont know sure
because the server is a VPS windows 2012
located in france
and i'm in spain
but i go to control panel and the server is there because i install IRC Server daemon there and this yes run
with IRC client you put the IP of the server and connects and enter....is all empty
not traffic from now
but is there.....i see the MOTD message.... i can enter in room with /join etc etc
the problem is with a EXE and TCPClient and TCP Server components
tecnically no errors ....run fine
but always get Timeout 10060 socket error
it's a problem with router or firewall
Remy Lebeau
@rlebeau
Oct 11 2018 22:23
@dixiewarp_twitter TIdIRC is a TIdCmdTCPClient descendant, TIdTCPClient and TIdIRC connect to servers in the exact same way
Alpinador
@dixiewarp_twitter
Oct 11 2018 22:24
because some months ago i tested with 2 machines local networked and runs fine
yes
Remy Lebeau
@rlebeau
Oct 11 2018 22:25
@dixiewarp_twitter as I already stated, either the firewall or router is misconfigured, or the ISP is blocking the connection, or you are simply connecting to the wrong IP:Port to begin with
Alpinador
@dixiewarp_twitter
Oct 11 2018 22:25
the thing is i need something easy as messenger or that
not request user dealing with NAT etc
yes
is a problem of routing the socket
Remy Lebeau
@rlebeau
Oct 11 2018 22:26
@dixiewarp_twitter The only way to handle NAT without involving the user is to run a centralized server on the public Internet for all peers to connect to
Alpinador
@dixiewarp_twitter
Oct 11 2018 22:26
something is wrong in VPS firewall or something
Remy Lebeau
@rlebeau
Oct 11 2018 22:26
@dixiewarp_twitter then talk to your VPS provider. This is not an Indy issue, it is a general networking issue. Since you were able to get things working on a local network
Alpinador
@dixiewarp_twitter
Oct 11 2018 22:26
okay
thanks for help me anyway
i make 2 modifications this night with your info
one thing more
i've this function
TForm4::IdIRC1Raw(TIdContext *ASender, bool AIn, const UnicodeString AMessage)
what is *ASender ?
Remy Lebeau
@rlebeau
Oct 11 2018 22:38
@dixiewarp_twitter TIdIRC is a multi-threaded component. It uses an internal worker thread to read incoming data. The TIdContext parameter represents the thread that is calling the event handlers. Similar to the events in TIdTCPServer. However, in the case of the OnRaw event in particular, the TIdContext will be NULL for outgoing commands. The TIdContext will only be non-NULL for incoming commands/notifications from the server.
Alpinador
@dixiewarp_twitter
Oct 11 2018 23:05
aha
okay....i'll try code a bit and if having more help return tomorrow
having = needing