Ejemplo n.º 1
0
//Sends a fleet back to it's home planet
void TaeTurn::sendHome(uint32_t fleet) {
    Game* game = Game::getGame();
    ObjectManager* obm = game->getObjectManager();
    ObjectTypeManager* obtm = game->getObjectTypeManager();
    PlayerManager* pm = game->getPlayerManager();

    IGObject* fleetobj = obm->getObject(fleet);
    //Check to make sure it is really a fleet
    if(fleetobj->getType() != obtm->getObjectTypeByName("Fleet")) {
        return;
    }
    
    //Get all the required objects
    Fleet* f = (Fleet*) fleetobj->getObjectBehaviour();
    Player* p = pm->getPlayer(f->getOwner());
    IGObject* sys = obm->getObject(fleetobj->getParent());
    StarSystem* sysData = (StarSystem*) sys->getObjectBehaviour();

    //Remove fleet from system
    sysData->setRegion(0);
    fleetobj->removeFromParent();

    //Find it's home planet
    std::set<uint32_t> objects = obm->getAllIds();
    std::set<uint32_t>::iterator itcurr;
    for(itcurr = objects.begin(); itcurr != objects.end(); ++itcurr) {
        IGObject * ob = obm->getObject(*itcurr);
        if(ob->getName().compare(string(p->getName() + "'s Home Planet")) == 0) {
            Planet* p = (Planet*) ob->getObjectBehaviour();
            f->setPosition(p->getPosition());
            fleetobj->addToParent(ob->getID());
        }
    }
}
Ejemplo n.º 2
0
void JukeboxImplementation::doMusicSelection(CreatureObject* player) {
	PlayerObject* ghost = player->getPlayerObject();

	if (ghost == NULL)
		return;

	PlayerManager* playerManager = player->getZoneServer()->getPlayerManager();

	if (playerManager == NULL)
		return;

	ManagedReference<SuiListBox*> listbox = new SuiListBox(player, SuiWindowType::JUKEBOX_SELECTION);
    listbox->setCallback(new JukeboxSelectionSuiCallback(server->getZoneServer()));
	listbox->setPromptTitle("@event_perk_jukebox_songs:songs_t"); // Music Select
	listbox->setPromptText("@event_perk_jukebox_songs:songs_d"); // Select a song to play from the list below.
	listbox->setUsingObject(_this.getReferenceUnsafeStaticCast());
	listbox->setForceCloseDistance(32.f);
	listbox->setCancelButton(true, "@cancel");

	int songListSize = playerManager->getNumJukeboxSongs();
	JukeboxSong* song = NULL;

	for (int i = 0; i < songListSize; i++) {
		song = playerManager->getJukeboxSong(i);

		if (song != NULL) {
			listbox->addMenuItem(song->getStringId());
		}
	}

	ghost->addSuiBox(listbox);
	player->sendMessage(listbox->generateMessage());
}
Ejemplo n.º 3
0
//-------------------------------------------------------------------------
void CardMovePlayerToPosition::action(
        PlayerManager &i_players
        )
{
    i_players.setPosition(m_newPosition);
    std::cout<< "Move " << i_players.getName() << " to " << i_players.getPosition() << " position." << std::endl;
}
Ejemplo n.º 4
0
BOOL CMDUnsilence::Execute(const std::string &verb, Player* mobile,std::vector<std::string> &args,int subcmd)
{
    World* world = World::GetPtr();
    PlayerManager* manager = world->GetPlayerManager();
    Player* targ = nullptr;

    if (!args.size())
    {
        mobile->Message(MSG_ERROR, "Syntax: unsilence <player>");
        return false;
    }

    targ = manager->FindPlayer(args[0]);
    if (!targ)
    {
        mobile->Message(MSG_ERROR, "Could not find the specified player.");
        return false;
    }
    if (!BitIsSet(targ->GetPflag(), PF_SILENCE))
    {
        mobile->Message(MSG_INFO, "That player is not silenced.");
        return false;
    }

    targ->SetPflag(BitClear(mobile->GetPflag(), PF_SILENCE));
    mobile->Message(MSG_INFO, Capitalize(targ->GetName())+" has been unsilenced.");
    world->WriteLog(Capitalize(targ->GetName())+" was unsilenced by "+Capitalize(mobile->GetName())+".");
    targ->Message(MSG_INFO, "You were unsilenced by "+Capitalize(mobile->GetName())+".");
    return true;
}
Ejemplo n.º 5
0
BOOL CMDDisconnect::Execute(const std::string &verb, Player* mobile,std::vector<std::string> &args,int subcmd)
{
    World* world = World::GetPtr();
    PlayerManager* manager = world->GetPlayerManager();
    Player* target = nullptr;

    if (!args.size())
    {
        mobile->Message(MSG_ERROR, "Syntax: disconnect <player>");
        return false;
    }

    target=manager->FindPlayer(args[0]);
    if (!target)
    {
        mobile->Message(MSG_ERROR, "I could not find that player.");
        return false;
    }
    if (mobile == target)
    {
        mobile->Message(MSG_ERROR, "If you really want to disconnect yourself, you could just use quit.");
        return false;
    }

    if ((BitIsSet(target->GetRank(), RANK_GOD)) || (BitIsSet(target->GetRank(), RANK_ADMIN)))
    {
        mobile->Message(MSG_ERROR, "You can't disconnect that person.");
        return false;
    }

    target->GetSocket()->Kill();
    return true;
}
int RingObjectMenuComponent::handleObjectMenuSelect(SceneObject* sceneObject, CreatureObject* player, byte selectedID) const {
	if (selectedID == 22) { // Propose Unity
		if (!sceneObject->isASubChildOf(player))
			return 0;

		ManagedReference<SceneObject*> target = player->getZoneServer()->getObject(player->getTargetID());

		if (target != NULL && target->isPlayerCreature()) {
			PlayerManager* playerManager = player->getZoneServer()->getPlayerManager();

			if (playerManager != NULL)
				playerManager->proposeUnity(player, cast<CreatureObject*>(target.get()), sceneObject);

			return 0;
		} else {
			player->sendSystemMessage("@unity:bad_target"); // "You must have a valid player target to Propose Unity."
			return 0;
		}

	} else if (selectedID == 234) { // Divorce
		if (!sceneObject->isASubChildOf(player))
			return 0;

		PlayerManager* playerManager = player->getZoneServer()->getPlayerManager();

		if (playerManager != NULL)
			playerManager->promptDivorce(player);

		return 0;
	}

	return TangibleObjectMenuComponent::handleObjectMenuSelect(sceneObject, player, selectedID);
}
Ejemplo n.º 7
0
bool Enemigo::personaje_en_radio(MapaServidor& mapa,PlayerManager& pm,TileServidor*& tilePersonaje){
	//it-> first = nick
	//it-> second = pje
	//TileServidor* tileEnemigo = mapa.getTilePorPixeles(this->getX(),this->getY());
	//int XlogicoEnemigo = tileEnemigo->getU();
	//int YlogicoEnemigo = tileEnemigo->getV();
	int XlogicoEnemigo = this->getX();
	int YlogicoEnemigo = this->getY();

	bool encontro_personaje = false;
	//posiciones fisicas
	for(auto it = pm.getPlayers().begin();it != pm.getPlayers().end(); it++) {
	
		int XLogicoPersonaje = it->second.getX();
		int YLogicoPersonaje = it->second.getY();

		if( (XLogicoPersonaje >= (XlogicoEnemigo - radioAtaque)) && (XLogicoPersonaje <= (XlogicoEnemigo + radioAtaque)) ){
			if( (YLogicoPersonaje >= (YlogicoEnemigo - radioAtaque)) && (YLogicoPersonaje <= (YlogicoEnemigo + radioAtaque)) ){
				encontro_personaje = true;
				tilePersonaje = mapa.getTile( XLogicoPersonaje,YLogicoPersonaje);
				break;
			}
		}
	}
	
	return encontro_personaje;
}
Ejemplo n.º 8
0
BOOL CMDMkwiz::Execute(const std::string &verb, Player* mobile,std::vector<std::string> &args,int subcmd)
{
    World* world = World::GetPtr();
    PlayerManager* manager = world->GetPlayerManager();
    Player* target = nullptr;

    if (!args.size())
    {
        mobile->Message(MSG_ERROR,"You must specify the person that you would like to make a wizard.\n");
        return false;
    }

    target=manager->FindPlayer(args[0]);
    if (target==mobile)
    {
        mobile->Message(MSG_ERROR,"You may not make yourself a wizard.");
        return false;
    }
    if (target==nullptr)
    {
        mobile->Message(MSG_ERROR,"That person couldn't be found.");
        return false;
    }
    if (BitIsSet(target->GetRank(),RANK_GOD))
    {
        mobile->Message(MSG_ERROR,"That person is already a wizard.");
        return false;
    }

    target->SetRank(BitSet(mobile->GetRank(), RANK_PLAYTESTER|RANK_NEWBIEHELPER|RANK_BUILDER|RANK_ADMIN|RANK_GOD));
    target->Message(MSG_INFO,"You suddenly feel more wizardly.");
    mobile->Message(MSG_INFO, Capitalize(target->GetName())+" has been made a wizard.");
    return true;
}
Ejemplo n.º 9
0
//-----------------------------------------------------------------------------
void CardReceiveMoneyFromPlayers::action(
        PlayerManager &i_players
        )
{
	//Uses method in PlayerManager 
    i_players.takeBalance(i_players.getMoneyFromEachPlayer(m_balanceToAdd));
}
Ejemplo n.º 10
0
jint Java_com_lisa_testplayer_jni_LocalPlayer_translateColor(JNIEnv *env,jobject thiz,jbyteArray out){
	PlayerManager *playerManager = PlayerManager::GetInstance();
	jbyte *Picture= env->GetByteArrayElements(out,0);
	playerManager->translate_color(Picture);
	env->ReleaseByteArrayElements(out, Picture, 0);

}
Ejemplo n.º 11
0
BOOL CMDMkbuilder::Execute(const std::string &verb, Player* mobile,std::vector<std::string> &args,int subcmd)
{
    World* world = World::GetPtr();
    PlayerManager* manager = world->GetPlayerManager();
    Player* target = nullptr;

    if (!args.size())
    {
        mobile->Message(MSG_ERROR,"You must specify the person that you would like to make a builder.\n");
        return false;
    }

    target=manager->FindPlayer(args[0]);
    if (target==nullptr)
    {
        mobile->Message(MSG_ERROR,"That person couldn't be found.");
        return false;
    }
    if (mobile == target)
    {
        mobile->Message(MSG_INFO, "You may not make yourself a builder.");
        return false;
    }
    if (BitIsSet(target->GetRank(),RANK_BUILDER))
    {
        mobile->Message(MSG_ERROR,"That person is already a builder.");
        return false;
    }

    target->SetRank(BitSet(mobile->GetRank(),RANK_BUILDER));
    target->Message(MSG_INFO,"You were made a builder.");
    mobile->Message(MSG_INFO, Capitalize(target->GetName())+" was made a builder.");
    return true;
}
Ejemplo n.º 12
0
jint Java_com_lisa_testplayer_jni_LocalPlayer_open(JNIEnv* env, jobject thiz, jstring pFileName) {
	FFmpegDecoder *ffmpegDecoder = FFmpegDecoder::GetInstance();
	const char *_filename = env->GetStringUTFChars(pFileName, NULL);
	ffmpegDecoder->open_video(_filename);
	PlayerManager *playerManager = PlayerManager::GetInstance();
	playerManager->init_player();
	env->ReleaseStringUTFChars(pFileName, _filename);
}
bool CampSiteActiveAreaImplementation::despawnCamp() {
	Locker locker(_this.get());

	if(!abandoned && campOwner != NULL && campOwner->getZoneServer() != NULL) {
		/// Get Player Manager
		PlayerManager* playerManager = campOwner->getZoneServer()->getPlayerManager();
		if (playerManager == NULL) {
			error("playerManager is null");
			return false;
		}

		float durationUsed = ((float)(System::getTime() - timeCreated)) / (campStructureData->getDuration() / 4);
		if (durationUsed > 1)
			durationUsed = 1;

		int amount = 0;
		int campXp = campStructureData->getExperience();
		amount = (int)(campXp * durationUsed);

		amount += (int)((visitors.size() -1) * (campXp / 30) * durationUsed);
		amount += (int)(currentXp * durationUsed);

		playerManager->awardExperience(campOwner, "camp", amount, true);
	}

	Locker tlocker(&taskMutex);

	if(despawnTask != NULL ) {
		if(despawnTask->isScheduled())
			despawnTask->cancel();
		despawnTask = NULL;
	}


	if(abandonTask != NULL) {
		if(abandonTask->isScheduled())
			abandonTask->cancel();
		abandonTask = NULL;
	}

	tlocker.release();

	if(campOwner != NULL)
		campOwner->dropObserver(ObserverEventType::STARTCOMBAT, campObserver);

	if (camp != NULL) {
		if(camp->getZone() == NULL)
			return false;

		StructureManager::instance()->destroyStructure(camp);
	}

	destroyObjectFromWorld(true);
	destroyObjectFromDatabase(true);


	return true;
}
void * RunMovementThreadAPI(void *arg)
{
    PlayerManager::MParam * param = (PlayerManager::MParam *) arg;
    PlayerManager * mgr = param->ClassAdd;
    //PlayerManager::Player *player = param->player;
    delete param;
    mgr->RunMovementThread();
    return NULL;
}
void __cdecl RunMovementThreadAPI(void *arg)
{
    PlayerManager::MParam * param = (PlayerManager::MParam *) arg;
    PlayerManager * mgr = param->ClassAdd;
    //PlayerManager::Player *player = param->player;
    delete param;
    mgr->RunMovementThread();
    _endthread();
}
Ejemplo n.º 16
0
int LuaCreatureObject::awardExperience(lua_State* L) {
    String experienceType = lua_tostring(L, -2);
    int experienceAmount = lua_tointeger(L, -1);

    PlayerManager* playerManager = realObject->getZoneServer()->getPlayerManager();
    playerManager->awardExperience(realObject, experienceType, experienceAmount, false);

    return 0;
}
/**
 * Is called when this object has been inserted with an object
 * @param object object that has been inserted
 */
