Пример #1
0
int LuaLobby::LeaveChannel(lua_State *L)
{
	LuaLobby* lob = toLuaLobby(L, 1);
	std::string channame(luaL_checkstring(L, 2));
	lob->LeaveChannel(channame);
	return 0;
}
Пример #2
0
int LuaLobby::RequestMutelist(lua_State *L)
{
	LuaLobby* lob = toLuaLobby(L, 1);
	std::string channame(luaL_checkstring(L, 2));
	lob->RequestMutelist(channame);
	return 0;
}
void  makeGaussianSignals(SigData_t& m_sigdata)
{
  //std::vector<TH1D *> vgsh(NUMCHAN);
  std::vector<TH1D *> vcdfh(NUMCHAN);

  if( m_sigdata.find("gs") == m_sigdata.end() ) {
    cerr << "Gaussian signal data not found, not making CDF signal!" << endl;
    return;
  }

  for (int ichan=0; ichan<NUMCHAN; ichan++) {
    TH1D *cdfh;

    TString channame(channames[ichan]);
    TString name;

    TH1D * gsh = m_sigdata["gs"].at(ichan);

    assert(gsh) ;

#if 0
    name = "Signalgs_"+channame;
    gsh = (TH1D *)tch->Clone(name.Data());

    assert(gsh);

    gsh->SetTitle("Gaussian signal");
    
    gsh->Reset();

    TF1 *g = (TF1 *)gROOT->GetFunction("gaus");
    g->SetParameters(1,gaussian_mean_mass_gev,gaussian_mass_sigma_gev);
    gsh->FillRandom("gaus",100000);

    // norm to 1pb signal with 1/fb integrated luminosity
    double norm = 1000 * gseffxacc[ichan]/gsh->Integral(0,gsh->GetNbinsX()+1,"width");

    //gsh->Scale(norm/eff_fudgefactor); // kludge: pre-undo the fudge in the next module
    gsh->Scale(norm);

    vgsh[ichan] = gsh;
#endif

    // New CDF bump, same as Gauss but set to CDF (obs/theor)*(LHC theor) = 3.43pb
    cdfh = (TH1D *)gsh->Clone("CDFbump");

    cdfh->Scale(3.43);

    vcdfh[ichan] = cdfh;

    cdfh->Draw();

    gsh->Draw("same");

  } // channel loop

  //m_sigdata["gs"]  = vgsh;
  m_sigdata["cdf"] = vcdfh;
}                                                           // makeGaussianSignals
Пример #4
0
int LuaLobby::SayEx(lua_State *L)
{
	LuaLobby* lob = toLuaLobby(L, 1);
	std::string channame(luaL_checkstring(L, 2));
	std::string message(luaL_checkstring(L, 3));
	lob->SayEx(channame, message);
	return 0;
}
Пример #5
0
int LuaLobby::ChangeTopic(lua_State *L)
{
	LuaLobby* lob = toLuaLobby(L, 1);
	std::string channame(luaL_checkstring(L, 2));
	std::string topic(luaL_checkstring(L, 3));
	lob->ChangeTopic(channame, topic);
	return 0;
}
Пример #6
0
int LuaLobby::KickChannelMember(lua_State *L)
{
	LuaLobby* lob = toLuaLobby(L, 1);
	std::string channame(luaL_checkstring(L, 2));
	std::string user(luaL_checkstring(L, 3));
	std::string reason(luaL_checkstring(L, 4));
	lob->KickChannelMember(channame, user, reason);
	return 0;
}
Пример #7
0
int LuaLobby::JoinChannel(lua_State *L)
{
	LuaLobby* lob = toLuaLobby(L, 1);
	std::string channame(luaL_checkstring(L, 2));
	std::string passwd = "";
	if (lua_isstring(L, 3))
		passwd = luaL_checkstring(L, 3);
	lob->JoinChannel(channame, passwd);
	return 0;
}
Пример #8
0
void quassel_irssi_backlog(void* arg, int msg_id, int timestamp, int bufferid, int network, char* buffer_id, char* sender, int type, int flags, char* content) {
	(void) msg_id;
	(void) bufferid;
	(void) type;
	(void) flags;
	Quassel_SERVER_REC *server = (Quassel_SERVER_REC*)arg;

	char *chan = channame(network, buffer_id);
	char *nick = strdup(sender);
	char *address;
	if( (address=index(nick, '!')) != NULL)
		*address = 0;
	address++;

	GSList *win = windows;
	while(win) {
		WINDOW_REC* winrec = (WINDOW_REC*) win->data;
		if(winrec->active_server != SERVER(server) &&
			winrec->connect_server != SERVER(server))
			goto next;

		if(!winrec->active)
			goto next;

		if(strcmp(winrec->active->visible_name, chan)!=0)
			goto next;

		if(!WINDOW_GUI(winrec) ||
				!WINDOW_GUI(winrec)->view ||
				!WINDOW_GUI(winrec)->view->buffer)
			goto next;

		LINE_INFO_REC lineinforec;
		lineinforec.time=timestamp;
		lineinforec.level = 0;

		LINE_REC* pos = WINDOW_GUI(winrec)->view->buffer->first_line;
		LINE_REC* before = pos;
		for(; pos!=NULL; pos = pos->next) {
			if(pos->info.time >= timestamp)
				break;
			before = pos;
		}

		unsigned char *data = NULL;
		int len = asprintf((char**)&data, "%d:%s:%sxx", timestamp, nick, content);
		data[len-2]=0;
		data[len-1]=0x80;
		LINE_REC *linerec = textbuffer_insert(WINDOW_GUI(winrec)->view->buffer, before, data, len, &lineinforec);
		free(data);
		textbuffer_view_insert_line(WINDOW_GUI(winrec)->view, linerec);
		if(WINDOW_GUI(winrec)->insert_after)
			WINDOW_GUI(winrec)->insert_after = linerec;

		WINDOW_GUI(winrec)->view->dirty = 1;
		winrec->last_line = time(NULL);

		mainwindows_redraw();
next:
		win = g_slist_next(win);
	}
	free(nick);
}