fb:porticula NoPaste
EGNP_Server_SendData
Uploader: | ThePuppetMaster |
Datum/Zeit: | 24.01.2016 21:34:11 |
'----------------------------------------------------------------------------------------------------------------------------------------------------
Function EGNP_Server_SendData(V_ServerID as UInteger, V_ToUserID as UInteger, ByRef V_Data as String) as EGNP_GURU_Enum
MutexLock(EGNP_INT_Mux)
Dim TSPtr as EGNP_INT_Server_Type Ptr = EGNP_INT_Server_GetPtrByID(V_ServerID)
If TSPtr = 0 Then MutexUnLock(EGNP_INT_Mux): Return EGNP_GURU_IDnotFound
Dim TSCPtr as EGNP_INT_ServerClient_Type Ptr
Dim TData1 as String = EGNP_INT_BuildUInteger(0)
TData1 += EGNP_INT_BuildUInteger(V_ToUserID)
TData1 += EGNP_INT_BuildString(V_Data)
If V_ToUserID <> 0 Then
TSCPtr = EGNP_INT_Client_GetByID(TSPtr, V_ToUserID)
If TSCPtr = 0 Then MutexUnLock(EGNP_INT_Mux): Return EGNP_GURU_IDnotFound
EGNP_INT_AsyncSendToOne(TSCPtr->V_TSNEID, EGNP_INT_BuildCMD(EGNP_CMD_UserData, TData1))
Else: EGNP_INT_AsyncSendToAll(TSPtr, EGNP_INT_BuildCMD(EGNP_CMD_UserData, TData1))
End If
MutexUnLock(EGNP_INT_Mux)
Return EGNP_GURU_NoError
End Function