Advertisement
bombillo

Untitled

Jan 2nd, 2016
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 6.53 KB | None | 0 0
  1. SEARCH IN P2PMessages.h FOR
  2. PKT_S2C_GroupNotify
  3.  
  4. Below add this
  5. PKT_S2C_CreateBuilding,
  6.  
  7. SEARCH FOR
  8. struct PKT_S2C_RepairItemAns_s : public DefaultPacketMixin<PKT_S2C_RepairItemAns>
  9.  
  10. Add below that
  11. struct PKT_S2C_CreateBuilding_s : public DefaultPacketMixin<PKT_S2C_CreateBuilding>
  12. {
  13.     gp2pnetid_t spawnID;
  14.     char        fname[512];
  15.     r3dPoint3D pos;
  16.     r3dVector angle;
  17.     bool col;
  18. };
  19.  
  20. SEARCH FOR
  21. struct PKT_C2S_StartGameReq_s : public DefaultPacketMixin<PKT_C2S_StartGameReq>
  22.  
  23. Add into the function below "__int64        uniqueID; // HWID for FF"
  24. bool FastLoad;
  25.  
  26.  
  27.  
  28. ClientGameLogic.h
  29. SEARCH FOR
  30. float       nextTimeToSendCameraPos;
  31.  
  32. Add this after one space
  33. float lastBuilding;
  34.  
  35. SEARCH FOR THIS
  36.      DEFINE_PACKET_FUNC(PKT_S2C_CreateNetObject);
  37.      
  38. Below that add this
  39.      DEFINE_PACKET_FUNC(PKT_S2C_CreateBuilding);
  40.      
  41.      
  42. ClientGameLogic.cpp
  43. SEARCH FOR
  44. int ClientGameLogic::RequestToStartGame()
  45.  
  46. Below this
  47. n.uniqueID = g_HardwareInfo.uniqueId;
  48.    
  49. Add this
  50. n.FastLoad = g_FastLoad->GetBool();
  51.    
  52. Below this function
  53. IMPL_PACKET_FUNC(ClientGameLogic, PKT_S2C_UpdateGearData)
  54.  
  55. Add this entery one
  56. void CreateBuildingThread(/*const PKT_S2C_CreateBuilding_s& n*/)
  57. {
  58.     r3dPoint3D bpos1;
  59.     r3dVector bangle1;
  60.     char bfname1[1024] = {0};
  61.     bool bcol1;
  62.     bpos1 = bpos;
  63.     bangle1 = bangle;
  64.     bcol1 = bcol;
  65.     sprintf(bfname1,"%s",bfname);
  66.     //Sleep( random(50) ); // Krit
  67.     const ClientGameLogic& CGL = gClientLogic();
  68.     if (r3dGetTime() > CGL.lastBuilding + 0.5f)
  69.     {
  70.         gClientLogic().lastBuilding = r3dGetTime();
  71.         obj_Building* Building = (obj_Building*)srv_CreateGameObject("obj_Building", bfname1, bpos1);
  72.         Building->NetworkLocal = false;
  73.         // Building->SetNetworkID(buildpkt->spawnID);
  74.         Building->SetRotationVector(bangle1);
  75.         if (bcol1)
  76.         {
  77.             Building->setSkipOcclusionCheck( true );
  78.             Building->ObjFlags |= OBJFLAG_PlayerCollisionOnly;
  79.         }
  80.         return; // exitthread
  81.     }
  82. }
  83. IMPL_PACKET_FUNC(ClientGameLogic, PKT_S2C_CreateBuilding)
  84. {
  85.  
  86.     if (!g_FastLoad->GetBool()) return; // if disabled fastload. ignore this packet from server.
  87.  
  88.     r3dOutToLog("CreateBuilding %s\n",n.fname);
  89.     /*const char* fname = n.fname;
  90.     //fname += 4;
  91.     std::string str= fname;
  92.     unsigned pos = str.find(".");
  93.     std::string str2 = str.substr(0,pos);
  94.     //r3dOutToLog("fName %s\n",fname);
  95.     char fname1[512] = {0};
  96.     r3dscpy(fname1,str2.c_str());
  97.     sprintf(fname1,"%s_playeronly.scb",fname1);
  98.     //r3dOutToLog("fNamePO %s\n",fname1);
  99.     if(r3dFileExists(fname1))
  100.     {
  101.     //r3dOutToLog("PlayerOnly Found! %s\n",fname1);
  102.     obj_Building* Building = (obj_Building*)srv_CreateGameObject("obj_Building", fname1, n.pos);
  103.     Building->NetworkLocal = false;
  104.     Building->SetNetworkID(n.spawnID);
  105.     Building->SetRotationVector(n.angle);
  106.     if (n.col)
  107.     {
  108.     Building->setSkipOcclusionCheck( true );
  109.     Building->ObjFlags |= OBJFLAG_PlayerCollisionOnly;
  110.     }
  111.     }
  112.     else
  113.     {*/
  114.  
  115.     //lastBuilding = r3dGetTime();
  116.  
  117.     //Sleep( random(5) ); // Krit
  118.     obj_Building* Building = (obj_Building*)srv_CreateGameObject("obj_Building", n.fname, n.pos);
  119.     Building->NetworkLocal = true;
  120.     //Building->SetNetworkID(n.spawnID);
  121.     Building->SetRotationVector(n.angle);
  122.     if (n.col)
  123.     {
  124.         Building->setSkipOcclusionCheck( true );
  125.         Building->ObjFlags |= OBJFLAG_PlayerCollisionOnly;
  126.     }
  127.     //Sleep(1);
  128.     Building->OnCreate();
  129.  
  130.  
  131.     //}
  132.     //buildpkt = n;
  133.     //bpos = n.pos;
  134.     //bangle = n.angle;
  135.     //bcol = n.col;
  136.     //sprintf(bfname,"%s",n.fname);
  137.     //CreateThread(NULL,NULL,(LPTHREAD_START_ROUTINE)CreateBuildingThread,NULL,0,0);
  138. }
  139.      
  140.      
  141. SEARCH FOR TIS
  142. DEFINE_PACKET_HANDLER(PKT_S2C_DestroyNetObject);
  143.  
  144. Below that paste this
  145. EFINE_PACKET_HANDLER(PKT_S2C_CreateBuilding);
  146.      
  147.  
  148. Now Search for
  149. bool ClientGameLogic::wait_GameStart()
  150.  
  151. scroll down and after this
  152. n.lastNetID = net_lastFreeId;
  153.  
  154. add this
  155. n.FastLoad = g_FastLoad->GetBool();  
  156.  
  157. Now goto the top and below this
  158. extern int g_RenderScopeEffect;
  159.  
  160. add this
  161. static r3dPoint3D bpos;
  162. static r3dVector bangle;
  163. char bfname[1024] = {0};
  164. static bool bcol;
  165.      
  166.      
  167. GameLevel_OI.cpp
  168. SEARCH FOR THIS
  169. GameObject * LoadLevelObject ( pugi::xml_node & curNode )
  170.  
  171. AFTER the #endif Add this
  172. #ifdef FINAL_BUILD
  173.     //r3dOutToLog("HomeDir %s"
  174.     if (strcmp( r3dGameLevel::GetHomeDir() , "Levels\\WZ_FrontEndLighting") && g_FastLoad->GetBool())
  175.     {
  176.     if(!strcmp( class_name, "obj_StoreNPC" ) || !strcmp( class_name, "obj_VaultNPC" ) || !strcmp( class_name, "obj_Terrain" ) || !strcmp( class_name, "obj_PermanentNote" ) || !strcmp( class_name, "obj_WaterPlane" ) || !strcmp( class_name, "obj_Lake" ) || !strcmp( class_name, "obj_Road" ) || !strcmp( class_name, "obj_ParticleSystem" ) || !strcmp( class_name, "obj_LightMesh" ) || !strcmp( class_name, "obj_LightHelper" ) || !strcmp( class_name, "obj_AmbientSound" )) /*|| (GameWorld().objplrLoad - pos).Length() < 1000 /*Load only object near player around 1000m) // we need to force load terrain , water*/
  177.     {
  178.         //r3dOutToLog("Terrain Found. , Loading..\n");
  179.         obj = srv_CreateGameObject(class_name, load_name, pos);
  180.         if(!obj)
  181.         {
  182.             r3dOutToLog("!!!Failed to create object! class: %s, name: %s\n", class_name, load_name);
  183.             return NULL;
  184.         }
  185.         r3d_assert ( obj );
  186.         obj->ReadSerializedData(curNode);
  187.         return obj;
  188.     }
  189.     }
  190.     else
  191.     {
  192.         obj = srv_CreateGameObject(class_name, load_name, pos);
  193.     if(!obj)
  194.     {
  195.         r3dOutToLog("!!!Failed to create object! class: %s, name: %s\n", class_name, load_name);
  196.         return NULL;
  197.     }
  198.     r3d_assert ( obj );
  199.     obj->ReadSerializedData(curNode);
  200.  
  201.     return obj;
  202.     }
  203.     // fill building data.
  204.     /*if ( !strcmp( class_name, "obj_Building" ))
  205.     {
  206.         //ObjectManager& GW = GameWorld();
  207.         ObjectManager::BuildingListData_s& build = GameWorld().BuildingListData[GameWorld().numbuilding++];
  208.         build.pos = pos;
  209.         //GW.BuildingListData[num].Angle =;
  210.         sprintf(build.fname,load_name);
  211.         //GW.BuildingListData[num].Node = curNode;
  212.         build.isVisible = false;
  213.         build.obj = NULL;
  214.         return NULL;
  215.     }*/
  216. #endif
  217.      
  218.  
  219. HUDPause.cpp
  220. SEARCH FOR THIS
  221. var[29].SetNumber( r_vsync_enabled->GetInt()+1);
  222.      
  223.      
  224. Add this below
  225. var[28].SetNumber(g_FastLoad->GetInt());
  226.  
  227. change the var[30] to var[31]
  228. Scaleform::GFx::Value var[31];
  229.  
  230. Change the this var to 31 too
  231. gfxMovie.Invoke("_root.api.setOptions", var, 31);
  232.      
  233. FrontEndWarZ.cpp
  234. Search for
  235. var[29].SetNumber( r_vsync_enabled->GetInt()+1);
  236.  
  237. Add this below
  238. var[30].SetNumber( g_FastLoad->GetInt()); // FastLoad
  239.  
  240. Change the var from 30 to 31 like this
  241. Scaleform::GFx::Value var[31];
  242.  
  243. also in this case below
  244. gfxMovie.Invoke("_root.api.setOptions", var, 31);
  245.  
  246.  
  247. Vars.h
  248. SEARCH FOR
  249. REG_VAR( g_serverip,            "25.168.34.172",    0 );
  250.  
  251. Add this above
  252. REG_VAR( g_FastLoad,    true,           VF_SAVE );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement