Ejemplo n.º 1
0
            private void OnChatComing(ulong hSocket, tagChatRequestID chatRequestID, uint len)
            {
                uint        res;
                CSocketPeer sp = Seek(hSocket);

                if (sp == null)
                {
                    return;
                }
                sp.m_CurrReqID = (ushort)chatRequestID;
                CUQueue q = sp.m_qBuffer;

                q.SetSize(0);
                if (len > q.MaxBufferSize)
                {
                    q.Realloc(len);
                }
                unsafe
                {
                    fixed(byte *buffer = q.m_bytes)
                    {
                        res = ServerCoreLoader.RetrieveBuffer(hSocket, len, buffer, true);
                    }
                }
                System.Diagnostics.Debug.Assert(res == len);
                q.SetSize(res);
                sp.OnChatComing(chatRequestID);
            }
Ejemplo n.º 2
0
            private void OnChatCame(ulong hSocket, tagChatRequestID chatRequestId)
            {
                CSocketPeer sp = Seek(hSocket);

                if (sp == null)
                {
                    return;
                }
                sp.OnCRCame(chatRequestId);
            }
Ejemplo n.º 3
0
            internal virtual void OnChatComing(tagChatRequestID chatRequestID)
            {
                uint    svsId = ServerCoreLoader.GetSvsID(m_sh);
                CUQueue q     = m_qBuffer;

                if (svsId != BaseServiceID.sidHTTP)
                {
                    bool endian           = false;
                    tagOperationSystem os = ServerCoreLoader.GetPeerOs(m_sh, ref endian);
                    q.Endian = endian;
                    q.OS     = os;
                }
                switch (chatRequestID)
                {
                case tagChatRequestID.idEnter:
                {
                    object objGroups;
                    q.Load(out objGroups);
                    OnSubscribe((uint[])objGroups);
                }
                break;

                case tagChatRequestID.idExit:
                {
                    OnUnsubscribe(ChatGroups);
                }
                break;

                case tagChatRequestID.idSendUserMessage:
                {
                    object msg;
                    string user;
                    q.Load(out user).Load(out msg);
                    OnSendUserMessage(user, msg);
                }
                break;

                case tagChatRequestID.idSpeak:
                {
                    object msg;
                    object groups;
                    q.Load(out groups).Load(out msg);
                    OnPublish(msg, (uint[])groups);
                }
                break;

                default:
                    ServerCoreLoader.SendExceptionResult(m_sh, "Unexpected chat request", Environment.StackTrace, (ushort)chatRequestID, 0);
                    break;
                }
            }
Ejemplo n.º 4
0
 internal void OnCRCame(tagChatRequestID chatRequestId)
 {
     OnChatRequestCame(chatRequestId);
 }
Ejemplo n.º 5
0
 protected virtual void OnChatRequestCame(tagChatRequestID chatRequestId)
 {
 }
Ejemplo n.º 6
0
 private void OnChatCame(ulong hSocket, tagChatRequestID chatRequestId)
 {
     CSocketPeer sp = Seek(hSocket);
     if (sp == null)
         return;
     sp.OnCRCame(chatRequestId);
 }
Ejemplo n.º 7
0
 private void OnChatComing(ulong hSocket, tagChatRequestID chatRequestID, uint len)
 {
     uint res;
     CSocketPeer sp = Seek(hSocket);
     if (sp == null)
         return;
     sp.m_CurrReqID = (ushort)chatRequestID;
     CUQueue q = sp.m_qBuffer;
     q.SetSize(0);
     if (len > q.MaxBufferSize)
         q.Realloc(len);
     unsafe
     {
         fixed (byte* buffer = q.m_bytes)
         {
             res = ServerCoreLoader.RetrieveBuffer(hSocket, len, buffer, true);
         }
     }
     System.Diagnostics.Debug.Assert(res == len);
     q.SetSize(res);
     sp.OnChatComing(chatRequestID);
 }