コード例 #1
0
void MMatchServer::OnAdminForumAnnounce(const MUID& uidAdmin, const char* szChat)
{
	MMatchObject* pObj = GetObject(uidAdmin);
	if (pObj == NULL) return;

	// 관리자 권한을 가진 사람이 아니면 연결을 끊는다.
	if (!IsAdminGrade(pObj))
	{
//		DisconnectObject(uidAdmin);		
		return;
	}

	char szMsg[256];
	strcpy(szMsg, szChat);
	MCommand* pCmd = CreateCommand(MC_ADMIN_FORUM_ANNOUNCE, MUID(0,0));
	pCmd->AddParameter(new MCmdParamUID(uidAdmin));
	pCmd->AddParameter(new MCmdParamStr(szMsg));

	RouteToAllClient(pCmd);
}
コード例 #2
0
ファイル: MMatchAdmin.cpp プロジェクト: Asunaya/RefinedGunz
bool MMatchServer::OnAdminExecute(MAdminArgvInfo* pAI, char* szOut, int maxlen)
{
	szOut[0] = 0;

	if (pAI->cargc <= 0) return false;

	// wall
	if (!_stricmp(pAI->cargv[0], "wall"))
	{
		if (pAI->cargc < 3)
		{
			sprintf_safe(szOut, maxlen, "인자가 부족합니다.");
			return true;
		}

		char szMsg[256];
		int nMsgType = 0;

		strcpy_safe(szMsg, pAI->cargv[1]);
		nMsgType = atoi(pAI->cargv[2]);


		MCommand* pCmd = CreateCommand(MC_ADMIN_ANNOUNCE, MUID(0,0));
		pCmd->AddParameter(new MCmdParamUID(MUID(0,0)));
		pCmd->AddParameter(new MCmdParamStr(szMsg));
		pCmd->AddParameter(new MCmdParamUInt(nMsgType));

		RouteToAllClient(pCmd);
	}
	else
	{
		sprintf_safe(szOut, maxlen, "%s: no such command", pAI->cargv[0]);
	}
	
	return true;
}