本文整理汇总了C++中GetHost函数的典型用法代码示例。如果您正苦于以下问题:C++ GetHost函数的具体用法?C++ GetHost怎么用?C++ GetHost使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetHost函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: CreateEntityByName
CBaseEntity * CEntHost::GiveNamedItem( const char * szName, int iSubType, bool removeIfNotCarried )
{
// If I already own this type don't create one
if ( GetHost()->Weapon_OwnsThisType( szName, iSubType ) )
return NULL;
CBaseEntity *pEntity = CreateEntityByName( szName );
if ( !pEntity ) {
Msg( "NULL Ent in GiveNamedItem!\n" );
return NULL;
}
pEntity->SetLocalOrigin( GetLocalOrigin() );
pEntity->AddSpawnFlags( SF_NORESPAWN );
CBaseCombatWeapon *pWeapon = dynamic_cast<CBaseCombatWeapon *>(pEntity);
DispatchSpawn( pEntity );
if ( pWeapon ) {
pWeapon->SetSubType( iSubType );
GetHost()->Weapon_Equip( pWeapon );
}
else {
if ( pEntity && !(pEntity->IsMarkedForDeletion()) ) {
pEntity->Touch( GetHost() );
}
}
return pEntity;
}
开发者ID:WootsMX,项目名称:InSource,代码行数:32,代码来源:ent_host.cpp
示例2: strcpy
const char* NNTPConnection::JoinGroup(const char* grp)
{
if (m_szActiveGroup && !strcmp(m_szActiveGroup, grp))
{
// already in group
strcpy(m_szLineBuf, "211 ");
return m_szLineBuf;
}
char tmp[1024];
snprintf(tmp, 1024, "GROUP %s\r\n", grp);
tmp[1024-1] = '\0';
const char* answer = Request(tmp);
if (answer && !strncmp(answer, "2", 1))
{
debug("Changed group to %s on %s", grp, GetHost());
if (m_szActiveGroup)
{
free(m_szActiveGroup);
}
m_szActiveGroup = strdup(grp);
}
else
{
debug("Error changing group on %s to %s: %s.", GetHost(), grp, answer);
}
return answer;
}
开发者ID:Bootz,项目名称:nzbget,代码行数:32,代码来源:NNTPConnection.cpp
示例3: GetHost
void CEntHost::Precache()
{
GetHost()->PrecacheModel( GetHostModel() );
GetHost()->PrecacheScriptSound( "Player.Death" );
GetHost()->PrecacheScriptSound( "Player.Pain" );
}
开发者ID:WootsMX,项目名称:InSource,代码行数:7,代码来源:ent_host.cpp
示例4: GetUser
bool
PeerIdentity::Equals(const nsAString& aOtherString) const
{
nsString user;
GetUser(mPeerIdentity, user);
nsString otherUser;
GetUser(aOtherString, otherUser);
if (user != otherUser) {
return false;
}
nsString host;
GetHost(mPeerIdentity, host);
nsString otherHost;
GetHost(aOtherString, otherHost);
nsresult rv;
nsCOMPtr<nsIIDNService> idnService
= do_GetService("@mozilla.org/network/idn-service;1", &rv);
if (NS_WARN_IF(NS_FAILED(rv))) {
return host == otherHost;
}
nsCString normHost;
GetNormalizedHost(idnService, host, normHost);
nsCString normOtherHost;
GetNormalizedHost(idnService, otherHost, normOtherHost);
return normHost == normOtherHost;
}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:29,代码来源:PeerIdentity.cpp
示例5: f_part_insecure_users
// Parts all insecure users on a +z channel (NOT KICK)
void f_part_insecure_users (aChannel *chptr)
{
Member *member, *mb2;
aClient *cptr;
char *comment = "Insecure user not allowed on secure channel (+z)";
for (member = chptr->members; member; member = mb2)
{
mb2 = member->next;
cptr = member->cptr;
if (MyClient(cptr) && !IsSecureConnect(cptr) && !IsULine(cptr))
{
RunHook4(HOOKTYPE_LOCAL_PART, cptr, &me, chptr, comment);
if ((chptr->mode.mode & MODE_AUDITORIUM) && is_chanownprotop(cptr, chptr))
{
sendto_chanops_butone(cptr, chptr, ":%s!%[email protected]%s PART %s :%s",
cptr->name, cptr->user->username, GetHost(cptr), chptr->chname, comment);
sendto_prefix_one(cptr, &me, ":%s!%[email protected]%s PART %s :%s",
cptr->name, cptr->user->username, GetHost(cptr), chptr->chname, comment);
}
else
{
sendto_channel_butserv(chptr, &me, ":%s!%[email protected]%s PART %s :%s",
cptr->name, cptr->user->username, GetHost(cptr), chptr->chname, comment);
}
sendto_one(cptr, err_str(ERR_SECUREONLYCHAN), me.name, cptr->name, chptr->chname);
sendto_serv_butone_token(&me, cptr->name, MSG_PART, TOK_PART, "%s :%s", chptr->chname, comment);
remove_user_from_channel(cptr, chptr);
}
}
}
开发者ID:wirelesspt,项目名称:unreal,代码行数:31,代码来源:f_ulinessl.c
示例6: SetLastError
int CService::GetStatus () {
SC_HANDLE hSCM = NULL;
SC_HANDLE hService = NULL;
SERVICE_STATUS ss;
int nResult;
do {
if (!GetServiceName () || !GetHost () || !GetPort ()) {
nResult = SERVICE_STATUS_BAD_CONFIG;
break;
}
if (m_nWinsock) {
nResult = SERVICE_STATUS_BAD_WINSOCK;
SetLastError (m_nWinsock);
break;
}
hSCM = OpenSCManager (_scmHost (GetHost ()), NULL, GENERIC_READ);
if (!hSCM) {
nResult = SERVICE_STATUS_BAD_SCM;
break;
}
hService = OpenService (hSCM, GetServiceName (), SERVICE_INTERROGATE);
if (!hService) {
DWORD dwError = GetLastError ();
switch (dwError) {
case ERROR_SERVICE_DOES_NOT_EXIST :
nResult = SERVICE_STATUS_NOT_INSTALLED;
break;
default :
nResult = SERVICE_STATUS_CONNECTOR_ERROR;
break;
}
break;
}
if (!ControlService (hService, SERVICE_CONTROL_INTERROGATE, &ss)) {
DWORD dwError = GetLastError ();
switch (dwError) {
case ERROR_SERVICE_NEVER_STARTED :
case ERROR_SERVICE_NOT_ACTIVE :
nResult = SERVICE_STATUS_STOPPED;
break;
case ERROR_SERVICE_CANNOT_ACCEPT_CTRL :
nResult = SERVICE_STATUS_BUSY;
break;
default :
nResult = SERVICE_STATUS_QUERY_ERROR;
break;
}
break;
}
if (ss.dwCurrentState != SERVICE_RUNNING) {
nResult = SERVICE_STATUS_BUSY;
break;
}
nResult = _socketConnect (GetHost (), GetPort ()) ? SERVICE_STATUS_OK : SERVICE_STATUS_STARTING;
} while (FALSE);
if (hSCM) CloseServiceHandle (hSCM);
if (hService) CloseServiceHandle (hService);
return nResult;
}
开发者ID:Vineeth-Mohan,项目名称:OG-Platform,代码行数:59,代码来源:service.cpp
示例7: OnInit
void BaseAnimation::OnInit(void)
{
m_transform = (Transform*)GetHost()->FindComponent(CRC(0xF543030E, "Transform"));
if (!m_transform)
{
m_transform = (Transform*)GetHost()->FindComponentByType(CRC(0xF543030E, "Transform"));
}
Dbg_Assert(m_transform != NULL);
}
开发者ID:rickjuang,项目名称:helium,代码行数:9,代码来源:base_animation.cpp
示例8: GetSocket
void ChatServerConnection::OnReceive(const char *pBuffer, uint32 nSize)
{
if (pBuffer) {
// Compose server message (we use the string copy constructor to ensure that there's a correct terminating zero)
const String sMessage = GetSocket().GetSocketAddress().GetHost() + ": '" + String(pBuffer, true, nSize-1) + '\''; // -1 = excluding the terminating zero
// Write the message into the log and start a new line
System::GetInstance()->GetConsole().Print(sMessage + '\n');
// Send message to all clients
for (uint32 i=0; i<GetHost().GetConnections().GetNumOfElements(); i++)
GetHost().GetConnections().Get(i)->Send(sMessage.GetASCII(), sMessage.GetLength()+1); // +1 so we also send the terminating zero
}
}
开发者ID:Tank-D,项目名称:potential-octo-dubstep,代码行数:14,代码来源:ChatServerConnection.cpp
示例9: send_who_reply
static void send_who_reply(aClient *sptr, aClient *acptr,
char *channel, char *status, char *xstat)
{
char *stat;
char *host;
int flat = (FLAT_MAP && !IsAnOper(sptr)) ? 1 : 0;
stat = malloc(strlen(status) + strlen(xstat) + 1);
sprintf(stat, "%s%s", status, xstat);
if (IsAnOper(sptr))
{
if (who_flags & WF_REALHOST)
host = acptr->user->realhost;
else if (who_flags & WF_IP)
host = (acptr->user->ip_str ? acptr->user->ip_str :
acptr->user->realhost);
else
host = GetHost(acptr);
}
else
host = GetHost(acptr);
if (IsULine(acptr) && !IsOper(sptr) && HIDE_ULINES)
sendto_one(sptr, getreply(RPL_WHOREPLY), me.name, sptr->name,
channel, /* channel name */
acptr->user->username, /* user name */
host, /* hostname */
"hidden", /* let's hide the server from normal users if the server is a uline and HIDE_ULINES is on */
acptr->name, /* nick */
stat, /* status */
0, /* hops (hidden) */
acptr->info /* realname */
);
else
sendto_one(sptr, getreply(RPL_WHOREPLY), me.name, sptr->name,
channel, /* channel name */
acptr->user->username, /* user name */
host, /* hostname */
acptr->user->server, /* server name */
acptr->name, /* nick */
stat, /* status */
flat ? 0 : acptr->hopcount, /* hops */
acptr->info /* realname */
);
free(stat);
}
开发者ID:Adam-,项目名称:unrealircd,代码行数:49,代码来源:m_who.c
示例10: GetHost
void MultiViewerConnectDlg::OnOKButtonClick( wxCommandEvent& event )
{
wxString wxstrHost = GetHost();
if(wxstrHost.IsEmpty())
{
SQLUtil::AlertDlg(_T("No Host"));
return;
}
//wxString wxstrPort = GetPort();
//if(wxstrPort.IsEmpty())
//{
// SQLUtil::AlertDlg(_T("No Port"));
// return;
//}
//wxString wxstrName = GetName();
//if(wxstrName.IsEmpty())
//{
// SQLUtil::AlertDlg(_T("No ID"));
// return;
//}
//wxString wxstrPassword = GetPassword();
//if(wxstrPassword.IsEmpty())
//{
// SQLUtil::AlertDlg(_T("No Password"));
// return;
//}
EndModal(wxID_OK);
}
开发者ID:yiunsr,项目名称:multidbviewer,代码行数:32,代码来源:MultiViewerConnectDlg.cpp
示例11: DzMilUnixTime
unsigned long long DzMilUnixTime()
{
DzHost* host = GetHost();
assert( host );
return (unsigned long long)MilUnixTime( host );
}
开发者ID:Foreverflying,项目名称:DzCot,代码行数:7,代码来源:DzCot.c
示例12: GetHost
void RawFormatWidget::showEvent( QShowEvent *event )
{
if (!m_Format)
{
m_Format = GetHost()->NewFormat();
}
SourceInfo info;
rawSource->GetInfo(info);
ui.Title->setText(rawSource->GetPath());
ui.Width->setText(QString::number(info.format->Width()));
ui.Height->setText(QString::number(info.format->Height()));
int idx = 0;
for (int j=0; j<COLOR_COUNT; j++)
{
if (colors[j] == info.format->Color())
{
idx = j;
}
}
ui.Color->setCurrentIndex(idx);
ui.FPS->setValue(info.maxFps);
/*ui.Stride0->setText(QString::number(info.format->Stride(0)));
ui.Stride1->setText(QString::number(info.format->Stride(1)));
ui.Stride2->setText(QString::number(info.format->Stride(2)));
ui.Stride3->setText(QString::number(info.format->Stride(3)));*/
}
开发者ID:Gamaru,项目名称:yuvtoolkit,代码行数:29,代码来源:RawFormatWidget.cpp
示例13: WriteLine
const char* NntpConnection::Request(const char* req)
{
if (!req)
{
return nullptr;
}
m_authError = false;
WriteLine(req);
char* answer = ReadLine(m_lineBuf, m_lineBuf.Size(), nullptr);
if (!answer)
{
return nullptr;
}
if (!strncmp(answer, "480", 3))
{
debug("%s requested authorization", GetHost());
if (!Authenticate())
{
return nullptr;
}
//try again
WriteLine(req);
answer = ReadLine(m_lineBuf, m_lineBuf.Size(), nullptr);
}
return answer;
}
开发者ID:ta264,项目名称:nzbget,代码行数:34,代码来源:NntpConnection.cpp
示例14: DzFreeEx
void DzFreeEx( void* p )
{
DzHost* host = GetHost();
assert( host );
FreeEx( host, p );
}
开发者ID:Foreverflying,项目名称:DzCot,代码行数:7,代码来源:DzCot.c
示例15: DzLatestMilUnixTime
unsigned long long DzLatestMilUnixTime()
{
DzHost* host = GetHost();
assert( host );
return (unsigned long long)host->latestMilUnixTime;
}
开发者ID:Foreverflying,项目名称:DzCot,代码行数:7,代码来源:DzCot.c
示例16: NS_ENSURE_ARG_POINTER
nsresult
nsPermissionManager::CommonTestPermission(nsIURI *aURI,
const char *aType,
PRUint32 *aPermission,
PRBool aExactHostMatch)
{
NS_ENSURE_ARG_POINTER(aURI);
NS_ENSURE_ARG_POINTER(aType);
// set the default
*aPermission = nsIPermissionManager::UNKNOWN_ACTION;
nsCAutoString host;
nsresult rv = GetHost(aURI, host);
// no host doesn't mean an error. just return the default
if (NS_FAILED(rv)) return NS_OK;
PRInt32 typeIndex = GetTypeIndex(aType, PR_FALSE);
// If type == -1, the type isn't known,
// so just return NS_OK
if (typeIndex == -1) return NS_OK;
nsHostEntry *entry = GetHostEntry(host, typeIndex, aExactHostMatch);
if (entry)
*aPermission = entry->GetPermission(typeIndex).mPermission;
return NS_OK;
}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:28,代码来源:nsPermissionManager.cpp
示例17: NS_ENSURE_TRUE
NS_IMETHODIMP
nsSiteSecurityService::RemoveState(uint32_t aType, nsIURI* aURI, uint32_t aFlags)
{
// Should be called on the main thread (or via proxy) since the permission
// manager is used and it's not threadsafe.
NS_ENSURE_TRUE(NS_IsMainThread(), NS_ERROR_UNEXPECTED);
// Only HSTS is supported at the moment.
NS_ENSURE_TRUE(aType == nsISiteSecurityService::HEADER_HSTS,
NS_ERROR_NOT_IMPLEMENTED);
nsAutoCString hostname;
nsresult rv = GetHost(aURI, hostname);
NS_ENSURE_SUCCESS(rv, rv);
bool isPrivate = aFlags & nsISocketProvider::NO_PERMANENT_STORAGE;
rv = RemovePermission(hostname, STS_PERMISSION, isPrivate);
NS_ENSURE_SUCCESS(rv, rv);
SSSLOG(("SSS: deleted maxage permission\n"));
rv = RemovePermission(hostname, STS_SUBDOMAIN_PERMISSION, isPrivate);
NS_ENSURE_SUCCESS(rv, rv);
SSSLOG(("SSS: deleted subdomains permission\n"));
return NS_OK;
}
开发者ID:cbrem,项目名称:gecko-dev,代码行数:26,代码来源:nsSiteSecurityService.cpp
示例18: __DzDbgLastErr
int __DzDbgLastErr()
{
DzHost* host = GetHost();
assert( host );
return __Dbg( GetLastErr )( host );
}
开发者ID:Foreverflying,项目名称:DzCot,代码行数:7,代码来源:DzCot.c
示例19: __DzDbgSynObjLeak
int __DzDbgSynObjLeak()
{
DzHost* host = GetHost();
assert( host );
return __Dbg( GetSynObjLeak )( host );
}
开发者ID:Foreverflying,项目名称:DzCot,代码行数:7,代码来源:DzCot.c
示例20: __DzDbgParamNodeLeak
int __DzDbgParamNodeLeak()
{
DzHost* host = GetHost();
assert( host );
return __Dbg( GetParamNodeLeak )( host );
}
开发者ID:Foreverflying,项目名称:DzCot,代码行数:7,代码来源:DzCot.c
注:本文中的GetHost函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论