| 867 | } |
| 868 | |
| 869 | void NetworkServer::ProcessRequest_ClientProtocolVersion(SOCKET client_sock, unsigned int data_size, char * data) |
| 870 | { |
| 871 | unsigned int protocol_version = 0; |
| 872 | |
| 873 | if(data_size == sizeof(unsigned int) && (data != NULL)) |
| 874 | { |
| 875 | memcpy(&protocol_version, data, sizeof(unsigned int)); |
| 876 | } |
| 877 | |
| 878 | if(protocol_version > OPENRGB_SDK_PROTOCOL_VERSION) |
| 879 | { |
| 880 | protocol_version = OPENRGB_SDK_PROTOCOL_VERSION; |
| 881 | } |
| 882 | |
| 883 | ServerClientsMutex.lock(); |
| 884 | for(unsigned int this_idx = 0; this_idx < ServerClients.size(); this_idx++) |
| 885 | { |
| 886 | if(ServerClients[this_idx]->client_sock == client_sock) |
| 887 | { |
| 888 | ServerClients[this_idx]->client_protocol_version = protocol_version; |
| 889 | break; |
| 890 | } |
| 891 | } |
| 892 | ServerClientsMutex.unlock(); |
| 893 | |
| 894 | /*-------------------------------------------------*\ |
| 895 | | Client info has changed, call the callbacks | |
| 896 | \*-------------------------------------------------*/ |
| 897 | ClientInfoChanged(); |
| 898 | } |
| 899 | |
| 900 | void NetworkServer::ProcessRequest_ClientString(SOCKET client_sock, unsigned int /*data_size*/, char * data) |
| 901 | { |