CIRCNetwork::~CIRCNetwork() { if (m_pIRCSock) { CZNC::Get().GetManager().DelSockByAddr(m_pIRCSock); m_pIRCSock = NULL; } // Delete clients while (!m_vClients.empty()) { CZNC::Get().GetManager().DelSockByAddr(m_vClients[0]); } m_vClients.clear(); // Delete servers DelServers(); // Delete modules (this unloads all modules) delete m_pModules; m_pModules = NULL; // Delete Channels for (vector<CChan*>::const_iterator it = m_vChans.begin(); it != m_vChans.end(); ++it) { delete *it; } m_vChans.clear(); SetUser(NULL); // Make sure we are not in the connection queue CZNC::Get().GetConnectionQueue().remove(this); }
void FeatureState::UserDisable(const char* aMessage, const nsACString& aFailureId) { AssertInitialized(); SetUser(FeatureStatus::Disabled, aMessage); SetFailureId(aFailureId); }
XTOOLS_NAMESPACE_BEGIN UserPresenceManagerLeaderImpl::UserPresenceManagerLeaderImpl(const NetworkConnectionPtr& barabooConnection, const UserPtr localUser) : m_barabooConnection(barabooConnection) , m_listenerList(ListenerList::Create()) { SetUser(localUser); m_barabooConnection->AddListener(MessageID::UserPresenceChange, this); }
bool WFSCapabilitiesRequest::Create(rude::CGI& cgi) { const char* val = NULL; SetVersion(cgi["version"]); SetUser(cgi["user"]); SetSourceName(cgi["sourceName"]); SetMapName(cgi["mapName"],true); return true; }
bool DescribeProcessRequest::Create(rude::CGI& cgi) { const char* val = NULL; SetVersion(cgi["version"]); SetUser(cgi["user"]); SetLanguage(cgi["language"]); SetIdentifiers(cgi["identifier"]); return true; }
void UserProfile::handleGotUser(const UserPtr& user) { if (!user || (user->GetId() != m_UserId && !m_UserId.startsWith(user->GetId()))) { return; } m_UserId = user->GetId(); emit userIdChanged(); SetUser(user); }
BOOL SVUnixOpMonitor::init( char * RemoteHost,int Port, char * User, char * Pwd, char * UserPrompt, char * PwdPrompt, char * LoginPrompt) { if(!init()) return FALSE; SetUser(User); SetUserPrompt(UserPrompt); SetPwd(Pwd); SetPwdPrompt(PwdPrompt); SetRemoteHost(RemoteHost); SetPort(Port); SetLoginPrompt(LoginPrompt); return TRUE; }
bool SVUnixOpMonitor::init( string RemoteHost,int Port, string User, string Pwd, string UserPrompt, string PwdPrompt, string LoginPrompt) { if(!init()) return FALSE; SetUser(User.c_str()); SetUserPrompt(UserPrompt.c_str()); SetPwd(Pwd.c_str()); SetPwdPrompt(PwdPrompt.c_str()); SetRemoteHost(RemoteHost.c_str()); SetPort(Port); SetLoginPrompt(LoginPrompt.c_str()); return true; }
CIRCNetwork::CIRCNetwork(CUser *pUser, const CString& sName) { m_pUser = NULL; SetUser(pUser); m_sName = sName; m_pModules = new CModules; m_pIRCSock = NULL; m_uServerIdx = 0; m_sChanPrefixes = ""; m_bIRCAway = false; m_RawBuffer.SetLineCount(100, true); // This should be more than enough raws, especially since we are buffering the MOTD separately m_MotdBuffer.SetLineCount(200, true); // This should be more than enough motd lines m_QueryBuffer.SetLineCount(250, true); }
bool UpdateTileRequest::Create(rude::CGI& cgi) { const char* val = NULL; SetVersion(cgi["version"]); SetUser(cgi["user"]); SetTypeName(cgi["typeName"]); SetMapName(cgi["mapName"]); SetSourceName(cgi["sourceName"]); SetTileStoreName(cgi["tileStore"]); SetLevel(cgi["level"]); SetRow(cgi["row"]); SetCol(cgi["col"]); return true; }
void Daggerstorm::Cast(ObjectRef user, ObjectRef enemy) { for (int i = 0; i < 8; i++) { auto projectileObject = Object::Create(); projectileObject->SetJustEnabled(); static int projectileNumber = 0; std::string name = std::string("projectile") + std::to_string(projectileNumber++); projectileObject->SetName(name); auto projectileComp = projectileObject->AddComponent<ProjectileComponent>(); auto spriteComp = projectileObject->AddComponent<SpriteComponent>(); auto colliderComp = projectileObject->AddComponent<ColliderComponent>(); Vector2f direction = directions[i]; projectileComp->SetDirection(direction); projectileComp->SetSpeed(projectileSpeed); projectileComp->SetSpell(this); projectileComp->SetUser(user); projectileComp->SetCanApplyOnUser(false); spriteComp->SetTexture("dagger.png"); spriteComp->SetSize(Vector2f(20, 40)); colliderComp->InitShape("rectangle", "20, 20"); colliderComp->SetIsStatic(false); colliderComp->SetIsPhantom(true); Vector2f userPos = user->GetComponent<SpriteComponent>()->GetSize(); Vector2f startingPos = user->GetPos() + userPos/2.f; Vector2f projectileSize = spriteComp->GetSize(); float magic = (sqrt(pow(projectileSize.x, 2) + pow(projectileSize.y, 2))) / 2; projectileObject->SetPos(startingPos + magic * direction); g_menuHandler->GetCurrentMenu()->AddChild(std::move(projectileObject)); } r_cooldown = cooldown; }
//-------------------------------------------------------------------------------- GameWorld::GameWorld() :mMode(true), mPlayerCharacter(::Game::GetPlayer()) { _trace Overlay::TheSystem = new Overlay::System; Overlay::TheMessage = Overlay::TheSystem->Instantiate<Overlay::Message>(); Overlay::TheMessage->Hide(); InputHook::GetInstance()->SetListener(this); Overlay::TheSystem->Acquire(); Crypt::RSA::Init(); TheMassiveMessageMgr->SetPort(kGamePort); TheMassiveMessageMgr->SetVersion(kProtocolVersion); TheMassiveMessageMgr->SetGOMServerConstructor(::Game::GameServer::GOMServerConstructor(&GameWorld::ConstructGOMServers)); TheMassiveMessageMgr->SetPlayerConstructor(::Game::GameServer::PlayerConstructor(&GameWorld::ConstructPlayer)); SetUser(EasySteam::Interface::GetInstance()->GetUser()->GetPersonaName()); }
bool RasterMosiacRequest::Create(rude::CGI& cgi) { const char* val = NULL; SetVersion(cgi["version"]); SetUser(cgi["user"]); SetInputRaster_1(cgi["inputRasterName_1"]); SetInputDataSource_1(cgi["inputSourceName_1"]); SetInputPath_1(cgi["inputPath_1"]); SetInputRaster_2(cgi["inputRasterName_2"]); SetInputDataSource_2(cgi["inputSourceName_2"]); SetInputPath_2(cgi["inputPath_2"]); SetOutputRaster(cgi["outputRasterName"]); SetOutputDataSource(cgi["outputSourceName"]); SetOutputPath(cgi["outputPath"]); return true; }
ChatPanel::ChatPanel(wxWindow* parent, User& user, wxImageList* imaglist) : wxPanel(parent, -1) , m_show_nick_list(false) , m_votePanel(0) , m_nicklist(0) , m_chat_tabs((SLNotebook*)parent) , m_channel(0) , m_server(0) , m_user(&user) , m_battle(0) , m_type(CPT_User) , m_popup_menu(NULL) , m_icon_index(3) , m_imagelist(imaglist) , m_disable_append(false) , m_display_joinitem(true) , m_topic_set(false) , m_reactOnPromoteEvents(false) { Init(_T("chatpanel-pm-") + TowxString(user.GetNick())); SetUser(&user); }
void MainObject::DispatchCommand(int ch) { QString default_name; char str[RD_RML_MAX_LENGTH]; RDMacro macro; char buffer[RD_RML_MAX_LENGTH]; char cmd[RD_RML_MAX_LENGTH+4]; int echo=0; QHostAddress addr; // // Common Commands // Authentication not required to execute these! // if(!strcmp(args[ch][0],"DC")) { // Drop Connection socket[ch]->close(); KillSocket(ch); return; } if(!strcmp(args[ch][0],"PW")) { // Password Authenticate if(!strcmp(args[ch][1],ripcd_config->password())) { auth[ch]=true; EchoCommand(ch,"PW +!"); return; } else { auth[ch]=false; EchoCommand(ch,"PW -!"); return; } } // // Priviledged Commands // Authentication required to execute these! // if(!auth[ch]) { EchoArgs(ch,'-'); return; } if(!strcmp(args[ch][0],"RU")) { // Request User EchoCommand(ch,(const char *)QString(). sprintf("RU %s!",(const char *)rdstation->userName())); return; } if(!strcmp(args[ch][0],"SU")) { // Set User SetUser(args[ch][1]); } if(!strcmp(args[ch][0],"MS")) { // Send RML Command if(argnum[ch]<4) { return; } strcpy(str,args[ch][3]); for(int i=4;i<argnum[ch];i++) { strcat(str," "); strcat(str,args[ch][i]); } strcat(str,"!"); } if(macro.parseString(str,strlen(str))) { addr.setAddress(args[ch][1]); macro.setAddress(addr); macro.setRole(RDMacro::Cmd); /* char temp[RD_RML_MAX_LENGTH]; macro.generateString(temp,RD_RML_MAX_LENGTH); LogLine(QString().sprintf("RECEIVED: %s ADDR: %s\n",temp,(const char *)macro.address().toString())); */ if(!macro.address().isNull()) { if(macro.address()==rdstation->address()) { // Local Loopback macro.generateString(buffer,RD_RML_MAX_LENGTH); if(macro.echoRequested()) { echo=1; } sprintf(cmd,"MS %s %d %s",(const char *)macro.address().toString(), echo,buffer); RunLocalMacros(¯o); BroadcastCommand(cmd); } else { sendRml(¯o); } } } if(!strcmp(args[ch][0],"ME")) { // Send RML Reply if(argnum[ch]<4) { return; } strcpy(str,args[ch][3]); for(int i=4;i<argnum[ch];i++) { strcat(str," "); strcat(str,args[ch][i]); } strcat(str,"!"); } if(macro.parseString(str,strlen(str))) { QHostAddress addr; addr.setAddress(args[ch][1]); macro.setAddress(addr); macro.setRole(RDMacro::Reply); if(macro.address()==rdstation->address()) { // Local Loopback macro.generateString(buffer,RD_RML_MAX_LENGTH); sprintf(cmd,"ME %s 0 %s",(const char *)macro.address().toString(), buffer); BroadcastCommand(cmd); } else { sendRml(¯o); } } if(!strcmp(args[ch][0],"RG")) { // Reload the GPI Table LoadGpiTable(); } if(!strcmp(args[ch][0],"GI")) { // Send Complete GPI Status int matrix; sscanf(args[ch][1],"%d",&matrix); SendGpi(ch,matrix); } if(!strcmp(args[ch][0],"GO")) { // Send Complete GPO Status int matrix; sscanf(args[ch][1],"%d",&matrix); SendGpo(ch,matrix); } if(!strcmp(args[ch][0],"GM")) { // Send Complete GPI Mask States int matrix; sscanf(args[ch][1],"%d",&matrix); SendGpiMask(ch,matrix); } if(!strcmp(args[ch][0],"GN")) { // Send Complete GPI Mask States int matrix; sscanf(args[ch][1],"%d",&matrix); SendGpoMask(ch,matrix); } if(!strcmp(args[ch][0],"GC")) { // Send Complete GPI Cart Assignments int matrix; sscanf(args[ch][1],"%d",&matrix); SendGpiCart(ch,matrix); } if(!strcmp(args[ch][0],"GD")) { // Send Complete GPO Cart Assignments int matrix; sscanf(args[ch][1],"%d",&matrix); SendGpoCart(ch,matrix); } if(!strcmp(args[ch][0],"TA")) { // Send Onair Flag State EchoCommand(ch,QString().sprintf("TA %d!",ripc_onair_flag)); } }
void gmVariable::SetUser(gmMachine * a_machine, void * a_userPtr, int a_userType) { SetUser( a_machine->AllocUserObject(a_userPtr, a_userType) ); }
void FeatureState::UserEnable(const char* aMessage) { AssertInitialized(); SetUser(FeatureStatus::Available, aMessage); }
void FeatureState::UserForceEnable(const char* aMessage) { AssertInitialized(); SetUser(FeatureStatus::ForceEnabled, aMessage); }
bool IniSetting::SetUser(const String& name, const Variant& value) { return SetUser(name.toCppString(), variant_to_dynamic(value), FollyDynamic()); }