Exemple #1
0
 public void addToStreamEx(Bundle stream, AVATAR_INFO v)
 {
     stream.writeUint64(v.dbid);
     stream.writeUnicode(v.name);
     stream.writeUint8(v.roleType);
     stream.writeUint16(v.level);
 }
        public override void onRemoteMethodCall(MemoryStream stream)
        {
            ScriptModule sm = EntityDef.moduledefs["Account"];

            UInt16 methodUtype            = 0;
            UInt16 componentPropertyUType = 0;

            if (sm.useMethodDescrAlias)
            {
                componentPropertyUType = stream.readUint8();
                methodUtype            = stream.readUint8();
            }
            else
            {
                componentPropertyUType = stream.readUint16();
                methodUtype            = stream.readUint16();
            }

            Method method = null;

            if (componentPropertyUType == 0)
            {
                method = sm.idmethods[methodUtype];
            }
            else
            {
                Property pComponentPropertyDescription = sm.idpropertys[componentPropertyUType];
                switch (pComponentPropertyDescription.properUtype)
                {
                default:
                    break;
                }

                return;
            }

            switch (method.methodUtype)
            {
            case 6:
                Byte        onCreateAvatarResult_arg1 = stream.readUint8();
                AVATAR_INFO onCreateAvatarResult_arg2 = ((DATATYPE_AVATAR_INFO)method.args[1]).createFromStreamEx(stream);
                onCreateAvatarResult(onCreateAvatarResult_arg1, onCreateAvatarResult_arg2);
                break;

            case 7:
                UInt64 onRemoveAvatar_arg1 = stream.readUint64();
                onRemoveAvatar(onRemoveAvatar_arg1);
                break;

            case 5:
                AVATAR_INFO_LIST onReqAvatarList_arg1 = ((DATATYPE_AVATAR_INFO_LIST)method.args[0]).createFromStreamEx(stream);
                onReqAvatarList(onReqAvatarList_arg1);
                break;

            default:
                break;
            }
            ;
        }
Exemple #3
0
        public AVATAR_INFO createFromStreamEx(MemoryStream stream)
        {
            AVATAR_INFO datas = new AVATAR_INFO();

            datas.entity_id     = stream.readInt32();
            datas.born_position = stream.readVector3();
            datas.born_yaw      = stream.readUint8();
            return(datas);
        }
Exemple #4
0
        public AVATAR_INFO createFromStreamEx(MemoryStream stream)
        {
            AVATAR_INFO datas = new AVATAR_INFO();

            datas.dbid     = stream.readUint64();
            datas.name     = stream.readUnicode();
            datas.roleType = stream.readUint8();
            datas.level    = stream.readUint16();
            return(datas);
        }
Exemple #5
0
        public override void onReqAvatarList(AVATAR_INFO_LIST infos)
        {
            avatars.Clear();

            Dbg.DEBUG_MSG("Account::onReqAvatarList: avatarsize=" + infos.values.Count);
            for (int i = 0; i < infos.values.Count; i++)
            {
                AVATAR_INFO info = infos.values[i];
                Dbg.DEBUG_MSG("Account::onReqAvatarList: name" + i + "=" + info.name);
                avatars.Add(info.dbid, info);
            }

            // ui event
            Dictionary <UInt64, AVATAR_INFO> avatarList = new Dictionary <ulong, AVATAR_INFO>(avatars);

            Event.fireOut("onReqAvatarList", new object[] { avatarList });

            // selectAvatarGame(avatars.Keys.ToList()[0]);
        }
Exemple #6
0
        public override void onCreateAvatarResult(byte retcode, AVATAR_INFO info)
        {
            if (retcode == 0)
            {
                avatars.Add(info.dbid, info);
                Dbg.DEBUG_MSG("Account::onCreateAvatarResult: name=" + info.name);
            }
            else
            {
                Dbg.ERROR_MSG("Account::onCreateAvatarResult: retcode=" + retcode);
                if (retcode == 3)
                {
                    Dbg.ERROR_MSG("角色数量不能超过三个!");
                }
            }

            // ui event

            Event.fireOut("onCreateAvatarResult", new object[] { retcode, info, avatars });
        }
Exemple #7
0
 public void addToStreamEx(Bundle stream, AVATAR_INFO v)
 {
     stream.writeInt32(v.entity_id);
     stream.writeVector3(v.born_position);
     stream.writeUint8(v.born_yaw);
 }
 public abstract void onCreateAvatarResult(Byte arg1, AVATAR_INFO arg2);