Exemplo n.º 1
0
 static void OnPropertydHandler(NFGUID self, string strProperty, NFDataList.TData oldVar, NFDataList.TData newVar)
 {
     Console.Write(self);
     Console.Write(" ");
     Console.Write(strProperty);
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.WriteLine(" ");
 }
Exemplo n.º 2
0
 static void OnRecordEventHandler(NFGUID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFDataList.TData oldVar, NFDataList.TData newVar)
 {
     Console.Write(self);
     Console.Write(" ");
     Console.Write(strRecordName);
     Console.Write(" ");
     Console.Write(eType.ToString());
     Console.Write(" ");
     Console.Write(nRow);
     Console.Write(" ");
     Console.Write(nCol);
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.Write(" ");
     Console.Write(oldVar.IntVal());
     Console.WriteLine(" ");
 }
Exemplo n.º 3
0
 static void OnPropertydHandler(NFGUID self, string strProperty, NFDataList.TData oldVar, NFDataList.TData newVar)
 {
     Debug.Log(self);
     Debug.Log(" ");
     Debug.Log(strProperty);
     Debug.Log(" ");
     Debug.Log(oldVar.IntVal());
     Debug.Log(" ");
     Debug.Log(newVar.IntVal());
     Debug.Log(" ");
 }
Exemplo n.º 4
0
        ////////////////////////////////////修改自身属性
        public void RequirePropertyInt(NFrame.NFGUID objectID, string strPropertyName, NFDataList.TData newVar)
        {
            NFMsg.ObjectPropertyInt xData = new NFMsg.ObjectPropertyInt();
            xData.player_id = NFNetController.NFToPB(objectID);

            NFMsg.PropertyInt xPropertyInt = new NFMsg.PropertyInt();
            xPropertyInt.property_name = System.Text.Encoding.Default.GetBytes(strPropertyName);
            xPropertyInt.data          = newVar.IntVal();
            xData.property_list.Add(xPropertyInt);

            mxBody.SetLength(0);
            mxSerializer.Serialize(mxBody, xData);

            Debug.Log("send upload int");
            SendMsg(objectID, NFMsg.EGameMsgID.EGMI_ACK_PROPERTY_INT, mxBody);
        }
Exemplo n.º 5
0
 static void OnRecordEventHandler(NFGUID self, string strRecordName, NFIRecord.eRecordOptype eType, int nRow, int nCol, NFDataList.TData oldVar, NFDataList.TData newVar)
 {
     Debug.Log(self);
     Debug.Log(" ");
     Debug.Log(strRecordName);
     Debug.Log(" ");
     Debug.Log(eType.ToString());
     Debug.Log(" ");
     Debug.Log(nRow);
     Debug.Log(" ");
     Debug.Log(nCol);
     Debug.Log(" ");
     Debug.Log(oldVar.IntVal());
     Debug.Log(" ");
     Debug.Log(newVar.IntVal());
     Debug.Log(" ");
 }
Exemplo n.º 6
0
        public void RequireRecordInt(NFGUID objectID, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordInt xData = new NFMsg.ObjectRecordInt();
            xData.PlayerId   = mHelpModule.NFToPB(objectID);
            xData.RecordName = ByteString.CopyFromUtf8(strRecordName);

            NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt();
            xData.PropertyList.Add(xRecordInt);
            xRecordInt.Row  = nRow;
            xRecordInt.Col  = nCol;
            xRecordInt.Data = newVar.IntVal();

            mxBody.SetLength(0);
            xData.WriteTo(mxBody);

            Debug.Log("send upload record int");
            SendMsg((int)NFMsg.EGameMsgID.AckRecordInt, mxBody);
        }
Exemplo n.º 7
0
        public void RequireRecordInt(NFrame.NFGUID self, string strRecordName, int nRow, int nCol, NFDataList.TData newVar)
        {
            NFMsg.ObjectRecordInt xData = new NFMsg.ObjectRecordInt();
            xData.player_id   = NFNetController.NFToPB(self);
            xData.record_name = System.Text.Encoding.Default.GetBytes(strRecordName);

            NFMsg.RecordInt xRecordInt = new NFMsg.RecordInt();
            xData.property_list.Add(xRecordInt);
            xRecordInt.row  = nRow;
            xRecordInt.col  = nCol;
            xRecordInt.data = newVar.IntVal();

            mxBody.SetLength(0);
            mxSerializer.Serialize(mxBody, xData);

            Debug.Log("send upload record int");
            SendMsg(self, NFMsg.EGameMsgID.EGMI_ACK_RECORD_INT, mxBody);
        }
Exemplo n.º 8
0
        private void OnPropertyDataHandler(NFGUID self, string strProperty, NFDataList.TData oldVar, NFDataList.TData newVar)
        {
            switch (newVar.GetType())
            {
            case NFDataList.VARIANT_TYPE.VTYPE_INT:
            {
                mNetModule.RequirePropertyInt(self, strProperty, newVar.IntVal());
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
            {
                mNetModule.RequirePropertyFloat(self, strProperty, newVar.FloatVal());
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_STRING:
            {
                mNetModule.RequirePropertyString(self, strProperty, newVar.StringVal());
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
            {
                mNetModule.RequirePropertyObject(self, strProperty, newVar.ObjectVal());
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_VECTOR2:
            {
                mNetModule.RequirePropertyVector2(self, strProperty, newVar.Vector2Val());
            }
            break;

            case NFDataList.VARIANT_TYPE.VTYPE_VECTOR3:
            {
                mNetModule.RequirePropertyVector3(self, strProperty, newVar.Vector3Val());
            }
            break;

            default:
                break;
            }
        }
Exemplo n.º 9
0
        public override bool SetData(NFDataList.TData x)
        {
            if (NFDataList.VARIANT_TYPE.VTYPE_UNKNOWN == mxData.GetType() ||
                x.GetType() == mxData.GetType())
            {
                switch (mxData.GetType())
                {
                case NFDataList.VARIANT_TYPE.VTYPE_INT:
                    SetInt(x.IntVal());
                    break;

                case NFDataList.VARIANT_TYPE.VTYPE_STRING:
                    SetString(x.StringVal());
                    break;

                case NFDataList.VARIANT_TYPE.VTYPE_FLOAT:
                    SetFloat(x.FloatVal());
                    break;

                case NFDataList.VARIANT_TYPE.VTYPE_OBJECT:
                    SetObject(x.ObjectVal());
                    break;

                case NFDataList.VARIANT_TYPE.VTYPE_VECTOR2:
                    SetVector2(x.Vector2Val());
                    break;

                case NFDataList.VARIANT_TYPE.VTYPE_VECTOR3:
                    SetVector3(x.Vector3Val());
                    break;

                default:
                    break;
                }

                return(true);
            }

            return(false);
        }