core/CPlayer.cpp
author Borja Ferrer <faluco@alliedmods.net>
Sat Jan 20 02:12:53 2007 +0000 (2007-01-20)
changeset 333 b668cbd49c35
parent 242 9dcd59d9014a
child 370 d3a484f98f6d
permissions -rw-r--r--
plugins get updated on map change
maponly plugins get unloaded on map change
faluco@242
     1
#include "CPlayer.h"
faluco@242
     2
faluco@242
     3
CPlayer::CPlayer()
faluco@242
     4
{
faluco@242
     5
	m_IsConnected = false;
faluco@242
     6
	m_IsInGame = false;
faluco@242
     7
	m_IsAuthorized = false;
faluco@242
     8
	m_PlayerEdict = NULL;
faluco@242
     9
}
faluco@242
    10
faluco@242
    11
void CPlayer::Initialize(const char *name, const char *ip, edict_t *pEntity)
faluco@242
    12
{
faluco@242
    13
	m_IsConnected = true;
faluco@242
    14
	m_Name.assign(name);
faluco@242
    15
	m_Ip.assign(ip);
faluco@242
    16
	m_PlayerEdict = pEntity;
faluco@242
    17
}
faluco@242
    18
faluco@242
    19
void CPlayer::Connect()
faluco@242
    20
{
faluco@242
    21
	m_IsInGame = true;
faluco@242
    22
}
faluco@242
    23
faluco@242
    24
void CPlayer::Authorize(const char *steamid)
faluco@242
    25
{
faluco@242
    26
	m_IsAuthorized = true;
faluco@242
    27
	m_AuthID.assign(steamid);
faluco@242
    28
}
faluco@242
    29
faluco@242
    30
void CPlayer::Disconnect()
faluco@242
    31
{
faluco@242
    32
	m_IsConnected = false;
faluco@242
    33
	m_IsInGame = false;
faluco@242
    34
	m_IsAuthorized = false;
faluco@242
    35
	m_Name.clear();
faluco@242
    36
	m_Ip.clear();
faluco@242
    37
	m_AuthID.clear();
faluco@242
    38
	m_PlayerEdict = NULL;
faluco@242
    39
}
faluco@242
    40
faluco@242
    41
void CPlayer::SetName(const char *name)
faluco@242
    42
{
faluco@242
    43
	m_Name.assign(name);
faluco@242
    44
}