NegativeNrG Posted December 25, 2005 Share Posted December 25, 2005 hello, i was wondering if it was possible to send a text from a GUI to a game server(through TCP) i know nothing about TCP so i was wondering if someone was able to start me up with a script? Thanks. [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
MrSpacely Posted December 25, 2005 Share Posted December 25, 2005 hello, i was wondering if it was possible to send a text from a GUI to a game server(through TCP)i know nothing about TCP so i was wondering if someone was able to start me up with a script?Thanks.Depends on the game almost every game has a differend way to connect.Lots of new games need cd keys to be able to logon also for security. Link to comment Share on other sites More sharing options...
themax90 Posted December 25, 2005 Share Posted December 25, 2005 It is more then possible. You just need too retreive the data from the GUI and send too the server. Have it store it. ETC. I already have a project dealing with this . Just read up the TCP Functionality and check my posts for examples... AutoIt Smith Link to comment Share on other sites More sharing options...
MrSpacely Posted December 25, 2005 Share Posted December 25, 2005 It is more then possible. You just need too retreive the data from the GUI and send too the server. Have it store it. ETC. I already have a project dealing with this . Just read up the TCP Functionality and check my posts for examples...AutoIt Smithexcept for te post where you say you cannot send files over tcp functions over te internet.donot read those all the scary capslock text in there.For te record it is possible I made a script wich does work (unlike the really slow half working one posted there in the ideas section).So you could also send binary data to chat (althougt chat almost always is text data) Link to comment Share on other sites More sharing options...
NegativeNrG Posted December 26, 2005 Author Share Posted December 26, 2005 thanks for your reply, because i got a huge list of game servers ips/ports that hopefully will connect, and ill look keep an eye on your post, and your programs. [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
themax90 Posted December 26, 2005 Share Posted December 26, 2005 I have developed ITS Servers, internal server structures, admindb server, remote server, and a few other things. You should be able to extract ideas and examples from that. Link to comment Share on other sites More sharing options...
themax90 Posted December 26, 2005 Share Posted December 26, 2005 That is a bit flawed. Try this too build from: expandcollapse popupGlobal Const $Port = 50911 Global $MaxConc = 100 Global $MainSocket = TCPStartServer($Port, $MaxConc) If @error <> 0 Then Exit MsgBox(16, "Error", "Server unable to initialize.") Global Const $MaxLength = 512 Global $ConnectedSocket[$MaxConc] Global $CurrentSocket = 0 Local $Track = 0 Global Const $MaxConnection = ($MaxConc - 1) For $Track = 0 To $MaxConnection Step 1 $ConnectedSocket[$Track] = -1 Next While 1 $ConnectedSocket[$CurrentSocket] = TCPAccept($MainSocket) If $ConnectedSocket[$CurrentSocket] <> - 1 Then $CurrentSocket = SocketSearch() EndIf $Track = 0 For $Track = 0 To $MaxConnection Step 1 If $ConnectedSocket[$Track] <> - 1 Then $Data = TCPRecv($ConnectedSocket[$Track], $MaxLength) If $Data = "~bye" Then TCPCloseSocket($ConnectedSocket[$Track]) $ConnectedSocket[$Track] = -1 $CurrentSocket = SocketSearch() ElseIf $Data <> "" Then TCPSendMessageAll($MaxConnection, $Data) EndIf EndIf Next WEnd Func TCPSendMessageAll($ConnectionLimit, $Data) Local $Track = 0 For $Track = 0 To $ConnectionLimit Step 1 If $ConnectedSocket[$Track] <> - 1 Then TCPSend($ConnectedSocket[$Track], $Data) Next EndFunc ;==>TCPSendMessageAll Func TCPStartServer($Port, $MaxConnect = 1) Local $Socket $Socket = TCPStartup() Select Case $Socket = 0 SetError(@error) Return -1 EndSelect $Socket = TCPListen(@IPAddress1, $Port, $MaxConnect) Select Case $Socket = -1 SetError(@error) Return 0 EndSelect SetError(0) Return $Socket EndFunc ;==>TCPStartServer Func SocketSearch() Local $Track = 0 For $Track = 0 To $MaxConnection Step 1 If $ConnectedSocket[$Track] = -1 Then Return $Track Else ; Socket In Use EndIf Next EndFunc ;==>SocketSearch Link to comment Share on other sites More sharing options...
MrSpacely Posted December 26, 2005 Share Posted December 26, 2005 (edited) Servers are almost always remote. For security you have to create more checking this aint save. Too much points where incorrect data can be received. Edited December 26, 2005 by MrSpacely Link to comment Share on other sites More sharing options...
NegativeNrG Posted December 26, 2005 Author Share Posted December 26, 2005 Thanks for your replys, But Smoke_N Figured it out!, Thanks . Happy Holidays! [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
MrSpacely Posted December 26, 2005 Share Posted December 26, 2005 Thanks for your replys, But Smoke_N Figured it out!, Thanks .Happy Holidays!Great but how could anyone help not even the name of the game was mentioned Link to comment Share on other sites More sharing options...
themax90 Posted December 26, 2005 Share Posted December 26, 2005 MySpacely, if you do not understand something, ask something about it. That server is an EXAMPLE structure which may need too be added to according too what people want. I gave him a base, which is what he needed. Also, you can always figure something out, without knowing the game. I don't know your real name, but I can tell you aren't very logical...... Link to comment Share on other sites More sharing options...
blademonkey Posted January 16, 2006 Share Posted January 16, 2006 That is a bit flawed. Try this too build from: expandcollapse popupGlobal Const $Port = 50911 Global $MaxConc = 100 Global $MainSocket = TCPStartServer($Port, $MaxConc) If @error <> 0 Then Exit MsgBox(16, "Error", "Server unable to initialize.") Global Const $MaxLength = 512 Global $ConnectedSocket[$MaxConc] Global $CurrentSocket = 0 Local $Track = 0 Global Const $MaxConnection = ($MaxConc - 1) For $Track = 0 To $MaxConnection Step 1 $ConnectedSocket[$Track] = -1 Next While 1 $ConnectedSocket[$CurrentSocket] = TCPAccept($MainSocket) If $ConnectedSocket[$CurrentSocket] <> - 1 Then $CurrentSocket = SocketSearch() EndIf $Track = 0 For $Track = 0 To $MaxConnection Step 1 If $ConnectedSocket[$Track] <> - 1 Then $Data = TCPRecv($ConnectedSocket[$Track], $MaxLength) If $Data = "~bye" Then TCPCloseSocket($ConnectedSocket[$Track]) $ConnectedSocket[$Track] = -1 $CurrentSocket = SocketSearch() ElseIf $Data <> "" Then TCPSendMessageAll($MaxConnection, $Data) EndIf EndIf Next WEnd Func TCPSendMessageAll($ConnectionLimit, $Data) Local $Track = 0 For $Track = 0 To $ConnectionLimit Step 1 If $ConnectedSocket[$Track] <> - 1 Then TCPSend($ConnectedSocket[$Track], $Data) Next EndFunc ;==>TCPSendMessageAll Func TCPStartServer($Port, $MaxConnect = 1) Local $Socket $Socket = TCPStartup() Select Case $Socket = 0 SetError(@error) Return -1 EndSelect $Socket = TCPListen(@IPAddress1, $Port, $MaxConnect) Select Case $Socket = -1 SetError(@error) Return 0 EndSelect SetError(0) Return $Socket EndFunc ;==>TCPStartServer Func SocketSearch() Local $Track = 0 For $Track = 0 To $MaxConnection Step 1 If $ConnectedSocket[$Track] = -1 Then Return $Track Else ; Socket In Use EndIf Next EndFunc ;==>SocketSearch Pardon my noobishness, but where did you find the documentation for these functions (like, TCPStartServer and all). I'm trying to create my own chat, but I would like to read the documentation first. Please point me in the right direction thanks. ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung Link to comment Share on other sites More sharing options...
NegativeNrG Posted January 16, 2006 Author Share Posted January 16, 2006 he just made his own UDF just i duno why.. look at the BETA help file to see the TCP/UDP Funcs. [size=20]My File Upload[/size]Register at my site and upload. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now