Advertisement
ijontichy

<stdin>

Jul 7th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. diff -r 00065f166c52 src/sv_main.cpp
  2. --- a/src/sv_main.cpp Sun Aug 19 22:11:18 2012 +0200
  3. +++ b/src/sv_main.cpp Sun Jul 07 12:30:32 2013 -0400
  4. @@ -1072,28 +1072,36 @@
  5. // [BB] This is to make the lines readily identifiable, necessary
  6. // for MiX-MaN's IRC server control tool for example.
  7. bool sv_logfiletimestampOldValue = sv_logfiletimestamp;
  8. - if( sv_markchatlines )
  9. - {
  10. - Printf( "CHAT " );
  11. - sv_logfiletimestamp = false;
  12. - }
  13. + char outString[512];
  14. + char tmpString[256];
  15. +
  16. + memset(outString, 0, 512 * sizeof(char));
  17. + memset(tmpString, 0, 256 * sizeof(char));
  18. +
  19. + snprintf(outString, 512, "CHAT %% ");
  20. + sv_logfiletimestamp = false;
  21. +
  22. // Print this message in the server's local window.
  23. if ( strnicmp( "/me", pszString, 3 ) == 0 )
  24. {
  25. pszString += 3;
  26. if ( ulPlayer == MAXPLAYERS )
  27. - Printf( "* <server>%s\n", pszString );
  28. + snprintf(tmpString, 256, "* <server> %%%s\n", pszString);
  29. else
  30. - Printf( "* %s%s\n", players[ulPlayer].userinfo.netname, pszString );
  31. + snprintf(tmpString, 256, "* %s %%%s\n", players[ulPlayer].userinfo.netname, pszString);
  32. }
  33. else
  34. {
  35. if ( ulPlayer == MAXPLAYERS )
  36. - Printf( "<server>: %s\n", pszString );
  37. + snprintf(tmpString, 256, "<server> %% %s\n", pszString );
  38. else
  39. - Printf( "%s: %s\n", players[ulPlayer].userinfo.netname, pszString );
  40. - }
  41. - if( sv_markchatlines && sv_logfiletimestampOldValue )
  42. + snprintf(tmpString, 256, "%s %% %s\n", players[ulPlayer].userinfo.netname, pszString );
  43. + }
  44. +
  45. + strcat(outString, tmpString);
  46. + Printf("%s", outString); // ugly hack to circumvent Printf processing
  47. +
  48. + if( sv_logfiletimestampOldValue )
  49. sv_logfiletimestamp = true;
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement