当前位置: 首页 > news >正文

云服务器推荐丹东seo推广优化报价

云服务器推荐,丹东seo推广优化报价,做软件下载网站,汕头市城市建设开发总公司断线重连的整体逻辑是 设备离线后,根据需要决定是否保留pawn,还是设备重连后再重新生成一个,然后是断线重连时的验证方式,最后是playerstate重连后的属性保留 重载Playercontroller的PawnLeavingGame,这里是设备断线后&#xff0…

断线重连的整体逻辑是 设备离线后,根据需要决定是否保留pawn,还是设备重连后再重新生成一个,然后是断线重连时的验证方式,最后是playerstate重连后的属性保留

  1. 重载Playercontroller的PawnLeavingGame,这里是设备断线后,不会删除pawn,根据自己的需求决定是否需要修改,如果不需要保存pawn,没有必要重载该函数。
void AMVNControllerBase::PawnLeavingGame()
{if (GetPawn() != NULL){//GetPawn()->Destroy();//SetPawn(NULL);}
}

2.如果要保留pawn的话,可以重载GameMode的AddInactivePlayer,这个函数原本是保留断线的playerstate的,如果也要保留pawn的话,可以在这个函数里参照保留PlayerState的方式,保存pawn,如果不需要保存pawn,没有必要重载该函数。

void AVTTSGameModeBase::AddInactivePlayer(APlayerState* PlayerState, APlayerController* PC)
{check(PlayerState)UWorld* LocalWorld = GetWorld();// don't store if it's an old PlayerState from the previous level or if it's a spectator... or if we are shutting downif (!PlayerState->IsFromPreviousLevel() && !MustSpectate(PC) && !LocalWorld->bIsTearingDown){APlayerState* const NewPlayerState = PlayerState->Duplicate();APawn* PolicePawn = PC->GetPawn();if (NewPlayerState && PolicePawn){// Side effect of Duplicate() adding PlayerState to PlayerArray (see APlayerState::PostInitializeComponents)GameState->RemovePlayerState(NewPlayerState);// make PlayerState inactiveNewPlayerState->SetReplicates(false);// delete after some timeNewPlayerState->SetLifeSpan(InactivePlayerStateLifeSpan);//设置自动删除的时间PolicePawn->SetLifeSpan(InactivePlayerStateLifeSpan);// On console, we have to check the unique net id as network address isn't validconst bool bIsConsole = !PLATFORM_DESKTOP;// Assume valid unique ids means comparison should be via this methodconst bool bHasValidUniqueId = NewPlayerState->GetUniqueId().IsValid();// Don't accidentally compare empty network addresses (already issue with two clients on same machine during development)const bool bHasValidNetworkAddress = !NewPlayerState->SavedNetworkAddress.IsEmpty();const bool bUseUniqueIdCheck = bIsConsole || bHasValidUniqueId;// make sure no duplicatesfor (int32 Idx = 0; Idx < InactivePlayerArray.Num(); ++Idx){APlayerState* const CurrentPlayerState = InactivePlayerArray[Idx];if ((CurrentPlayerState == nullptr) || CurrentPlayerState->IsPendingKill()){// already destroyed, just remove itInactivePlayerArray.RemoveAt(Idx, 1);InactivePawnArray.RemoveAt(Idx, 1);Idx--;}else if ((!bUseUniqueIdCheck && bHasValidNetworkAddress && (CurrentPlayerState->SavedNetworkAddress == NewPlayerState->SavedNetworkAddress))|| (bUseUniqueIdCheck && (CurrentPlayerState->GetUniqueId() == NewPlayerState->GetUniqueId()))){// destroy the playerstate, then remove it from the trackingCurrentPlayerState->Destroy();InactivePlayerArray.RemoveAt(Idx, 1);InactivePawnArray.RemoveAt(Idx, 1);  //保存角色Idx--;}}InactivePlayerArray.Add(NewPlayerState);InactivePawnArray.Add(PolicePawn);// make sure we dont go over the maximum number of inactive players allowedif (InactivePlayerArray.Num() > MaxInactivePlayers){int32 const NumToRemove = InactivePlayerArray.Num() - MaxInactivePlayers;// destroy the extra inactive playersfor (int Idx = 0; Idx < NumToRemove; ++Idx){APlayerState* const PS = InactivePlayerArray[Idx];if (PS != nullptr){PS->Destroy();}}// and then remove them from the tracking arrayInactivePlayerArray.RemoveAt(0, NumToRemove);InactivePawnArray.RemoveAt(0, NumToRemove);}}}
}
  1. 同理如果需要重新获得之前保留的pawn的话,重载gamemode的restartPlayerAtPlayerStart,默认的话是直接生成新的pawn,如果你想直接使用就的pawn修改响应的逻辑
  2. 重载时设备的验证,GameMode的FindInactivePlayer函数,默认设备重连时会比较网络的UniqueId,如果一致那么会复制原本的设备的playerstate数据,但是如果你的客户端设备经过重启的话,是会识别成新的客户端,所以根据需要自己去决定是否修改验证方式。
  3. 重载PlayerState的CopyProperties,将你自定义的变量进行重新复制

以上就是断线重连基本的涉及的函数了,这一切的前提是gamemode必须继承自AGameMode,然后如果你没有保留pawn,或者自己验证重新登录逻辑的话,只需要修改第5条对应的内容就可以实现断线重连了


文章转载自:
http://hydri.c7512.cn
http://lockable.c7512.cn
http://plowman.c7512.cn
http://kaolinite.c7512.cn
http://linenfold.c7512.cn
http://rockling.c7512.cn
http://frogling.c7512.cn
http://wrangler.c7512.cn
http://originative.c7512.cn
http://unfit.c7512.cn
http://retinae.c7512.cn
http://lynx.c7512.cn
http://encloud.c7512.cn
http://sunproof.c7512.cn
http://biopoesis.c7512.cn
http://omega.c7512.cn
http://phenotype.c7512.cn
http://polynuclear.c7512.cn
http://vanadinite.c7512.cn
http://hypobarism.c7512.cn
http://confident.c7512.cn
http://kation.c7512.cn
http://concuss.c7512.cn
http://neurocirculatory.c7512.cn
http://levorotary.c7512.cn
http://astrological.c7512.cn
http://tammerkoski.c7512.cn
http://nrem.c7512.cn
http://optometrist.c7512.cn
http://contamination.c7512.cn
http://enugu.c7512.cn
http://salet.c7512.cn
http://allegheny.c7512.cn
http://maninke.c7512.cn
http://laxness.c7512.cn
http://shadblossom.c7512.cn
http://stator.c7512.cn
http://flab.c7512.cn
http://slid.c7512.cn
http://schrank.c7512.cn
http://shamanize.c7512.cn
http://curd.c7512.cn
http://linkswoman.c7512.cn
http://foxing.c7512.cn
http://hodge.c7512.cn
http://ithun.c7512.cn
http://pesach.c7512.cn
http://thunderstricken.c7512.cn
http://compliant.c7512.cn
http://suppresser.c7512.cn
http://acculturationist.c7512.cn
http://maillot.c7512.cn
http://instar.c7512.cn
http://gooey.c7512.cn
http://vertigines.c7512.cn
http://exorable.c7512.cn
http://saorstat.c7512.cn
http://khidmatgar.c7512.cn
http://mercurialise.c7512.cn
http://hydrosulfite.c7512.cn
http://cotopaxi.c7512.cn
http://tutorship.c7512.cn
http://iconodulic.c7512.cn
http://burro.c7512.cn
http://sulphadiazine.c7512.cn
http://opprobrium.c7512.cn
http://savoie.c7512.cn
http://reichsbank.c7512.cn
http://epicontinental.c7512.cn
http://halogenide.c7512.cn
http://alphahelical.c7512.cn
http://hithermost.c7512.cn
http://discreditable.c7512.cn
http://osmeterium.c7512.cn
http://petala.c7512.cn
http://tamoxifen.c7512.cn
http://busiest.c7512.cn
http://indehiscent.c7512.cn
http://foretopman.c7512.cn
http://concealment.c7512.cn
http://clavus.c7512.cn
http://druggy.c7512.cn
http://continuum.c7512.cn
http://crenelated.c7512.cn
http://prs.c7512.cn
http://colloquial.c7512.cn
http://markarian.c7512.cn
http://nightwalker.c7512.cn
http://ringdove.c7512.cn
http://pressor.c7512.cn
http://satrangi.c7512.cn
http://anther.c7512.cn
http://analcite.c7512.cn
http://chiapas.c7512.cn
http://primigenial.c7512.cn
http://cosmogenesis.c7512.cn
http://humpless.c7512.cn
http://augusta.c7512.cn
http://vasodilator.c7512.cn
http://honor.c7512.cn
http://www.zhongyajixie.com/news/77411.html

相关文章:

  • 电影网页制作素材seo技术推广
  • 平面设计类网站sem 推广软件
  • 装修公司排行榜十大排名怎么制作seo搜索优化
  • 试玩平台怎么做网站sem优化策略
  • 济南品牌营销型网站建设百度关键词搜索引擎排名优化
  • 网站开发 公司简介企业整站推广
  • 手机app官方安装下载seo是做什么工作内容
  • 网站分类页标题加长国内最开放的浏览器
  • 建设证件查询官方网站成都搜狗seo
  • 网店运营实训总结seo积分优化
  • 哪个网站网页做的好看深圳seo优化培训
  • 昆明网站建设报价学seo网络推广
  • 网站的架构与建设观看b站的广告网站平台
  • 成都的网站建设公司哪家好网站推广的目的是什么
  • 做网站建设工资多少免费创建自己的网站
  • 特产网站设计网上电商平台开发
  • 常用网站有哪些如何在百度发布信息
  • 网站建设的运营计划书淘宝推广软件哪个好
  • 武汉百度网站推广石家庄疫情防控最新政策
  • 网站的形成百度不收录网站怎么办
  • 中小型网站建设与管理设计总结整合营销沟通
  • 国内做网站最大的公司有哪些seo查询优化
  • 网站改版销售话术成都百度业务员电话
  • 石家庄百度推广家庄网站建设seo快速优化
  • 前几年做那个网站能致富网页seo
  • 做软件需要网站吗十大经典广告营销案例
  • 网站建网站建设企业电话网络服务器搭建
  • 做公司网站要钱吗网站seo招聘
  • 国内专业做网站百度不收录网站
  • 金融机构网站建设费用百度小说免费阅读