Ambiera ForumDiscussions, Help and Support. |
|
[ 1 2 3 ] Page 1 of 3 |
|
|||||
|
Hi.... This is the command to send data to TCP port using command line. curl telnet://192.168.0.170:59403 <<< someText This is the javascript code to execute this command https://www.ambiera.com/coppercu... This is an example of PHP to listen to the port on the server https://stackoverflow.com/questi... Congratulations you can now send data to a server using TCP which is what AAA systems use for networking. Bye Bye |
||||
|
Where it says 'some Test' simply insert a javascript variable holding the data through string concatination... Tutorial done! |
||||
|
Hi Zoo, This is not a websocket connection. I'm also on windows and don't have curl. How do I read the received data, though? |
||||
|
Curl is installed by default on all windows connections. Websocket differs from TCP in that it enables a stream of messages instead of a stream of bytes... Same protocol. |
||||
|
It also seems that TCP is faster then standard websockets because websockets share a port with https thus, there is typically more traffic on a websocket port, depending on your applications structure. |
||||
|
Ok, but still how do you read the received data from coppercube game client? |
||||
|
Linked above |
||||
|
No it's not. Tcp is basically a two way data stream: one is incomming another one is outcomming. - can we agree on this statement? So: Firstly, you use system function to spawn a cmd process (which takes time), then it calls curl (which also takes time) and then you use telnet protocol (?) to send the data. After that the tcp connection gets closed, i.e. data stream from the host stops, since the cmd instance which holds it closes. Every time you call system function from the code these steps repeat again. I'm not sure if it's "faster" in any way even compared to the built-in http client. Secondly, there is also an incomming stream. The question is how do I read it from the game? - curl runs inside the separate process and there is no ipc. You haven't described this part, and without being able to read the data it doesn't make any sence to use this approach at all. |
||||
|
and he will never be able to explain it, cause he don't know. He can only link back to the other websites that has nothing to do with CC. If you really want to check out curl and other multiplayer stuff than checkout @Ngame stuff, he has already used curl and other stuff to create a playable multiplayer game in coppercube. I am not sure if he is active anymore in the community. or ask @sven, or @rolevix they also had created some multiplayar scripts |
||||
|
Hahahahahahahahahahahahahahahaha TCP slower then http hahahahahahahahahahaha aiming bullets...go away, you are a troll and not a programmer... FYI - https also returns a response and is built o top of TCP as a second layer just like a web socket connection. If you wanted a one way connection you would need to use UDP. |
||||
|
Hahahahahahaha TCP always returns a response. If you knew anything about TCP you would know that it is super simple to parse that response. Buy I won't tell you how because you are a troll and not a real programmer |
||||
|
@zoo TCP doesn't return a response TCP is just a both ways data streams. Telnet might return a response, I dunno. It was introduced in like 70s, I'm not that old to catch up with this crap. My question is not how do I parse the response, it is how do I get the byte/string/object/whatever data type response from cmd process there you run curl to coppercube process?. These are two different processes which do not share memory. There is actually no option for IPC in coppercube as I mentioned before. To simplify my question: imagine, you have two instances of coppercube game running on the same machine, so there is no need for any networking now. How do you interchange data between them? @Aiming_bullets To tell the truth I'm just interested in what Zoo can propose. |
||||
|
LOL https://www.freecodecamp.org/news/tcp-vs-udp/ |
||||
|
Simple... Use CMD command to save returned data to file and call data via javascript.... Really it is not hard...That is just one way of doing it |
||||
|
Another method is to do the same thing but via a batch script. Also, CMD is technology older then the internet. It's origins are in dos which ran on 386 computers... If you think that running a cmd call is slow, then you don't understand networking. Also TCP always returns a response because it is a handshacking service. The data, however needs to be parsed on the other end and sent back manually Furthermore... TCP keeps the connection open at all times and always returns a response...running a bat script with TCP commands and within that bat script, writing the data to file is sufficient to keep that connection open and updating the io. It is a simple method, that I have tested and it works. Another method is to simply use CMD to make a direct connection to Mysql or other.... Mysql Uses TCP and it is not hard to insert the variables.... |
[ 1 2 3 ] Page 1 of 3 |
|