MCPcopy Create free account
hub / github.com/bwapi/bwapi / _SStrCopy

Function _SStrCopy

bwapi/BWAPI/Source/Detours.cpp:343–370  ·  view source on GitHub ↗

------------------------------------------------- SEND TEXT ------------------------------------------------

Source from the content-addressed store, hash-verified

341
342//------------------------------------------------- SEND TEXT ------------------------------------------------
343int __stdcall _SStrCopy(char *dest, const char *source, int size)
344{
345 if ( source[0] && isCorrectVersion )
346 {
347 if ( size == 0x7FFFFFFF && BW::BWDATA::gwGameMode == BW::GAME_RUN )
348 {
349 if ( dest == BW::BWDATA::SaveGameFile.data() )
350 {
351 // onSaveGame
352 BWAPI::BroodwarImpl.onSaveGame(source);
353 }
354 else
355 {
356 // onSend Game
357 BWAPI::BroodwarImpl.queueSentMessage(source);
358 if (size > 0) dest[0] = '\0';
359 if (size > 1) dest[1] = '\0';
360 return 0;
361 }
362 }
363 else if ( size == 120 && BW::BWDATA::gwGameMode != BW::GAME_RUN )
364 {
365 // onSend Lobby
366 }
367 }
368 auto SStrCopyProc = _SStrCopyOld ? _SStrCopyOld : &SStrCopy;
369 return SStrCopyProc(dest, source, size);
370}
371
372//----------------------------------------------- RECEIVE TEXT -----------------------------------------------
373BOOL __stdcall _SNetReceiveMessage(int *senderplayerid, char **data, int *databytes)

Callers

nothing calls this directly

Calls 2

queueSentMessageMethod · 0.80
onSaveGameMethod · 0.45

Tested by

no test coverage detected