TileSocialProfile::TileSocialProfile(CCSceneBase *scene, const float size, const char *userSeed) : TileSocial( scene, size, size ) { drawOrder = 200; fbInfoDownloadedCallback = NULL; photosDownloadedCallback = NULL; rotationSpeed = 180.0f; taggedPhotosRefreshing = false; // Set a default profile photo CCModelBase *f7u12Model = new CCModelBase(); model->addModel( f7u12Model ); f7u12Photo = new CCPrimitiveSquare(); f7u12Photo->setupZFacing( collisionBounds.x - borderWidth, collisionBounds.y - borderWidth ); f7u12Photo->setTexture( GetDefaultProfilePhoto(), Resource_Packaged ); f7u12Model->addPrimitive( f7u12Photo ); f7u12Model->setColour( CCColour( 1.0f ) ); f7u12ColourInterpolator.setup( f7u12Model->getColour(), *f7u12Model->getColour() ); f7u12ColourInterpolator.setDuration( 0.25f ); // Provisionally set the userID to be the userSeed value // Which will be confirmed by the FBApi setUserID( userSeed ); scaleInterpolator.clear(); DELETE_POINTER( scale ); }
/********************************************************** * CLdapSecUser * **********************************************************/ CLdapSecUser::CLdapSecUser(const char *name, const char *pw) : m_pw(pw), m_authenticateStatus(AS_UNKNOWN) { setName(name); setUserID(0); setPosixenabled(false); setSudoersEnabled(false); setInSudoers(false); }
UserDesktopWidget::UserDesktopWidget(QWidget* parent, int userid, int border_width) : UserImageWidget(parent, userid, false, border_width) , m_desktop_updated(true) , m_access_requested(false) , m_mousedown(false) , m_desktop_window(NULL) , m_user() { m_refresh_timerid = startTimer(100); m_sendinput_timerid = startTimer(50); setMouseTracking(true); setUserID(userid); }
void TileSocialProfile::parseFBInfo(json_t *jsonObject) { json_t *jsonID = json_object_get( jsonObject, "id" ); const char *jsonStringID = json_string_value( jsonID ); json_t *jsonName = json_object_get( jsonObject, "name" ); const char *jsonStringName = json_string_value( jsonName ); setUserID( jsonStringID ); setUserName( jsonStringName ); bufferProfilePhoto( 0 ); bufferTaggedPhotos( 0 ); if( fbInfoDownloadedCallback != NULL ) { fbInfoDownloadedCallback->run(); } }
/* ******************************************************************* * Function: * * Description: * * Parameters: * * Returns: * ******************************************************************* */ void xDistributedSession::unpackUpdate(TNL::GhostConnection *connection, TNL::BitStream *stream) { xNetInterface *netInterface = (xNetInterface*) connection->getInterface(); if (netInterface) { ////////////////////////////////////////////////////////////////////////// //initial update ? if(stream->readFlag()) { if(stream->readFlag()) { char oName[256];stream->readString(oName); // retrieve objects name : char cName[256];stream->readString(cName); // retrieve objects dist class name : int type = stream->readInt(32); //read the dist class base type : int userID = stream->readInt(32); int serverID2 = stream->readInt(32); float creationTime = 0.0f; stream->read(&creationTime); int sessionID = stream->readInt(32); int MaxUsers = stream->readInt(32); char pass[256];stream->readString(pass); ////////////////////////////////////////////////////////////////////////// //now we store all in the dist object : //find and store the dist class : xDistributedClassesArrayType *_classes = netInterface->getDistributedClassInterface()->getDistrutedClassesPtr(); xDistributedClass *classTemplate = netInterface->getDistributedClassInterface()->get(cName,type); if (!classTemplate) { xLogger::xLog(ELOGERROR,E_LI_SESSION,"Warning initial unpack of session %s failed : no related class found : %s",oName,cName); //xLogger::xLog(ELOGINFO,XL_START,"Warning Initial Unpack Update, no related class found : %s",cName); //xLogger::xLog(ELOGERROR,XL_SESSION,"Warning Initial Unpack Update, no related class found : %s",cName); classTemplate = netInterface->getDistributedClassInterface()->createClass(cName,type); } setDistributedClass(classTemplate); SetName(oName); setServerID(connection->getGhostIndex(this)); setObjectFlags(E_DO_CREATION_CREATED); setUserID(userID); setNetInterface(netInterface); setCreationTime(creationTime); setSessionID(sessionID); getOwnershipState().set( 1<<E_DO_OS_OWNER, getUserID() == ((vtConnection*)connection)->getUserID() ); setInterfaceFlags(E_DO_CREATED); getSessionFlags().set( 1 << E_SF_INCOMPLETE ); xLogger::xLog(ELOGTRACE,E_LI_SESSION,"Retrieved initial state of session %s",oName); initProperties(); setMaxUsers(MaxUsers); setPassword(xNString(pass)); vtConnection *con = (vtConnection*)connection; setOwnerConnection(con); } } int updateBits = stream->readSignedInt(32); TNL::BitSet32 updateBitsMask(updateBits); setGhostUpdateBits(updateBits); xDistributedPropertyArrayType &props = *getDistributedPorperties(); int propCounter = 0; for (unsigned int i = 0 ; i < props.size() ; i++ ) { xDistributedProperty *prop = props[i]; xDistributedPropertyInfo*propInfo = prop->getPropertyInfo(); int blockIndex = prop->getBlockIndex(); if (updateBitsMask.testStrict(1<<blockIndex)) { prop->updateFromServer(stream); xLogger::xLog(ELOGTRACE,E_LI_SESSION,"Client : retrieving session property : %s |pred :%d",prop->getPropertyInfo()->mName.getString(),prop->getPropertyInfo()->mPredictionType); //xLogger::xLog(ELOGINFO,XL_START,"client : retrieving session property : %s",prop->getPropertyInfo()->mName.getString()); getSessionFlags().set( 1 << E_SF_COMPLETE ); propCounter++; } } if (propCounter == props.size()) { getSessionFlags().set( 1 << E_SF_COMPLETE ); } } }
CPlayer::CPlayer() { Graphic.Introduction(); setUserID(); Graphic.iClearScreen(); }
void PackageManager::parseUserInfo(HaypiJsonPtr data) { auto bag = getCurrBag(); auto player = getCurrPlayer(); int event = 0; Json::Value mem = (*data)["Member"]; if (!mem.isNull()) { Member* member = Member::create(); player->setMember(member); member->setBanTalk(mem["BanTalk"].asInt()); member->setDeviceID(mem["DeviceID"].asString()); member->setEMail(mem["EMail"].asString()); member->setGCName(mem["GCName"].asString()); member->setGCType(mem["GCType"].asInt()); member->setInviteBy(mem["InvitedBy"].asString()); member->setLoginTime(mem["LoginTime"].asDouble()); member->setMemberID(mem["MemberID"].asInt()); member->setName(mem["Name"].asString()); member->setRegionID(mem["RegionID"].asString()); member->setRegisterTime(mem["RegisterTime"].asDouble()); member->setStatus(mem["Status"].asInt()); player->setUserID(member->getMemberID()); player->setUserName(member->getName()); } Json::Value& stime = (*data)["STime"]; if (stime != nullptr) { GameTime::setServerTime(stime.asInt()); } Json::Value& wareall = data->at("WareHouse"); if(wareall != nullptr) { bag->updateWareByJsonValue(wareall); event |= (int)PackageEvent::WareHouse; } Json::Value& userData = (*data)["UserData"]; if (userData != Json::Value::null) { getCurrMap()->setMaxMap(userData["MaxMap"].asInt()); GameTime::setServerTime(userData["STime"].asInt()); event |= (int)PackageEvent::Map; } Json::Value& pets = (*data)["PetList"]; if (pets != Json::Value::null) { bag->updateAllPetsByJsonValue(pets); event |= (int)PackageEvent::PetInfo; } Json::Value& teams = (*data)["Teams"]; if (teams != Json::Value::null) { bag->updateAllTeamsByJsonValue(teams); event |= (int)PackageEvent::TeamInfo; } Json::Value& city = data->at("City"); if (city != nullptr) { bag->updateTechInfoByJsonValue(city); event |= (int)PackageEvent::TechInfo; } Json::Value& queue = data->at("Queue"); if (queue != nullptr) { bag->updateTechQueueByJsonValue(queue); event |= (int)PackageEvent::TechInfo; } Json::Value& petChange = data->at("PetChange"); if (petChange != nullptr) { bag->updatePetByJsonValue(petChange); event |= (int)PackageEvent::PetInfo; } Json::Value& petDel = data->at("Pet_Dels"); if (petDel != nullptr) { bag->updatePetDelByJsonValue(petDel); event |= (int)PackageEvent::PetInfo; } Json::Value& teamChange = data->at("TeamChange"); if (teamChange != nullptr) { bag->updateTeamByJsonValue(teamChange); event |= (int)PackageEvent::TeamInfo; } Json::Value& itemadd = data->at("Item_Add"); if(itemadd != nullptr) { bag->updateItemAddByJsonValue(itemadd); event |= (int)PackageEvent::WareHouse; } Json::Value& itemdel = data->at("Item_Del"); if(itemdel != nullptr) { bag->updateItemDelByJsonValue(itemdel); event |= (int)PackageEvent::WareHouse; } Json::Value& res = data->at("Res"); if (res != nullptr) { bag->updateTimerInfoByJsonValue(res); event |= (int)PackageEvent::ResTimer; event |= (int)PackageEvent::WareHouse; } if (event != 0) { event |= (int)PackageEvent::UserInfo; NetManager::getInstance()->dispatcherCustomEvent((PackageEvent)event, data); } }