   Using An Already Active Socket
  Hey all,I am trying to create a program similar to the UOAssist, Razor, and Injection tools for Ultima Online.  I would be using this tool for a player run server, however they all use the same protocol so it doesn't really matter.  Although all the current programs are great and work very well, none of them will run in Linux.  I have even tried using WineX(now Cedega) to run them and it still does not work.  The game client itself will run in WineX without a problem, so I am hoping to write a program that will run in Linux and offer the functionality that I am missing due to the lack of these tools.Here is what I am specifically looking to do, from the gamer's view:In the game, you have 4 different types of potions you can use.  One of the best uses for the above tools is to set a hotkey to "chug" a certain potion.  This functionality does not exist within the game client itself, so anyone not using a third party tool is put at a great disadvantage when it comes to Player vs Player combat.  I want to create a program that will listen for a certain key stroke and then send the packet that corresponds to "chugging" that potion.  I do not have too much experiance with network programming, but I've used C++ quite a bit for a while and I've learned Java rather well in college.  I am not sure which language I would like to use yet, although I probably know C++ better.I have done a great deal of research into the Ultima Online protocol, so I know how to create the packets that I want to send. My probably is that I do not know how to go about "injecting" this new packet into the the current stream between the client on my computer and the server.Would someone be able to offer any ideas on how to do this?  I am more than willing to use another library, as long as it will run in Linux.Thanks,Chris   
  One thing you can do is have your "regular" client connect to your Linux box, instead of the remote server. The program on the Linux box would then, when it gets an incoming connection, connect to the remote server. It would then funnel packet data back and forth, injecting what it needs in the stream.This should be quite feasible, as long as the protocol is well understood, and as long as the remote server won't send IP addresses in the data stream that your client would attempt to connect to. If it does, you have to modify the data stream to have the client (re-)connect to your Linux box for each instance.In fact, what your box is doing is a form of NAT. The Linux kernel NAT package actually allows you to load modules that modify the stream. That environment is not super conducive to application development (as you'll typically need to do kernel debugging), but it's a framework that already handles all of the "munging" bits for you, so that might be an alternative -- configure your Linux box as the gateway of the client, and write your packet filter as a NAT module.   ;  No offense, but this seems like a "cheat" tool.  I dont play Ultima Online, but using "cheat" tools in Tibia <Insert shameless plug>which I do play, and its an awesome game</Insert shameless plug> is against the rules and is worth banning.  Becarefull on what you do with this program you are trying to use.   