MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DedicatedSocketputs

Function DedicatedSocketputs

Descent3/dedicated_server.cpp:909–933  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

907}
908
909void DedicatedSocketputs(char *str) {
910 char newstr[300];
911 char buf[2];
912
913 memset(newstr, 0, 300);
914 int len = strlen(str);
915 for (int i = 0; i < len; i++) {
916 if (str[i] == '\n') {
917 strcat(newstr, "\r\n");
918 } else {
919 buf[0] = str[i];
920 buf[1] = '\0';
921 strcat(newstr, buf);
922 }
923 }
924
925 dedicated_socket *conn;
926 conn = Head_sock;
927 while (conn) {
928 if (conn->validated) {
929 send(conn->sock, newstr, strlen(newstr) + 1, 0);
930 }
931 conn = conn->next;
932 }
933}
934
935dedicated_socket *DedicatedLogoutTelnet(dedicated_socket *conn) {
936 // user is no longer valid (so we don't attempt to send them a message

Callers 1

PrintDedicatedMessageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected