core/CPlayer.cpp
author David Anderson <dvander@alliedmods.net>
Sat Jan 27 04:21:11 2007 +0000 (2007-01-27)
changeset 396 c0af59ee9ca4
parent 370 d3a484f98f6d
permissions -rw-r--r--
exposed translation natives and fixed build
dvander@370
     1
/**
dvander@370
     2
 * ===============================================================
dvander@370
     3
 * SourceMod (C)2004-2007 AlliedModders LLC.  All rights reserved.
dvander@370
     4
 * ===============================================================
dvander@370
     5
 *
dvander@370
     6
 * This file is not open source and may not be copied without explicit
dvander@370
     7
 * written permission of AlliedModders LLC.  This file may not be redistributed 
dvander@370
     8
 * in whole or significant part.
dvander@370
     9
 * For information, see LICENSE.txt or http://www.sourcemod.net/license.php
dvander@370
    10
 *
dvander@370
    11
 * Version: $Id$
dvander@370
    12
 */
dvander@370
    13
faluco@242
    14
#include "CPlayer.h"
faluco@242
    15
faluco@242
    16
CPlayer::CPlayer()
faluco@242
    17
{
faluco@242
    18
	m_IsConnected = false;
faluco@242
    19
	m_IsInGame = false;
faluco@242
    20
	m_IsAuthorized = false;
faluco@242
    21
	m_PlayerEdict = NULL;
faluco@242
    22
}
faluco@242
    23
faluco@242
    24
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
faluco@242
    25
{
faluco@242
    26
	m_IsConnected = true;
faluco@242
    27
	m_Name.assign(name);
faluco@242
    28
	m_Ip.assign(ip);
faluco@242
    29
	m_PlayerEdict = pEntity;
faluco@242
    30
}
faluco@242
    31
faluco@242
    32
void CPlayer::Connect()
faluco@242
    33
{
faluco@242
    34
	m_IsInGame = true;
faluco@242
    35
}
faluco@242
    36
faluco@242
    37
void CPlayer::Authorize(const char *steamid)
faluco@242
    38
{
faluco@242
    39
	m_IsAuthorized = true;
faluco@242
    40
	m_AuthID.assign(steamid);
faluco@242
    41
}
faluco@242
    42
faluco@242
    43
void CPlayer::Disconnect()
faluco@242
    44
{
faluco@242
    45
	m_IsConnected = false;
faluco@242
    46
	m_IsInGame = false;
faluco@242
    47
	m_IsAuthorized = false;
faluco@242
    48
	m_Name.clear();
faluco@242
    49
	m_Ip.clear();
faluco@242
    50
	m_AuthID.clear();
faluco@242
    51
	m_PlayerEdict = NULL;
faluco@242
    52
}
faluco@242
    53
faluco@242
    54
void CPlayer::SetName(const char *name)
faluco@242
    55
{
faluco@242
    56
	m_Name.assign(name);
faluco@242
    57
}