Jump to content

fauconjona

Member
  • Content Count

    20
  • Joined

  • Last visited

  • Medals

Everything posted by fauconjona

  1. fauconjona

    X-Cam 1.0 for Arma 3 released

    Download link: https://drive.google.com/open?id=0B4J-rYzO-kt0WmlrT2VfNXFOWjA
  2. fauconjona

    X-Cam 1.0 for Arma 3 released

    I found the solution: in xCam_Press_Btn.sqf: replace: _ef = ["xCam_EF_ID", "onEachFrame", xCam_fCamObject] call BIS_fnc_addStackedEventHandler; by : onEachFrame{ [] spawn xCam_fCamObject; }; And, in xCam_Cam_Object.sqf: add this on begin (I don't know why it doen't inisialized in xCam_Start_UI.sqf): if(isNil 'xcam_vector_marker')then { xCam_Vector_Marker = createVehicle ["Sign_Sphere10cm_F", (position player), [], 0, "NONE"]; }; And done, you can move the camera ;)
  3. Hello everybody :) I know there is already some thread about this, but I need some clarification. I have a server, it turns at 47fps with nobody, with ~10 players : >30fps and with >60 players : 5 - 0 fps. I have only 1 loop, not hard for the moment, on the server side. There's never desync on the server even with 1fps. server.cfg: class sockets{maxPacketSize = 1400;}; adapter=-1; 3D_Performance=1; Resolution_W=0; Resolution_H=0; Resolution_Bpp=32; Windowed=0; MaxMsgSend = 2048; MaxSizeGuaranteed = 958; MaxSizeNonguaranteed = 384; setTerrainGrid = 50; viewDistance = 600; MinBandwidth = 107374182; MaxBandwidth = 1073741824; MinErrorToSend = 0.01; MinErrorToSendNear = 0.02; MaxCustomFileSize = 1310720; with 80 or 0 vehicles is the same thing and there isn't AI on the mission. CPU goes to 50% and memory to 2000MB. I don't know why the server loses fps like this. Anyone have an idea to help me?
  4. Hello everybody, I'm creating an extension to remote sqf function by socket. For the moment I'm just trying to connect to the server, start the process by calling extension from arma and execute the client application. But, I can't connect and when I look the log I have "Client connected" on every frame even without my client application. Before, create the .dll I tried with a server application and there's no problem. #include "stdafx.h" #include <unordered_map> #include <thread> #include <mutex> #include <atomic> #pragma comment(lib,"Ws2_32.lib") #include <WinSock2.h> #include <iostream> #include <string> #include <fstream> #include "Log.h" const int MAX_CONNECTION = 20; char PASSWORD[MAX_CONNECTION]; char IP[MAX_CONNECTION]; int PORT; const int MESSAGE_SIZE = 256; SOCKET connections[MAX_CONNECTION]; int connectionCounter = 0; bool socketWorking = false; using namespace std; struct Data { bool ready = false; string params = ""; string result = ""; }; unordered_map<long int, Data> tickets; mutex mtx; atomic<bool> worker_working(false); long int id = 0; // global ticket id long int cur_id = 0; // current ticket id int clientHandlerThread(int index) { char buffer[MESSAGE_SIZE]; //password check writeInFile("connection", "Waiting for password"); recv(connections[index], buffer, sizeof(buffer), NULL); if (strcmp(buffer, PASSWORD) != 0) { strcpy_s(buffer, "refused"); send(connections[index], buffer, sizeof(buffer), NULL); connectionCounter--; return 0; } else { strcpy_s(buffer, "accepted"); send(connections[index], buffer, sizeof(buffer), NULL); } while (strcmp(buffer, "exit") != 0) { recv(connections[index], buffer, sizeof(buffer), NULL); writeInFile("message", (char*)(std::string("Message: ") + std::string(buffer)).c_str()); } connectionCounter--; return 0; } bool getConfig() { std::ifstream confFile("AventuraRCon//config.txt", std::ifstream::binary); if (confFile) { std::string line; //ip std::getline(confFile, line); strcpy_s(IP, (char*)line.c_str()); writeInFile("config", (char*)(std::string("IP : ") + std::string(IP)).c_str()); //port std::getline(confFile, line); PORT = atoi(line.c_str()); writeInFile("config", (char*)(std::string("PORT : ") + line).c_str()); //password std::getline(confFile, line); strcpy_s(PASSWORD, (char*)line.c_str()); writeInFile("config", (char*)(std::string("PASSWORD : ") + std::string(PASSWORD)).c_str()); } else { return false; } return true; } void socketWorker() { if (!getConfig()) { return ; } //winsock startup WSAData wsaData; WORD DllVersion = MAKEWORD(2, 1); if (WSAStartup(DllVersion, &wsaData) != 0) { return; } socketWorking = true; SOCKADDR_IN addr; int addrlen = sizeof(addr); addr.sin_addr.s_addr = inet_addr(IP); addr.sin_port = htons(PORT); addr.sin_family = AF_INET; SOCKET sListen = socket(AF_INET, SOCK_STREAM, NULL); bind(sListen, (SOCKADDR*)&addr, sizeof(addr)); listen(sListen, SOMAXCONN); SOCKET newConnection; while (true) { if (connectionCounter < MAX_CONNECTION) { newConnection = accept(sListen, (SOCKADDR*)&addr, &addrlen); if (newConnection == 0) { writeInFile("debug", "Client can't connect"); closesocket(newConnection); WSACleanup(); } else { writeInFile("debug", "Client connected"); connections[connectionCounter] = newConnection; CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)clientHandlerThread, (LPVOID)(connectionCounter), NULL, NULL); connectionCounter++; } } else { Sleep(10); } } return ; } extern "C" { __declspec (dllexport) void __stdcall RVExtension(char *output, int outputSize, const char *function); } void worker() { //to-do later } void __stdcall RVExtension(char *output, int outputSize, const char *function) { if (!strcmp(function, "Start")) { //start socketworker if (socketWorking) { strncpy_s(output, outputSize, "ALREADY WORKING", _TRUNCATE); } else { CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)socketWorker, NULL, NULL, NULL); strncpy_s(output, outputSize, "DONE", _TRUNCATE); } } else if (!strncmp(function, "C:", 2)) // searching for command { if (!tickets.empty()) { mtx.lock(); strncpy_s(output, outputSize, tickets[0].params.c_str(), _TRUNCATE); // result mtx.unlock(); return; } strncpy_s(output, outputSize, "EMPTY", _TRUNCATE); } else if (!strncmp(function, "R:", 2)) // sending result { mtx.lock(); std::string tmp = function; tickets.at(0).result = (char*)tmp.substr(2, size_t(function) - 2).c_str(); tickets.at(0).ready = true; mtx.unlock(); strncpy_s(output, outputSize, "DONE", _TRUNCATE); } else { strncpy_s(output, outputSize, "INVALID COMMAND", _TRUNCATE); } } To create it I use this tutorial: http://killzonekid.com/arma-scripting-tutorials-how-to-make-arma-extension-part-4/ and, this one: I've already did some .dll, but this time I really don't know where's the problem. Any solution?
  5. fauconjona

    socket extension

    I find the solution! It's not a Arma3 problem, when you use WinSock2 with using namespace std; make sure to add :: before any socket function, or just don't use using namespace std ;)
  6. fauconjona

    Server low fps with a lot of player

    Ah it's not that, but it's when game start after loading ^^
  7. fauconjona

    Server low fps with a lot of player

    Ok, I think I find the problem! My server wait 5-6 minutes (after the mission started) to load persistent things, and when the loading finish player can get their informations. It is at this moment that the server loses fps, in fact, in my custom network request I generate a random global variable to broadcast the answer to player, but I never set my var to nil after broadcast. I think this is it, I'll test it at the next reboot ;). When the server is at 47fps, is loading, there're some drop but not a lot. As you can see, there're the same count of players during the loading than the game start. So it's not player on the server, but something after loading, and the same moment it's beginning of network traffic ^^. So my bad is on the network traffic ;). I'll keep you informed
  8. fauconjona

    Server low fps with a lot of player

    Oh I totally forgot to check 1 thing in my .rpt. I have not any script error but I have this : "Update of nonlocal object 2:34860 called" every time. I'm looking for this issue on google, but I don't find the cause for the moment. I already tried with -noLogs and I had low fps too.
  9. fauconjona

    Server low fps with a lot of player

    It's not a virtual server, it's a dedicated server with (I don't remember exactly) CPU 4Ghz quad core, 32GBram and ssd.
  10. fauconjona

    Server low fps with a lot of player

    What do you mean "Vserver"?
  11. fauconjona

    Server low fps with a lot of player

    Like I said, I have only 1 loop on the server side, with a sleep 30 and it's execute some function every 30 minutes, it uses only 2 fps when executed. So, I don't think my script cause problem.
  12. It's work to get list of function with what you say, thanks ;). And my CfgFunctions work perfectly, the plugin don't detect if it's in another file. Is it possible to add my custom macro in IntelliJ? I would like to add ifelse, for, forEach, while, switch ...
  13. Hello, I tried your plugin and it's awesome!!! But there is a thing I can't use ^^. I tried "call" and ctrl + space, but nothing append. If i use ctrl + space alone I can show all commands, but not my functions. (and I tried with CfgFunctions directly in description.ext) I saw an other problem, if CfgFunction is in another file than description.ext I can't use rename command ("function '....' is not defined in CfgFunctions config"). But ctrl+G and F2 macro are very useful ;), thanks a lot for your plugin :D
  14. fauconjona

    seagull problem

    Hello everybody, To begin, sorry for my english ^^. My team converted our mission 2d to eden mission and now I have an issue I can't fix. Let me explain: when I'm connecting for the first time everything's ok, but when I return to lobby to reconnect on the same slot I become a seagull... I read this topic : https://forums.bistudio.com/topic/188328-jip-in-eden But it didn't fix my problem. If I use 2d mission it's work, but we would like to use eden ^^. Another thing, in the description.ext I included some .hpp, and if there's an error, like "member already defined", arma server doesn't show me the error with the eden mission. Is the mission.sqm corrupted? please help me, I don't have any solution....
  15. fauconjona

    X-Cam 1.0 for Arma 3 released

    thanks a lots for your answer silola, I reinstal correctly xCam with good library and it's working ;). I was just an whose re-config some buildings. ^^
  16. fauconjona

    X-Cam 1.0 for Arma 3 released

    I tried with and without, and I export with enable simulation true
  17. fauconjona

    X-Cam 1.0 for Arma 3 released

    Ok, but I tried to copy an existing building from Altis(not xcam_xxx object), and I'm not able to open door...
  18. fauconjona

    X-Cam 1.0 for Arma 3 released

    Thank you a lots for your works :p But I have a problem, when I add a building like "xcam_i_House_Big_01_V1_F", I'm not able to open doors. I tried to export as .sqm and .sqf, but it's still unable. Did I forget to do something?
×