int PlayerContainerComponent::notifyObjectInserted(SceneObject* sceneObject, SceneObject* object) const {
	CreatureObject* creo = dynamic_cast<CreatureObject*>(sceneObject);

	if (creo == NULL) {
		return 0;
	}

	if (object->isArmorObject()) {
		PlayerManager* playerManager = sceneObject->getZoneServer()->getPlayerManager();
		playerManager->applyEncumbrancies(creo, cast<ArmorObject*>(object));
	}

	if (object->isTangibleObject()) {
		TangibleObject* tano = cast<TangibleObject*>(object);
		tano->applySkillModsTo(creo);
	}

	if (object->isInstrument() && creo->isEntertaining())
		creo->stopEntertaining();

	//this it to update the equipment list
	//we need a DeltaVector with all the slotted objects it seems
	/*CreatureObjectMessage6* msg6 = new CreatureObjectMessage6(creo);
	creo->broadcastMessage(msg6, true, true);*/

	if (object->isTangibleObject() && object->getArrangementDescriptorSize() != 0 && object->getArrangementDescriptor(0)->size() != 0) {
		const String& arrangement = object->getArrangementDescriptor(0)->get(0);

		if (arrangement != "mission_bag" && arrangement != "ghost" && arrangement != "bank") {
			creo->addWearableObject(object->asTangibleObject(), true);
		}
	}

	if (object->isTangibleObject()) {
		ManagedReference<TangibleObject*> tano = object->asTangibleObject();
		tano->addTemplateSkillMods(creo);
	}

	// Jedi stuff below.
	PlayerObject* ghost = creo->getPlayerObject();

	if (ghost && ghost->isJedi()) {

		if (object->isRobeObject()) {
			ghost->recalculateForcePower();
		} else if (object->isWeaponObject()) {
			WeaponObject* weaponObject = cast<WeaponObject*>(object);
			if (weaponObject->isJediWeapon()) {
				VisibilityManager::instance()->increaseVisibility(creo, VisibilityManager::SABERVISMOD);
			}
		}
	}

	return ContainerComponent::notifyObjectInserted(sceneObject, object);
}
Ejemplo n.º 18
0
	ResultType OnTimer(ITimer *pTimer, void *pData)
	{
		int userid = (int)pData;
		int client = g_Players.GetClientOfUserId(userid);
		if (client)
		{
			CPlayer *player = g_Players.GetPlayerByIndex(client);
			player->Kick("Your name is reserved by SourceMod; set your password to use it.");
		}
		return Pl_Stop;
	}
void ClientCreateCharacterCallback::run() {
	client->info("ClientCreateCharacterCallback::run()");

	PlayerManager* playerManager = server->getPlayerManager();
	bool success = playerManager->createPlayer(this);

	if (success) {
		client->info("success creating char");
	} else {
		client->info("failed to create char", true);
	}
}
/**
 * Is called when an object was removed
 * @param object object that has been inserted
 */
int PlayerContainerComponent::notifyObjectRemoved(SceneObject* sceneObject, SceneObject* object, SceneObject* destination) const {
	CreatureObject* creo = dynamic_cast<CreatureObject*>(sceneObject);

	if (creo == NULL) {
		return 0;
	}

	if (object->isArmorObject()) {
		PlayerManager* playerManager = creo->getZoneServer()->getPlayerManager();
		playerManager->removeEncumbrancies(creo, cast<ArmorObject*>(object));
	}

	if (object->isTangibleObject()) {
		TangibleObject* tano = cast<TangibleObject*>(object);
		tano->removeSkillModsFrom(creo);
	}

	if (object->isInstrument()) {
		if (creo->isPlayingMusic())
			creo->stopEntertaining();
	}

	//this it to update the equipment list
	//we need a DeltaVector with all the slotted objects it seems
	/*CreatureObjectMessage6* msg6 = new CreatureObjectMessage6(creo);
	creo->broadcastMessage(msg6, true, true);*/

	if (object->isTangibleObject() && object->getArrangementDescriptorSize() != 0 && object->getArrangementDescriptor(0)->size() != 0) {
		const String& arrangement = object->getArrangementDescriptor(0)->get(0); //CHK

		if (arrangement != "mission_bag" && arrangement != "ghost" && arrangement != "bank") {
			creo->removeWearableObject(object->asTangibleObject(), true);
		}
	}

	if (object->isTangibleObject()) {
		ManagedReference<TangibleObject*> tano = object->asTangibleObject();
		tano->removeTemplateSkillMods(creo);
	}

	// Jedi stuff below.
	PlayerObject* ghost = creo->getPlayerObject();

	if (ghost && ghost->isJedi()) {
		if (object->isRobeObject()) {
			ghost->recalculateForcePower();
		}
	}

	return ContainerComponent::notifyObjectRemoved(sceneObject, object, destination);
}
Ejemplo n.º 21
0
bool Enemigo::personaje_adyacente(MapaServidor& mapa,PlayerManager& pm, TileServidor*& tilePersonaje,string& enemigoAtacado){
	bool res = false;
	for(auto it = pm.getPlayers().begin();it != pm.getPlayers().end();it++) {
		int x = it->second.getX() - this->getX();
		int y = it->second.getY() - this->getY();
		if(abs(x) <=1 && abs(y)<=1){
			tilePersonaje = mapa.getTile(it->second.getX(),it->second.getY());
			res = true;
			enemigoAtacado = it->second.getNick();
			break;
		}
	}
	return res;
}
Ejemplo n.º 22
0
/*创建英雄*/
PlayerManager* PlayerManager::createWithLevel(Vec2 pt, int level)
{
	PlayerManager* heroMgr = new PlayerManager();
	if (heroMgr && heroMgr->initWithLevel(pt, level))
	{
		heroMgr->autorelease();
	}
	else
	{
		CC_SAFE_DELETE(heroMgr);
	}

	return heroMgr;
}
Ejemplo n.º 23
0
void NormalProperty::payRent(
        PlayerManager &i_players
        )
{
    if(i_players.takeBalance(m_rentPrices[m_numOfHouse]))
    {
        i_players.addBalance(m_rentPrices[m_numOfHouse],m_owner);
        std::cout << "Rent paid: " << m_rentPrices[m_numOfHouse] << std::endl;
    }
    else
    {
        std::cout << "Player does not have enough money to pay\n";
    }
}
Ejemplo n.º 24
0
//-------------------------------------------------------------------------
void Station::payRent(
        PlayerManager & i_players
        )
{
    unsigned int rent = m_rentPrices[0];
    std::cout << "You have to pay " << rent << " for Rent\n";
    if(i_players.takeBalance(rent))
    {
        i_players.addBalance(rent,m_owner);
    }
    else
    {
        std::cout << "Player do not have enough money to pay";
        rent = i_players.withdrawGame();
        i_players.addBalance(rent);
    }
}
void ClientCreateCharacterCallback::run() {
	if (client->getAccountID() == 0) {
		client->error("character create attempt with account id 0");

		return;
	}

	client->info("ClientCreateCharacterCallback::run()");

	PlayerManager* playerManager = server->getPlayerManager();
	bool success = playerManager->createPlayer(this);

	if (success) {
		client->info("success creating char");
	} else {
		client->info("failed to create char", true);
	}
}
Ejemplo n.º 26
0
//-----------------------------------------------------------------------------
void Utility::payRent(
        PlayerManager & i_players
        )
{
    Dice dice;
    dice.roll();
    const unsigned int amountTobePaid = dice.getTotal() *m_rentPrices[0];
    if(i_players.takeBalance(amountTobePaid))
    {
        std::cout << "You have paid " << amountTobePaid << " rent.\n";
        i_players.addBalance(amountTobePaid,m_owner);
    }
    else
    {
        std::cout << "You do not have enough money to pay!\n";
        i_players.withdrawGame();
    }
}
Ejemplo n.º 27
0
/**
 * Is called when an object was removed
 * @param object object that has been inserted
 */
int PlayerContainerComponent::notifyObjectRemoved(SceneObject* sceneObject, SceneObject* object, SceneObject* destination) {
	CreatureObject* creo = dynamic_cast<CreatureObject*>(sceneObject);

	if (object->isArmorObject()) {
		PlayerManager* playerManager = creo->getZoneServer()->getPlayerManager();
		playerManager->removeEncumbrancies(creo, cast<ArmorObject*>(object));
	}

	if (object->isTangibleObject()) {
		TangibleObject* tano = cast<TangibleObject*>(object);
		tano->removeSkillModsFrom(creo);
	}

	if (object->isInstrument()) {
		if (creo->isPlayingMusic())
			creo->stopEntertaining();
	}

	if (creo->getPlayerObject().get() != NULL && creo->getPlayerObject()->isJedi()) {
		if ((object->isRobeObject() && cast<RobeObject*>( object)->getSkillRequired() != "") || (object->isWeaponObject() && cast<WeaponObject*>(object)->isJediWeapon()))
			VisibilityManager::instance()->increaseVisibility(creo);
	}

	//this it to update the equipment list
	//we need a DeltaVector with all the slotted objects it seems
	/*CreatureObjectMessage6* msg6 = new CreatureObjectMessage6(creo);
	creo->broadcastMessage(msg6, true, true);*/

	if (object->isTangibleObject() && object->getArrangementDescriptorSize() != 0 && object->getArrangementDescriptor(0).size() != 0) {
		String arrangement = object->getArrangementDescriptor(0).get(0); //CHK

		if (arrangement != "mission_bag" && arrangement != "ghost" && arrangement != "bank") {
			creo->removeWearableObject(cast<TangibleObject*>(object), true);
		}
	}

	if (creo != NULL && object->isTangibleObject()) {
		ManagedReference<TangibleObject*> tano = cast<TangibleObject*>(object);
		tano->removeTemplateSkillMods(creo);
	}

	return ContainerComponent::notifyObjectRemoved(sceneObject, object, destination);
}
Ejemplo n.º 28
0
void GameModule::SendCurRoomPokersTo(const unsigned int &playerID)
{
  using face2wind::PokerVo;
  using face2wind::RoomManager;
  using face2wind::PlayerManager;
  using face2wind::GameManager;

  PlayerManager *playerMgr = PlayerManager::GetInstance();
  RoomManager *roomMgr = RoomManager::GetInstance();
  GameManager *gameMgr = GameManager::GetInstance();

  unsigned int roomID = roomMgr->GetRoomID(playerID);
  if(0 == roomID)
    return;
  std::vector<unsigned int> *roomPlist = gameMgr->GetPlayerList(roomID);
  SC10202 *sc2 = new SC10202();
  sc2->nextTurnIndex = gameMgr->GetCurrentTurnIndex(roomID);
  unsigned int index = 0;
  for(std::vector<unsigned int>::iterator pid = roomPlist->begin();
      pid != roomPlist->end(); ++pid){
    std::vector<PokerVo*> *pokerList = gameMgr->GetPlayerPokerList(*pid);
    SC10202_pokerNumList num;
    if(NULL != pokerList)
      num.pokerNum = pokerList->size();
    else
      num.pokerNum = 0;
    sc2->pokerNumList.push_back(num);
    if(playerID == *pid && NULL != pokerList){
      sc2->roleIndex = index;
      for(std::vector<PokerVo*>::iterator pvo = pokerList->begin();
	  pvo != pokerList->end(); ++pvo){
	PokerInfo info;
	info.color = (*pvo)->color;
	info.value = (*pvo)->value;
	sc2->pokerList.push_back(info);
      }
    }
    ++index;
  }
  unsigned int roomPlayerSocketID = playerMgr->GetSocketFDWithPlayerID(playerID);
  networkMgr->SendMessage(10202,sc2,roomPlayerSocketID);
}
Ejemplo n.º 29
0
bool TeamGroup::onAdd (void)
{
	// Allocate id and assign name before calling the
	// parent onAdd because it will add all it's members
	// to the manager and the teamId needs to be set
	// before this happens.

   char nameBuf[10] = "teamX";
   
	PlayerManager *playerManager = 
		(PlayerManager*)(manager->findObject(PlayerManagerId));

   teamId = playerManager->getNumTeams();
   nameBuf[4] = '0' + teamId;
   SimObject::assignName(nameBuf);

	playerManager->teamAdded (teamId);

   return Parent::onAdd();
}
void CharacterBuilderTerminalImplementation::enhanceCharacter(CreatureObject* player) {
	PlayerManager* pm = player->getZoneServer()->getPlayerManager();

	pm->enhanceCharacter(player);

	ManagedReference<PlayerObject*> ghost = player->getPlayerObject();

	if (ghost == NULL)
		return;

	for (int i = 0; i < ghost->getActivePetsSize(); i++) {
		ManagedReference<AiAgent*> pet = ghost->getActivePet(i);

		if (pet != NULL) {
			Locker crossLocker(pet, player);

			pm->enhanceCharacter(pet);
		}
	}
}