public static WorldMap_OtherRoleUpdateInfoProto GetProto(byte[] buffer, bool isChild = false)
    {
        WorldMap_OtherRoleUpdateInfoProto proto = new WorldMap_OtherRoleUpdateInfoProto();

        MMO_MemoryStream ms = null;

        if (!isChild)
        {
            ms = GameEntry.Socket.SocketSendMS;
        }
        else
        {
            ms = GameEntry.Pool.DequeueClassObject <MMO_MemoryStream>();
        }
        ms.SetLength(0);
        ms.Write(buffer, 0, buffer.Length);
        ms.Position = 0;

        proto.RoldId       = ms.ReadInt();
        proto.RoleNickName = ms.ReadUTF8String();

        if (isChild)
        {
            GameEntry.Pool.EnqueueClassObject(ms);
        }
        return(proto);
    }
Esempio n. 2
0
    public static WorldMap_OtherRoleUpdateInfoProto GetProto(byte[] buffer)
    {
        WorldMap_OtherRoleUpdateInfoProto proto = new WorldMap_OtherRoleUpdateInfoProto();

        using (MMO_MemoryStream ms = new MMO_MemoryStream(buffer))
        {
            proto.RoldId       = ms.ReadInt();
            proto.RoleNickName = ms.ReadUTF8String();
        }
        return(proto);
    }
Esempio n. 3
0
    public static WorldMap_OtherRoleUpdateInfoProto GetProto(MMO_MemoryStream ms, byte[] buffer)
    {
        WorldMap_OtherRoleUpdateInfoProto proto = new WorldMap_OtherRoleUpdateInfoProto();

        ms.SetLength(0);
        ms.Write(buffer, 0, buffer.Length);
        ms.Position = 0;

        proto.RoldId       = ms.ReadInt();
        proto.RoleNickName = ms.ReadUTF8String();

        return(proto);
    }