saveGuiPos = false;
keepDownstreams = true;
+ topmostGui = false;
+ startWithGui = false;
+
chanLog="";
maxRelaysIndexTxt = 1; // for PCRaw (relay)
+
+ { //JP-MOD
+#ifdef WIN32
+ guiSimpleChannelList = false;
+ guiSimpleConnectionList = false;
+ guiTopMost = false;
+
+ guiChanListDisplays = 10;
+ guiConnListDisplays = 10;
+
+ guiTitleModify = false;
+ guiTitleModifyNormal = "PeerCast \8eó\90M:%rx.kbits.1%kbps \91\97\90M:%tx.kbits.1%kbps";
+ guiTitleModifyMinimized = "R:%rx.kbytes%KB/s T:%tx.kbytes%KB/s";
+
+ guiAntennaNotifyIcon = false;
+#endif
+
+ disableAutoBumpIfDirect = 1;
+ asxDetailedMode = 1;
+ }
}
// -----------------------------------
BCID *ServMgr::findValidBCID(int index)
numFilters++;
+ LOG_DEBUG("numFilters = %d", numFilters);
}
// -----------------------------------
iniFile.writeIntValue("maxRelaysIndexTxt", servMgr->maxRelaysIndexTxt); // for PCRaw (relay)
+ { //JP-MOD
+ iniFile.writeIntValue("disableAutoBumpIfDirect",servMgr->disableAutoBumpIfDirect);
+ iniFile.writeIntValue("asxDetailedMode",servMgr->asxDetailedMode);
+
+ iniFile.writeSection("PP");
+#ifdef WIN32
+ iniFile.writeBoolValue("ppClapSound", servMgr->ppClapSound);
+ iniFile.writeStrValue("ppClapSoundPath", servMgr->ppClapSoundPath.cstr());
+#endif
+ }
+
//JP-EX
iniFile.writeSection("Windows");
iniFile.writeBoolValue("getModulePath",servMgr->getModulePath);
iniFile.writeIntValue("guiLeft", winPlace.rcNormalPosition.left);
iniFile.writeIntValue("guiRight", winPlace.rcNormalPosition.right);
}
+
+ { //JP-MOD
+ iniFile.writeBoolValue("guiSimpleChannelList", servMgr->guiSimpleChannelList);
+ iniFile.writeBoolValue("guiSimpleConnectionList", servMgr->guiSimpleConnectionList);
+ iniFile.writeBoolValue("guiTopMost", servMgr->guiTopMost);
+
+ iniFile.writeIntValue("guiChanListDisplays", servMgr->guiChanListDisplays);
+ iniFile.writeIntValue("guiConnListDisplays", servMgr->guiConnListDisplays);
+
+ iniFile.writeBoolValue("guiTitleModify", servMgr->guiTitleModify);
+ iniFile.writeStrValue("guiTitleModifyNormal", servMgr->guiTitleModifyNormal.cstr());
+ iniFile.writeStrValue("guiTitleModifyMinimized", servMgr->guiTitleModifyMinimized.cstr());
+
+ iniFile.writeBoolValue("guiAntennaNotifyIcon", servMgr->guiAntennaNotifyIcon);
+ }
+
+ iniFile.writeBoolValue("topmostGui", servMgr->topmostGui);
+ iniFile.writeBoolValue("startWithGui", servMgr->startWithGui);
#endif
int i;
iniFile.writeBoolValue("PeerCast",notifyMask&NT_PEERCAST);
iniFile.writeBoolValue("Broadcasters",notifyMask&NT_BROADCASTERS);
iniFile.writeBoolValue("TrackInfo",notifyMask&NT_TRACKINFO);
+ iniFile.writeBoolValue("Applause",notifyMask&NT_APPLAUSE); //JP-MOD
iniFile.writeLine("[End]");
else if (iniFile.isName("maxRelaysIndexTxt")) // for PCRaw (relay)
servMgr->maxRelaysIndexTxt = iniFile.getIntValue();
+ //JP-MOD
+ else if (iniFile.isName("disableAutoBumpIfDirect"))
+ servMgr->disableAutoBumpIfDirect = iniFile.getIntValue();
+ else if (iniFile.isName("asxDetailedMode"))
+ servMgr->asxDetailedMode = iniFile.getIntValue();
+
+#ifdef WIN32
+ else if (iniFile.isName("ppClapSound"))
+ servMgr->ppClapSound = iniFile.getBoolValue();
+ else if (iniFile.isName("ppClapSoundPath"))
+ servMgr->ppClapSoundPath.set(iniFile.getStrValue(),String::T_ASCII);
+#endif
+
//JP-Windows
else if (iniFile.isName("getModulePath"))
servMgr->getModulePath = iniFile.getBoolValue();
if (servMgr->saveGuiPos){
guiFlg = true;
}
+ }else if (iniFile.isName("guiSimpleChannelList")) //JP-MOD
+ servMgr->guiSimpleChannelList = iniFile.getBoolValue();
+ else if (iniFile.isName("guiSimpleConnectionList")) //JP-MOD
+ servMgr->guiSimpleConnectionList = iniFile.getBoolValue();
+ else if (iniFile.isName("guiTopMost")) //JP-MOD
+ servMgr->guiTopMost = iniFile.getBoolValue();
+ else if (iniFile.isName("guiChanListDisplays")) //JP-MOD
+ servMgr->guiChanListDisplays = iniFile.getIntValue();
+ else if (iniFile.isName("guiConnListDisplays")) //JP-MOD
+ servMgr->guiConnListDisplays = iniFile.getIntValue();
+ else if (iniFile.isName("guiTitleModify")) //JP-MOD
+ servMgr->guiTitleModify = iniFile.getBoolValue();
+ else if (iniFile.isName("guiTitleModifyNormal")) //JP-MOD
+ servMgr->guiTitleModifyNormal.set(iniFile.getStrValue(),String::T_ASCII);
+ else if (iniFile.isName("guiTitleModifyMinimized")) //JP-MOD
+ servMgr->guiTitleModifyMinimized.set(iniFile.getStrValue(),String::T_ASCII);
+ else if (iniFile.isName("guiAntennaNotifyIcon")) //JP-MOD
+ servMgr->guiAntennaNotifyIcon = iniFile.getBoolValue();
+
+ else if (iniFile.isName("topmostGui"))
+ {
+ servMgr->topmostGui = iniFile.getBoolValue();
+ } else if (iniFile.isName("startWithGui"))
+ {
+ servMgr->startWithGui = iniFile.getBoolValue();
}
#endif
if (numFilters < (MAX_FILTERS-1))
numFilters++;
+ LOG_DEBUG("*** numFilters = %d", numFilters);
}
else if (iniFile.isName("[Notify]"))
{
notifyMask |= iniFile.getBoolValue()?NT_BROADCASTERS:0;
else if (iniFile.isName("TrackInfo"))
notifyMask |= iniFile.getBoolValue()?NT_TRACKINFO:0;
+ else if (iniFile.isName("Applause")) //JP-MOD
+ notifyMask |= iniFile.getBoolValue()?NT_APPLAUSE:0;
}
}
if (!numFilters)
setFilterDefaults();
+ LOG_DEBUG("numFilters = %d", numFilters);
}
// --------------------------------------------------
#else
priv = "";
#endif
-#ifdef VERSION_EX
- LOG_DEBUG("Peercast %s, %s %s",PCX_VERSTRING_EX,peercastApp->getClientTypeOS(),priv);
-#else
- LOG_DEBUG("Peercast %s, %s %s",PCX_VERSTRING,peercastApp->getClientTypeOS(),priv);
-#endif
+ if (version_ex)
+ {
+ LOG_DEBUG("Peercast %s, %s %s",PCX_VERSTRING_EX,peercastApp->getClientTypeOS(),priv);
+ } else
+ {
+ LOG_DEBUG("Peercast %s, %s %s",PCX_VERSTRING,peercastApp->getClientTypeOS(),priv);
+ }
sessionID.toStr(idStr);
LOG_DEBUG("SessionID: %s",idStr);
atom.writeBytes(PCP_BCST_FROM,servMgr->sessionID.id,16);
atom.writeInt(PCP_BCST_VERSION,PCP_CLIENT_VERSION);
atom.writeInt(PCP_BCST_VERSION_VP,PCP_CLIENT_VERSION_VP);
-#ifdef VERSION_EX
- atom.writeBytes(PCP_BCST_VERSION_EX_PREFIX,PCP_CLIENT_VERSION_EX_PREFIX,2);
- atom.writeShort(PCP_BCST_VERSION_EX_NUMBER,PCP_CLIENT_VERSION_EX_NUMBER);
-#endif
+ if (version_ex)
+ {
+ atom.writeBytes(PCP_BCST_VERSION_EX_PREFIX,PCP_CLIENT_VERSION_EX_PREFIX,2);
+ atom.writeShort(PCP_BCST_VERSION_EX_NUMBER,PCP_CLIENT_VERSION_EX_NUMBER);
+ }
atom.writeParent(PCP_PUSH,3);
atom.writeInt(PCP_PUSH_IP,to.ip);
atom.writeShort(PCP_PUSH_PORT,to.port);
ChanPacket pack;
MemoryStream mem(pack.data,sizeof(pack.data));
AtomStream atom(mem);
-#ifndef VERSION_EX
+ if (version_ex == 0)
+ {
atom.writeParent(PCP_BCST,7);
-#else
+ } else
+ {
atom.writeParent(PCP_BCST,9);
-#endif
- atom.writeChar(PCP_BCST_GROUP,PCP_BCST_GROUP_TRACKERS);
- atom.writeChar(PCP_BCST_HOPS,0);
- atom.writeChar(PCP_BCST_TTL,7);
- atom.writeBytes(PCP_BCST_FROM,sessionID.id,16);
- atom.writeInt(PCP_BCST_VERSION,PCP_CLIENT_VERSION);
- atom.writeInt(PCP_BCST_VERSION_VP,PCP_CLIENT_VERSION_VP);
-#ifdef VERSION_EX
+ }
+ atom.writeChar(PCP_BCST_GROUP,PCP_BCST_GROUP_TRACKERS);
+ atom.writeChar(PCP_BCST_HOPS,0);
+ atom.writeChar(PCP_BCST_TTL,7);
+ atom.writeBytes(PCP_BCST_FROM,sessionID.id,16);
+ atom.writeInt(PCP_BCST_VERSION,PCP_CLIENT_VERSION);
+ atom.writeInt(PCP_BCST_VERSION_VP,PCP_CLIENT_VERSION_VP);
+ if (version_ex)
+ {
atom.writeBytes(PCP_BCST_VERSION_EX_PREFIX,PCP_CLIENT_VERSION_EX_PREFIX,2);
atom.writeShort(PCP_BCST_VERSION_EX_NUMBER,PCP_CLIENT_VERSION_EX_NUMBER);
-#endif
- writeRootAtoms(atom,getUpdate);
+ }
+ writeRootAtoms(atom,getUpdate);
mem.len = mem.pos;
mem.rewind();
String str;
if (var == "version")
-#ifdef VERSION_EX
- strcpy(buf,PCX_VERSTRING_EX);
-#else
- strcpy(buf,PCX_VERSTRING);
-#endif
+ if (version_ex)
+ {
+ strcpy(buf,PCX_VERSTRING_EX);
+ } else
+ {
+ strcpy(buf,PCX_VERSTRING);
+ }
else if (var == "uptime")
{
str.setFromStopwatch(getUptime());
sprintf(buf,"%d",getFirewall()==FW_UNKNOWN?0:1);
else if (var == "rootMsg")
strcpy(buf,rootMsg);
- else if (var == "isRoot")
+ else if (var == "isRoot"){
+ LOG_DEBUG("isRoot = %d", isRoot);
sprintf(buf,"%d",isRoot?1:0);
+ }
else if (var == "isPrivate")
sprintf(buf,"%d",(PCP_BROADCAST_FLAGS&1)?1:0);
else if (var == "forceYP")
sprintf(buf,"%d",maxBitrateOut);
else if (var == "maxControlsIn")
sprintf(buf,"%d",maxControl);
- else if (var == "numFilters")
+ else if (var == "maxServIn")
+ sprintf(buf,"%d",maxServIn);
+ else if (var == "numFilters") {
+ LOG_DEBUG("*-* numFilters = %d", numFilters);
sprintf(buf,"%d",numFilters+1);
+ }
else if (var == "maxPGNUIn")
sprintf(buf,"%d",maxGnuIncoming);
else if (var == "minPGNUIn")
else if (var == "enableGetName")
strcpy(buf, (enableGetName == 1)? "1":"0");
+ //JP-MOD
+ else if (var == "disableAutoBumpIfDirect")
+ strcpy(buf, (disableAutoBumpIfDirect == 1) ? "1":"0");
+ else if (var.startsWith("asxDetailedMode"))
+ {
+ if (var == "asxDetailedMode.0")
+ strcpy(buf, (asxDetailedMode == 0) ? "1":"0");
+ else if (var == "asxDetailedMode.1")
+ strcpy(buf, (asxDetailedMode == 1) ? "1":"0");
+ else if (var == "asxDetailedMode.2")
+ strcpy(buf, (asxDetailedMode == 2) ? "1":"0");
+ }
+
// VP-EX
else if (var == "ypAddress2")
strcpy(buf,rootHost2.cstr());
}
}
+// --------------------------------------------------
+#if 0
+static ChanHit *findServentHit(Servent *s)
+{
+ ChanHitList *chl = chanMgr->findHitListByID(s->chanID);
+ Host h = s->getHost();
+
+ if (chl)
+ {
+ ChanHit *hit = chl->hit;
+ while (hit)
+ {
+ if ((hit->numHops == 1) && hit->host.isValid() && (h.ip == hit->host.ip))
+ return hit;
+ hit = hit->next;
+ }
+ }
+ return NULL;
+}
+#endif
+// --------------------------------------------------
+int ServMgr::kickUnrelayableHost(GnuID &chid, ChanHit &sendhit)
+{
+ Servent *ks = NULL;
+ Servent *s = servMgr->servents;
+
+ while (s)
+ {
+ if (s->type == Servent::T_RELAY && s->chanID.isSame(chid) && !s->isPrivate())
+ {
+ Host h = s->getHost();
+
+ ChanHit hit = s->serventHit;
+ if (!hit.relay && hit.numRelays == 0)
+ {
+ char hostName[256];
+ h.toStr(hostName);
+ //s->thread.active = false;
+ LOG_DEBUG("unrelayable Servent : %s",hostName);
+ if (!ks || s->lastConnect < ks->lastConnect) // elder servent
+ ks = s;
+ }
+ }
+ s = s->next;
+ }
+
+ if (ks)
+ {
+ if (sendhit.rhost[0].port)
+ {
+ ChanPacket pack;
+ MemoryStream mem(pack.data,sizeof(pack.data));
+ AtomStream atom(mem);
+ sendhit.writeAtoms(atom, chid);
+ pack.len = mem.pos;
+ pack.type = ChanPacket::T_PCP;
+ GnuID noID;
+ noID.clear();
+
+ ks->sendPacket(pack, chid, noID, noID, Servent::T_RELAY);
+ }
+
+ ks->setStatus(Servent::S_CLOSING);
+ ks->thread.active = false;
+
+ char hostName[256];
+ ks->getHost().toStr(hostName);
+
+ LOG_DEBUG("Stop unrelayable Servent : %s",hostName);
+
+ return 1;
+ }
+
+ return 0;
+}