Inheritance: global::ProtoBuf.IExtensible
示例#1
0
 private void HandleUseItem(NodeMessage msg, int handle, uint seq)
 {
     GameFrameworkMessage.NodeMessageWithGuid nodeMsg = msg.m_NodeHeader as GameFrameworkMessage.NodeMessageWithGuid;
     if (null != nodeMsg)
     {
         GameFrameworkMessage.Msg_CL_UseItem protoData = msg.m_ProtoData as GameFrameworkMessage.Msg_CL_UseItem;
         if (null != protoData)
         {
             UserThread userThread = m_UserProcessScheduler.GetUserThread(nodeMsg.m_Guid);
             if (null != userThread)
             {
                 userThread.QueueAction(userThread.UseItem, nodeMsg.m_Guid, protoData);
             }
         }
     }
 }
        internal void UseItem(ulong guid, Msg_CL_UseItem msg)
        {
            UserInfo userInfo = GetUserInfo(guid);
            if (null != userInfo) {

                SyncItems(guid);
            }
        }
 internal void UseItem(int itemId, int itemNum)
 {
     try {
         NodeMessage msg = new NodeMessage(LobbyMessageDefine.Msg_CL_UseItem);
         msg.SetHeaderWithGuid(m_Guid);
         Msg_CL_UseItem protoData = new Msg_CL_UseItem();
         protoData.ItemId = itemId;
         protoData.ItemNum = itemNum;
         msg.m_ProtoData = protoData;
         SendMessage(msg);
     } catch (Exception ex) {
         LogSystem.Error("Exception:{0}\n{1}", ex.Message, ex.StackTrace);
     }
 }