bool CNtlLogSystem::RegisterChannel( DWORD dwSource, BYTE byChannel, CNtlString strChannelName, CNtlString strLogFileNamePrefix, CNtlString strLogFileNameSuffix, CNtlString strLogFileExtName, bool bIsOn) { if (0 == strLogFileExtName.GetString().length()) { return RegisterChannel(dwSource, byChannel, (char*)(strChannelName.c_str()), (char*)(strLogFileNamePrefix.c_str()), (char*)(strLogFileNameSuffix.c_str()), "csv", bIsOn); } else { return RegisterChannel(dwSource, byChannel, (char*)(strChannelName.c_str()), (char*)(strLogFileNamePrefix.c_str()), (char*)(strLogFileNameSuffix.c_str()), (char*)(strLogFileExtName.c_str()), bIsOn); } }
short SockAccept (void) { SOCKET channel; struct sockaddr_in channelAddr; int nLength = sizeof (channelAddr); short sockRes; if (!ssd.bListen) return WinSockMsg (-1, "socket not in listening mode"); if (ssd.nChannels == MAX_PLAYERS) return WinSockMsg (-1, "server is full"); ssd.status.msgCode = 0; ssd.status.msgText = ""; if (0 > (long) (channel = accept (ssd.socket, (struct sockaddr *) &channelAddr, &nLength))) { WinSockMsg (WSAGetLastError (), NULL); return -1; } return RegisterChannel (channel); }