Staredit Network > Forums > General StarCraft > Topic: Game networking
Game networking
Aug 12 2015, 1:02 am
By: iCCup.xboi209  

Aug 12 2015, 1:02 am iCCup.xboi209 Post #1

What version of Winsock and which functions does SC use to send and receive ingame packets?

Aug 13 2015, 8:21 pm Neiv Post #2

SC uses UDP, so it would be reasonable to expect that at winsock level it uses sendto/recvfrom.
For what version it uses, I think it calls WSAStartup(0x101) if that is what you mean.. You could just verify it by looking at it in debugger though. It also uses mostly the Berkeley sockets functions.

And most of (all?) the winsock functions are hidden behind the storm SNet api, which may be documented somewhere.

Some info about the storm packet format is here:
Also at end of this page:


Aug 14 2015, 9:35 am iCCup.xboi209 Post #3

What about the functions like WSASendTo/WSARecvFrom? Does SC use a combination of wsock32.dll and ws2_32.dll?

Aug 14 2015, 1:11 pm Neiv Post #4

These are the only winsock functions use by standard.snp
#2 bind
#3 closesocket
#9 htons
#17 recvfrom
#20 sendto
#21 setsockopt
#23 socket
#111 WSAGetLastError
#115 WSAStartup
#116 WSACleanup


At least on my pc though, wsock32 functions just redirect to ws32_32.
Battle.snp uses other functions as well, as it needs to communicate with the chat server, and it is not required to share any of its code with standard.snp, but ingame communication should be the same.


  Back to forum
Please log in to reply to this topic or to report it.
Members in this topic: None.
[01:00 am]
sraw531 -- is there an "easy" (without modding/EUD) way to make flying command centers have a movement speed of ~0 when trying to fly, but can still land/lift?
[12:50 am]
sraw531 -- surprisingly easy to change all the hero marines into normal marines, and vice versa, across the map though.
[12:10 am]
sraw531 -- really hate when SCMdraft replaces deaths with " Memory(17, At least, 1);", makes it so I can't do mass replace for triggers when it changes to memory type :(
[11:02 pm]
MTiger156 -- x
[10:51 pm]
sraw531 -- and sometimes Y
[05:20 pm]
UndeadStar -- e
[04:40 pm]
lil-Inferno -- u
[01:25 pm]
MTiger156 -- a
[06:22 am]
NudeRaider -- double fail
Please log in to shout.

Members Online: Doodan, Dem0n