lol here's the tool SmG Clan uses
if you searched you would've found it
http://www.modacity.net/forums/showt...798-Servertool
lol here's the tool SmG Clan uses
if you searched you would've found it
http://www.modacity.net/forums/showt...798-Servertool
Your looking for this: http://www.vivid-abstractions.net/pr...tom-edition-2/
Your welcome
This is the thread on modacity if you want to discuss it: http://www.modacity.net/forums/showt...Custom-Edition
Like kornman said, quite a few functions use registers for one or more of their parameters, it's easier to just embed the assembly call in another function. The performance difference is basically non-existent.
@sehe: That could cause the disconnects, if you bypass the queue you screw up the packet counters and they get out of sync. I used to have a proxy approach (2-3 years ago) but it was a really bad design and so I changed. Most of the relevant code is included, you should basically just need to to update the addresses. I only included the code I use for global messages (ie sv_say server messages). I just included the actual functions, didn't bother with their headers as you can just copy the declaration to one. I'll explain a bit of the code and if you still want some help, I added you on xfire and can send the whole project.
1. Update addresses, there are only three that need updating. You can make that two if you're only interested in server messages, I have the third so I can handle all chat processing.
2. Call the GlobalMessage function (ie GlobalMessage(L"your message, in wide char...")
3. The first bit of GlobalMessage is just used for variable length parameters, WFormatVarArgs is just a memory safe wrapper around _vsnwprintf_s. I'm sure you have code for doing the same thing. It lets you call the function like GlobalMessage(L"Hello %s", player).
4. The next bit just traverses the player list and sends the message to everyone in the server, (*itr)->memoryId is the player's memory id. I think other people call it their machine index or something. The game::ChatData struct is below, you may want to put byte alignment around it.
If you just want sv_say functionality you can basically get rid of DispatchChat and just put the calls to BuildPacket and AddToPlayerQueue in your GlobalMessage function.Code:struct chatData { DWORD type; DWORD player; wchar_t* msg; };
@ Patrickssj6, they probably can be type defined but I didn't really see the point.
edit: no they can't, they use registers. See lines 95/96 for BuildPacket and 127/158 for the queue functions.
Last edited by urbanyoung; September 22nd, 2011 at 04:59 PM.
Oh now I fully understand what Korn meant: There is no way of creating a function prototype since the original function "changed" through optimizations to use registers. I did know that optimization is quite smart but not that smart xD
Of course one could still inline those two assembly lines before calling the function, or am I missing something here again?
e.g.
_asm MOV EDX,0x7FF8
_asm MOV EAX,output
dwBuildPacket(..., ...)
Last edited by Patrickssj6; September 22nd, 2011 at 05:23 PM.
There are currently 3 users browsing this thread. (0 members and 3 guests)
Bookmarks