Exemplo n.º 1
0
bool GameClient::RunFrame()
{
	ClientEntity * ent;  
	Actor  * actor = NULL;
	BYTE Status;
	if(!gClient->GetIsConnected())
		return false;
	//Check if Menu Mode:

	InterfaceManager* intfc = InterfaceManager::GetSingleton();
	if(!intfc->IsGameMode())
		g_bRenderGUI = false;
	else
		g_bRenderGUI = true;

	if(!gClient->GetIsInitialized() )
	{
		gClient->GetConnection().Process();//Poll connection until a player id is received
		return true;
	}
	// A heavy command xD
	// 1 - send local player data up .
	// 2 - send health magicka and fatigue  + equip up.
	// if MC :
	// 2 - send up position , stat equip , etc of NPCs
	//(*g_thePlayer) is ignored
	ent = (ClientEntity *)gClient->GetEntities()->GetOrCreateEntity(gClient->GetLocalPlayer());
	//gClient->GetServerStream()->Send(); // Prevent Lag
	SendActorPosition(*g_thePlayer,ent);
	SendActorValues(*g_thePlayer,ent);
	SendActorEquip(*g_thePlayer,ent);
	SendActorAnimation(*g_thePlayer,ent);
		//Find all cells any "ignored objects" are in. these are mostly players.
		std::set<TESObjectCELL *> cells;
		cells.insert((*g_thePlayer)->parentCell);
		BOOST_FOREACH(UINT32 i,ignore)
		{
			TESObjectREFR *form = (TESObjectREFR *)LookupFormByID(i);
			if(!form)
				continue;
			if(!form->parentCell) continue;

			if(cells.find(form->parentCell)  == cells.end())//Not present
				cells.insert(form->parentCell);
		}
Exemplo n.º 2
0
static bool Cmd_GetCursorPos_Execute(COMMAND_ARGS)
{
	UInt32 axis = 0;
	*result = 0;

	InterfaceManager* intfc = InterfaceManager::GetSingleton();
	if (intfc->IsGameMode())		// can crash during gamemode if playing full-screen
		return true;

	if (ExtractArgs(PASS_EXTRACT_ARGS, &axis))
	{
		POINT mouseCoords;
		if (GetCursorPos(&mouseCoords))
		{
			if (axis == 'X')
				*result = mouseCoords.x;
			else if (axis == 'Y')
				*result = mouseCoords.y;
		}
	}

	return true;
}